From d9415b0fb556e93e09ba5231604cd0f7b8e777e1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 3 Sep 2025 09:48:20 -0500 Subject: [PATCH] Set machine-id to uninitialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An empty `/etc/machine-id` file does _not_ trigger systemd's "first boot" logic. This means with `ConditionFirstBoot=true` will not run, and the unit preset policy will not be applied. To ensure a first boot behaves the way we want, we need to pre-populate the `/etc/machine-id` file with the string `uninitialized\n`, per _machine-id(5)_ ยง _First Boot Semantics_. --- external.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external.mk b/external.mk index 4f24ac5..1bbdbe7 100644 --- a/external.mk +++ b/external.mk @@ -67,6 +67,11 @@ $(BR2_EXTERNAL_AIMEEOS_PATH)/boot/grub2/gen-grub-cfg.sh $(LINUX_IMAGE_NAME) endef LINUX_TARGET_FINALIZE_HOOKS += AIMEEOS_GEN_GRUB_CFG +define AIMEEOS_TARGET_FINALIZE_HOOKS +echo uninitialized > $(TARGET_DIR)/etc/machine-id +endef +TARGET_FINALIZE_HOOKS += AIMEEOS_TARGET_FINALIZE_HOOKS + BR2_ROOTFS_POST_IMAGE_SCRIPT += $(BR2_EXTERNAL_AIMEEOS_PATH)/update/make-package.sh endif