Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Move systemd binaries to /sbin/systemd
@ 2013-04-11 16:28 Ross Burton
  2013-04-11 16:28 ` [PATCH 1/2] systemd: move the " Ross Burton
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ross Burton @ 2013-04-11 16:28 UTC (permalink / raw)
  To: openembedded-core

Hi,

Following the example set by udev, move the binaries to /sbin/systemd and
hardcode less paths in general.  Tested on atom-pc with a .hddimg so the live
boot/initrd paths were tested.

Ross

The following changes since commit 2ef72c3174c8c111678ac7e3cf3d866eaf2c8d77:

  wayland: add necessary dependencies to fix build error (2013-04-11 16:41:13 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib ross/systemd

for you to fetch changes up to 0154334c32234d70dc064fb7dac6b499ca91cf3a:

  initrdscripts: look for new systemd-udevd location (2013-04-11 17:18:19 +0100)

----------------------------------------------------------------
Ross Burton (2):
      systemd: move the binaries to /sbin/systemd
      initrdscripts: look for new systemd-udevd location

 meta/recipes-core/initrdscripts/files/init-live.sh |    2 +-
 .../initrdscripts/initramfs-framework/udev         |    2 +-
 meta/recipes-core/systemd/systemd/init             |   14 +++---
 meta/recipes-core/systemd/systemd_199.bb           |   46 +++++++-------------
 4 files changed, 25 insertions(+), 39 deletions(-)

-- 
1.7.10.4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] systemd: move the binaries to /sbin/systemd
  2013-04-11 16:28 [PATCH 0/2] Move systemd binaries to /sbin/systemd Ross Burton
@ 2013-04-11 16:28 ` Ross Burton
  2013-04-11 16:28 ` [PATCH 2/2] initrdscripts: look for new systemd-udevd location Ross Burton
  2013-04-15 11:00 ` [PATCH 0/2] Move systemd binaries to /sbin/systemd Enrico Scholz
  2 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2013-04-11 16:28 UTC (permalink / raw)
  To: openembedded-core

As with udev, placing binaries in /lib breaks our current multilib
implementation.  Change the rootlibexecdir to /sbin/systemd so that binaries
don't move in multilib situations.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/systemd/systemd/init   |   14 ++++-----
 meta/recipes-core/systemd/systemd_199.bb |   46 +++++++++++-------------------
 2 files changed, 23 insertions(+), 37 deletions(-)

diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init
index 0ddd043..32a474d 100644
--- a/meta/recipes-core/systemd/systemd/init
+++ b/meta/recipes-core/systemd/systemd/init
@@ -15,7 +15,7 @@ export TZ=/etc/localtime
 
 [ -d /sys/class ] || exit 1
 [ -r /proc/mounts ] || exit 1
