Skip to contentSkip to conversation

rootfs_ipk: issue a diagnostic if rootfs is declared read-only and not all maintainer scripts could be applied offline

PATCH Applied Phil Blundell 2 participants 2 messages May 24, 2011 – May 25, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rootfs_ipk: issue a diagnostic if rootfs is declared read-only and not all maintainer scripts could be applied offline

---
 meta/classes/rootfs_ipk.bbclass |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +10 -0
index 4c8088b..99584eb 100644
@@ -54,17 +54,27 @@ fakeroot rootfs_ipk_do_rootfs () {
 	${OPKG_POSTPROCESS_COMMANDS}
 	${ROOTFS_POSTINSTALL_COMMAND}
 	
+	runtime_script_required=0
 	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
 		if [ -f $i ] && ! sh $i; then
+		     	runtime_script_required=1
 			opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
 		fi
 	done
 	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do
 		if [ -f $i ] && ! sh $i configure; then
+		     	runtime_script_required=1
 			opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
 		fi
 	done
 
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+		if [ $runtime_script_required -eq 1 ]; then
+			echo "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
 
Signature · 1 line
1.7.1
Applied
#1 lore raw
Quoted 28 lines · Phil Blundell
---
  meta/classes/rootfs_ipk.bbclass |   10 ++++++++++
  1 files changed, 10 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +3 -0
index 4c8088b..99584eb 100644
@@ -54,17 +54,27 @@ fakeroot rootfs_ipk_do_rootfs () {
  	${OPKG_POSTPROCESS_COMMANDS}
  	${ROOTFS_POSTINSTALL_COMMAND}
 
+	runtime_script_required=0
  	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.preinst; do
  		if [ -f $i ]&&  ! sh $i; then
+		     	runtime_script_required=1
  			opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .preinst`
  		fi
  	done
  	for i in ${IMAGE_ROOTFS}${opkglibdir}/info/*.postinst; do
  		if [ -f $i ]&&  ! sh $i configure; then
+		     	runtime_script_required=1
  			opkg-cl ${IPKG_ARGS} flag unpacked `basename $i .postinst`
  		fi
  	done
 

meta/classes/rootfs_ipk.bbclass fakeroot rootfs_ipk_do_rootfs () { · line 80

Quoted 10 lines
meta/classes/rootfs_ipk.bbclass +7 -0
+	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
+		if [ $runtime_script_required -eq 1 ]; then
+			echo "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
 

Merged into OE-Core

Thanks
Sau!