diff --git a/docs/skills/ddi-installer.md b/docs/skills/ddi-installer.md index f6fdfcf1..8fbebb56 100644 --- a/docs/skills/ddi-installer.md +++ b/docs/skills/ddi-installer.md @@ -48,9 +48,13 @@ terminal-based interactive installation that: User provisioning is handled on the target system's first boot via systemd system credentials (`systemd-sysusers`, `systemd-tmpfiles`) so the base image -remains stateless. `systemd-firstboot.service` is masked on the target image -(`/etc/systemd/system/systemd-firstboot.service -> /dev/null`) to guarantee -unattended, prompt-free startup. The target DDI also pre-stages the extracted CA +remains stateless. Both of systemd's first-boot wizards are masked on the target +image (`/etc/systemd/system/systemd-firstboot.service -> /dev/null` and +`/etc/systemd/system/systemd-homed-firstboot.service -> /dev/null`) to guarantee +unattended, prompt-free startup: both are `ConditionFirstBoot=yes`, read +`StandardInput=tty`, and order themselves before `first-boot-complete.target`, so +either one left unmasked blocks a headless boot forever on an unattended console. +The target DDI also pre-stages the extracted CA certificate bundle (`/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem` and `/etc/ssl/certs/ca-certificates.crt`) and a standard `/etc/hosts` file for container runtime pod sandboxes. diff --git a/elements/oci/bluefin-server-ddi.bst b/elements/oci/bluefin-server-ddi.bst index 9f801570..cbc57293 100644 --- a/elements/oci/bluefin-server-ddi.bst +++ b/elements/oci/bluefin-server-ddi.bst @@ -47,9 +47,16 @@ config: ln -sf /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /layer/etc/pki/tls/certs/ca-bundle.crt ln -sf /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem /layer/etc/pki/tls/cert.pem - # Mask systemd-firstboot to prevent interactive prompts on headless first boot + # Mask both first-boot wizards to prevent interactive prompts on headless + # first boot: systemd-firstboot.service prompts for locale/keymap/timezone/ + # root password, and systemd-homed-firstboot.service runs + # `homectl firstboot --prompt-new-user`. Both are ConditionFirstBoot=yes, + # read StandardInput=tty, and order themselves before + # first-boot-complete.target, so either one blocks the boot transaction + # forever on a console nobody is attached to. mkdir -p /layer/etc/systemd/system ln -sf /dev/null /layer/etc/systemd/system/systemd-firstboot.service + ln -sf /dev/null /layer/etc/systemd/system/systemd-homed-firstboot.service # Mask audit-rules to prevent failure on shell-free OS (augenrules requires /bin/sh) ln -sf /dev/null /layer/etc/systemd/system/audit-rules.service diff --git a/tests/unit/test_installer_contract.py b/tests/unit/test_installer_contract.py index d423c685..286fb829 100644 --- a/tests/unit/test_installer_contract.py +++ b/tests/unit/test_installer_contract.py @@ -96,6 +96,10 @@ def test_ddi_generates_module_indexes_for_runtime_filesystem_drivers() -> None: assert "cp -a /etc/pki/ca-trust/extracted/* /layer/etc/pki/ca-trust/extracted/" in ddi_element assert "tls-ca-bundle.pem" in ddi_element assert "ln -sf /dev/null /layer/etc/systemd/system/systemd-firstboot.service" in ddi_element + assert ( + "ln -sf /dev/null /layer/etc/systemd/system/systemd-homed-firstboot.service" + in ddi_element + ) assert "ln -sf /dev/null /layer/etc/systemd/system/audit-rules.service" in ddi_element assert "printf '127.0.0.1 localhost" in ddi_element assert "> /layer/etc/hosts" in ddi_element