diff options
Diffstat (limited to 'meta')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 14 |
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 |
12 | DIRNAME=`dirname $0` | 12 | DIRNAME=`dirname $0` |
13 | ROOT_DIR=`echo $DIRNAME | sed -ne 's:etc/.*::p'` | 13 | ROOT_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 |
214 | fi | 214 | fi |
215 | 215 | ||
216 | if [ "${ROOT_DIR}" = "/" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] | 216 | if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] |
217 | then | 217 | then |
218 | ln -s /etc/ld.so.cache /var/run/ld.so.cache | 218 | ln -s /etc/ld.so.cache /var/run/ld.so.cache |
219 | fi | 219 | fi |