* [PATCH 0/1] alsa-state: do not install the init script in case of systemd
@ 2014-02-13 7:32 Chen Qi
2014-02-13 7:32 ` [PATCH 1/1] " Chen Qi
0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2014-02-13 7:32 UTC (permalink / raw)
To: openembedded-core
The following changes since commit b188bda18690dc1af1cb5d18bb0f3ad40c9a6cc6:
systemd-serialgetty: Update to match version in recent systemd (2014-02-11 22:59:10 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib ChenQi/alsa-state-systemd
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/alsa-state-systemd
Chen Qi (1):
alsa-state: do not install the init script in case of systemd
meta/recipes-bsp/alsa-state/alsa-state.bb | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] alsa-state: do not install the init script in case of systemd
2014-02-13 7:32 [PATCH 0/1] alsa-state: do not install the init script in case of systemd Chen Qi
@ 2014-02-13 7:32 ` Chen Qi
2014-02-13 12:51 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: Chen Qi @ 2014-02-13 7:32 UTC (permalink / raw)
To: openembedded-core
As the corresponding service files have already been provided by
the alsa-utils-alsactl package, the init script is really not needed.
So we do not install it in a systemd based image.
[YOCTO #4420]
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
meta/recipes-bsp/alsa-state/alsa-state.bb | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
index 552fcfc..6dbc1aa 100644
--- a/meta/recipes-bsp/alsa-state/alsa-state.bb
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -18,16 +18,20 @@ SRC_URI = "\
file://alsa-state-init \
"
-inherit update-rc.d
+inherit update-rc.d systemd
INITSCRIPT_NAME = "alsa-state"
INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
do_install() {
- sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
- install -d ${D}${sysconfdir}/init.d
- install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
-
+ # The alsa-utils-alsactl already provides corresponding systemd unit files.
+ # So the init script should not be installed in a systemd based image.
+ install -d ${D}${sysconfdir}
+ if ${@base_contains('DISTRO_FEATURES','systemd','false','true',d)}; then
+ sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
+ install -d ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
+ fi
install -d ${D}/${localstatedir}/lib/alsa
install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] alsa-state: do not install the init script in case of systemd
2014-02-13 7:32 ` [PATCH 1/1] " Chen Qi
@ 2014-02-13 12:51 ` Burton, Ross
0 siblings, 0 replies; 3+ messages in thread
From: Burton, Ross @ 2014-02-13 12:51 UTC (permalink / raw)
To: Chen Qi; +Cc: OE-core
On 13 February 2014 07:32, Chen Qi <Qi.Chen@windriver.com> wrote:
> As the corresponding service files have already been provided by
> the alsa-utils-alsactl package, the init script is really not needed.
> So we do not install it in a systemd based image.
Remember that the presence of the systemd DISTRO_FEATURE doesn't mean
that systemd is actually being used: the distro could have systemd and
sysvinit features, and the choice of init system is decided at image
time. In this case if a distro was using sysvinit and systemd, your
patch has just deleted the init scripts that are required for sysvinit
boots.
For every situation where there is both a service file and an init
file you must always remember that it's possible that both are to be
installed. To avoid systemd invoking both the systemd unit and the
sysvinit script on boot it's best to ensure they have the same name
(systemd will then ignore the init script). If that's not possible
then you can use "systemctl mask" in a postinst to hide the init
script from systemd. There's plenty of examples for this in oe-core.
Ross
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-13 12:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 7:32 [PATCH 0/1] alsa-state: do not install the init script in case of systemd Chen Qi
2014-02-13 7:32 ` [PATCH 1/1] " Chen Qi
2014-02-13 12:51 ` Burton, Ross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox