mirror of
https://github.com/kairos-io/packages.git
synced 2025-09-28 15:55:33 +00:00
Make sure /etc/machine-id is generate as early as possible in systemd (#1178)
* Make sure /etc/machine-id is generate as early as possible in systemd Fixes https://github.com/kairos-io/kairos/issues/3038 Deprecates https://github.com/mudler/yip/pull/193 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Mask in rootfs (earlier) as per the PR comment https://github.com/kairos-io/packages/pull/1178#discussion_r1883552090 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> * Bump version Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me> --------- Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
This commit is contained in:
committed by
GitHub
parent
c4134ddbb4
commit
2a80ac9551
@@ -1,4 +1,4 @@
|
||||
packages:
|
||||
- name: "kairos-overlay-files"
|
||||
category: "static"
|
||||
version: "1.6.1"
|
||||
version: "1.6.2"
|
||||
|
@@ -106,6 +106,13 @@ stages:
|
||||
/var/run/cilium
|
||||
/var/snap
|
||||
PERSISTENT_STATE_BIND: "true"
|
||||
- if: '[ -e "/sbin/systemctl" ] || [ -e "/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
|
||||
# Mask the commit service to avoid systemd messing with machine-id.
|
||||
# https://www.freedesktop.org/software/systemd/man/latest/systemd-machine-id-commit.service.html
|
||||
name: "Mask the commit service to avoid systemd messing with machine-id"
|
||||
systemctl:
|
||||
mask:
|
||||
- systemd-machine-id-commit.service
|
||||
rootfs.after:
|
||||
- if: '[ -r /run/cos/custom-layout.env ] && [ ! -f "/run/cos/recovery_mode" ] && [ ! -f /run/cos/live_mode ]'
|
||||
name: "add custom bind and ephemeral mounts to /run/cos/cos-layout.env"
|
||||
@@ -140,8 +147,15 @@ stages:
|
||||
name: "Restore /etc/machine-id for systemd systems"
|
||||
commands:
|
||||
- cat /usr/local/etc/machine-id > /etc/machine-id
|
||||
# If we didn't restore it already, ensure /etc/machine-id is generated
|
||||
- if: '[ -e "/sbin/systemctl" ] || [ -e "/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
|
||||
name: "Ensure /etc/machine-id for systemd systems"
|
||||
commands:
|
||||
# https://www.freedesktop.org/software/systemd/man/latest/systemd-machine-id-setup.html
|
||||
- systemd-machine-id-setup
|
||||
|
||||
- if: '[ ! -f "/run/cos/recovery_mode" ] && [ -f "/sbin/openrc" ]'
|
||||
name: "Restore /etc/machine-id for openrc systems"
|
||||
name: "Ensure /etc/machine-id for openrc systems"
|
||||
commands:
|
||||
- dbus-uuidgen --ensure # This makes sure that the machine-id exists and its valid
|
||||
- cat /var/lib/dbus/machine-id > /etc/machine-id
|
||||
|
Reference in New Issue
Block a user