[OE-core] [PATCH] base-passwd: Make it possible to build and install native

Fabrice Coulon fabrice.coulon at axis.com
Wed Dec 2 11:07:38 UTC 2015


In order to be able to install the package base-passwd-native in the
sysroot, make it possible to override the install options specifying
the owner and group names for native.

This change is needed for introducing pseudo-native support. I.e.,
to be able to install, chown, into the sysroot with users and groups
that are not available on the build host by default.

Signed-off-by: Fabrice Coulon <fabrice.coulon at axis.com>
---
 meta/recipes-core/base-passwd/base-passwd_3.5.29.bb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
index ac9bd81..1ec0c81 100644
--- a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -21,18 +21,26 @@ inherit autotools
 
 SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
 
+# Make it possible to build base-passwd-native
+BBCLASSEXTEND += "native"
+# Make it possible to override these install options for class native
+OWN = "root"
+GROUP = "root"
+INSTALL_OPTS = "-o ${OWN} -g ${GROUP}"
+INSTALL_OPTS_class-native = ""
+
 do_install () {
 	install -d -m 755 ${D}${sbindir}
-	install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
+	install ${INSTALL_OPTS} -p -m 755 ${B}/update-passwd ${D}${sbindir}/
 	install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
 	install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
 	install -p -m 644 ${S}/man/update-passwd.pl.8 \
 		${D}${mandir}/pl/man8/update-passwd.8
 	gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
 	install -d -m 755 ${D}${datadir}/base-passwd
-	install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
+	install ${INSTALL_OPTS} -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
 	sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
-	install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
+	install ${INSTALL_OPTS} -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
 
 	install -d -m 755 ${D}${docdir}/${BPN}
 	install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
-- 
1.9.1




More information about the Openembedded-core mailing list