diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index fd1e5fd..88f39cc 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -196,14 +196,14 @@ findmediamount() { if [ -b "${x}" ] then skip=0 - bsn=`basename "${x}"` + bsn=$(basename "${x}") # # If disk and it has at least one partition, skip. # We use /sys/block/${bsn}/${bsn}[0-9]* to make sure that we # don't skip device mapper devices. Even the craziest scenario # deserves a fair chance. # - for part in `ls /sys/block/${bsn}/${bsn}*[0-9]* 2>/dev/null` + for part in $(ls /sys/block/${bsn}/${bsn}*[0-9]* 2>/dev/null) do skip=1 break; @@ -282,7 +282,7 @@ bootstrapCD() { bootstrapKey() { # $1 = ROOT/SWAP - local KEYDEVS=`devicelist` + local KEYDEVS=$(devicelist) eval local keyloc='"${CRYPT_'${1}'_KEY}"' findmediamount "key" "${keyloc}" "CRYPT_${1}_KEYDEV" "/mnt/key" ${KEYDEVS} @@ -328,27 +328,27 @@ mount_sysfs() { findnfsmount() { if [ "${IP}" != '' ] || busybox udhcpc -n -T 15 -q then - [ -e /rootpath ] && NFSROOT=`cat /rootpath` + [ -e /rootpath ] && NFSROOT=$(cat /rootpath) if [ "${NFSROOT}" = '' ] then # Obtain NFSIP - OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"` + OPTIONS=$(busybox dmesg | grep rootserver | sed -e "s/,/ /g") for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ] + if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootserver' ] then - NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` + NFSIP=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) fi done # Obtain NFSPATH - OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"` + OPTIONS=$(busybox dmesg | grep rootpath | sed -e "s/,/ /g") for OPTION in $OPTIONS do - if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ] + if [ $(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1) = 'rootpath' ] then - NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2` + NFSPATH=$(echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2) fi done @@ -408,17 +408,17 @@ find_real_device() { local retval=1 if [ "${retval}" -ne 0 ]; then - REAL_DEVICE=`findfs "${DEVICE}" 2>/dev/null` + REAL_DEVICE=$(findfs "${DEVICE}" 2>/dev/null) retval=$? fi if [ "$retval" -ne 0 ]; then - REAL_DEVICE=`busybox findfs "${DEVICE}" 2>/dev/null` + REAL_DEVICE=$(busybox findfs "${DEVICE}" 2>/dev/null) retval=$? fi if [ "${retval}" -ne 0 ]; then - REAL_DEVICE=`blkid -o device -l -t "${DEVICE}"` + REAL_DEVICE=$(blkid -o device -l -t "${DEVICE}") retval=$? fi @@ -645,7 +645,7 @@ prompt_user(){ bad_msg '- type "q" to skip...' echo -n "${2}(${oldvalue}) :: " read ${1} - case `eval echo '$'${1}` in + case $(eval echo '$'${1}) in 'q') eval ${1}'='${oldvalue} warn_msg "Skipping step, this will likely cause a boot failure." @@ -677,7 +677,7 @@ cmdline_hwopts() { MY_HWOPTS="${MY_HWOPTS} $x" elif [ "${y}" = "no${x}" ] then - MY_HWOPTS="`echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -`" + MY_HWOPTS="$(echo ${MY_HWOPTS} | sed -e \"s/${x}//g\" -)" fi if [ "$(echo ${y} | cut -b -7)" = "keymap=" ] then @@ -688,7 +688,7 @@ cmdline_hwopts() { # Shouldnt need to sort this as the following loop should figure out the # duplicates and strip them out - #MY_HWOPTS=`echo ${MY_HWOPTS}| sort` + #MY_HWOPTS=$(echo ${MY_HWOPTS}| sort) for x in ${MY_HWOPTS} do @@ -701,7 +701,7 @@ cmdline_hwopts() { fi done TMP_HWOPTS="${TMP_HWOPTS} ${x}" - eval DO_`echo ${x} | sed 's/-//'`=1 + eval DO_$(echo ${x} | sed 's/-//')=1 done MY_HWOPTS=${TMP_HWOPTS} @@ -1005,7 +1005,7 @@ startiscsi() { # $1 - root/swap openLUKS() { # please use 'tr' and this line, or remove it - # eval local TYPE=`uppercase $1` + # eval local TYPE=$(uppercase $1) case $1 in root) @@ -1238,10 +1238,10 @@ setup_md_device() { [ -z "$1" ] && device="${REAL_ROOT}" || device="$1" [ -z "${device}" ] && return # LiveCD - if [ `echo ${device}|sed -e 's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#'` = "/dev/md" ] + if [ $(echo ${device}|sed -e 's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#') = "/dev/md" ] then good_msg 'Detected real_root as a md device. Setting up the device node...' - MD_NUMBER=`echo ${device}|sed -e 's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#'` + MD_NUMBER=$(echo ${device}|sed -e 's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#') if [ ! -e /dev/md${MD_NUMBER} ] then mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 2>&1 diff --git a/defaults/linuxrc b/defaults/linuxrc index 0051faa..82aa77a 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -859,7 +859,7 @@ for fs in $fslist; do dev=$(get_mount_device $fs) [ -z "${dev}" ] && continue # Resolve it like util-linux mount does - [ -L ${dev} ] && dev=`readlink ${dev}` + [ -L ${dev} ] && dev=$(readlink ${dev}) # In this case, it's probably part of the filesystem # and not a mountpoint [ -z "$dev" ] && continue