summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-11-07 16:47:19 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-31 10:18:38 +0000
commitfdf882c091f5b797e3c21b8b74b1f28a8eea6870 (patch)
treef4df48ed572350b1bf66da8ef36479c691927bff /meta
parent2d40d3228da48566ed781303bf43390581373bf1 (diff)
downloadpoky-fdf882c091f5b797e3c21b8b74b1f28a8eea6870.tar.gz
nfs-utils: change owner/group of directories in do_install
Previously, the owners/groups of directories like /var/lib/nfs/statd are changed in the init script, /etc/init.d/nfscommon. This is actually a workaround. We need to change them at do_install time. This patch fixes the above problem by changing owners/groups at do_install time. Besides, configuration option '--with-staduser=nobody' is changed to be '--with-statduser=rpcuser'. And /var/lib/nfs/statd/state is modified to have permission 0644, just like other distros (ubuntu, fedora, etc.) do. (From OE-Core rev: 8c27a1e25ae42a435ab7d290cab40f94f9286243) (From OE-Core rev: 10b5adcc6d3d3ae1ffe64de72777da091ba98274) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon27
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb7
2 files changed, 5 insertions, 29 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
index 65fdd1dd4f..992267d5a1 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -28,33 +28,7 @@ test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
28#---------------------------------------------------------------------- 28#----------------------------------------------------------------------
29# Startup and shutdown functions. 29# Startup and shutdown functions.
30# Actual startup/shutdown is at the end of this file. 30# Actual startup/shutdown is at the end of this file.
31#directories
32create_directories(){
33 echo -n 'creating NFS state directory: '
34 mkdir -p "$NFS_STATEDIR"
35 ( cd "$NFS_STATEDIR"
36 umask 077
37 mkdir -p rpc_pipefs
38 mkdir -p sm sm.bak statd
39 chown rpcuser:rpcuser sm sm.bak statd
40 test -w statd/state || {
41 rm -f statd/state
42 :>statd/state
43 }
44 umask 022
45 for file in xtab etab smtab rmtab
46 do
47 test -w "$file" || {
48 rm -f "$file"
49 :>"$file"
50 }
51 done
52 )
53 chown rpcuser:rpcuser "$NFS_STATEDIR"
54 echo done
55}
56 31
57#statd
58start_statd(){ 32start_statd(){
59 echo -n "starting statd: " 33 echo -n "starting statd: "
60 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID" 34 start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
@@ -74,7 +48,6 @@ stop_statd(){
74#FIXME: need to create the /var/lib/nfs/... directories 48#FIXME: need to create the /var/lib/nfs/... directories
75case "$1" in 49case "$1" in
76 start) 50 start)
77 create_directories
78 start_statd;; 51 start_statd;;
79 stop) 52 stop)
80 stop_statd;; 53 stop_statd;;
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
index c813d7f61e..6e6d09bf42 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.0.bb
@@ -54,7 +54,7 @@ SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
54SYSTEMD_AUTO_ENABLE = "disable" 54SYSTEMD_AUTO_ENABLE = "disable"
55 55
56# --enable-uuid is need for cross-compiling 56# --enable-uuid is need for cross-compiling
57EXTRA_OECONF = "--with-statduser=nobody \ 57EXTRA_OECONF = "--with-statduser=rpcuser \
58 --enable-mountconfig \ 58 --enable-mountconfig \
59 --enable-libmount-mount \ 59 --enable-libmount-mount \
60 --disable-nfsv41 \ 60 --disable-nfsv41 \
@@ -90,7 +90,6 @@ do_compile_prepend() {
90 90
91do_install_append () { 91do_install_append () {
92 install -d ${D}${sysconfdir}/init.d 92 install -d ${D}${sysconfdir}/init.d
93 install -d ${D}${localstatedir}/lib/nfs/statd
94 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver 93 install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
95 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon 94 install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
96 95
@@ -106,6 +105,10 @@ do_install_append () {
106 # kernel code as of 3.8 hard-codes this path as a default 105 # kernel code as of 3.8 hard-codes this path as a default
107 install -d ${D}/var/lib/nfs/v4recovery 106 install -d ${D}/var/lib/nfs/v4recovery
108 107
108 # chown the directories and files
109 chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
110 chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
111
109 # the following are built by CC_FOR_BUILD 112 # the following are built by CC_FOR_BUILD
110 rm -f ${D}${sbindir}/rpcdebug 113 rm -f ${D}${sbindir}/rpcdebug
111 rm -f ${D}${sbindir}/rpcgen 114 rm -f ${D}${sbindir}/rpcgen