Patchwork [2/4] base-files: use dynamic root home directory

login
register
mail settings
Submitter Kang Kai
Date Dec. 19, 2012, 9:39 a.m.
Message ID <263dec923f4318de7ca03864c646e82c29cdc73d.1355902677.git.kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/41325/
State Accepted
Commit 07b842ff053c9c738486e3b98c2121fee7817fbc
Headers show

Comments

Kang Kai - Dec. 19, 2012, 9:39 a.m.
Use var ROOT_HOME to configure root home directory dynamically.

Signed-off-by: Kang Kai <kai.kang@windriver.com>
---
 meta/recipes-core/base-files/base-files/profile   |    2 +-
 meta/recipes-core/base-files/base-files_3.0.14.bb |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
index e9408d1..8eeaac3 100644
--- a/meta/recipes-core/base-files/base-files/profile
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -11,7 +11,7 @@  if [ ! -e /etc/localtime ]; then
 	export TZ
 fi
 
-if [ "$HOME" = "/home/root" ]; then
+if [ "$HOME" = "ROOTHOME" ]; then
    PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
 fi
 if [ "$PS1" ]; then
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 ba355ee..39faad9 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
@@ -34,7 +34,7 @@  docdir_append = "/${P}"
 dirs1777 = "/tmp ${localstatedir}/volatile/lock ${localstatedir}/volatile/tmp"
 dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
 dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
-           ${sysconfdir}/skel /lib /mnt /proc /home/root /sbin \
+           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /sbin \
            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
            ${libdir} ${sbindir} ${datadir} \
            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
@@ -94,6 +94,7 @@  do_install () {
 	install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
 	install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
 	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
+	sed -i "s#ROOTHOME#${ROOT_HOME}#" ${WORKDIR}/profile
 	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
 	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
 	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile