Skip to contentSkip to conversation

Use dynamic root home directory

PATCH In review Kang Kai 2 participants 8 messages Dec 19, 2012 – Dec 20, 2012

lore
Share & tools
lore

Kang Kai

author
#0 lore raw

cover Use dynamic root home directory

Import variable ROOT_HOME which can be configured. Update base-files, base-passwd, oprofile to use the dynamic root home directory.

The following changes since commit 2a9c574fd8b0800199b6569b6abf02634801013d:

gst-openmax: fix build with newer GLib (2012-12-17 17:53:52 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib kangkai/roothome
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/roothome

Kang Kai (4):
bitbake.conf: import var ROOT_HOME
base-files: use dynamic root home directory
base-passwd: use configurable root home directory
oprofile: use dynamic root home directory

 meta/conf/bitbake.conf                             |    3 ++
 meta/recipes-core/base-files/base-files/profile    |    2 +-
 meta/recipes-core/base-files/base-files_3.0.14.bb  |    3 +-
 .../base-passwd/base-passwd-3.5.26/root-home.patch |   16 -------------
 .../recipes-core/base-passwd/base-passwd_3.5.26.bb |    4 +-
 meta/recipes-kernel/oprofile/oprofile.inc          |    1 +
 .../oprofile/oprofile/oprofile-root.patch          |   23 ++++++++++++-------
 7 files changed, 23 insertions(+), 29 deletions(-)
 delete mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.26/root-home.patch
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/4 bitbake.conf: import var ROOT_HOME

Import var ROOT_HOME to configure root home directory dynamically.

[Yocto 2683]

---
 meta/conf/bitbake.conf |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
meta/conf/bitbake.conf +3 -0
index be3bfc2..983b3c0 100644
@@ -73,6 +73,9 @@ USRBINPATH = "${bindir}"
 USRBINPATH_class-native = "/usr/bin"
 USRBINPATH_class-nativesdk = "/usr/bin"
 
+# Root home directory
+ROOT_HOME ?= "/home/root"
+
 ##################################################################
 # Architecture-dependent build variables.
 ##################################################################
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 2/4 base-files: use dynamic root home directory

In reply to Kang Kai

Use var ROOT_HOME to configure root home directory dynamically.

---
 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(-)
meta/recipes-core/base-files/base-files/profile +1 -1
index e9408d1..8eeaac3 100644
@@ -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
meta/recipes-core/base-files/base-files_3.0.14.bb +2 -1
index ba355ee..39faad9 100644
@@ -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
Signature · 1 line
1.7.5.4
author
#3 lore raw

PATCH 3/4 base-passwd: use configurable root home directory

In reply to Kang Kai

Use configurable variable ROOT_HOME as root home directory. Drop root-home.patch because it is not needed any more.

---
 .../base-passwd/base-passwd-3.5.26/root-home.patch |   16 ----------------
 .../recipes-core/base-passwd/base-passwd_3.5.26.bb |    4 ++--
 2 files changed, 2 insertions(+), 18 deletions(-)
 delete mode 100644 meta/recipes-core/base-passwd/base-passwd-3.5.26/root-home.patch
meta/recipes-core/base-passwd/base-passwd-3.5.26/root-home.patch deleted +0 -16
deleted file mode 100644
index eab77f1..0000000
@@ -1,16 +0,0 @@
-we use /home/root instead of /root
-
-Comment added by Kevin Tian <[email protected]>, 2010-07-06
-
-Upstream-Status: Inappropriate [configuration]
-
-Signed-off-by: Scott Garman <[email protected]>
-
---- base-passwd/passwd.master.orig	2005-07-08 06:26:22.000000000 +0200
-+++ base-passwd/passwd.master	2005-07-08 06:31:58.000000000 +0200
-@@ -1,4 +1,4 @@
--root::0:0:root:/root:/bin/sh
-+root::0:0:root:/home/root:/bin/sh
- daemon:*:1:1:daemon:/usr/sbin:/bin/sh
- bin:*:2:2:bin:/bin:/bin/sh
- sys:*:3:3:sys:/dev:/bin/sh
meta/recipes-core/base-passwd/base-passwd_3.5.26.bb +2 -2
index 3eae214..2b1dc1c 100644
@@ -6,8 +6,7 @@ LICENSE = "GPLv2+"
 LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
-           file://nobash.patch \
-           file://root-home.patch"
+           file://nobash.patch"
 
 SRC_URI[md5sum] = "74245e5c21dc74d9675c77cd8dfa02e6"
 SRC_URI[sha256sum] = "258a78317aa563143d10375c6e1e63a60898e503887f00fffd70b6b297c1b429"
@@ -25,6 +24,7 @@ do_install () {
 		${D}${mandir}/pl/man8/update-passwd.8
 	gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
 	install -d -m 755 ${D}${datadir}/base-passwd
+	sed -i 's#:/root:#:${ROOT_HOME}:#' ${S}/passwd.master
 	install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
 	install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
 
Signature · 1 line
1.7.5.4
author
#4 lore raw

PATCH 4/4 oprofile: use dynamic root home directory

In reply to Kang Kai

Use stub "ROOTHOME" to replace "/home/root" in oprofile-root.patch, then we can substitute it with configured root home directory.

---
 meta/recipes-kernel/oprofile/oprofile.inc          |    1 +
 .../oprofile/oprofile/oprofile-root.patch          |   23 ++++++++++++-------
 2 files changed, 15 insertions(+), 9 deletions(-)
meta/recipes-kernel/oprofile/oprofile.inc +1 -0
index b3ce852..0977065 100644
@@ -31,6 +31,7 @@ inherit autotools
 
 EXTRA_OECONF = "--with-kernel-support --without-x"
 do_configure () {
+        find . -type f | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#'
 	cp ${WORKDIR}/acinclude.m4 ${S}/
 	autotools_do_configure
 }
meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +14 -9
index db63a8e..f3fe4c9 100644
@@ -4,6 +4,11 @@ Upstream-Status: inappropriate [OE specific]
 
 Signed-off-by: Mark Hatle <[email protected]>
 
+Replace "/home/root" with stub "ROOTHOME", then substitute it with
+real root home directory which is configured dymanically.
+
+Signed-off-by: Kang Kai <[email protected]>
+
 diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.in
 --- oprofile-0.9.7.orig/doc/opcontrol.1.in	2011-07-04 21:25:04.000000000 -0500
 +++ oprofile-0.9.7/doc/opcontrol.1.in	2012-07-02 14:02:16.358865420 -0500
@@ -12,7 +17,7 @@ diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.i
  .SH FILES
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I /var/lib/oprofile/samples/
@@ -24,7 +29,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1 oprofile-0.9.7/doc/oprofile.1
  Configuration files
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I /opt/oprofile-0.9.7-rc3/share/oprofile/
@@ -36,7 +41,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in oprofile-0.9.7/doc/oprofile.1.in
  Configuration files
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I @prefix@/share/oprofile/
@@ -48,7 +53,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                  <p>
  		    Followed by list arguments for profiling set up. List of arguments
 -		    saved in <code class="filename">/root/.oprofile/daemonrc</code>.
-+		    saved in <code class="filename">/home/root/.oprofile/daemonrc</code>.
++		    saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>.
  		    Giving this option is not necessary; you can just directly pass one
  		    of the setup options, e.g. <span class="command"><strong>opcontrol --no-vmlinux</strong></span>.
  		  </p>
@@ -57,7 +62,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                  <p>
  		    Start data collection with either arguments provided by <code class="option">--setup</code>
 -		or information saved in <code class="filename">/root/.oprofile/daemonrc</code>. Specifying
-+		or information saved in <code class="filename">/home/root/.oprofile/daemonrc</code>. Specifying
++		or information saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>. Specifying
  		the addition <code class="option">--verbose</code> makes the daemon generate lots of debug data
  		whilst it is running.
  		</p>
@@ -69,7 +74,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
  		<listitem><para>
  		    Followed by list arguments for profiling set up. List of arguments
 -		    saved in <filename>/root/.oprofile/daemonrc</filename>.
-+		    saved in <filename>/home/root/.oprofile/daemonrc</filename>.
++		    saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>.
  		    Giving this option is not necessary; you can just directly pass one
  		    of the setup options, e.g. <command>opcontrol --no-vmlinux</command>.
  		  </para></listitem>
@@ -78,7 +83,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
  		<listitem><para>
  		    Start data collection with either arguments provided by <option>--setup</option>
 -		or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying
-+		or information saved in <filename>/home/root/.oprofile/daemonrc</filename>. Specifying
++		or information saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>. Specifying
  		the addition <option>--verbose</option> makes the daemon generate lots of debug data
  		whilst it is running.
  		</para></listitem>
@@ -90,7 +95,7 @@ diff -ur oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_s
  string const get_config_dir()
  {
 -	return "/root";
-+	return "/home/root";
++	return "ROOTHOME";
  }
  
  string daemon_pid;
@@ -102,7 +107,7 @@ diff -ur oprofile-0.9.7.orig/utils/opcontrol oprofile-0.9.7/utils/opcontrol
  
  	# location for daemon setup information
 -	SETUP_DIR="/root/.oprofile"
-+	SETUP_DIR="/home/root/.oprofile"
++	SETUP_DIR="ROOTHOME/.oprofile"
  	SETUP_FILE="$SETUP_DIR/daemonrc"
  	SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
  
Signature · 1 line
1.7.5.4
#5 lore raw

Re: [PATCH 4/4] oprofile: use dynamic root home directory

Quoted 14 lines · Kang Kai

Use stub "ROOTHOME" to replace "/home/root" in oprofile-root.patch, then we can substitute it with configured root home directory.

---
 meta/recipes-kernel/oprofile/oprofile.inc          |    1 +
 .../oprofile/oprofile/oprofile-root.patch          |   23 ++++++++++++-------
 2 files changed, 15 insertions(+), 9 deletions(-)
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
index b3ce852..0977065 100644

meta/recipes-kernel/oprofile/oprofile.inc inherit autotools · line 36

Quoted 6 lines
meta/recipes-kernel/oprofile/oprofile.inc +1 -0
@@ -31,6 +31,7 @@ inherit autotools
 
 EXTRA_OECONF = "--with-kernel-support --without-x"
 do_configure () {
+        find . -type f | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#'
 	cp ${WORKDIR}/acinclude.m4 ${S}/
 	autotools_do_configure

You should use tab here.

Cheers,

Quoted 106 lines
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
 }
meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +14 -9
index db63a8e..f3fe4c9 100644
@@ -4,6 +4,11 @@ Upstream-Status: inappropriate [OE specific]
 
 Signed-off-by: Mark Hatle <[email protected]>
 
+Replace "/home/root" with stub "ROOTHOME", then substitute it with
+real root home directory which is configured dymanically.
+
+Signed-off-by: Kang Kai <[email protected]>
+
 diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.in
 --- oprofile-0.9.7.orig/doc/opcontrol.1.in	2011-07-04 21:25:04.000000000 -0500
 +++ oprofile-0.9.7/doc/opcontrol.1.in	2012-07-02 14:02:16.358865420 -0500
@@ -12,7 +17,7 @@ diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.i
  .SH FILES
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I /var/lib/oprofile/samples/
@@ -24,7 +29,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1 oprofile-0.9.7/doc/oprofile.1
  Configuration files
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I /opt/oprofile-0.9.7-rc3/share/oprofile/
@@ -36,7 +41,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in oprofile-0.9.7/doc/oprofile.1.in
  Configuration files
  .TP
 -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
  Configuration file for opcontrol
  .TP
  .I @prefix@/share/oprofile/
@@ -48,7 +53,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                  <p>
  		    Followed by list arguments for profiling set up. List of arguments
 -		    saved in <code class="filename">/root/.oprofile/daemonrc</code>.
-+		    saved in <code class="filename">/home/root/.oprofile/daemonrc</code>.
++		    saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>.
  		    Giving this option is not necessary; you can just directly pass one
  		    of the setup options, e.g. <span class="command"><strong>opcontrol --no-vmlinux</strong></span>.
  		  </p>
@@ -57,7 +62,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                  <p>
  		    Start data collection with either arguments provided by <code class="option">--setup</code>
 -		or information saved in <code class="filename">/root/.oprofile/daemonrc</code>. Specifying
-+		or information saved in <code class="filename">/home/root/.oprofile/daemonrc</code>. Specifying
++		or information saved in <code class="filename">ROOTHOME/.oprofile/daemonrc</code>. Specifying
  		the addition <code class="option">--verbose</code> makes the daemon generate lots of debug data
  		whilst it is running.
  		</p>
@@ -69,7 +74,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
  		<listitem><para>
  		    Followed by list arguments for profiling set up. List of arguments
 -		    saved in <filename>/root/.oprofile/daemonrc</filename>.
-+		    saved in <filename>/home/root/.oprofile/daemonrc</filename>.
++		    saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>.
  		    Giving this option is not necessary; you can just directly pass one
  		    of the setup options, e.g. <command>opcontrol --no-vmlinux</command>.
  		  </para></listitem>
@@ -78,7 +83,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
  		<listitem><para>
  		    Start data collection with either arguments provided by <option>--setup</option>
 -		or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying
-+		or information saved in <filename>/home/root/.oprofile/daemonrc</filename>. Specifying
++		or information saved in <filename>ROOTHOME/.oprofile/daemonrc</filename>. Specifying
  		the addition <option>--verbose</option> makes the daemon generate lots of debug data
  		whilst it is running.
  		</para></listitem>
@@ -90,7 +95,7 @@ diff -ur oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_s
  string const get_config_dir()
  {
 -	return "/root";
-+	return "/home/root";
++	return "ROOTHOME";
  }
 
  string daemon_pid;
@@ -102,7 +107,7 @@ diff -ur oprofile-0.9.7.orig/utils/opcontrol oprofile-0.9.7/utils/opcontrol
 
  	# location for daemon setup information
 -	SETUP_DIR="/root/.oprofile"
-+	SETUP_DIR="/home/root/.oprofile"
++	SETUP_DIR="ROOTHOME/.oprofile"
  	SETUP_FILE="$SETUP_DIR/daemonrc"
  	SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
 
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#6 lore raw

Re: [PATCH 4/4] oprofile: use dynamic root home directory

Quoted 16 lines · Martin Jansa
Quoted 15 lines · Kang Kai

Use stub "ROOTHOME" to replace "/home/root" in oprofile-root.patch, then we can substitute it with configured root home directory.

---
  meta/recipes-kernel/oprofile/oprofile.inc          |    1 +
  .../oprofile/oprofile/oprofile-root.patch          |   23 ++++++++++++-------
  2 files changed, 15 insertions(+), 9 deletions(-)
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
index b3ce852..0977065 100644
@@ -31,6 +31,7 @@ inherit autotools
 
Quoted 6 lines

meta/recipes-kernel/oprofile/oprofile.inc inherit autotools · line 36

Quoted 5 lines
meta/recipes-kernel/oprofile/oprofile.inc +1 -0
  EXTRA_OECONF = "--with-kernel-support --without-x"
  do_configure () {
+        find . -type f | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#'
  	cp ${WORKDIR}/acinclude.m4 ${S}/
  	autotools_do_configure

You should use tab here.

OK, thanks. I'll wait for others comments until this afternoon and then send V2.

Regards,
Kai

Quoted 109 lines

Cheers,

Quoted 106 lines
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
  }
meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +14 -9
index db63a8e..f3fe4c9 100644
@@ -4,6 +4,11 @@ Upstream-Status: inappropriate [OE specific]
 
  Signed-off-by: Mark Hatle<[email protected]>
 
+Replace "/home/root" with stub "ROOTHOME", then substitute it with
+real root home directory which is configured dymanically.
+
+Signed-off-by: Kang Kai<[email protected]>
+
  diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.in
  --- oprofile-0.9.7.orig/doc/opcontrol.1.in	2011-07-04 21:25:04.000000000 -0500
  +++ oprofile-0.9.7/doc/opcontrol.1.in	2012-07-02 14:02:16.358865420 -0500
@@ -12,7 +17,7 @@ diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.i
   .SH FILES
   .TP
  -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
   Configuration file for opcontrol
   .TP
   .I /var/lib/oprofile/samples/
@@ -24,7 +29,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1 oprofile-0.9.7/doc/oprofile.1
   Configuration files
   .TP
  -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
   Configuration file for opcontrol
   .TP
   .I /opt/oprofile-0.9.7-rc3/share/oprofile/
@@ -36,7 +41,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in oprofile-0.9.7/doc/oprofile.1.in
   Configuration files
   .TP
  -.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
   Configuration file for opcontrol
   .TP
   .I @prefix@/share/oprofile/
@@ -48,7 +53,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                   <p>
   		Followed by list arguments for profiling set up. List of arguments
  -		    saved in<code class="filename">/root/.oprofile/daemonrc</code>.
-+		    saved in<code class="filename">/home/root/.oprofile/daemonrc</code>.
++		    saved in<code class="filename">ROOTHOME/.oprofile/daemonrc</code>.
   		    Giving this option is not necessary; you can just directly pass one
   		    of the setup options, e.g.<span class="command"><strong>opcontrol --no-vmlinux</strong></span>.
   		</p>
@@ -57,7 +62,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html
                   <p>
   		Start data collection with either arguments provided by<code class="option">--setup</code>
  -		or information saved in<code class="filename">/root/.oprofile/daemonrc</code>. Specifying
-+		or information saved in<code class="filename">/home/root/.oprofile/daemonrc</code>. Specifying
++		or information saved in<code class="filename">ROOTHOME/.oprofile/daemonrc</code>. Specifying
   		the addition<code class="option">--verbose</code>  makes the daemon generate lots of debug data
   		whilst it is running.
   		</p>
@@ -69,7 +74,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
   		<listitem><para>
   		Followed by list arguments for profiling set up. List of arguments
  -		    saved in<filename>/root/.oprofile/daemonrc</filename>.
-+		    saved in<filename>/home/root/.oprofile/daemonrc</filename>.
++		    saved in<filename>ROOTHOME/.oprofile/daemonrc</filename>.
   		    Giving this option is not necessary; you can just directly pass one
   		    of the setup options, e.g.<command>opcontrol --no-vmlinux</command>.
   		</para></listitem>
@@ -78,7 +83,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml
   		<listitem><para>
   		Start data collection with either arguments provided by<option>--setup</option>
  -		or information saved in<filename>/root/.oprofile/daemonrc</filename>. Specifying
-+		or information saved in<filename>/home/root/.oprofile/daemonrc</filename>. Specifying
++		or information saved in<filename>ROOTHOME/.oprofile/daemonrc</filename>. Specifying
   		the addition<option>--verbose</option>  makes the daemon generate lots of debug data
   		whilst it is running.
   		</para></listitem>
@@ -90,7 +95,7 @@ diff -ur oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_s
   string const get_config_dir()
   {
  -	return "/root";
-+	return "/home/root";
++	return "ROOTHOME";
   }
 
   string daemon_pid;
@@ -102,7 +107,7 @@ diff -ur oprofile-0.9.7.orig/utils/opcontrol oprofile-0.9.7/utils/opcontrol
 
   	# location for daemon setup information
  -	SETUP_DIR="/root/.oprofile"
-+	SETUP_DIR="/home/root/.oprofile"
++	SETUP_DIR="ROOTHOME/.oprofile"
   	SETUP_FILE="$SETUP_DIR/daemonrc"
   	SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
 
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
author
#7 lore raw

Re: [PATCH 4/4] oprofile: use dynamic root home directory

Quoted 18 lines · Kang Kai
Quoted 17 lines · Martin Jansa
Quoted 16 lines · Kang Kai

Use stub "ROOTHOME" to replace "/home/root" in oprofile-root.patch, then we can substitute it with configured root home directory.

---
  meta/recipes-kernel/oprofile/oprofile.inc          |    1 +
  .../oprofile/oprofile/oprofile-root.patch          |   23 
++++++++++++-------
  2 files changed, 15 insertions(+), 9 deletions(-)
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
index b3ce852..0977065 100644
@@ -31,6 +31,7 @@ inherit autotools
 
Quoted 8 lines
Quoted 6 lines

meta/recipes-kernel/oprofile/oprofile.inc inherit autotools · line 36

Quoted 5 lines
meta/recipes-kernel/oprofile/oprofile.inc +1 -0
  EXTRA_OECONF = "--with-kernel-support --without-x"
  do_configure () {
+        find . -type f | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#'
      cp ${WORKDIR}/acinclude.m4 ${S}/
      autotools_do_configure

You should use tab here.

OK, thanks. I'll wait for others comments until this afternoon and then send V2.

Because no other comments and this is tiny update, I just update it in the contribute branch on

http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=kangkai/roothome

which also show in cover letter.

Regards,
Kai

Quoted 151 lines

Regards,
Kai

Quoted 133 lines

Cheers,

Quoted 130 lines
meta/recipes-kernel/oprofile/oprofile.inc +0 -0
  }
meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +5 -0
index db63a8e..f3fe4c9 100644
@@ -4,6 +4,11 @@ Upstream-Status: inappropriate [OE specific]
 
  Signed-off-by: Mark Hatle<[email protected]>
 
+Replace "/home/root" with stub "ROOTHOME", then substitute it with
+real root home directory which is configured dymanically.
+
+Signed-off-by: Kang Kai<[email protected]>
+
  diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in 

oprofile-0.9.7/doc/opcontrol.1.in
--- oprofile-0.9.7.orig/doc/opcontrol.1.in 2011-07-04
21:25:04.000000000 -0500
+++ oprofile-0.9.7/doc/opcontrol.1.in 2012-07-02
14:02:16.358865420 -0500

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -12,7 +17,7 @@ diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in 

oprofile-0.9.7/doc/opcontrol.1.i
.SH FILES
.TP
-.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
Configuration file for opcontrol
.TP
.I /var/lib/oprofile/samples/

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -24,7 +29,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1 

oprofile-0.9.7/doc/oprofile.1
Configuration files
.TP
-.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
Configuration file for opcontrol
.TP
.I /opt/oprofile-0.9.7-rc3/share/oprofile/

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -36,7 +41,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in 

oprofile-0.9.7/doc/oprofile.1.in
Configuration files
.TP
-.I /root/.oprofile/daemonrc
-+.I /home/root/.oprofile/daemonrc
++.I ROOTHOME/.oprofile/daemonrc
Configuration file for opcontrol
.TP
.I @prefix@/share/oprofile/

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -48,7 +53,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html 

oprofile-0.9.7/doc/oprofile.html
<p>
Followed by list arguments for profiling set up. List of
arguments
- saved in<code
class="filename">/root/.oprofile/daemonrc</code>.
-+ saved in<code
class="filename">/home/root/.oprofile/daemonrc</code>.
++ saved in<code
class="filename">ROOTHOME/.oprofile/daemonrc</code>.
Giving this option is not necessary; you can just
directly pass one
of the setup options, e.g.<span
class="command"><strong>opcontrol --no-vmlinux</strong></span>. </p>

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -57,7 +62,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html 

oprofile-0.9.7/doc/oprofile.html
<p>
Start data collection with either arguments provided
by<code class="option">--setup</code>
- or information saved in<code
class="filename">/root/.oprofile/daemonrc</code>. Specifying
-+ or information saved in<code
class="filename">/home/root/.oprofile/daemonrc</code>. Specifying
++ or information saved in<code
class="filename">ROOTHOME/.oprofile/daemonrc</code>. Specifying
the addition<code class="option">--verbose</code> makes
the daemon generate lots of debug data
whilst it is running.
</p>

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -69,7 +74,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml 

oprofile-0.9.7/doc/oprofile.xml
<listitem><para>
Followed by list arguments for profiling set up. List of
arguments
- saved in<filename>/root/.oprofile/daemonrc</filename>.
-+ saved
in<filename>/home/root/.oprofile/daemonrc</filename>.
++ saved in<filename>ROOTHOME/.oprofile/daemonrc</filename>.
Giving this option is not necessary; you can just
directly pass one
of the setup options, e.g.<command>opcontrol
--no-vmlinux</command>.
</para></listitem>

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -78,7 +83,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml 

oprofile-0.9.7/doc/oprofile.xml
<listitem><para>
Start data collection with either arguments provided
by<option>--setup</option>
- or information saved
in<filename>/root/.oprofile/daemonrc</filename>. Specifying
-+ or information saved
in<filename>/home/root/.oprofile/daemonrc</filename>. Specifying
++ or information saved
in<filename>ROOTHOME/.oprofile/daemonrc</filename>. Specifying
the addition<option>--verbose</option> makes the daemon
generate lots of debug data
whilst it is running.
</para></listitem>

meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -90,7 +95,7 @@ diff -ur 

oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_s
string const get_config_dir()
{
- return "/root";
-+ return "/home/root";

++    return "ROOTHOME";
   }

   string daemon_pid;
meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +0 -0
@@ -102,7 +107,7 @@ diff -ur oprofile-0.9.7.orig/utils/opcontrol 

oprofile-0.9.7/utils/opcontrol

       # location for daemon setup information
  -    SETUP_DIR="/root/.oprofile"
-+    SETUP_DIR="/home/root/.oprofile"
++    SETUP_DIR="ROOTHOME/.oprofile"
       SETUP_FILE="$SETUP_DIR/daemonrc"
       SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new"
Quoted 8 lines
Quoted 8 lines
Signature · 7 lines
1.7.5.4


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core