Patchwork rootfs_ipk bbclass: special-case base-passwd preinst to run first

login
register
mail settings
Submitter Koen Kooi
Date Nov. 4, 2011, 9:25 a.m.
Message ID <1320398724-22429-1-git-send-email-koen@dominion.thruhere.net>
Download mbox | patch
Permalink /patch/14255/
State New
Headers show

Comments

Koen Kooi - Nov. 4, 2011, 9:25 a.m.
Preinst are run alphabetically which breaks when e.g. avahi-daemon needs /etc/passwd present.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
---
 meta/classes/rootfs_ipk.bbclass |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index e02b816..3ae0529 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -77,6 +77,15 @@  fakeroot rootfs_ipk_do_rootfs () {
 	${ROOTFS_POSTINSTALL_COMMAND}
 	
 	runtime_script_required=0
+
+	# Base-passwd needs to run first to install /etc/passwd and friends
+	if [ -e ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst ] ; then
+		if ! sh ${IMAGE_ROOTFS}${opkglibdir}/info/base-passwd.preinst; then
+			runtime_script_required=1
+			opkg-cl ${IPKG_ARGS} flag unpacked base-passwd
+		fi
+	fi
+
 	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
 		if [ -f $i ] && ! sh $i; then
 		     	runtime_script_required=1