From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: In-Reply-To: <20201204093024.1785079-1-artur@4wiebe.de> MIME-Version: 1.0 Message-Id: From: Michael Olbrich Date: Fri, 08 Jan 2021 10:29:18 +0100 Subject: Re: [ptxdist] [APPLIED] machine-id: make using rc-once optional List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Artur Wiebe Thanks, applied as 91fcb28b61c6ddcc9b0e1542822eb81c80b58d82. Michael [sent from post-receive hook] On Fri, 08 Jan 2021 10:29:18 +0100, Artur Wiebe wrote: > If not set /etc/machine-id will be installed from projectroot (default: empty file). > > Signed-off-by: Artur Wiebe > Message-Id: <20201204093024.1785079-1-artur@4wiebe.de> > Signed-off-by: Michael Olbrich > > diff --git a/projectroot/etc/machine-id b/projectroot/etc/machine-id > new file mode 100644 > index 000000000000..e69de29bb2d1 > diff --git a/rules/machine-id.in b/rules/machine-id.in > index f18fec554cf1..9ad6db935d21 100644 > --- a/rules/machine-id.in > +++ b/rules/machine-id.in > @@ -1,11 +1,26 @@ > ## SECTION=initmethod > > -config MACHINE_ID > +menuconfig MACHINE_ID > tristate > - prompt "create /etc/machine-id" > - select RC_ONCE if RUNTIME > - select UTIL_LINUX_NG if !INITMETHOD_SYSTEMD > - select UTIL_LINUX_NG_UUIDGEN if !INITMETHOD_SYSTEMD > + prompt "create /etc/machine-id " > + select RC_ONCE if MACHINE_ID_RC_ONCE && RUNTIME > + select UTIL_LINUX_NG if MACHINE_ID_RC_ONCE && !INITMETHOD_SYSTEMD > + select UTIL_LINUX_NG_UUIDGEN if MACHINE_ID_RC_ONCE && !INITMETHOD_SYSTEMD > help > Enable this to make sure there is always a unique /etc/machine-id > available in the system. > + > +if MACHINE_ID > + > +config MACHINE_ID_RC_ONCE > + bool "generate (bbinit) or save (systemd) machine-id using rc-once at first boot" > + default y > + help > + If not set /etc/machine-id will be installed from projectroot > + (default: empty file). > + Systemd: > + If /etc/machine-id exists and is empty, systemd will bind-mount > + a file containing the new machine-id over it and later try > + to commit it to disk (if /etc/ is writable). > + > +endif > diff --git a/rules/machine-id.make b/rules/machine-id.make > index 3883d64cba3a..50e9b99ee2e8 100644 > --- a/rules/machine-id.make > +++ b/rules/machine-id.make > @@ -27,7 +27,11 @@ $(STATEDIR)/machine-id.targetinstall: > @$(call install_fixup,machine-id,AUTHOR,"Michael Olbrich ") > @$(call install_fixup,machine-id,DESCRIPTION,missing) > > +ifdef PTXCONF_MACHINE_ID_RC_ONCE > @$(call install_alternative, machine-id, 0, 0, 0755, /etc/rc.once.d/machine-id) > +else > + @$(call install_alternative, machine-id, 0, 0, 0444, /etc/machine-id) > +endif > > @$(call install_finish,machine-id) > > diff --git a/rules/machine-id.postinst b/rules/machine-id.postinst > index 2060129d14eb..208f7b4b8d56 100644 > --- a/rules/machine-id.postinst > +++ b/rules/machine-id.postinst > @@ -1,3 +1,5 @@ > #!/bin/sh > -touch "$DESTDIR/etc/machine-id" > -$DESTDIR/usr/sbin/enable-rc-once machine-id > +if [ -f $DESTDIR/etc/rc.once.d/machine-id ]; then > + touch "$DESTDIR/etc/machine-id" > + $DESTDIR/usr/sbin/enable-rc-once machine-id > +fi _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de