diskimage-builder/diskimage_builder
Steve Baker 147641fc3e Set machine-id to uninitialized to trigger first boot
According to the systemd documentation[1], if /etc/machine-id is empty
it will be populated with a unique value, but not in a way which
triggers an actual first boot event (running units with
ConditionFirstBoot=yes set)

This change writes "uninitialized" to /etc/machine-id to ensure that
systemd-firstboot.service actually runs, and other units can use
first-boot-complete.target as a dependency to trigger on first boot.

Since /var/lib/dbus/machine-id is sometimes a symlink to
/etc/machine-id, it is truncated before writing to /etc/machine-id.

On older versions of systemd before first boot semantics were
formalised, any non-uuid value will trigger a new machine-id to be
generated, so "uninitialized" also works.

[1] https://www.freedesktop.org/software/systemd/man/machine-id.html#First%20Boot%20Semantics

Change-Id: I77c35e51a3da2e8a6b5a2c80d033a159b303c9af
2022-04-21 09:39:42 +12:00
..
block_device Replace deprecated import of ABCs from collections 2021-07-17 01:02:19 +09:00
elements Set machine-id to uninitialized to trigger first boot 2022-04-21 09:39:42 +12:00
lib Correctly create DIB_ENV variable and dib_environment file 2022-02-28 16:46:16 +03:00
tests Switch from unittest2 compat methods to Python 3.x methods 2020-07-07 11:11:28 +08:00
__init__.py Bump hacking to 0.9.x series 2014-07-21 10:15:41 +02:00
disk_image_create.py Remove virtualenv activation 2020-06-11 16:49:15 +10:00
element_dependencies.py Uncap hacking 2020-02-24 10:34:46 +11:00
logging_config.py Add timestamp output filter 2017-06-16 15:58:50 +10:00
paths.py Move diskimage-image-create to an entry point 2016-11-02 05:12:11 +00:00
version.py Create docs site containing element READMEs 2015-02-10 11:45:35 -08:00