* [PATCH] classes/rootfs_*: error out if postinstalls exist with read-only rootfs
@ 2013-01-16 18:09 Paul Eggleton
0 siblings, 0 replies; only message in thread
From: Paul Eggleton @ 2013-01-16 18:09 UTC (permalink / raw)
To: openembedded-core
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>
---
meta/classes/rootfs_deb.bbclass | 7 +++++++
meta/classes/rootfs_ipk.bbclass | 2 +-
meta/classes/rootfs_rpm.bbclass | 9 +++++++++
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 293953d..9997996 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -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
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 5c962de..0e2fa12 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -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
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
index 2bfd1b7..7d789cc 100644
--- a/meta/classes/rootfs_rpm.bbclass
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -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
--
1.7.10.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-16 18:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-16 18:09 [PATCH] classes/rootfs_*: error out if postinstalls exist with read-only rootfs Paul Eggleton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox