[OE-core] [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management
Otavio Salvador
otavio at ossystems.com.br
Fri Feb 17 17:47:05 UTC 2012
When building without package management we can end with a system
without opkg and thus without support for running unfinished postinsts
on first boot, we fix this providing a S98configure script for this
use case.
Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
meta/classes/rootfs_ipk.bbclass | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 2df8ca4..11ab8a1 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -96,6 +96,22 @@ fakeroot rootfs_ipk_do_rootfs () {
# Also delete the status files
rm -rf ${IMAGE_ROOTFS}${opkglibdir}
+ else
+ if [ ! -e ${IMAGE_ROOTFS}${bindir}/opkg-cl ]; then
+ # We need to run postinsts but lack opkg, do it byhand
+ cat > ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S98configure <<EOF
+#!/bin/sh
+
+for pkg in \`grep -B4 Status:.install.ok.unpacked ${opkglibdir}/status | awk '/^Package: / { print \$2 }'\`; do
+ ${opkglibdir}/info/\$pkg.postinst configure
+done
+
+rm -rf ${opkglibdir}
+
+rm ${sysconfdir}/rcS.d/S98configure
+EOF
+ chmod a+x ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S98configure
+ fi
fi
fi
set +x
--
1.7.2.5
More information about the Openembedded-core
mailing list