From: Alex Kiernan <alex.kiernan@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v5 6/6] rootfs-postcommands: call preset-all for read-only-rootfs
Date: Mon, 29 Apr 2019 15:43:25 +0100 [thread overview]
Message-ID: <20190429144325.63744-7-alex.kiernan@gmail.com> (raw)
In-Reply-To: <20190429144325.63744-1-alex.kiernan@gmail.com>
From: Jonas Bonn <jonas@norrbonn.se>
When the rootfs is read-only, we cannot rely on systemd's default
invocation of preset-all at runtime in order to enable services. As
such, we need to do it at image creation time.
Signed-off-by: Jonas Bonn <jonas@norrbonn.se>
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
meta/classes/rootfs-postcommands.bbclass | 2 ++
1 file changed, 2 insertions(+)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 89f8efd32363..5fcd53c4ca7a 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -16,6 +16,7 @@ ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
+IMAGE_EXTRADEPENDS += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "systemd-systemctl-native", "", d)}'
# We also need to do the same for the kernel boot parameters,
# otherwise kernel or initramfs end up mounting the rootfs read/write
@@ -131,6 +132,7 @@ read_only_rootfs_hook () {
# 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
+ systemctl --root=${IMAGE_ROOTFS} preset-all
fi
}
--
2.17.1
next prev parent reply other threads:[~2019-04-29 14:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 14:43 [PATCH v5 0/6] Fix systemd service enables/move towards "stateless" configuration Alex Kiernan
2019-04-29 14:43 ` [PATCH v5 1/6] systemd: don't build firstboot by default Alex Kiernan
2019-04-29 14:43 ` [PATCH v5 2/6] systemd: do not create machine-id Alex Kiernan
2019-04-29 14:43 ` [PATCH v5 3/6] systemd-conf: simplify creation of machine-specific configuration Alex Kiernan
2019-04-29 14:43 ` [PATCH v5 4/6] systemd: create preset files instead of installing in image Alex Kiernan
2019-04-29 14:43 ` [PATCH v5 5/6] systemd-systemctl-native: simplify and support preset-all Alex Kiernan
2019-04-30 10:31 ` Alex Kiernan
2019-04-29 14:43 ` Alex Kiernan [this message]
2019-04-30 10:59 ` [PATCH v5 0/6] Fix systemd service enables/move towards "stateless" configuration richard.purdie
2019-04-30 11:45 ` Alex Kiernan
2019-04-30 11:52 ` Alex Kiernan
2019-04-30 12:02 ` Paul Barker
2019-04-30 12:13 ` Alex Kiernan
2019-04-30 12:24 ` Paul Barker
2019-04-30 12:33 ` Alex Kiernan
2019-04-30 12:37 ` Paul Barker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190429144325.63744-7-alex.kiernan@gmail.com \
--to=alex.kiernan@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox