archiso/mkarchiso: write "uninitialized" to /etc/machine-id

This is a new value introduced in systemd v247. It makes sure a new
machine-id is generated, but is handled as first boot as well.

See "First Boot Semantics" in machine-id(5) for details.
This commit is contained in:
Christian Hesse 2022-12-22 10:41:41 +01:00
parent 55a1b132a0
commit 6e1be91961
2 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,9 @@ Changed
- Error out early if any of the code signing certificate files passed with option ``-c`` do not exist. - Error out early if any of the code signing certificate files passed with option ``-c`` do not exist.
- Use LZMA compressed EROFS image for the baseline profile. Now that xz 5.4 is out and erofs-utils is built with LZMA - Use LZMA compressed EROFS image for the baseline profile. Now that xz 5.4 is out and erofs-utils is built with LZMA
support, using a higher compression is possible. support, using a higher compression is possible.
- Add ``/etc/machine-id`` with special value ``uninitialized``. The final id is generated at boot time, and systemd's
first-boot mechanim (see ``First Boot Semantics`` in ``machine-id(5)``) applies. No functional change unless that
``ConditionFirstBoot=yes`` is true and passive unit ``first-boot-complete.target`` activates for ordering.
Removed Removed
------- -------

View File

@ -163,9 +163,10 @@ _cleanup_pacstrap_dir() {
[[ -d "${pacstrap_dir}/var/tmp" ]] && find "${pacstrap_dir}/var/tmp" -mindepth 1 -delete [[ -d "${pacstrap_dir}/var/tmp" ]] && find "${pacstrap_dir}/var/tmp" -mindepth 1 -delete
# Delete package pacman related files. # Delete package pacman related files.
find "${work_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete find "${work_dir}" \( -name '*.pacnew' -o -name '*.pacsave' -o -name '*.pacorig' \) -delete
# Create an empty /etc/machine-id # Create /etc/machine-id with special value 'uninitialized': the final id is
# generated on first boot, systemd's first-boot mechanism applies (see machine-id(5))
rm -f -- "${pacstrap_dir}/etc/machine-id" rm -f -- "${pacstrap_dir}/etc/machine-id"
printf '' > "${pacstrap_dir}/etc/machine-id" printf 'uninitialized\n' > "${pacstrap_dir}/etc/machine-id"
_msg_info "Done!" _msg_info "Done!"
} }