mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-27 06:56:29 +00:00
Make machine-id persist (#649)
* Make machine-id persist * update * Adjustments * cleanup * fix cleanups * small cleanup
This commit is contained in:
parent
15a80bb405
commit
db184bf5d3
@ -8,7 +8,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x8000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x8000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
mmc write ${ramdisk_addr_r} ${mmc_env} 0x40;"
|
mmc write ${ramdisk_addr_r} ${mmc_env} 0x40;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -17,11 +17,11 @@ test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
|||||||
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor rootwait"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait"
|
||||||
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro"
|
setenv bootargs_b "root=PARTUUID=a3ec664e-32ce-4665-95ea-7ae90ce9aa20 rootfstype=squashfs ro rootwait"
|
||||||
|
|
||||||
# Load extraargs
|
# Load extraargs
|
||||||
fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline
|
fileenv mmc ${devnum}:1 ${ramdisk_addr_r} cmdline.txt cmdline
|
||||||
|
@ -10,7 +10,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;"
|
mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -27,7 +27,7 @@ if test "${m}" = "custombuilt"; then setenv cmode "modeline=${modeline}"; fi
|
|||||||
setenv bootargs_odroidc2 "no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam}"
|
setenv bootargs_odroidc2 "no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam}"
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor cgroup_enable=memory"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
||||||
|
@ -10,7 +10,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x2000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;"
|
mmc write ${ramdisk_addr_r} ${mmc_env} 0x10;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -29,7 +29,7 @@ if test "${hdmimode}" = "custombuilt"; then setenv cmode "modeline=${modeline}";
|
|||||||
setenv bootargs_odroidn2 "clk_ignore_unused hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} ${cmode} voutmode=${voutmode} disablehpd=${disablehpd} overscan=${overscan}"
|
setenv bootargs_odroidn2 "clk_ignore_unused hdmimode=${hdmimode} cvbsmode=576cvbs max_freq_a53=${max_freq_a53} max_freq_a73=${max_freq_a73} maxcpus=${maxcpus} ${cmode} voutmode=${voutmode} disablehpd=${disablehpd} overscan=${overscan}"
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor cgroup_enable=memory"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
||||||
|
@ -12,7 +12,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
mmc write ${ramdisk_addr_r} ${mmc_env} 0x20;"
|
mmc write ${ramdisk_addr_r} ${mmc_env} 0x20;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -33,7 +33,7 @@ if test "${external_watchdog}" = "true"; then setenv external_watchdog "external
|
|||||||
setenv bootargs_odroidxu4 "${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
|
setenv bootargs_odroidxu4 "${videoconfig} ${hdmi_phy_control} ${hid_quirks} smsc95xx.macaddr=${macaddr} ${external_watchdog}"
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor cgroup_enable=memory"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait"
|
||||||
|
@ -8,7 +8,7 @@ function hassos_pre_image() {
|
|||||||
mkdir -p "${BOOT_DATA}/EFI/barebox"
|
mkdir -p "${BOOT_DATA}/EFI/barebox"
|
||||||
|
|
||||||
cp "${BINARIES_DIR}/barebox.bin" "${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI"
|
cp "${BINARIES_DIR}/barebox.bin" "${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI"
|
||||||
cp "${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb" "${BOOT_DATA}/EFI/barebox/state.dtb"
|
cp "${BR2_EXTERNAL_HASSOS_PATH}/bootloader/barebox-state-efi.dtb" "${BOOT_DATA}/EFI/barebox/state.dtb"
|
||||||
|
|
||||||
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
|
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ function hassos_pre_image() {
|
|||||||
mkdir -p "${BOOT_DATA}/EFI/barebox"
|
mkdir -p "${BOOT_DATA}/EFI/barebox"
|
||||||
|
|
||||||
cp "${BINARIES_DIR}/barebox.bin" "${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI"
|
cp "${BINARIES_DIR}/barebox.bin" "${BOOT_DATA}/EFI/BOOT/BOOTx64.EFI"
|
||||||
cp "${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb" "${BOOT_DATA}/EFI/barebox/state.dtb"
|
cp "${BR2_EXTERNAL_HASSOS_PATH}/bootloader/barebox-state-efi.dtb" "${BOOT_DATA}/EFI/barebox/state.dtb"
|
||||||
|
|
||||||
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
|
echo "console=tty1" > "${BOOT_DATA}/cmdline.txt"
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
${devtype} write ${ramdisk_addr_r} ${dev_env} 0x20;"
|
${devtype} write ${ramdisk_addr_r} ${dev_env} 0x20;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -18,7 +18,7 @@ test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
|||||||
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor rootwait cgroup_enable=memory"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor rootwait systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
||||||
|
@ -9,7 +9,7 @@ setenv loadbootstate " \
|
|||||||
|
|
||||||
setenv storebootstate " \
|
setenv storebootstate " \
|
||||||
echo 'storing env...'; \
|
echo 'storing env...'; \
|
||||||
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT; \
|
env export -c -s 0x4000 ${ramdisk_addr_r} BOOT_ORDER BOOT_A_LEFT BOOT_B_LEFT MACHINE_ID; \
|
||||||
${devtype} write ${ramdisk_addr_r} ${dev_env} 0x20;"
|
${devtype} write ${ramdisk_addr_r} ${dev_env} 0x20;"
|
||||||
|
|
||||||
run loadbootstate
|
run loadbootstate
|
||||||
@ -18,7 +18,7 @@ test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3
|
|||||||
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3
|
||||||
|
|
||||||
# HassOS bootargs
|
# HassOS bootargs
|
||||||
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor rootwait cgroup_enable=memory"
|
setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 apparmor=1 security=apparmor rootwait systemd.machine_id=${MACHINE_ID} cgroup_enable=memory"
|
||||||
|
|
||||||
# HassOS system A/B
|
# HassOS system A/B
|
||||||
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro"
|
||||||
|
Binary file not shown.
@ -8,11 +8,12 @@
|
|||||||
state: state {
|
state: state {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
magic = <0xef98423f>;
|
|
||||||
compatible = "barebox,state";
|
magic = <0xef98423f>;
|
||||||
backend = <&backend_state>;
|
compatible = "barebox,state";
|
||||||
backend-type = "raw";
|
backend = <&backend_state>;
|
||||||
backend-stridesize = <4048>;
|
backend-type = "raw";
|
||||||
|
backend-stridesize = <4048>;
|
||||||
|
|
||||||
bootstate {
|
bootstate {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
@ -32,6 +33,7 @@
|
|||||||
default = <20>;
|
default = <20>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
B {
|
B {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <1>;
|
#size-cells = <1>;
|
||||||
@ -46,11 +48,18 @@
|
|||||||
default = <10>;
|
default = <10>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
last_chosen@10 {
|
last_chosen@10 {
|
||||||
reg = <0x10 0x4>;
|
reg = <0x10 0x4>;
|
||||||
type = "uint32";
|
type = "uint32";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
machine_id@14 {
|
||||||
|
reg = <0x14 0x24>;
|
||||||
|
type = "string";
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
partitions {
|
partitions {
|
@ -3,3 +3,4 @@
|
|||||||
global linux.bootargs.zram="zram.enabled=1 zram.num_devices=3"
|
global linux.bootargs.zram="zram.enabled=1 zram.num_devices=3"
|
||||||
global linux.bootargs.apparmor="apparmor=1 security=apparmor"
|
global linux.bootargs.apparmor="apparmor=1 security=apparmor"
|
||||||
global linux.bootargs.misc="rootwait"
|
global linux.bootargs.misc="rootwait"
|
||||||
|
global linux.bootargs.systemd="systemd.machine_id=${state.machine_id}"
|
||||||
|
@ -31,8 +31,5 @@ fi
|
|||||||
##
|
##
|
||||||
# Fixups
|
# Fixups
|
||||||
|
|
||||||
# Rename CLI Hass.io
|
|
||||||
sed -i "s/hassio:172.30.32.2/supervisor:172.30.32.2/g" /mnt/data/hassos.json
|
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
[Journal]
|
[Journal]
|
||||||
Storage=auto
|
Storage=auto
|
||||||
Compress=yes
|
Compress=yes
|
||||||
SystemMaxUse=12M
|
|
||||||
RuntimeMaxUse=10M
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
/usr/lib/systemd/system/hassos-persists-journald.service
|
|
@ -0,0 +1 @@
|
|||||||
|
/usr/lib/systemd/system/hassos-persists.service
|
@ -1,2 +1,2 @@
|
|||||||
d /mnt/data/supervisor
|
d /mnt/data/supervisor - root root -
|
||||||
d /mnt/data/cli
|
R /mnt/data/cli - - - -
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# Cleanup lease files
|
# Cleanup lease files
|
||||||
e /var/lib/NetworkManager/*.lease - - - 14d
|
e /var/lib/NetworkManager/*.lease - - - 14d
|
||||||
f /run/resolv.conf - - - -
|
f /run/resolv.conf - root root -
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
R /mnt/overlay/var/log/journal - - - -
|
@ -1,14 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=HassOS persists journald
|
|
||||||
Requires=var-log-journal.mount
|
|
||||||
After=sysinit.target systemd-journald.service
|
|
||||||
RefuseManualStart=true
|
|
||||||
RefuseManualStop=true
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/libexec/hassos-persists-journald
|
|
||||||
RemainAfterExit=true
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,13 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HassOS persists data on bootstate
|
||||||
|
After=sysinit.target
|
||||||
|
RefuseManualStart=true
|
||||||
|
RefuseManualStop=true
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/libexec/hassos-persists
|
||||||
|
RemainAfterExit=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -1,11 +1,11 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Systemd persistent logging
|
Description=Systemd persistent logging
|
||||||
Requires=mnt-overlay.mount
|
Requires=mnt-data.mount
|
||||||
After=mnt-overlay.mount
|
After=mnt-data.mount
|
||||||
Before=systemd-journal-flush.service
|
Before=systemd-journal-flush.service
|
||||||
|
|
||||||
[Mount]
|
[Mount]
|
||||||
What=/mnt/overlay/var/log/journal
|
What=/mnt/data/logs
|
||||||
Where=/var/log/journal
|
Where=/var/log/journal
|
||||||
Type=None
|
Type=None
|
||||||
Options=bind
|
Options=bind
|
||||||
|
30
buildroot-external/rootfs-overlay/usr/libexec/hassos-persists
Executable file
30
buildroot-external/rootfs-overlay/usr/libexec/hassos-persists
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
MACHINE_ID=$(cat /etc/machine-id)
|
||||||
|
|
||||||
|
###
|
||||||
|
# u-boot
|
||||||
|
if [ -e /usr/sbin/fw_setenv ]; then
|
||||||
|
|
||||||
|
# machine-id
|
||||||
|
if [ "$(fw_printenv -n MACHINE_ID)" != "${MACHINE_ID}" ]; then
|
||||||
|
echo "[info] set machine-id to ${MACHINE_ID}"
|
||||||
|
fw_setenv MACHINE_ID "${MACHINE_ID}"
|
||||||
|
else
|
||||||
|
echo "[info] machine-id is okay"
|
||||||
|
fi
|
||||||
|
|
||||||
|
###
|
||||||
|
# Barebox
|
||||||
|
else
|
||||||
|
|
||||||
|
# machine-id
|
||||||
|
if [ "$(barebox-state -g state.machine_id -i /etc/barebox-state.dtb)" != "${MACHINE_ID}" ]; then
|
||||||
|
echo "[info] set machine-id to ${MACHINE_ID}"
|
||||||
|
barebox-state -s "state.machine_id=${MACHINE_ID}" -i /etc/barebox-state.dtb
|
||||||
|
else
|
||||||
|
echo "[info] machine-id is okay"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
MACHINE_ID=$(cat /etc/machine-id)
|
|
||||||
|
|
||||||
# Loop all logs folder and move
|
|
||||||
for log_folder in /var/log/journal/*; do
|
|
||||||
# Not a log folder
|
|
||||||
if [ ! -d "${log_folder}" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Current log folder
|
|
||||||
if (echo "${log_folder}" | grep "${MACHINE_ID}"); then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "${log_folder}"
|
|
||||||
done
|
|
@ -269,7 +269,7 @@ function _fix_disk_hyprid() {
|
|||||||
local hdd_img="$(hassos_image_name img)"
|
local hdd_img="$(hassos_image_name img)"
|
||||||
|
|
||||||
sgdisk -t 1:"E3C9E316-0B5C-4DB8-817D-F92DF00215AE" "${hdd_img}"
|
sgdisk -t 1:"E3C9E316-0B5C-4DB8-817D-F92DF00215AE" "${hdd_img}"
|
||||||
dd if="${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr.img" of="${hdd_img}" conv=notrunc bs=512 count=1
|
dd if="${BR2_EXTERNAL_HASSOS_PATH}/bootloader/mbr.img" of="${hdd_img}" conv=notrunc bs=512 count=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ function _fix_disk_spl_gpt() {
|
|||||||
local spl_img="$(path_spl_img)"
|
local spl_img="$(path_spl_img)"
|
||||||
|
|
||||||
sgdisk -t 1:"E3C9E316-0B5C-4DB8-817D-F92DF00215AE" "${hdd_img}"
|
sgdisk -t 1:"E3C9E316-0B5C-4DB8-817D-F92DF00215AE" "${hdd_img}"
|
||||||
dd if="${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-spl.img" of="${hdd_img}" conv=notrunc bs=512 count=1
|
dd if="${BR2_EXTERNAL_HASSOS_PATH}/bootloader/mbr-spl.img" of="${hdd_img}" conv=notrunc bs=512 count=1
|
||||||
dd if="${spl_img}" of="${hdd_img}" conv=notrunc bs=512 seek=2 skip=2
|
dd if="${spl_img}" of="${hdd_img}" conv=notrunc bs=512 seek=2 skip=2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,12 +81,12 @@ function install_bootloader_config() {
|
|||||||
# shellcheck disable=SC1117
|
# shellcheck disable=SC1117
|
||||||
echo -e "/dev/disk/by-partlabel/hassos-bootstate\t0x0000\t${BOOT_ENV_SIZE}" > "${TARGET_DIR}/etc/fw_env.config"
|
echo -e "/dev/disk/by-partlabel/hassos-bootstate\t0x0000\t${BOOT_ENV_SIZE}" > "${TARGET_DIR}/etc/fw_env.config"
|
||||||
else
|
else
|
||||||
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/misc/barebox-state-efi.dtb" "${TARGET_DIR}/etc/barebox-state.dtb"
|
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/bootloader/barebox-state-efi.dtb" "${TARGET_DIR}/etc/barebox-state.dtb"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix MBR
|
# Fix MBR
|
||||||
if [ "${BOOT_SYS}" == "mbr" ]; then
|
if [ "${BOOT_SYS}" == "mbr" ]; then
|
||||||
mkdir -p "${TARGET_DIR}/usr/lib/udev/rules.d"
|
mkdir -p "${TARGET_DIR}/usr/lib/udev/rules.d"
|
||||||
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/misc/mbr-part.rules" "${TARGET_DIR}/usr/lib/udev/rules.d/"
|
cp -f "${BR2_EXTERNAL_HASSOS_PATH}/bootloader/mbr-part.rules" "${TARGET_DIR}/usr/lib/udev/rules.d/"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
## OVA
|
## OVA
|
||||||
dtc -@ -I dts -O dtb -o buildroot-external/misc/barebox-state-efi.dtb buildroot-external/misc/barebox-state-efi.dts
|
dtc -@ -I dts -O dtb -o buildroot-external/bootloader/barebox-state-efi.dtb buildroot-external/bootloader/barebox-state-efi.dts
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user