Patchwork [03/11] rootfs_(ipk|deb|rpm).bbclass: check package installation status after ROOTFS_POSTPROCESS_COMMAND

login
register
mail settings
Submitter Laurentiu Palcu
Date Feb. 12, 2013, 4:12 p.m.
Message ID <6644f9bd4918d4c0e098b62194895468cd49f597.1360684306.git.laurentiu.palcu@intel.com>
Download mbox | patch
Permalink /patch/44523/
State Accepted
Commit 5bb362a0ba97687029b3aef76b7e789570a4d728
Headers show

Comments

Laurentiu Palcu - Feb. 12, 2013, 4:12 p.m.
Since the intercept fall-back procedure will change the package
installation status, do the checking after ROOTFS_POSTPROCESS_COMMAND
ends.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 meta/classes/rootfs_deb.bbclass |   14 +++++++-------
 meta/classes/rootfs_ipk.bbclass |   13 ++++++-------
 meta/classes/rootfs_rpm.bbclass |   20 ++++++++++----------
 3 files changed, 23 insertions(+), 24 deletions(-)

Patch

diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 9997996..92a6579 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -70,13 +70,6 @@  fakeroot rootfs_deb_do_rootfs () {
 
 	set -e
 
-	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
-		if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}/var/lib/dpkg/status; then
-			bberror "Some packages could not be configured offline and rootfs is read-only."
-			exit 1
-		fi
-	fi
-
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}
 	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
 
@@ -91,6 +84,13 @@  fakeroot rootfs_deb_do_rootfs () {
 
 	${ROOTFS_POSTPROCESS_COMMAND}
 
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+		if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}/var/lib/dpkg/status; then
+			bberror "Some packages could not be configured offline and rootfs is read-only."
+			exit 1
+		fi
+	fi
+
 	log_check rootfs
 }
 
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index fadec4d..135bb60 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -80,7 +80,12 @@  fakeroot rootfs_ipk_do_rootfs () {
 
 	${OPKG_POSTPROCESS_COMMANDS}
 	${ROOTFS_POSTINSTALL_COMMAND}
-	
+
+	install -d ${IMAGE_ROOTFS}/${sysconfdir}
+	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
+
+	${ROOTFS_POSTPROCESS_COMMAND}
+
 	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
 		if grep Status:.install.ok.unpacked ${STATUS}; then
 			bberror "Some packages could not be configured offline and rootfs is read-only."
@@ -88,11 +93,6 @@  fakeroot rootfs_ipk_do_rootfs () {
 		fi
 	fi
 
-	install -d ${IMAGE_ROOTFS}/${sysconfdir}
-	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
-
-	${ROOTFS_POSTPROCESS_COMMAND}
-	
 	rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/*
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
 		if ! grep Status:.install.ok.unpacked ${STATUS}; then
@@ -114,7 +114,6 @@  fakeroot rootfs_ipk_do_rootfs () {
 			remove_packaging_data_files
 		fi
 	fi
-	set +x
 	log_check rootfs
 }
 
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 119bf92..5651243 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -87,15 +87,6 @@  fakeroot rootfs_rpm_do_rootfs () {
 
 	${ROOTFS_POSTINSTALL_COMMAND}
 
-	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
-		if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then
-			if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then
-				bberror "Some packages could not be configured offline and rootfs is read-only."
-				exit 1
-			fi
-		fi
-	fi
-
 	# Report delayed package scriptlets
 	for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do
 		if [ -f $i ]; then
@@ -126,7 +117,16 @@  EOF
 
 	${RPM_POSTPROCESS_COMMANDS}
 	${ROOTFS_POSTPROCESS_COMMAND}
-	
+
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+		if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then
+			if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then
+				bberror "Some packages could not be configured offline and rootfs is read-only."
+				exit 1
+			fi
+		fi
+	fi
+
 	rm -rf ${IMAGE_ROOTFS}/var/cache2/
 	rm -rf ${IMAGE_ROOTFS}/var/run2/
 	rm -rf ${IMAGE_ROOTFS}/var/log2/