aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-07-12 23:06:53 +0200
committerThomas Deutschmann <whissi@gentoo.org>2019-07-14 11:29:10 +0200
commitd0e76cd8e8dd9d1cc70245f8c8ff4d5959409b96 (patch)
tree2cd9687cf171a8fe243b279cbe424850f21bb601
parentgen_funcs.sh: Strip 'function' keyword to match code style (diff)
downloadgenkernel-d0e76cd8e8dd9d1cc70245f8c8ff4d5959409b96.tar.gz
genkernel-d0e76cd8e8dd9d1cc70245f8c8ff4d5959409b96.tar.bz2
genkernel-d0e76cd8e8dd9d1cc70245f8c8ff4d5959409b96.zip
Replace backticks
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rw-r--r--Makefile4
-rwxr-xr-xdefaults/initrd.defaults6
-rw-r--r--defaults/initrd.scripts42
-rw-r--r--defaults/linuxrc4
-rwxr-xr-xgen_arch.sh2
-rwxr-xr-xgen_bootloader.sh7
-rwxr-xr-xgen_cmdline.sh104
-rwxr-xr-xgen_compile.sh8
-rwxr-xr-xgen_configkernel.sh2
-rwxr-xr-xgen_determineargs.sh44
-rwxr-xr-xgen_funcs.sh12
-rwxr-xr-xgen_moddeps.sh2
-rwxr-xr-xgenkernel3
-rw-r--r--netboot/linuxrc.x4
14 files changed, 130 insertions, 114 deletions
diff --git a/Makefile b/Makefile
index 4751822..753400b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-#PACKAGE_VERSION = `/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/"`
-PACKAGE_VERSION = `git describe --tags |sed 's,^v,,g'`
+#PACKAGE_VERSION = $(/bin/fgrep GK_V= genkernel | sed "s/.*GK_V='\([^']\+\)'/\1/")
+PACKAGE_VERSION = $(git describe --tags |sed 's,^v,,g')
distdir = genkernel-$(PACKAGE_VERSION)
MANPAGE = genkernel.8
# Add off-Git/generated files here that need to be shipped with releases
diff --git a/defaults/initrd.defaults b/defaults/initrd.defaults
index 7c755a8..8623e27 100755
--- a/defaults/initrd.defaults
+++ b/defaults/initrd.defaults
@@ -46,9 +46,9 @@ WHITE=""
# Just go to the top of the screen
# printf ""
-KV=`uname -r`
-KMAJOR=`echo $KV | cut -f1 -d.`
-KMINOR=`echo $KV | cut -f2 -d.`
+KV=$(uname -r)
+KMAJOR=$(echo $KV | cut -f1 -d.)
+KMINOR=$(echo $KV | cut -f2 -d.)
KVER="${KMAJOR}.${KMINOR}"
MISCOPTS='debug detect'
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index b9b958b..9a56e82 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -111,14 +111,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;
@@ -259,7 +259,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}
@@ -635,27 +635,27 @@ setup_overlayfs() {
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
@@ -720,17 +720,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
@@ -863,7 +863,7 @@ prompt_user(){
bad_msg '- type "q" to skip...'
printf "%s" "${2}(${oldvalue}) :: "
read -t 10 ${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."
@@ -894,7 +894,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
@@ -905,7 +905,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
@@ -918,7 +918,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}
@@ -1023,7 +1023,7 @@ chooseKeymap() {
# echo ${keymap} | egrep -e "[0-9]+" >/dev/null 2>&1
# if [ $? -eq 0 ]
# then
-# xkeymap=`tail -n 8 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1`
+# xkeymap=$(tail -n 8 /lib/keymaps/keymapList | grep ${keymap} | sed -r "s/.*\s+${keymap}\s+([a-z-]+).*/\1/g" | egrep -v 1)
# fi
mkdir -p /etc/sysconfig
# echo "XKEYBOARD=${xkeymap}" > /etc/sysconfig/keyboard
@@ -1279,7 +1279,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)
@@ -1552,10 +1552,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 b2c3947..dda2da4 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -713,7 +713,7 @@ do
else
# If $REAL_ROOT is a symlink
# Resolve it like util-linux mount does
- [ -L ${REAL_ROOT} ] && REAL_ROOT=`readlink ${REAL_ROOT}`
+ [ -L ${REAL_ROOT} ] && REAL_ROOT=$(readlink ${REAL_ROOT})
# mount ro so fsck doesn't barf later
if [ "${REAL_ROOTFLAGS}" = '' ]; then
good_msg "Using mount -t ${ROOTFSTYPE} -o ${MOUNT_STATE} ${REAL_ROOT} ${NEW_ROOT}"
@@ -1012,7 +1012,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
diff --git a/gen_arch.sh b/gen_arch.sh
index 4ced125..79eb650 100755
--- a/gen_arch.sh
+++ b/gen_arch.sh
@@ -10,7 +10,7 @@ get_official_arch() {
then
ARCH=${ARCH_OVERRIDE}
else
- ARCH=`uname -m`
+ ARCH=$(uname -m)
case "${ARCH}" in
i?86)
ARCH="x86"
diff --git a/gen_bootloader.sh b/gen_bootloader.sh
index 42641ef..015da45 100755
--- a/gen_bootloader.sh
+++ b/gen_bootloader.sh
@@ -81,7 +81,12 @@ set_bootloader_grub() {
then
# Create grub configuration directory and file if it doesn't exist.
- [ ! -d `dirname ${GRUB_CONF}` ] && mkdir -p `dirname ${GRUB_CONF}`
+ local GRUB_CONF_DIR=$(dirname "${GRUB_CONF}")
+ if [ ! -d "${GRUB_CONF_DIR}" ]
+ then
+ mkdir -p "${GRUB_CONF_DIR}" \
+ || gen_die "Failed to create GRUB config directory '${GRUB_CONF_DIR}'!"
+ fi
touch ${GRUB_CONF}
echo 'default 0' >> ${GRUB_CONF}
diff --git a/gen_cmdline.sh b/gen_cmdline.sh
index ceaf212..dc77522 100755
--- a/gen_cmdline.sh
+++ b/gen_cmdline.sh
@@ -301,7 +301,7 @@ parse_cmdline() {
print_info 2 "CMD_MAKEOPTS: ${CMD_MAKEOPTS}"
;;
--mountboot|--no-mountboot)
- CMD_MOUNTBOOT=`parse_optbool "$*"`
+ CMD_MOUNTBOOT=$(parse_optbool "$*")
print_info 2 "CMD_MOUNTBOOT: ${CMD_MOUNTBOOT}"
;;
--bootdir=*)
@@ -318,21 +318,21 @@ parse_cmdline() {
print_info 2 "CMD_DOKEYMAPAUTO: ${CMD_DOKEYMAPAUTO}"
;;
--keymap|--no-keymap)
- CMD_KEYMAP=`parse_optbool "$*"`
+ CMD_KEYMAP=$(parse_optbool "$*")
print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}"
;;
--lvm|--no-lvm)
- CMD_LVM=`parse_optbool "$*"`
+ CMD_LVM=$(parse_optbool "$*")
print_info 2 "CMD_LVM: ${CMD_LVM}"
;;
--lvm2|--no-lvm2)
- CMD_LVM=`parse_optbool "$*"`
+ CMD_LVM=$(parse_optbool "$*")
print_info 2 "CMD_LVM: ${CMD_LVM}"
echo
print_warning 1 "Please use --lvm, as --lvm2 is deprecated."
;;
--mdadm|--no-mdadm)
- CMD_MDADM=`parse_optbool "$*"`
+ CMD_MDADM=$(parse_optbool "$*")
print_info 2 "CMD_MDADM: $CMD_MDADM"
if isTrue "${CMD_MDADM}" && [ ! -e /sbin/mdadm ]
then
@@ -344,11 +344,11 @@ parse_cmdline() {
print_info 2 "CMD_MDADM_CONFIG: $CMD_MDADM_CONFIG"
;;
--busybox|--no-busybox)
- CMD_BUSYBOX=`parse_optbool "$*"`
+ CMD_BUSYBOX=$(parse_optbool "$*")
print_info 2 "CMD_BUSYBOX: ${CMD_BUSYBOX}"
;;
--microcode|--no-microcode)
- case `parse_optbool "$*"` in
+ case $(parse_optbool "$*") in
no) CMD_MICROCODE='no' ;;
yes) CMD_MICROCODE='all' ;;
esac
@@ -359,19 +359,19 @@ parse_cmdline() {
print_info 2 "CMD_MICROCODE: $CMD_MICROCODE"
;;
--microcode-initramfs|--no-microcode-initramfs)
- CMD_MICROCODE_INITRAMFS=`parse_optbool "$*"`
+ CMD_MICROCODE_INITRAMFS=$(parse_optbool "$*")
print_info 2 "CMD_MICROCODE_INITRAMFS: ${CMD_MICROCODE_INITRAMFS}"
;;
--nfs|--no-nfs)
- CMD_NFS=`parse_optbool "$*"`
+ CMD_NFS=$(parse_optbool "$*")
print_info 2 "CMD_NFS: ${CMD_NFS}"
;;
--unionfs|--no-unionfs)
- CMD_UNIONFS=`parse_optbool "$*"`
+ CMD_UNIONFS=$(parse_optbool "$*")
print_info 2 "CMD_UNIONFS: ${CMD_UNIONFS}"
;;
--netboot|--no-netboot)
- CMD_NETBOOT=`parse_optbool "$*"`
+ CMD_NETBOOT=$(parse_optbool "$*")
print_info 2 "CMD_NETBOOT: ${CMD_NETBOOT}"
;;
--real-root=*)
@@ -379,7 +379,7 @@ parse_cmdline() {
print_info 2 "CMD_REAL_ROOT: ${CMD_REAL_ROOT}"
;;
--dmraid|--no-dmraid)
- CMD_DMRAID=`parse_optbool "$*"`
+ CMD_DMRAID=$(parse_optbool "$*")
if isTrue "${CMD_DMRAID}" && [ ! -e /usr/sbin/dmraid ]
then
echo 'Error: --dmraid requires sys-fs/dmraid' \
@@ -395,23 +395,23 @@ parse_cmdline() {
print_info 2 "CMD_DMRAID: ${CMD_DMRAID}"
;;
--e2fsprogs|--no-e2fsprogs)
- CMD_E2FSPROGS=`parse_optbool "$*"`
+ CMD_E2FSPROGS=$(parse_optbool "$*")
print_info 2 "CMD_E2FSPROGS: ${CMD_E2FSPROGS}"
;;
--zfs|--no-zfs)
- CMD_ZFS=`parse_optbool "$*"`
+ CMD_ZFS=$(parse_optbool "$*")
print_info 2 "CMD_ZFS: ${CMD_ZFS}"
;;
--btrfs|--no-btrfs)
- CMD_BTRFS=`parse_optbool "$*"`
+ CMD_BTRFS=$(parse_optbool "$*")
print_info 2 "CMD_BTRFS: ${CMD_BTRFS}"
;;
--virtio|--no-virtio)
- CMD_VIRTIO=`parse_optbool "$*"`
+ CMD_VIRTIO=$(parse_optbool "$*")
print_info 2 "CMD_VIRTIO: ${CMD_VIRTIO}"
;;
--multipath|--no-multipath)
- CMD_MULTIPATH=`parse_optbool "$*"`
+ CMD_MULTIPATH=$(parse_optbool "$*")
if isTrue "${CMD_MULTIPATH}" && [ ! -e /sbin/multipath ]
then
echo 'Error: --multipath requires sys-fs/multipath-tools' \
@@ -443,15 +443,15 @@ parse_cmdline() {
print_info 2 "CMD_BOOTLOADER: ${CMD_BOOTLOADER}"
;;
--iscsi|--no-iscsi)
- CMD_ISCSI=`parse_optbool "$*"`
+ CMD_ISCSI=$(parse_optbool "$*")
print_info 2 "CMD_ISCSI: ${CMD_ISCSI}"
;;
--hyperv|--no-hyperv)
- CMD_HYPERV=`parse_optbool "$*"`
+ CMD_HYPERV=$(parse_optbool "$*")
print_info 2 "CMD_HYPERV: ${CMD_HYPERV}"
;;
--ssh|--no-ssh)
- CMD_SSH=`parse_optbool "$*"`
+ CMD_SSH=$(parse_optbool "$*")
print_info 2 "CMD_SSH: ${CMD_SSH}"
if isTrue "${CMD_SSH}" && [ ! -e /usr/sbin/dropbear ]
then
@@ -472,8 +472,8 @@ parse_cmdline() {
print_info 2 "CMD_LOGLEVEL: ${CMD_LOGLEVEL}"
;;
--menuconfig)
- TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
- TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
+ TERM_LINES=$(stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1)
+ TERM_COLUMNS=$(stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1)
if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
then
echo 'Error: You need a terminal with at least 80 columns' \
@@ -488,8 +488,8 @@ parse_cmdline() {
print_info 2 "CMD_MENUCONFIG: ${CMD_MENUCONFIG}"
;;
--nconfig)
- TERM_LINES=`stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1`
- TERM_COLUMNS=`stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1`
+ TERM_LINES=$(stty -a | head -n 1 | cut -d\ -f5 | cut -d\; -f1)
+ TERM_COLUMNS=$(stty -a | head -n 1 | cut -d\ -f7 | cut -d\; -f1)
if [[ TERM_LINES -lt 19 || TERM_COLUMNS -lt 80 ]]
then
echo 'Error: You need a terminal with at least 80 columns' \
@@ -504,27 +504,27 @@ parse_cmdline() {
print_info 2 "CMD_NCONFIG: ${CMD_NCONFIG}"
;;
--gconfig|--no-gconfig)
- CMD_GCONFIG=`parse_optbool "$*"`
+ CMD_GCONFIG=$(parse_optbool "$*")
print_info 2 "CMD_GCONFIG: ${CMD_GCONFIG}"
;;
--xconfig|--no-xconfig)
- CMD_XCONFIG=`parse_optbool "$*"`
+ CMD_XCONFIG=$(parse_optbool "$*")
print_info 2 "CMD_XCONFIG: ${CMD_XCONFIG}"
;;
--save-config|--no-save-config)
- CMD_SAVE_CONFIG=`parse_optbool "$*"`
+ CMD_SAVE_CONFIG=$(parse_optbool "$*")
print_info 2 "CMD_SAVE_CONFIG: ${CMD_SAVE_CONFIG}"
;;
--mrproper|--no-mrproper)
- CMD_MRPROPER=`parse_optbool "$*"`
+ CMD_MRPROPER=$(parse_optbool "$*")
print_info 2 "CMD_MRPROPER: ${CMD_MRPROPER}"
;;
--clean|--no-clean)
- CMD_CLEAN=`parse_optbool "$*"`
+ CMD_CLEAN=$(parse_optbool "$*")
print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
;;
--oldconfig|--no-oldconfig)
- CMD_OLDCONFIG=`parse_optbool "$*"`
+ CMD_OLDCONFIG=$(parse_optbool "$*")
isTrue "${CMD_OLDCONFIG}" && CMD_CLEAN="no"
print_info 2 "CMD_CLEAN: ${CMD_CLEAN}"
print_info 2 "CMD_OLDCONFIG: ${CMD_OLDCONFIG}"
@@ -538,7 +538,7 @@ parse_cmdline() {
print_warning 1 "Please use --splash, as --gensplash is deprecated."
;;
--gensplash|--no-gensplash)
- CMD_SPLASH=`parse_optbool "$*"`
+ CMD_SPLASH=$(parse_optbool "$*")
SPLASH_THEME='default'
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
echo
@@ -551,7 +551,7 @@ parse_cmdline() {
print_info 2 "SPLASH_THEME: ${SPLASH_THEME}"
;;
--splash|--no-splash)
- CMD_SPLASH=`parse_optbool "$*"`
+ CMD_SPLASH=$(parse_optbool "$*")
SPLASH_THEME='default'
print_info 2 "CMD_SPLASH: ${CMD_SPLASH}"
;;
@@ -566,15 +566,15 @@ parse_cmdline() {
print_info 2 "SPLASH_RES: ${SPLASH_RES}"
;;
--install|--no-install)
- CMD_INSTALL=`parse_optbool "$*"`
+ CMD_INSTALL=$(parse_optbool "$*")
print_info 2 "CMD_INSTALL: ${CMD_INSTALL}"
;;
--ramdisk-modules|--no-ramdisk-modules)
- CMD_RAMDISKMODULES=`parse_optbool "$*"`
+ CMD_RAMDISKMODULES=$(parse_optbool "$*")
print_info 2 "CMD_RAMDISKMODULES: ${CMD_RAMDISKMODULES}"
;;
--all-ramdisk-modules|--no-all-ramdisk-modules)
- CMD_ALLRAMDISKMODULES=`parse_optbool "$*"`
+ CMD_ALLRAMDISKMODULES=$(parse_optbool "$*")
print_info 2 "CMD_ALLRAMDISKMODULES: ${CMD_ALLRAMDISKMODULES}"
;;
--callback=*)
@@ -582,7 +582,7 @@ parse_cmdline() {
print_info 2 "CMD_CALLBACK: ${CMD_CALLBACK}/$*"
;;
--static|--no-static)
- CMD_STATIC=`parse_optbool "$*"`
+ CMD_STATIC=$(parse_optbool "$*")
print_info 2 "CMD_STATIC: ${CMD_STATIC}"
;;
--tempdir=*)
@@ -597,7 +597,7 @@ parse_cmdline() {
print_info 2 "TEMP: ${TEMP}"
;;
--postclear|--no-postclear)
- CMD_POSTCLEAR=`parse_optbool "$*"`
+ CMD_POSTCLEAR=$(parse_optbool "$*")
print_info 2 "CMD_POSTCLEAR: ${CMD_POSTCLEAR}"
;;
--arch-override=*)
@@ -605,12 +605,12 @@ parse_cmdline() {
print_info 2 "CMD_ARCHOVERRIDE: ${CMD_ARCHOVERRIDE}"
;;
--color|--no-color)
- USECOLOR=`parse_optbool "$*"`
+ USECOLOR=$(parse_optbool "$*")
print_info 2 "USECOLOR: ${USECOLOR}"
setColorVars
;;
--debug-cleanup|--no-debug-cleanup)
- CMD_DEBUGCLEANUP=`parse_optbool "$*"`
+ CMD_DEBUGCLEANUP=$(parse_optbool "$*")
print_info 2 "CMD_DEBUGCLEANUP: ${CMD_DEBUGCLEANUP}"
;;
--logfile=*)
@@ -636,7 +636,7 @@ parse_cmdline() {
print_info 2 "CACHE_DIR: ${CACHE_DIR}"
;;
--clear-cachedir|--no-clear-cachedir)
- CMD_CLEAR_CACHEDIR=`parse_optbool "$*"`
+ CMD_CLEAR_CACHEDIR=$(parse_optbool "$*")
print_info 2 "CMD_CLEAR_CACHEDIR: ${CMD_CLEAR_CACHEDIR}"
;;
--minkernpackage=*)
@@ -659,11 +659,11 @@ parse_cmdline() {
print_info 2 "KERNNAME: ${CMD_KERNNAME}"
;;
--symlink|--no-symlink)
- CMD_SYMLINK=`parse_optbool "$*"`
+ CMD_SYMLINK=$(parse_optbool "$*")
print_info 2 "CMD_SYMLINK: ${CMD_SYMLINK}"
;;
--kernel-sources|--no-kernel-sources)
- CMD_KERNEL_SOURCES=`parse_optbool "$*"`
+ CMD_KERNEL_SOURCES=$(parse_optbool "$*")
print_info 2 "CMD_KERNEL_SOURCES: ${CMD_KERNEL_SOURCES}"
;;
--initramfs-overlay=*)
@@ -687,19 +687,19 @@ parse_cmdline() {
# print_info 2 "ENABLE_PEGASOS_HACKS: ${ENABLE_PEGASOS_HACKS}"
;;
--disklabel|--no-disklabel)
- CMD_DISKLABEL=`parse_optbool "$*"`
+ CMD_DISKLABEL=$(parse_optbool "$*")
print_info 2 "CMD_DISKLABEL: ${CMD_DISKLABEL}"
;;
--luks|--no-luks)
- CMD_LUKS=`parse_optbool "$*"`
+ CMD_LUKS=$(parse_optbool "$*")
print_info 2 "CMD_LUKS: ${CMD_LUKS}"
;;
--gpg|--no-gpg)
- CMD_GPG=`parse_optbool "$*"`
+ CMD_GPG=$(parse_optbool "$*")
print_info 2 "CMD_GPG: ${CMD_GPG}"
;;
--firmware|--no-firmware)
- CMD_FIRMWARE=`parse_optbool "$*"`
+ CMD_FIRMWARE=$(parse_optbool "$*")
print_info 2 "CMD_FIRMWARE: ${CMD_FIRMWARE}"
;;
--firmware-dir=*)
@@ -713,23 +713,23 @@ parse_cmdline() {
print_info 2 "CMD_FIRMWARE_FILES: ${CMD_FIRMWARE_FILES}"
;;
--firmware-install|--no-firmware-install)
- CMD_FIRMWARE_INSTALL=`parse_optbool "$*"`
+ CMD_FIRMWARE_INSTALL=$(parse_optbool "$*")
print_info 2 "CMD_FIRMWARE_INSTALL: ${CMD_FIRMWARE_INSTALL}"
;;
--integrated-initramfs|--no-integrated-initramfs)
- CMD_INTEGRATED_INITRAMFS=`parse_optbool "$*"`
+ CMD_INTEGRATED_INITRAMFS=$(parse_optbool "$*")
print_info 2 "CMD_INTEGRATED_INITRAMFS=${CMD_INTEGRATED_INITRAMFS}"
;;
--wrap-initrd|--no-wrap-initrd)
- CMD_WRAP_INITRD=`parse_optbool "$*"`
+ CMD_WRAP_INITRD=$(parse_optbool "$*")
print_info 2 "CMD_WRAP_INITRD=${CMD_WRAP_INITRD}"
;;
--compress-initramfs|--no-compress-initramfs)
- CMD_COMPRESS_INITRD=`parse_optbool "$*"`
+ CMD_COMPRESS_INITRD=$(parse_optbool "$*")
print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}"
;;
--compress-initrd|--no-compress-initrd)
- CMD_COMPRESS_INITRD=`parse_optbool "$*"`
+ CMD_COMPRESS_INITRD=$(parse_optbool "$*")
print_info 2 "CMD_COMPRESS_INITRD=${CMD_COMPRESS_INITRD}"
echo
print_warning 1 "Please use --[no-]compress-initramfs, as --[no-]compress-initrd is deprecated."
@@ -759,7 +759,7 @@ parse_cmdline() {
print_info 2 "CMD_NICE: ${CMD_NICE}"
;;
--strip=*)
- CMD_STRIP_TYPE=`parse_opt "$*"`
+ CMD_STRIP_TYPE=$(parse_opt "$*")
print_info 2 "CMD_STRIP_TYPE: ${CMD_STRIP_TYPE}"
;;
--no-strip)
diff --git a/gen_compile.sh b/gen_compile.sh
index 86df33a..ee4687a 100755
--- a/gen_compile.sh
+++ b/gen_compile.sh
@@ -222,7 +222,7 @@ apply_patches() {
do
[ -f "${i}" ] || continue
patch_success=0
- for j in `seq 0 5`
+ for j in $(seq 0 5)
do
patch -p${j} --backup-if-mismatch -f < "${i}" --dry-run >/dev/null && \
patch ${silent}-p${j} --backup-if-mismatch -f < "${i}"
@@ -234,7 +234,7 @@ apply_patches() {
done
if [ ${patch_success} -eq 1 ]
then
- print_info 2 "$(getIndent 3) - `basename ${i}`"
+ print_info 2 "$(getIndent 3) - $(basename "${i}")"
else
gen_die "Failed to apply patch '${i}' for '${util}-${version}'!"
fi
@@ -284,7 +284,7 @@ compile_generic() {
case "${argstype}" in
kernel|kernelruntask)
- ARGS="`compile_kernel_args`"
+ ARGS="$(compile_kernel_args)"
if [[ "${ARGS}" = *O=* ]]
then
if [ -f "${KERNEL_DIR}/.config" -o -d "${KERNEL_DIR}/include/config" ]
@@ -301,7 +301,7 @@ compile_generic() {
fi
fi
;;
- utils) ARGS="`compile_utils_args`" ;;
+ utils) ARGS="$(compile_utils_args)" ;;
*) ARGS="" ;;
esac
shift 2
diff --git a/gen_configkernel.sh b/gen_configkernel.sh
index a0a92a5..20f5df5 100755
--- a/gen_configkernel.sh
+++ b/gen_configkernel.sh
@@ -95,7 +95,7 @@ config_kernel() {
if [ -n "${CMD_KERNEL_CONFIG}" -a "${CMD_KERNEL_CONFIG}" = "default" ] || \
! diff -q "${KERNEL_OUTPUTDIR}"/.config "${KERNEL_CONFIG}" > /dev/null
then
- NOW=`date +--%Y-%m-%d--%H-%M-%S`
+ NOW=$(date +--%Y-%m-%d--%H-%M-%S)
cp "${KERNEL_OUTPUTDIR}/.config" "${KERNEL_OUTPUTDIR}/.config${NOW}.bak" \
|| gen_die "Could not backup kernel config (${KERNEL_OUTPUTDIR}/.config)"
print_info 1 "$(getIndent 1)>> Previous config backed up to .config${NOW}.bak"
diff --git a/gen_determineargs.sh b/gen_determineargs.sh
index a97b794..876902f 100755
--- a/gen_determineargs.sh
+++ b/gen_determineargs.sh
@@ -10,11 +10,11 @@ determine_KV() {
/bin/tar -x -C ${TEMP} -f ${KERNCACHE} kerncache.config
if [ -e ${TEMP}/kerncache.config ]
then
- VER=`grep ^VERSION\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
- PAT=`grep ^PATCHLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
- SUB=`grep ^SUBLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };'`
- EXV=`grep ^EXTRAVERSION\ \= ${TEMP}/kerncache.config | sed -e "s/EXTRAVERSION =//" -e "s/ //g"`
- LOV=`grep ^CONFIG_LOCALVERSION\= ${TEMP}/kerncache.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/"`
+ VER=$(grep ^VERSION\ \= ${TEMP}/kerncache.config | awk '{ print $3 };')
+ PAT=$(grep ^PATCHLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };')
+ SUB=$(grep ^SUBLEVEL\ \= ${TEMP}/kerncache.config | awk '{ print $3 };')
+ EXV=$(grep ^EXTRAVERSION\ \= ${TEMP}/kerncache.config | sed -e "s/EXTRAVERSION =//" -e "s/ //g")
+ LOV=$(grep ^CONFIG_LOCALVERSION\= ${TEMP}/kerncache.config | sed -e "s/CONFIG_LOCALVERSION=\"\(.*\)\"/\1/")
KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
gen_die "Could not find kerncache.config in the kernel cache! Exiting."
@@ -28,10 +28,10 @@ determine_KV() {
gen_die "Kernel Makefile (${KERNEL_DIR}/Makefile) missing. Maybe re-install the kernel sources."
fi
- VER=`grep ^VERSION\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
- PAT=`grep ^PATCHLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
- SUB=`grep ^SUBLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };'`
- EXV=`grep ^EXTRAVERSION\ \= ${KERNEL_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g" -e 's/\$([a-z]*)//gi'`
+ VER=$(grep ^VERSION\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };')
+ PAT=$(grep ^PATCHLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };')
+ SUB=$(grep ^SUBLEVEL\ \= ${KERNEL_DIR}/Makefile | awk '{ print $3 };')
+ EXV=$(grep ^EXTRAVERSION\ \= ${KERNEL_DIR}/Makefile | sed -e "s/EXTRAVERSION =//" -e "s/ //g" -e 's/\$([a-z]*)//gi')
# The files we are looking for are always in KERNEL_OUTPUTDIR
# because in most cases, KERNEL_OUTPUTDIR == KERNEL_DIR.
@@ -45,14 +45,14 @@ determine_KV() {
if [ -f ${KERNEL_OUTPUTDIR}/include/config/kernel.release ]
then
print_info 3 "Using '${KERNEL_OUTPUTDIR}/include/config/kernel.release' to extract LOCALVERSION..."
- UTS_RELEASE=`cat ${KERNEL_OUTPUTDIR}/include/config/kernel.release`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
+ UTS_RELEASE=$(cat ${KERNEL_OUTPUTDIR}/include/config/kernel.release)
+ LOV=$(echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//")
KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
elif [ -n "${VERSION_SOURCE}" ]
then
print_info 3 "Using '${VERSION_SOURCE}' to extract LOCALVERSION..."
- UTS_RELEASE=`grep UTS_RELEASE ${VERSION_SOURCE} | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/'`
- LOV=`echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//"`
+ UTS_RELEASE=$(grep UTS_RELEASE ${VERSION_SOURCE} | sed -e 's/#define UTS_RELEASE "\(.*\)"/\1/')
+ LOV=$(echo ${UTS_RELEASE}|sed -e "s/${VER}.${PAT}.${SUB}${EXV}//")
KV=${VER}.${PAT}.${SUB}${EXV}${LOV}
else
# We will be here only when currently selected kernel source
@@ -169,7 +169,7 @@ determine_real_args() {
set_config_with_override BOOL INSTALL CMD_INSTALL "yes"
set_config_with_override BOOL DEBUGCLEANUP CMD_DEBUGCLEANUP "yes"
- BOOTDIR=`arch_replace "${BOOTDIR}"`
+ BOOTDIR=$(arch_replace "${BOOTDIR}")
BOOTDIR=${BOOTDIR%/} # Remove any trailing slash
MODPROBEDIR=${MODPROBEDIR%/} # Remove any trailing slash
@@ -196,8 +196,8 @@ determine_real_args() {
BOOTLOADER="${CMD_BOOTLOADER}"
if [ "${CMD_BOOTLOADER}" != "${CMD_BOOTLOADER/:/}" ]
then
- BOOTFS=`echo "${CMD_BOOTLOADER}" | cut -f2- -d:`
- BOOTLOADER=`echo "${CMD_BOOTLOADER}" | cut -f1 -d:`
+ BOOTFS=$(echo "${CMD_BOOTLOADER}" | cut -f2- -d:)
+ BOOTLOADER=$(echo "${CMD_BOOTLOADER}" | cut -f1 -d:)
fi
fi
@@ -238,17 +238,23 @@ determine_real_args() {
if [ -n "${MINKERNPACKAGE}" ]
then
- mkdir -p `dirname ${MINKERNPACKAGE}`
+ local minkernpackage_dir=$(dirname "${MINKERNPACKAGE}")
+ mkdir -p "${minkernpackage_dir}" \
+ || gen_die "Failed to create '${minkernpackage_dir}'!"
fi
if [ -n "${MODULESPACKAGE}" ]
then
- mkdir -p `dirname ${MODULESPACKAGE}`
+ local modulespackage_dir=$(dirname "${MODULESPACKAGE}")
+ mkdir -p "${modulespackage_dir}" \
+ || gen_die "Failed to create '${modulespackage_dir}'!"
fi
if [ -n "${KERNCACHE}" ]
then
- mkdir -p `dirname ${KERNCACHE}`
+ local kerncache_dir=$(dirname "${KERNCACHE}")
+ mkdir -p "${kerncache_dir}" \
+ || gen_die "Failed to create '${kerncache_dir}'!"
fi
if ! isTrue "${BUILD_RAMDISK}"
diff --git a/gen_funcs.sh b/gen_funcs.sh
index 75bb044..ae1b392 100755
--- a/gen_funcs.sh
+++ b/gen_funcs.sh
@@ -173,9 +173,13 @@ var_replace() {
# Escape '\' and '.' in $2 to make it safe to use
# in the later sed expression
local SAFE_VAR
- SAFE_VAR=`echo "${2}" | sed -e 's/\([\/\.]\)/\\\\\\1/g'`
+ SAFE_VAR=$(echo "${2}" | sed -e 's#\([/.]\)#\\\1#g')
echo "${3}" | sed -e "s/%%${1}%%/${SAFE_VAR}/g" -
+ if [ $? -ne 0 ]
+ then
+ gen_die "var_replace() failed: 1: '${1}' 2: '${2}' 3: '${3}'"
+ fi
}
arch_replace() {
@@ -268,7 +272,7 @@ setup_cache_dir() {
clear_tmpdir() {
if isTrue "${CMD_INSTALL}"
then
- TMPDIR_CONTENTS=`ls ${TMPDIR}`
+ TMPDIR_CONTENTS=$(ls "${TMPDIR}")
print_info 1 "Removing tmp dir contents"
for i in ${TMPDIR_CONTENTS}
do
@@ -314,7 +318,7 @@ copy_image_with_preserve() {
then
# JRG: Do I need a special case here for when the standard symlink
# name is, in fact, not a symlink?
- currDestImage=`readlink --no-newline ${BOOTDIR}/${symlinkName}`
+ currDestImage=$(readlink --no-newline "${BOOTDIR}/${symlinkName}")
print_info 5 " Current ${symlinkName} symlink exists:"
print_info 5 " ${currDestImage}"
else
@@ -333,7 +337,7 @@ copy_image_with_preserve() {
then
# JRG: Do I need a special case here for when the standard symlink
# name is, in fact, not a symlink?
- prevDestImage=`readlink --no-newline ${BOOTDIR}/${symlinkName}.old`
+ prevDestImage=$(readlink --no-newline "${BOOTDIR}/${symlinkName}.old")
print_info 5 " Old ${symlinkName} symlink exists:"
print_info 5 " ${prevDestImage}"
else
diff --git a/gen_moddeps.sh b/gen_moddeps.sh
index 44f10a8..1664c33 100755
--- a/gen_moddeps.sh
+++ b/gen_moddeps.sh
@@ -30,7 +30,7 @@ gen_deps() {
for x in ${*}
do
echo ${x} >> "${TEMP}/moddeps"
- modlist=`modules_dep_list ${x}`
+ modlist=$(modules_dep_list ${x})
if [ "${modlist}" != "" -a "${modlist}" != " " ]
then
deps=$(strip_mod_paths ${modlist})
diff --git a/genkernel b/genkernel
index f1f09bb..3337dbc 100755
--- a/genkernel
+++ b/genkernel
@@ -399,7 +399,8 @@ then
CONFGREP=grep
fi
- if [ `${CONFGREP} 'CONFIG_EXT[0-9]_FS=' "${KERNEL_CONFIG}" | wc -l` -ge 2 ]; then
+ if [ $(${CONFGREP} 'CONFIG_EXT[0-9]_FS=' "${KERNEL_CONFIG}" | wc -l) -ge 2 ]
+ then
print_warning 1 'With support for several ext* filesystems available, it may be needed to'
print_warning 1 'add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.'
fi
diff --git a/netboot/linuxrc.x b/netboot/linuxrc.x
index 4bd711c..88a2aa7 100644
--- a/netboot/linuxrc.x
+++ b/netboot/linuxrc.x
@@ -10,7 +10,7 @@ export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
BasicSetup() {
#// Copyright year, Build date in YYYYMMDD format, and in MMDDYYYY to make busybox 'date' happy
- MYDATE="`/bin/cat /etc/build_date`"
+ MYDATE="$(cat /etc/build_date)"
CPYYEAR="$(echo ${MYDATE} | cut -c 1-4)"
BBDATE="$(echo ${MYDATE} | cut -c 5-8)$(echo ${MYDATE} | cut -c 1-4)"
DISDATE="$(echo ${MYDATE} | cut -c 7-8) $(echo ${MYDATE} | cut -c 5-6) $(echo ${MYDATE} | cut -c 1-4)"
@@ -97,7 +97,7 @@ StartUp() {
#// Hostname
hostname netboot
- if [ -n "`which dropbear 2>/dev/null`" ]
+ if [ -n "$(which dropbear 2>/dev/null)" ]
then
# Setup dropbear (sshd)
echo