-[ -x /lib/systemd/systemd-udevd ] || exit 1
+[ -x @UDEVD@ ] || exit 1
 [ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
 [ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
 
@@ -71,15 +71,15 @@ case "$1" in
 
     # trigger the sorted events
     echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
-    /lib/systemd/systemd-udevd -d
+    @UDEVD@ -d
 
-    /usr/bin/udevadm control --env=STARTUP=1
+    udevadm control --env=STARTUP=1
     if [ "$not_first_boot" != "" ];then
-            /usr/bin/udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics	 --subsystem-nomatch=backlight --subsystem-nomatch=video4linux	--subsystem-nomatch=platform
-            (/usr/bin/udevadm settle --timeout=3; /usr/bin/udevadm control --env=STARTUP=)&
+            udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics	 --subsystem-nomatch=backlight --subsystem-nomatch=video4linux	--subsystem-nomatch=platform
+            (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
     else
-            /usr/bin/udevadm trigger --action=add
-            /usr/bin/udevadm settle
+            udevadm trigger --action=add
+            udevadm settle
     fi
     ;;
   stop)
diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index 3ee1283..76c5973 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -57,8 +57,6 @@ CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
 # The gtk+ tools should get built as a separate recipe e.g. systemd-tools
 EXTRA_OECONF = " --with-rootprefix=${base_prefix} \
                  --with-rootlibdir=${base_libdir} \
-                 --sbindir=${base_sbindir} \
-                 --libexecdir=${base_libdir} \
                  ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
                  --enable-xz \
                  --disable-manpages \
@@ -82,6 +80,9 @@ do_configure_prepend() {
 	sed -i -e 's:=/root:=${ROOT_HOME}:g' units/*.service*
 }
 
+EXTRA_OEMAKE = "rootlibexecdir=${base_sbindir}/systemd \
+                udevlibexecdir=${base_sbindir}/udev"
+
 do_install() {
 	autotools_do_install
 	install -d ${D}/${base_sbindir}
@@ -89,8 +90,8 @@ do_install() {
 	rm ${D}${systemd_unitdir}/system/serial-getty* -f
 
 	# provide support for initramfs
-	ln -s ${systemd_unitdir}/systemd ${D}/init
-	ln -s ${systemd_unitdir}/systemd-udevd ${D}/${base_sbindir}/udevd
+	ln -s ${base_sbindir}/systemd/systemd ${D}/init
+	ln -s ${base_sbindir}/systemd/systemd-udevd ${D}/${base_sbindir}/udev/udevd
 
 	# create dir for journal
 	install -d ${D}${localstatedir}/log/journal
@@ -108,6 +109,7 @@ do_install() {
 	if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
 		install -d ${D}${sysconfdir}/init.d
 		install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
+		sed -i s%@UDEVD@%${base_sbindir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
 	fi
 }
 
@@ -145,6 +147,9 @@ CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
                 ${sysconfdir}/systemd/user.conf"
 
 FILES_${PN} = " ${base_bindir}/* \
+                ${base_sbindir}/systemd \
+                ${base_sbindir}/systemd/system-generators \
+                ${base_sbindir}/udev \
                 ${datadir}/bash-completion \
                 ${datadir}/dbus-1/services \
                 ${datadir}/dbus-1/system-services \
@@ -178,14 +183,13 @@ FILES_${PN} = " ${base_bindir}/* \
                 ${exec_prefix}/lib/modules-load.d \
                 ${exec_prefix}/lib/sysctl.d \
                 ${localstatedir} \
-                ${libexecdir} \
                 /lib/udev/rules.d/70-uaccess.rules \
                 /lib/udev/rules.d/71-seat.rules \
                 /lib/udev/rules.d/73-seat-late.rules \
                 /lib/udev/rules.d/99-systemd.rules \
                "
 
-FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
+FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/ ${base_sbindir}/systemd/.debug ${base_sbindir}/systemd/system-generators/.debug ${base_sbindir}/udev/.debug"
 FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
 
 RDEPENDS_${PN} += "dbus"
@@ -196,35 +200,17 @@ RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
                       kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
 "
 
-PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-hwdb"
+PACKAGES =+ "udev-dbg udev-hwdb udev udev-consolekit udev-utils"
 
-FILES_udev-dbg += "/lib/udev/.debug"
+FILES_udev-dbg += "${base_sbindir}/udev/.debug"
 
 RDEPENDS_udev += "udev-utils"
 RPROVIDES_udev = "hotplug"
 RRECOMMENDS_udev += "udev-extraconf udev-hwdb"
 
 FILES_udev += "${base_sbindir}/udevd \
-               ${base_libdir}/systemd/systemd-udevd \
-               /lib/udev/accelerometer \
-               /lib/udev/ata_id \
-               /lib/udev/cdrom_id \
-               /lib/udev/collect \
-               /lib/udev/findkeyboards \
-               /lib/udev/keyboard-force-release.sh \
-               /lib/udev/keymap \
-               /lib/udev/mtd_probe \
-               /lib/udev/scsi_id \
-               /lib/udev/v4l_id \
-               /lib/udev/keymaps \
-               /lib/udev/rules.d/4*.rules \
-               /lib/udev/rules.d/5*.rules \
-               /lib/udev/rules.d/6*.rules \
-               /lib/udev/rules.d/70-power-switch.rules \
-               /lib/udev/rules.d/75*.rules \
-               /lib/udev/rules.d/78*.rules \
-               /lib/udev/rules.d/8*.rules \
-               /lib/udev/rules.d/95*.rules \
+               ${base_sbindir}/systemd/systemd-udevd \
+               ${base_sbindir}/udev \
                ${sysconfdir}/udev \
                ${sysconfdir}/init.d/systemd-udevd \
                ${systemd_unitdir}/system/*udev* \
@@ -236,7 +222,7 @@ RDEPENDS_udev-consolekit += "${@base_contains('DISTRO_FEATURES', 'x11', 'console
 
 FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm"
 
-FILES_udev-hwdb = "${base_libdir}/udev/hwdb.d"
+FILES_udev-hwdb = "${base_sbindir}/udev/hwdb.d"
 
 INITSCRIPT_PACKAGES = "udev"
 INITSCRIPT_NAME_udev = "systemd-udevd"
@@ -253,7 +239,7 @@ python __anonymous() {
 
 ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff"
 
-ALTERNATIVE_TARGET[init] = "${systemd_unitdir}/systemd"
+ALTERNATIVE_TARGET[init] = "${base_sbindir}/systemd/systemd"
 ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
 ALTERNATIVE_PRIORITY[init] ?= "300"
 
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] initrdscripts: look for new systemd-udevd location
  2013-04-11 16:28 [PATCH 0/2] Move systemd binaries to /sbin/systemd Ross Burton
  2013-04-11 16:28 ` [PATCH 1/2] systemd: move the " Ross Burton
@ 2013-04-11 16:28 ` Ross Burton
  2013-04-15 11:00 ` [PATCH 0/2] Move systemd binaries to /sbin/systemd Enrico Scholz
  2 siblings, 0 replies; 7+ messages in thread
From: Ross Burton @ 2013-04-11 16:28 UTC (permalink / raw)
  To: openembedded-core

As per the previous commit, systemd-udevd is now in /sbin/systemd/.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-core/initrdscripts/files/init-live.sh       |    2 +-
 meta/recipes-core/initrdscripts/initramfs-framework/udev |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
index 9fe1cd6..4bd1b52 100644
--- a/meta/recipes-core/initrdscripts/files/init-live.sh
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -12,7 +12,7 @@ UNIONFS="no"
 # Copied from initramfs-framework. The core of this script probably should be
 # turned into initramfs-framework modules to reduce duplication.
 udev_daemon() {
-	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
 
 	for o in $OPTIONS; do
 		if [ -x "$o" ]; then
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev
index bb462dc..18d44a5 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/udev
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -11,7 +11,7 @@ udev_shutdown_hook_handler() {
 }
 
 udev_daemon() {
-	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /sbin/systemd/systemd-udevd /lib/systemd/systemd-udevd"
 
 	for o in $OPTIONS; do
 		if [ -x "$o" ]; then
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Move systemd binaries to /sbin/systemd
  2013-04-11 16:28 [PATCH 0/2] Move systemd binaries to /sbin/systemd Ross Burton
  2013-04-11 16:28 ` [PATCH 1/2] systemd: move the " Ross Burton
  2013-04-11 16:28 ` [PATCH 2/2] initrdscripts: look for new systemd-udevd location Ross Burton
@ 2013-04-15 11:00 ` Enrico Scholz
  2013-04-15 11:21   ` Koen Kooi
  2 siblings, 1 reply; 7+ messages in thread
From: Enrico Scholz @ 2013-04-15 11:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: Ross Burton

Ross Burton <ross.burton-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
writes:

> Following the example set by udev, move the binaries to /sbin/systemd
> and hardcode less paths in general.  Tested on atom-pc with a .hddimg
> so the live boot/initrd paths were tested.

At least the moving of udev breaks a lot of local recipes here which
install e.g. local rules or keymaps in /lib/udev.  This is a silent break
which is detected at device runtime only.  The global 'bitbake.conf' has
not been updated for the new paths neither.


There should be:

1. added some QA checks which detect this broken packaging

2. added some global variables (e.g. 'udev_basedir') which can be used
   in the rules.



Enrico



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Move systemd binaries to /sbin/systemd
  2013-04-15 11:00 ` [PATCH 0/2] Move systemd binaries to /sbin/systemd Enrico Scholz
@ 2013-04-15 11:21   ` Koen Kooi
  2013-04-15 15:15     ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Koen Kooi @ 2013-04-15 11:21 UTC (permalink / raw)
  To: Enrico Scholz; +Cc: Ross Burton, openembedded-core


Op 15 apr. 2013, om 13:00 heeft Enrico Scholz <enrico.scholz@sigma-chemnitz.de> het volgende geschreven:

> Ross Burton <ross.burton-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> writes:
> 
>> Following the example set by udev, move the binaries to /sbin/systemd
>> and hardcode less paths in general.  Tested on atom-pc with a .hddimg
>> so the live boot/initrd paths were tested.
> 
> At least the moving of udev breaks a lot of local recipes here which
> install e.g. local rules or keymaps in /lib/udev.  This is a silent break
> which is detected at device runtime only.  The global 'bitbake.conf' has
> not been updated for the new paths neither.
> 
> 
> There should be:
> 
> 1. added some QA checks which detect this broken packaging
> 
> 2. added some global variables (e.g. 'udev_basedir') which can be used
>   in the rules.

These patches can get NAK'd all you want, but they will go in. I still say: NAK, this is a bad, bad idea. It diverges from upstream and introduces silent breakage as you point out due to that.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Move systemd binaries to /sbin/systemd
  2013-04-15 11:21   ` Koen Kooi
@ 2013-04-15 15:15     ` Richard Purdie
  2013-04-15 15:58       ` Enrico Scholz
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2013-04-15 15:15 UTC (permalink / raw)
  To: Koen Kooi; +Cc: Enrico Scholz, Ross Burton, openembedded-core

On Mon, 2013-04-15 at 13:21 +0200, Koen Kooi wrote:
> Op 15 apr. 2013, om 13:00 heeft Enrico Scholz <enrico.scholz@sigma-chemnitz.de> het volgende geschreven:
> 
> > Ross Burton <ross.burton-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > writes:
> > 
> >> Following the example set by udev, move the binaries to /sbin/systemd
> >> and hardcode less paths in general.  Tested on atom-pc with a .hddimg
> >> so the live boot/initrd paths were tested.
> > 
> > At least the moving of udev breaks a lot of local recipes here which
> > install e.g. local rules or keymaps in /lib/udev.  This is a silent break
> > which is detected at device runtime only.  The global 'bitbake.conf' has
> > not been updated for the new paths neither.
> > 
> > 
> > There should be:
> > 
> > 1. added some QA checks which detect this broken packaging
> > 
> > 2. added some global variables (e.g. 'udev_basedir') which can be used
> >   in the rules.
> 
> These patches can get NAK'd all you want, but they will go in. I still
> say: NAK, this is a bad, bad idea. It diverges from upstream and
> introduces silent breakage as you point out due to that.

In the 1.5 timeframe I want to look at this again and see how we can
better solve it as it may be we can do something to the multilib code to
avoid the issues. We ran out of runway with this for 1.4 :(.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Move systemd binaries to /sbin/systemd
  2013-04-15 15:15     ` Richard Purdie
@ 2013-04-15 15:58       ` Enrico Scholz
  0 siblings, 0 replies; 7+ messages in thread
From: Enrico Scholz @ 2013-04-15 15:58 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Koen Kooi, Ross Burton, openembedded-core

Richard Purdie <richard.purdie@linuxfoundation.org> writes:

>> >> Following the example set by udev, move the binaries to /sbin/systemd
>> >> and hardcode less paths in general.  Tested on atom-pc with a .hddimg
>> >> so the live boot/initrd paths were tested.
>> > 
>> > At least the moving of udev breaks a lot of local recipes here which
>> > install e.g. local rules or keymaps in /lib/udev.  This is a silent break
>> > which is detected at device runtime only.  The global 'bitbake.conf' has
>> > not been updated for the new paths neither.
>> > 
>> > 
>> > There should be:
>> > 
>> > 1. added some QA checks which detect this broken packaging
>> > 
>> > 2. added some global variables (e.g. 'udev_basedir') which can be used
>> >   in the rules.
>> 
>> These patches can get NAK'd all you want, but they will go in. I still
>> say: NAK, this is a bad, bad idea. It diverges from upstream and
>> introduces silent breakage as you point out due to that.
>
> In the 1.5 timeframe I want to look at this again and see how we can
> better solve it as it may be we can do something to the multilib code to
> avoid the issues. We ran out of runway with this for 1.4 :(.

Does this mean, this last-minute and invasive patch gets reverted (-->
it is already in oe). Or, that it stays and we have to live in 1.4 with
bad surprises[1] because an undefined number of packages[2] uses still
the upstream defaults?



Enrico

Footnotes: 
[1]  udev rules, keymaps and firmware at the wrong location

[2]  surprisingly, 'systemd' itself where this change has been applied
     still refers to /lib/udev/rules.d




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-04-15 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 16:28 [PATCH 0/2] Move systemd binaries to /sbin/systemd Ross Burton
2013-04-11 16:28 ` [PATCH 1/2] systemd: move the " Ross Burton
2013-04-11 16:28 ` [PATCH 2/2] initrdscripts: look for new systemd-udevd location Ross Burton
2013-04-15 11:00 ` [PATCH 0/2] Move systemd binaries to /sbin/systemd Enrico Scholz
2013-04-15 11:21   ` Koen Kooi
2013-04-15 15:15     ` Richard Purdie
2013-04-15 15:58       ` Enrico Scholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox