meta-phosphor: phosphor-static-norootfs-init: add home as persistent
In order to allow users other than root to be created, home needs to be
writable. Add it to the persistence list.
Since sometimes root's home is in `/home` and sometimes it is in
`/root`, also add logic to detect where `ROOT_HOME` is and also add
it if it is outside of `/home`
Tested:
`bitbake phosphor-static-norootfs-init -ne` with ROOT_HOME in `/root`
and in `/home/root`:
NOROOTFS_PERSISTENT_DIRS=" var etc home root mnt/data"
NOROOTFS_PERSISTENT_DIRS=" var etc home mnt/data"
Change-Id: I1a389a3546409b2fe888f47ebd49c0d3e43c13bb
Signed-off-by: Marco Kawajiri <kawajiri@meta.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bb b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bb
index 3d193bc..fd7a9bf 100644
--- a/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bb
+++ b/meta-phosphor/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bb
@@ -19,7 +19,12 @@
S = "${WORKDIR}"
-NOROOTFS_PERSISTENT_DIRS = "var etc ${@ d.getVar('ROOT_HOME')[1:]}"
+NOROOTFS_PERSISTENT_DIRS = "\
+ var \
+ etc \
+ home \
+ ${@ bb.utils.contains('ROOT_HOME', '/home/root', '', d.getVar('ROOT_HOME')[1:], d)} \
+ "
inherit allarch
inherit update-alternatives