[oe] [PATCH 45/70] rootfs_rpm.bbclass: Add basic postinstall handling during image creation (from Poky)

Marcin Juszkiewicz openembedded at haerwu.biz
Wed Mar 4 15:53:00 UTC 2009


From: Richard Purdie <richard at openedhand.com>

git-svn-id: https://svn.o-hand.com/repos/poky@5134 311d38ba-8fff-0310-9ca6-ca027cbcb966
---
 classes/rootfs_rpm.bbclass |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/classes/rootfs_rpm.bbclass b/classes/rootfs_rpm.bbclass
index 8da7f3a..b2d6762 100644
--- a/classes/rootfs_rpm.bbclass
+++ b/classes/rootfs_rpm.bbclass
@@ -12,6 +12,8 @@ do_rootfs[recrdeptask] += "do_package_write_rpm"
 YUMCONF = "${IMAGE_ROOTFS}/etc/yum.conf"
 YUMARGS = "-c ${YUMCONF} --installroot ${IMAGE_ROOTFS}"
 
+AWKPOSTINSTSCRIPT = "${STAGING_BINDIR_NATIVE}/extract-postinst.awk"
+
 fakeroot rootfs_rpm_do_rootfs () {
 	set -x
 
@@ -67,26 +69,26 @@ EOF
 		fakechroot yum ${YUMARGS} -y install ${PACKAGE_INSTALL}
 	fi
 
-	#export D=${IMAGE_ROOTFS}
-	#export OFFLINE_ROOT=${IMAGE_ROOTFS}
-	#export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
-	#export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
+	export D=${IMAGE_ROOTFS}
+	export OFFLINE_ROOT=${IMAGE_ROOTFS}
+	export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
+	export OPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
 
 	#mkdir -p ${IMAGE_ROOTFS}/etc/opkg/
 	#grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf
 
 	${ROOTFS_POSTINSTALL_COMMAND}
-	
-	#for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.preinst; do
-	#	if [ -f $i ] && ! sh $i; then
-	#		opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
-	#	fi
-	#done
-	#for i in ${IMAGE_ROOTFS}${libdir}/opkg/info/*.postinst; do
-	#	if [ -f $i ] && ! sh $i configure; then
-	#		opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
-	#	fi
-	#done
+
+	mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/
+	rpm --root ${IMAGE_ROOTFS} -aq --queryformat 'Name: %{NAME}\n' --scripts > ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
+	awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined
+	rm ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined	
+
+	for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do
+		if [ -f $i ] && sh $i; then
+			rm $i
+		fi
+	done
 
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}
 	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
-- 
1.6.1.3







More information about the Openembedded-devel mailing list