]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/rootfs_*: error out if postinstalls exist with read-only rootfs
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 16 Jan 2013 18:09:27 +0000 (18:09 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 18 Jan 2013 13:01:42 +0000 (13:01 +0000)
If there are postinstall scripts to be run on first boot and
IMAGE_FEATURES contains "read-only-rootfs", we know this will fail on
the target device so just error out during do_rootfs. This check was
already implemented for ipk, so add it to the deb and rpm backends. Also
make all backends use bberror rather than just echo to display the
error.

Fixes [YOCTO #3407].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/rootfs_deb.bbclass
meta/classes/rootfs_ipk.bbclass
meta/classes/rootfs_rpm.bbclass

index 293953df3e28758165d9c79ec42d0c37e25e5a1a..99979961eaed3c63288b9a4859941b4afcb91f5a 100644 (file)
@@ -70,6 +70,13 @@ 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
 
index 5c962de11b9741be2ffb36369af1e495cd523bb9..0e2fa12ac98bd228fc6963663a1b4198a9cf5536 100644 (file)
@@ -83,7 +83,7 @@ fakeroot rootfs_ipk_do_rootfs () {
        
        if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
                if grep Status:.install.ok.unpacked ${STATUS}; then
-                       echo "Some packages could not be configured offline and rootfs is read-only."
+                       bberror "Some packages could not be configured offline and rootfs is read-only."
                        exit 1
                fi
        fi
index 2bfd1b779ebc3a6b1b0ad70b8094e305d134f61e..7d789cc8fdc917b89050e078b679df8534321d6f 100644 (file)
@@ -87,6 +87,15 @@ 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