summaryrefslogtreecommitdiffstats
path: root/meta/classes/rootfs-postcommands.bbclass
diff options
context:
space:
mode:
authorJonas Bonn <jonas@norrbonn.se>2019-05-02 22:09:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-02 22:20:24 +0100
commit76444b63e614baea33c044851a5859f6d1e69729 (patch)
tree0bf2c7d88377550271ef629bb49e7225b4638fa1 /meta/classes/rootfs-postcommands.bbclass
parent6f0072d34107f4d351c79b43ce71bf4489428a34 (diff)
downloadopenembedded-core-76444b63e614baea33c044851a5859f6d1e69729.tar.gz
systemd: do not create machine-id
There is no reason to have an emtpy machine-id as part of the systemd package. Either: i) the filesystem is writable and the file will be created automatically; or ii) the filesystem is read-only, in which case the empty machine-id file should be created as part of the read-only-rootfs tweaks. Signed-off-by: Jonas Bonn <jonas@norrbonn.se> Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rootfs-postcommands.bbclass')
-rw-r--r--meta/classes/rootfs-postcommands.bbclass6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index bde58ad6cd..89f8efd323 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -126,6 +126,12 @@ read_only_rootfs_hook () {
${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
fi
fi
+
+ if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then
+ # Create machine-id
+ # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
+ touch ${IMAGE_ROOTFS}${sysconfdir}/machine-id
+ fi
}
#