Patchwork systemd: make udev-hwdb postinstall run on host

login
register
mail settings
Submitter Laurentiu Palcu
Date May 14, 2013, 11:23 a.m.
Message ID <1368530609-11218-1-git-send-email-laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/49895/
State Accepted
Commit ec89446cb41c2be6aa76904f972d21611df90a5f
Headers show

Comments

Laurentiu Palcu - May 14, 2013, 11:23 a.m.
Run udevadm inside qemu in order to create the HW database index on
host.

The alternative would be to build a native version
of udevadm which would imply several things: split out systemd recipe,
create a common inc file and create a new recipe for udevadm native.

However, this latter solution might also add up to the build time
(the native recipe would need to run configure, make udevadm, install),
besides the time spent in the actual postinstall...

So, having the postinstall run through qemu is a good trade-off.

[YOCTO #4341]

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/recipes-core/systemd/systemd_199.bb |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Ross Burton - May 14, 2013, 12:49 p.m.
On 14 May 2013 12:23, Laurentiu Palcu <laurentiu.palcu@intel.com> wrote:
> Run udevadm inside qemu in order to create the HW database index on
> host.
>
> The alternative would be to build a native version
> of udevadm which would imply several things: split out systemd recipe,
> create a common inc file and create a new recipe for udevadm native.
>
> However, this latter solution might also add up to the build time
> (the native recipe would need to run configure, make udevadm, install),
> besides the time spent in the actual postinstall...
>
> So, having the postinstall run through qemu is a good trade-off.

Agreed.

Signed-off-by: Ross Burton <ross.burton@intel.com>

Ross

Patch

diff --git a/meta/recipes-core/systemd/systemd_199.bb b/meta/recipes-core/systemd/systemd_199.bb
index fadc385..b1cc046 100644
--- a/meta/recipes-core/systemd/systemd_199.bb
+++ b/meta/recipes-core/systemd/systemd_199.bb
@@ -11,12 +11,12 @@  PROVIDES = "udev"
 PE = "1"
 PR = "r4"
 
-DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0"
+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0 qemu-native"
 DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
 
 SECTION = "base/shell"
 
-inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives
+inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu
 
 SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
            file://touchscreen.rules \
@@ -280,10 +280,11 @@  ALTERNATIVE_PRIORITY[poweroff] ?= "300"
 
 pkg_postinst_udev-hwdb () {
 	if test -n "$D"; then
-		exit 1
+		${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
+			--root $D
+	else
+		udevadm hwdb --update
 	fi
-
-	udevadm hwdb --update
 }
 
 pkg_prerm_udev-hwdb () {