diff --git a/buildroot-external/board/arm-uefi/generic-aarch64/grub.cfg b/buildroot-external/board/arm-uefi/generic-aarch64/grub.cfg index 5733f4c27..9c8a62a1c 100644 --- a/buildroot-external/board/arm-uefi/generic-aarch64/grub.cfg +++ b/buildroot-external/board/arm-uefi/generic-aarch64/grub.cfg @@ -54,9 +54,13 @@ if [ "$default" -eq 99 ]; then fi fi +if [ "$MACHINE_ID" == "" ]; then + boot_condition="systemd.condition-first-boot=true" +fi + save_env A_TRY A_OK B_TRY B_OK ORDER MACHINE_ID -default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=$MACHINE_ID fsck.repair=yes" +default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=$MACHINE_ID fsck.repair=yes $boot_condition" file_env -f ($root)/cmdline.txt cmdline # root is a full HDD/partition definition in GRUB format like hd0,gpt1 diff --git a/buildroot-external/board/asus/tinker/uboot-boot.ush b/buildroot-external/board/asus/tinker/uboot-boot.ush index 7de8871d9..f83d577c9 100644 --- a/buildroot-external/board/asus/tinker/uboot-boot.ush +++ b/buildroot-external/board/asus/tinker/uboot-boot.ush @@ -16,8 +16,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.ush b/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.ush index 886a888b6..079ea19eb 100644 --- a/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.ush +++ b/buildroot-external/board/hardkernel/odroid-c2/uboot-boot.ush @@ -18,8 +18,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/hardkernel/odroid-c4/uboot-boot.ush b/buildroot-external/board/hardkernel/odroid-c4/uboot-boot.ush index 37280feac..a009a22d1 100644 --- a/buildroot-external/board/hardkernel/odroid-c4/uboot-boot.ush +++ b/buildroot-external/board/hardkernel/odroid-c4/uboot-boot.ush @@ -18,8 +18,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} clk_ignore_unused usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} clk_ignore_unused usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/hardkernel/odroid-m1/uboot-boot.ush b/buildroot-external/board/hardkernel/odroid-m1/uboot-boot.ush index e4a130e92..973c12d90 100644 --- a/buildroot-external/board/hardkernel/odroid-m1/uboot-boot.ush +++ b/buildroot-external/board/hardkernel/odroid-m1/uboot-boot.ush @@ -16,8 +16,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/hardkernel/odroid-n2/uboot-boot.ush b/buildroot-external/board/hardkernel/odroid-n2/uboot-boot.ush index 6549772c4..8c50a8c92 100644 --- a/buildroot-external/board/hardkernel/odroid-n2/uboot-boot.ush +++ b/buildroot-external/board/hardkernel/odroid-n2/uboot-boot.ush @@ -18,8 +18,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/hardkernel/odroid-xu4/uboot-boot.ush b/buildroot-external/board/hardkernel/odroid-xu4/uboot-boot.ush index 99ad60f06..830203d84 100644 --- a/buildroot-external/board/hardkernel/odroid-xu4/uboot-boot.ush +++ b/buildroot-external/board/hardkernel/odroid-xu4/uboot-boot.ush @@ -20,8 +20,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/khadas/vim3/uboot-boot.ush b/buildroot-external/board/khadas/vim3/uboot-boot.ush index 345c9f76c..d8c517334 100644 --- a/buildroot-external/board/khadas/vim3/uboot-boot.ush +++ b/buildroot-external/board/khadas/vim3/uboot-boot.ush @@ -18,8 +18,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=48617373-06 rootfstype=squashfs ro rootwait" diff --git a/buildroot-external/board/pc/grub.cfg b/buildroot-external/board/pc/grub.cfg index eef33c5d4..5a92d8ff7 100644 --- a/buildroot-external/board/pc/grub.cfg +++ b/buildroot-external/board/pc/grub.cfg @@ -54,9 +54,13 @@ if [ "$default" -eq 99 ]; then fi fi +if [ "$MACHINE_ID" == "" ]; then + boot_condition="systemd.condition-first-boot=true" +fi + save_env A_TRY A_OK B_TRY B_OK ORDER MACHINE_ID -default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=$MACHINE_ID fsck.repair=yes" +default_cmdline="rootwait zram.enabled=1 zram.num_devices=3 net.naming-scheme=v250 systemd.machine_id=$MACHINE_ID fsck.repair=yes $boot_condition" file_env -f ($root)/cmdline.txt cmdline # root is a full HDD/partition definition in GRUB format like hd0,gpt1 diff --git a/buildroot-external/board/raspberrypi/uboot-boot.ush b/buildroot-external/board/raspberrypi/uboot-boot.ush index b56741b5f..0d73797a6 100644 --- a/buildroot-external/board/raspberrypi/uboot-boot.ush +++ b/buildroot-external/board/raspberrypi/uboot-boot.ush @@ -17,8 +17,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro" diff --git a/buildroot-external/board/raspberrypi/uboot-boot64.ush b/buildroot-external/board/raspberrypi/uboot-boot64.ush index 84515b2bf..7d49780f3 100644 --- a/buildroot-external/board/raspberrypi/uboot-boot64.ush +++ b/buildroot-external/board/raspberrypi/uboot-boot64.ush @@ -17,8 +17,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes ${BOOT_CONDITION}" # HassOS system A/B setenv bootargs_a "root=PARTUUID=8d3d53e3-6d49-4c38-8349-aff6859e82fd rootfstype=squashfs ro" diff --git a/buildroot-external/board/raspberrypi/yellow/uboot-boot64.ush b/buildroot-external/board/raspberrypi/yellow/uboot-boot64.ush index 0230a731a..1dbb38cb4 100644 --- a/buildroot-external/board/raspberrypi/yellow/uboot-boot64.ush +++ b/buildroot-external/board/raspberrypi/yellow/uboot-boot64.ush @@ -17,8 +17,11 @@ test -n "${BOOT_ORDER}" || setenv BOOT_ORDER "A B" test -n "${BOOT_A_LEFT}" || setenv BOOT_A_LEFT 3 test -n "${BOOT_B_LEFT}" || setenv BOOT_B_LEFT 3 +# Allows ConditionFirstBoot= +test -n "${MACHINE_ID}" || setenv BOOT_CONDITION "systemd.condition-first-boot=true" + # HassOS bootargs -setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes" +setenv bootargs_hassos "zram.enabled=1 zram.num_devices=3 rootwait net.naming-scheme=v250 systemd.machine_id=${MACHINE_ID} cgroup_enable=memory fsck.repair=yes ${BOOT_CONDITION}" # Red Button pressed? if gpio input GPIO27; then