summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/initscripts
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-05-23 09:37:07 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-24 14:14:47 +0100
commit657e46480b6f21b3e81e3f33764392539d7308ef (patch)
tree6a194118c2dba5976602ae137a3b948e85d81f00 /meta/recipes-core/initscripts
parent45bf11434061e5f78a28ce96ed4cc3cb74883953 (diff)
downloadpoky-657e46480b6f21b3e81e3f33764392539d7308ef.tar.gz
populate-volatile.sh: remove repeated leading slashes in TNAME
This avoids triple slashes in the generated /etc/volatile.cache to reduce disk usage and in the output when verbose mode is enabled. As all the paths for volatiles start with a slash, we can change TNAME=${ROOT_DIR}/${TNAME} to TNAME=${ROOT_DIR}${TNAME}. To avoid a double slash when ROOT_DIR is /, we strip the extra slash from ROOT_DIR. (From OE-Core rev: af56670f656ec0989aa7fd6cf6037cbc9cd88185) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initscripts')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh14
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index ab092317b0..91c70efbbd 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -10,11 +10,11 @@
10 10
11# Get ROOT_DIR 11# Get ROOT_DIR
12DIRNAME=`dirname $0` 12DIRNAME=`dirname $0`
13ROOT_DIR=`echo $DIRNAME | sed -ne 's:etc/.*::p'` 13ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
14 14
15[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS 15[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
16# When running populate-volatile.sh at rootfs time, disable cache. 16# When running populate-volatile.sh at rootfs time, disable cache.
17[ "$ROOT_DIR" != "/" ] && VOLATILE_ENABLE_CACHE=no 17[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
18# If rootfs is read-only, disable cache. 18# If rootfs is read-only, disable cache.
19[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no 19[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
20 20
@@ -35,7 +35,7 @@ create_file() {
35 [ -e "$1" ] && { 35 [ -e "$1" ] && {
36 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." 36 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
37 } || { 37 } || {
38 if [ "$ROOT_DIR" = "/" ]; then 38 if [ -z "$ROOT_DIR" ]; then
39 eval $EXEC & 39 eval $EXEC &
40 else 40 else
41 # Creating some files at rootfs time may fail and should fail, 41 # Creating some files at rootfs time may fail and should fail,
@@ -57,7 +57,7 @@ mk_dir() {
57 [ -e "$1" ] && { 57 [ -e "$1" ] && {
58 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." 58 [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
59 } || { 59 } || {
60 if [ "$ROOT_DIR" = "/" ]; then 60 if [ -z "$ROOT_DIR" ]; then
61 eval $EXEC 61 eval $EXEC
62 else 62 else
63 # For the same reason with create_file(), failures should 63 # For the same reason with create_file(), failures should
@@ -82,7 +82,7 @@ link_file() {
82 82
83 test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build 83 test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build
84 84
85 if [ "$ROOT_DIR" = "/" ]; then 85 if [ -z "$ROOT_DIR" ]; then
86 eval $EXEC & 86 eval $EXEC &
87 else 87 else
88 # For the same reason with create_file(), failures should 88 # For the same reason with create_file(), failures should
@@ -150,7 +150,7 @@ apply_cfgfile() {
150 cat ${CFGFILE} | grep -v "^#" | \ 150 cat ${CFGFILE} | grep -v "^#" | \
151 while read LINE; do 151 while read LINE; do
152 eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"` 152 eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
153 TNAME=${ROOT_DIR}/${TNAME} 153 TNAME=${ROOT_DIR}${TNAME}
154 [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." 154 [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
155 155
156 [ "${TTYPE}" = "l" ] && { 156 [ "${TTYPE}" = "l" ] && {
@@ -213,7 +213,7 @@ else
213 [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache 213 [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
214fi 214fi
215 215
216if [ "${ROOT_DIR}" = "/" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] 216if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
217then 217then
218 ln -s /etc/ld.so.cache /var/run/ld.so.cache 218 ln -s /etc/ld.so.cache /var/run/ld.so.cache
219fi 219fi