summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGregor <dan.mcgregor@usask.ca>2018-05-09 13:12:53 -0600
committerDan McGregor <dan.mcgregor@usask.ca>2018-05-11 09:48:00 -0600
commit2fb350c80d9ab134e45332ae57d72db593de4ffc (patch)
tree29bcfa4f9403832a1ab7641dbfe63a6f66034f7b
parent166e40a4790cc977aa5136bf3f2c98bd34b7871d (diff)
downloadopenembedded-core-contrib-2fb350c80d9ab134e45332ae57d72db593de4ffc.tar.gz
openembedded-core-contrib-2fb350c80d9ab134e45332ae57d72db593de4ffc.tar.bz2
openembedded-core-contrib-2fb350c80d9ab134e45332ae57d72db593de4ffc.zip
base-files: make root home mode customisabledankm/base-permissions
Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
-rw-r--r--meta/conf/bitbake.conf1
-rw-r--r--meta/files/fs-perms-persistent-log.txt4
-rw-r--r--meta/files/fs-perms.txt4
-rw-r--r--meta/recipes-core/base-files/base-files_3.0.14.bb4
4 files changed, 8 insertions, 5 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a21b7282fb..cd07b86a99 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -84,6 +84,7 @@ USRBINPATH_class-nativesdk = "/usr/bin"
# Root home directory
ROOT_HOME ??= "/home/root"
+ROOT_HOME_MODE ??= "0700"
# If set to boolean true ('yes', 'y', 'true', 't', '1'), /var/log links to /var/volatile/log.
# If set to boolean false ('no', 'n', 'false', 'f', '0'), /var/log is on persistent storage.
diff --git a/meta/files/fs-perms-persistent-log.txt b/meta/files/fs-perms-persistent-log.txt
index 3a7cf3ab94..e16c446484 100644
--- a/meta/files/fs-perms-persistent-log.txt
+++ b/meta/files/fs-perms-persistent-log.txt
@@ -59,8 +59,8 @@ ${localstatedir}/local 0755 root root false - - -
/tmp 01777 root root false - - -
${localstatedir}/volatile/tmp 01777 root root false - - -
-# Set 0700
-${ROOT_HOME} 0700 root root false - - -
+# Set ${ROOT_HOME_MODE}, by default 0700.
+${ROOT_HOME} ${ROOT_HOME_MODE} root root false - - -
# Set 2775-lsb
${localstatedir}/mail 02775 root mail false - - -
diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms.txt
index c8c3ac5dbe..ad18039910 100644
--- a/meta/files/fs-perms.txt
+++ b/meta/files/fs-perms.txt
@@ -60,8 +60,8 @@ ${localstatedir}/local 0755 root root false - - -
/tmp 01777 root root false - - -
${localstatedir}/volatile/tmp 01777 root root false - - -
-# Set 0700
-${ROOT_HOME} 0700 root root false - - -
+# Set ${ROOT_HOME_MODE}, by default 0700.
+${ROOT_HOME} ${ROOT_HOME_MODE} root root false - - -
# Set 2775-lsb
${localstatedir}/mail 02775 root mail false - - -
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
index a4c22c51c7..6267b64946 100644
--- a/meta/recipes-core/base-files/base-files_3.0.14.bb
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -35,7 +35,7 @@ dirs2775 = ""
dirs555 = "/sys /proc"
dirs755 = "/boot /dev ${base_bindir} ${base_sbindir} ${base_libdir} \
${sysconfdir} ${sysconfdir}/default \
- ${sysconfdir}/skel ${nonarch_base_libdir} /mnt ${ROOT_HOME} /run \
+ ${sysconfdir}/skel ${nonarch_base_libdir} /mnt /run \
${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
${libdir} ${sbindir} ${datadir} \
${datadir}/common-licenses ${datadir}/dict ${infodir} \
@@ -110,6 +110,8 @@ do_install () {
ln -sf volatile/$d ${D}${localstatedir}/$d
done
+ install -m ${ROOT_HOME_MODE} -d ${D}${ROOT_HOME}
+
ln -snf ../run ${D}${localstatedir}/run
ln -snf ../run/lock ${D}${localstatedir}/lock