diff options
Diffstat (limited to 'external/poky/meta/recipes-core/initscripts/initscripts-1.0')
-rw-r--r-- | external/poky/meta/recipes-core/initscripts/initscripts-1.0/alignment.sh (renamed from external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh) | 0 | ||||
-rwxr-xr-x | external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 7 | ||||
-rwxr-xr-x | external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 82 | ||||
-rw-r--r-- | external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh | 6 | ||||
-rw-r--r-- | external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh | 4 | ||||
-rw-r--r-- | external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles | 2 |
6 files changed, 56 insertions, 45 deletions
diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/alignment.sh index b577b9a0..b577b9a0 100644 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/alignment.sh diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh index df553bc0..591591f8 100755 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh @@ -8,7 +8,10 @@ # Short-Description: Misc and other. ### END INIT INFO +TIMESTAMP_FILE=/etc/timestamp + . /etc/default/rcS +[ -f /etc/default/timestamp ] && . /etc/default/timestamp # # Put a nologin file in /etc to prevent people from logging in before # system startup is complete. @@ -64,10 +67,10 @@ fi # If the timestamp is more recent than the current time, # use the timestamp instead. test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start -if test -e /etc/timestamp +if test -e "$TIMESTAMP_FILE" then SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S` - read TIMESTAMP < /etc/timestamp + read TIMESTAMP < "$TIMESTAMP_FILE" if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then # format the timestamp as date expects it (2m2d2H2M4Y.2S) TS_YR=${TIMESTAMP%??????????} diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh index 6f965a68..f21f48dd 100755 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh @@ -9,10 +9,10 @@ ### END INIT INFO # Get ROOT_DIR -DIRNAME=`dirname $0` -ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'` +DIRNAME="$(dirname "$0")" +ROOT_DIR="$(echo "$DIRNAME" | sed -ne 's:/etc/.*::p')" -[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS +[ -e "${ROOT_DIR}/etc/default/rcS" ] && . "${ROOT_DIR}/etc/default/rcS" # When running populate-volatile.sh at rootfs time, disable cache. [ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no # If rootfs is read-only, disable cache. @@ -26,15 +26,15 @@ COREDEF="00_core" create_file() { EXEC="" - [ -z "$2" ] && { + if [ -z "$2" ]; then EXEC=" touch \"$1\"; " - } || { + else EXEC=" cp \"$2\" \"$1\"; " - } + fi EXEC=" ${EXEC} chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1; @@ -42,19 +42,19 @@ create_file() { test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build - [ -e "$1" ] && { + if [ -e "$1" ]; then [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." - } || { + else if [ -z "$ROOT_DIR" ]; then - eval $EXEC + eval "$EXEC" else # Creating some files at rootfs time may fail and should fail, # but these failures should not be logged to make sure the do_rootfs # process doesn't fail. This does no harm, as this script will # run on target to set up the correct files and directories. - eval $EXEC > /dev/null 2>&1 + eval "$EXEC" > /dev/null 2>&1 fi - } + fi } mk_dir() { @@ -64,23 +64,23 @@ mk_dir() { chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build - [ -e "$1" ] && { + if [ -e "$1" ]; then [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." - } || { + else if [ -z "$ROOT_DIR" ]; then - eval $EXEC + eval "$EXEC" else # For the same reason with create_file(), failures should # not be logged. - eval $EXEC > /dev/null 2>&1 + eval "$EXEC" > /dev/null 2>&1 fi - } + fi } link_file() { EXEC=" if [ -L \"$2\" ]; then - [ \"\$(readlink -f \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; + [ \"\$(readlink \"$2\")\" != \"$1\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; elif [ -d \"$2\" ]; then if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then cp -a $2/* $1 2>/dev/null; @@ -96,11 +96,11 @@ link_file() { test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build if [ -z "$ROOT_DIR" ]; then - eval $EXEC + eval "$EXEC" else # For the same reason with create_file(), failures should # not be logged. - eval $EXEC > /dev/null 2>&1 + eval "$EXEC" > /dev/null 2>&1 fi } @@ -117,11 +117,11 @@ check_requirements() { TMP_DEFINED="${TMPROOT}/tmpdefined.$$" TMP_COMBINED="${TMPROOT}/tmpcombined.$$" - sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > "${TMP_DEFINED}" - cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}" + sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/passwd" | sort | uniq > "${TMP_DEFINED}" + grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 2 > "${TMP_INTERMED}" cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" - NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`" - NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`" + NR_DEFINED_USERS="$(wc -l < "${TMP_DEFINED}")" + NR_COMBINED_USERS="$(wc -l < "${TMP_COMBINED}")" [ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && { echo "Undefined users:" @@ -131,12 +131,12 @@ check_requirements() { } - sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > "${TMP_DEFINED}" - cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}" + sed 's@\(^:\)*:.*@\1@' "${ROOT_DIR}/etc/group" | sort | uniq > "${TMP_DEFINED}" + grep -v "^#" "${CFGFILE}" | cut -s -d " " -f 3 > "${TMP_INTERMED}" cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}" - NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`" - NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`" + NR_DEFINED_GROUPS="$(wc -l < "${TMP_DEFINED}")" + NR_COMBINED_GROUPS="$(wc -l < "${TMP_COMBINED}")" [ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && { echo "Undefined groups:" @@ -157,13 +157,13 @@ apply_cfgfile() { [ "${VERBOSE}" != "no" ] && echo "Applying ${CFGFILE}" - [ "${SKIP_REQUIREMENTS}" == "yes" ] || check_requirements "${CFGFILE}" || { + [ "${SKIP_REQUIREMENTS}" = "yes" ] || check_requirements "${CFGFILE}" || { echo "Skipping ${CFGFILE}" return 1 } - cat ${CFGFILE} | sed 's/#.*//' | \ - while read TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do + sed 's/#.*//' "${CFGFILE}" | \ + while read -r TTYPE TUSER TGROUP TMODE TNAME TLTARGET; do test -z "${TLTARGET}" && continue TNAME=${ROOT_DIR}${TNAME} [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." @@ -187,14 +187,14 @@ apply_cfgfile() { [ -L "${TNAME}" ] && { [ "${VERBOSE}" != "no" ] && echo "Found link." - NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'` - echo ${NEWNAME} | grep -v "^/" >/dev/null && { - TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}" + NEWNAME=$(ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/') + if echo "${NEWNAME}" | grep -v "^/" >/dev/null; then + TNAME="$(echo "${TNAME}" | sed -e 's@\(.*\)/.*@\1@')/${NEWNAME}" [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." - } || { + else TNAME="${NEWNAME}" [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." - } + fi } case "${TTYPE}" in @@ -217,7 +217,7 @@ apply_cfgfile() { clearcache=0 exec 9</proc/cmdline -while read line <&9 +while read -r line <&9 do case "$line" in *clearcache*) clearcache=1 @@ -228,11 +228,11 @@ do done exec 9>&- -if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0" +if test -e "${ROOT_DIR}/etc/volatile.cache" -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0" then - sh ${ROOT_DIR}/etc/volatile.cache + sh "${ROOT_DIR}/etc/volatile.cache" else - rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build + rm -f "${ROOT_DIR}/etc/volatile.cache" "${ROOT_DIR}/etc/volatile.cache.build" # Apply the core file with out checking requirements. ${TMPROOT} is # needed by check_requirements but is setup by this file, so it must be @@ -246,7 +246,7 @@ else TMP_FILE="${TMPROOT}/tmp_volatile.$$" rm -f "$TMP_FILE" - CFGFILES="`ls -1 "${CFGDIR}" | grep -v "^${COREDEF}\$" | sort`" + CFGFILES="$(ls -1 "${CFGDIR}" | grep -v "^${COREDEF}\$" | sort)" for file in ${CFGFILES}; do cat "${CFGDIR}/${file}" >> "$TMP_FILE" done @@ -264,7 +264,7 @@ else fi rm "$TMP_FILE" - [ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache + [ -e "${ROOT_DIR}/etc/volatile.cache.build" ] && sync && mv "${ROOT_DIR}/etc/volatile.cache.build" "${ROOT_DIR}/etc/volatile.cache" fi if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ] diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh index 1632a5f6..ffa1eee4 100644 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh @@ -9,5 +9,9 @@ # Description: ### END INIT INFO +TIMESTAMP_FILE=/etc/timestamp + +[ -f /etc/default/timestamp ] && . /etc/default/timestamp + # Update the timestamp -date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > /etc/timestamp +date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > "$TIMESTAMP_FILE" diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh index f5b5b990..4871ee94 100644 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh @@ -26,6 +26,10 @@ if [ -e /sys/kernel/config ] && grep -q configfs /proc/filesystems; then mount -t configfs configfs /sys/kernel/config fi +if [ -e /sys/firmware/efi/efivars ] && grep -q efivarfs /proc/filesystems; then + mount -t efivarfs efivarfs /sys/firmware/efi/efivars +fi + if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then mount -n -t devtmpfs devtmpfs /dev fi diff --git a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles index 20110664..cd8a4be0 100644 --- a/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles +++ b/external/poky/meta/recipes-core/initscripts/initscripts-1.0/volatiles @@ -8,7 +8,7 @@ # The # character introduces a comment lasting until end of line. # Blank lines are ignored. # -# <type> : d|f|l : (d)irectory|(f)ile|(l)ink +# <type> : d|f|l|b : (d)irectory|(f)ile|(l)ink|(b)ind # # A linking example: # l root root 0777 /var/test /tmp/testfile |