aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuy Dang <duy.dang.yw@renesas.com>2019-07-09 11:20:55 +0700
committerKhang Nguyen <khang.nguyen.xw@renesas.com>2019-07-11 14:25:01 +0700
commitf88207c461da31c464c2764f5b54b24fd1594ded (patch)
tree1fc025d849342cbc5259929af3d732d4b112a186
parent49873206ed865023a67de2da36816ec3b3dede8a (diff)
rcar-gen3: Add a bad update bundle
This is a sample for bad bundle to demonstrate the roll back feature. The image which removed the /sbin/init will fail to boot. It will go back to the last success rootfs after several failures. To build this bundle, add to local.conf: DISTRO_FEATURES_append = " bad-bundle" and run: $ bitbake bad-agl-demo-bundle Change-Id: Ibfac913d2dbcd8c523999b2a6ed0ec6b37ed67eb Signed-off-by: Duy Dang <duy.dang.yw@renesas.com>
-rw-r--r--meta-rcar-gen3/recipes-core/bundles/bad-agl-demo-bundle.bb5
-rw-r--r--meta-rcar-gen3/recipes-platform/images/agl-demo-platform.bbappend7
2 files changed, 12 insertions, 0 deletions
diff --git a/meta-rcar-gen3/recipes-core/bundles/bad-agl-demo-bundle.bb b/meta-rcar-gen3/recipes-core/bundles/bad-agl-demo-bundle.bb
new file mode 100644
index 0000000..b6fc691
--- /dev/null
+++ b/meta-rcar-gen3/recipes-core/bundles/bad-agl-demo-bundle.bb
@@ -0,0 +1,5 @@
+require agl-demo-bundle.bb
+
+inherit distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "bad-bundle"
diff --git a/meta-rcar-gen3/recipes-platform/images/agl-demo-platform.bbappend b/meta-rcar-gen3/recipes-platform/images/agl-demo-platform.bbappend
new file mode 100644
index 0000000..2c40057
--- /dev/null
+++ b/meta-rcar-gen3/recipes-platform/images/agl-demo-platform.bbappend
@@ -0,0 +1,7 @@
+do_rootfs_append_rcar-gen3(){
+ import os
+ if "bad-bundle" in d.getVar("DISTRO_FEATURES"):
+ init_path = os.path.join(d.getVar("IMAGE_ROOTFS"),'sbin/init')
+ new_init_path = os.path.join(d.getVar("IMAGE_ROOTFS"),'sbin/init2')
+ os.rename(init_path, new_init_path)
+}