Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Dan McGregor <danismostlikely@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/3] base-files: make root home mode customisable
Date: Fri, 11 May 2018 14:10:55 -0600	[thread overview]
Message-ID: <20180511201055.15463-3-danismostlikely@gmail.com> (raw)
In-Reply-To: <20180511201055.15463-1-danismostlikely@gmail.com>

From: Dan McGregor <dan.mcgregor@usask.ca>

Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
---
 meta/conf/bitbake.conf                            | 1 +
 meta/files/fs-perms-persistent-log.txt            | 4 ++--
 meta/files/fs-perms.txt                           | 4 ++--
 meta/recipes-core/base-files/base-files_3.0.14.bb | 4 +++-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index a21b7282fbd..cd07b86a99c 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 3a7cf3ab945..e16c4464843 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 c8c3ac5dbed..ad180399105 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 a4c22c51c77..6267b649465 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
 
-- 
2.18.0-dev



      parent reply	other threads:[~2018-05-11 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 20:10 [PATCH 1/3] base-files: change permissions on /sys and /proc Dan McGregor
2018-05-11 20:10 ` [PATCH 2/3] base-files: use /proc/self/mounts for /etc/mtab Dan McGregor
2018-05-11 20:10 ` Dan McGregor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180511201055.15463-3-danismostlikely@gmail.com \
    --to=danismostlikely@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox