]> code.ossystems Code Review - openembedded-core.git/commitdiff
rootfs: add option to allow delayed postinsts on read-only rootfs
authorAnton Kachalov <rnouse@google.com>
Fri, 15 Jan 2021 15:43:23 +0000 (16:43 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 16 Jan 2021 22:39:17 +0000 (22:39 +0000)
Example use case in OpenBMC: rootfs is squashfs and the system has either
overlayfs for whole rootfs or for some parts (e.g. /etc).

This option will allow to create migration one-shot postinsts using
"pkg_postinst_ontarget_${PN}" routines defined in recipes to fix
files under upper workdir in overlayfs.

Signed-off-by: Anton D. Kachalov <rnouse@google.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image.bbclass
meta/lib/oe/rootfs.py

index 045f4494c8bf45699d93bf054b483ab36e5eecf6..3239d5cf5e4aa272bd36c18168fa1b0026163555 100644 (file)
@@ -33,7 +33,7 @@ INHIBIT_DEFAULT_DEPS = "1"
 # IMAGE_FEATURES may contain any available package group
 IMAGE_FEATURES ?= ""
 IMAGE_FEATURES[type] = "list"
-IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs stateless-rootfs empty-root-password allow-empty-password allow-root-login post-install-logging"
+IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs read-only-rootfs-delayed-postinsts stateless-rootfs empty-root-password allow-empty-password allow-root-login post-install-logging"
 
 # Generate companion debugfs?
 IMAGE_GEN_DEBUGFS ?= "0"
index 4b747dd0f41b7420af0d5aa28b945fd28e71f372..249c685dcfce5bec6996620bfe68fa70ab4fad1e 100644 (file)
@@ -217,6 +217,9 @@ class Rootfs(object, metaclass=ABCMeta):
             self.progress_reporter.next_stage()
 
         if bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+                         True, False, self.d) and \
+           not bb.utils.contains("IMAGE_FEATURES",
+                         "read-only-rootfs-delayed-postinsts",
                          True, False, self.d):
             delayed_postinsts = self._get_delayed_postinsts()
             if delayed_postinsts is not None: