diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2020-01-11 00:33:08 +0100 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2020-01-11 00:33:41 +0100 |
commit | 66ec240910ffa979fd18fb8528df6660af2d5ee9 (patch) | |
tree | 5aa88e8a1a04602f653e7954097e75d25912b6f4 | |
parent | gen_compile.sh: compile_modules(): Add parameter "copy_kernel" (diff) | |
download | genkernel-66ec240910ffa979fd18fb8528df6660af2d5ee9.tar.gz genkernel-66ec240910ffa979fd18fb8528df6660af2d5ee9.tar.bz2 genkernel-66ec240910ffa979fd18fb8528df6660af2d5ee9.zip |
Style fix: Use curly braces
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-x | gen_bootloader.sh | 4 | ||||
-rwxr-xr-x | gen_cmdline.sh | 4 | ||||
-rwxr-xr-x | gen_compile.sh | 4 | ||||
-rwxr-xr-x | gen_configkernel.sh | 8 | ||||
-rwxr-xr-x | gen_determineargs.sh | 30 | ||||
-rwxr-xr-x | gen_funcs.sh | 32 | ||||
-rwxr-xr-x | genkernel | 2 |
7 files changed, 42 insertions, 42 deletions
diff --git a/gen_bootloader.sh b/gen_bootloader.sh index 68eb7216..06fb7ba1 100755 --- a/gen_bootloader.sh +++ b/gen_bootloader.sh @@ -70,7 +70,7 @@ set_bootloader_grub() { local GRUB_BOOTFS if [ -n "${BOOTFS}" ] then - GRUB_BOOTFS=$BOOTFS + GRUB_BOOTFS=${BOOTFS} else GRUB_BOOTFS=$(set_bootloader_read_fstab | cut -d' ' -f2) fi @@ -101,7 +101,7 @@ set_bootloader_grub() { # Add grub configuration to grub.conf echo "# Genkernel generated entry, see GRUB documentation for details" >> ${GRUB_CONF} - echo "title=Gentoo Linux ($KV)" >> ${GRUB_CONF} + echo "title=Gentoo Linux (${KV})" >> ${GRUB_CONF} printf "%b\n" "\tkernel /${GK_FILENAME_KERNEL} root=${GRUB_ROOTFS}" >> ${GRUB_CONF} if isTrue "${BUILD_RAMDISK}" then diff --git a/gen_cmdline.sh b/gen_cmdline.sh index c33f738d..025187f3 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -273,7 +273,7 @@ usage() { parse_optbool() { local opt=${1/--no-*/no} # false opt=${opt/--*/yes} # true - echo $opt + echo ${opt} } parse_cmdline() { @@ -394,7 +394,7 @@ parse_cmdline() { ;; --microcode=*) CMD_MICROCODE="${*#*=}" - print_info 3 "CMD_MICROCODE: $CMD_MICROCODE" + print_info 3 "CMD_MICROCODE: ${CMD_MICROCODE}" ;; --microcode-initramfs|--no-microcode-initramfs) CMD_MICROCODE_INITRAMFS=$(parse_optbool "$*") diff --git a/gen_compile.sh b/gen_compile.sh index 4942a0cb..3f10adb4 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -294,7 +294,7 @@ compile_kernel() { elif isTrue "${FIRMWARE_INSTALL}" then local cfg_CONFIG_FIRMWARE_IN_KERNEL=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" CONFIG_FIRMWARE_IN_KERNEL) - if isTrue "$cfg_CONFIG_FIRMWARE_IN_KERNEL" + if isTrue "${cfg_CONFIG_FIRMWARE_IN_KERNEL}" then print_info 1 "$(get_indent 1)>> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y) ..." else @@ -391,7 +391,7 @@ determine_busybox_config_file() { if [ -f "${f}" ] then - BUSYBOX_CONFIG="$f" + BUSYBOX_CONFIG="${f}" break else print_info 3 "$(get_indent 3)- '${f}' not found; Skipping ..." diff --git a/gen_configkernel.sh b/gen_configkernel.sh index dd47df65..69430508 100755 --- a/gen_configkernel.sh +++ b/gen_configkernel.sh @@ -79,11 +79,11 @@ determine_kernel_config_file() { if [ -f "${f}" ] then - if grep -sq THIS_CONFIG_IS_BROKEN "$f" + if grep -sq THIS_CONFIG_IS_BROKEN "${f}" then print_info 2 "$(get_indent 1)- '${f}' is marked as broken; Skipping ..." else - KERNEL_CONFIG="$f" && break + KERNEL_CONFIG="${f}" && break fi else print_info 2 "$(get_indent 1)- '${f}' not found; Skipping ..." @@ -845,12 +845,12 @@ config_kernel() { local k for k in "${kconfigs_microcode[@]}" do - local cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "$k") + local cfg=$(kconfig_get_opt "${KERNEL_OUTPUTDIR}/.config" "${k}") case "${cfg}" in y) ;; # Do nothing *) cfg='y' esac - kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "$k" "${cfg}" + kconfig_set_opt "${KERNEL_OUTPUTDIR}/.config" "${k}" "${cfg}" done required_kernel_options+=( 'CONFIG_MICROCODE' ) diff --git a/gen_determineargs.sh b/gen_determineargs.sh index e4aea0c5..616f4fef 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -72,8 +72,8 @@ determine_KV() { fi fi - KV_MAJOR=$(echo $KV | cut -f1 -d.) - KV_MINOR=$(echo $KV | cut -f2 -d.) + KV_MAJOR=$(echo ${KV} | cut -f1 -d.) + KV_MINOR=$(echo ${KV} | cut -f2 -d.) KV_NUMERIC=$((${KV_MAJOR} * 1000 + ${KV_MINOR})) if [ -n "${old_KV}" -a "${KV}" != "${old_KV}" ] @@ -283,20 +283,20 @@ determine_real_args() { set_config_with_override STRING CHECK_FREE_DISK_SPACE_BOOTDIR CMD_CHECK_FREE_DISK_SPACE_BOOTDIR set_config_with_override STRING CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR CMD_CHECK_FREE_DISK_SPACE_KERNELOUTPUTDIR - set_config_with_override STRING COMPRESS_INITRD CMD_COMPRESS_INITRD "$DEFAULT_COMPRESS_INITRD" - set_config_with_override STRING COMPRESS_INITRD_TYPE CMD_COMPRESS_INITRD_TYPE "$DEFAULT_COMPRESS_INITRD_TYPE" - set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "$DEFAULT_MAKEOPTS" + set_config_with_override STRING COMPRESS_INITRD CMD_COMPRESS_INITRD "${DEFAULT_COMPRESS_INITRD}" + set_config_with_override STRING COMPRESS_INITRD_TYPE CMD_COMPRESS_INITRD_TYPE "${DEFAULT_COMPRESS_INITRD_TYPE}" + set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "${DEFAULT_MAKEOPTS}" set_config_with_override STRING NICE CMD_NICE "10" - set_config_with_override STRING KERNEL_MAKE CMD_KERNEL_MAKE "$DEFAULT_KERNEL_MAKE" - set_config_with_override STRING UTILS_CFLAGS CMD_UTILS_CFLAGS "$DEFAULT_UTILS_CFLAGS" - set_config_with_override STRING UTILS_MAKE CMD_UTILS_MAKE "$DEFAULT_UTILS_MAKE" - set_config_with_override STRING KERNEL_CC CMD_KERNEL_CC "$DEFAULT_KERNEL_CC" - set_config_with_override STRING KERNEL_LD CMD_KERNEL_LD "$DEFAULT_KERNEL_LD" - set_config_with_override STRING KERNEL_AS CMD_KERNEL_AS "$DEFAULT_KERNEL_AS" - set_config_with_override STRING UTILS_CC CMD_UTILS_CC "$DEFAULT_UTILS_CC" - set_config_with_override STRING UTILS_CXX CMD_UTILS_CXX "$DEFAULT_UTILS_CXX" - set_config_with_override STRING UTILS_LD CMD_UTILS_LD "$DEFAULT_UTILS_LD" - set_config_with_override STRING UTILS_AS CMD_UTILS_AS "$DEFAULT_UTILS_AS" + set_config_with_override STRING KERNEL_MAKE CMD_KERNEL_MAKE "${DEFAULT_KERNEL_MAKE}" + set_config_with_override STRING UTILS_CFLAGS CMD_UTILS_CFLAGS "${DEFAULT_UTILS_CFLAGS}" + set_config_with_override STRING UTILS_MAKE CMD_UTILS_MAKE "${DEFAULT_UTILS_MAKE}" + set_config_with_override STRING KERNEL_CC CMD_KERNEL_CC "${DEFAULT_KERNEL_CC}" + set_config_with_override STRING KERNEL_LD CMD_KERNEL_LD "${DEFAULT_KERNEL_LD}" + set_config_with_override STRING KERNEL_AS CMD_KERNEL_AS "${DEFAULT_KERNEL_AS}" + set_config_with_override STRING UTILS_CC CMD_UTILS_CC "${DEFAULT_UTILS_CC}" + set_config_with_override STRING UTILS_CXX CMD_UTILS_CXX "${DEFAULT_UTILS_CXX}" + set_config_with_override STRING UTILS_LD CMD_UTILS_LD "${DEFAULT_UTILS_LD}" + set_config_with_override STRING UTILS_AS CMD_UTILS_AS "${DEFAULT_UTILS_AS}" set_config_with_override STRING CROSS_COMPILE CMD_CROSS_COMPILE set_config_with_override STRING BOOTDIR CMD_BOOTDIR "/boot" diff --git a/gen_funcs.sh b/gen_funcs.sh index 1f574ad5..a19cb88a 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -1537,20 +1537,20 @@ set_default_gk_trap() { # - JRG # set_config_with_override() { - local VarType=$1 - local CfgVar=$2 - local OverrideVar=$3 - local Default=$4 + local VarType=${1} + local CfgVar=${2} + local OverrideVar=${3} + local Default=${4} local Result # # Syntax check the function arguments. # - case "$VarType" in + case "${VarType}" in BOOL|STRING) ;; *) - gen_die "Illegal variable type \"$VarType\" passed to set_config_with_override()." + gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Variable type \"${VarType}\" is unknown!" ;; esac @@ -1559,9 +1559,9 @@ set_config_with_override() { Result=${!OverrideVar} if [ -n "${!CfgVar}" ] then - print_info 5 " $CfgVar overridden on command line to \"$Result\"." + print_info 5 " ${CfgVar} overridden on command line to \"${Result}\"." else - print_info 5 " $CfgVar set on command line to \"$Result\"." + print_info 5 " ${CfgVar} set on command line to \"${Result}\"." fi else if [ -n "${!CfgVar}" ] @@ -1571,18 +1571,18 @@ set_config_with_override() { eval ${OverrideVar}=\"${Result}\" \ || small_die "Failed to set variable '${OverrideVar}=${Result}' !" - print_info 5 " $CfgVar set in config file to \"${Result}\"." + print_info 5 " ${CfgVar} set in config file to \"${Result}\"." else - if [ -n "$Default" ] + if [ -n "${Default}" ] then Result=${Default} # set OverrideVar to Result, otherwise CMD_* may not be initialized... eval ${OverrideVar}=\"${Result}\" \ || small_die "Failed to set variable '${OverrideVar}=${Result}' !" - print_info 5 " $CfgVar defaulted to \"${Result}\"." + print_info 5 " ${CfgVar} defaulted to \"${Result}\"." else - print_info 5 " $CfgVar not set." + print_info 5 " ${CfgVar} not set." fi fi fi @@ -1688,7 +1688,7 @@ rootfs_type_is() { # It is possible that the awk will return MULTIPLE lines, depending on your # initramfs setup (one of the entries will be 'rootfs'). - if awk '($2=="/"){print $3}' /proc/mounts | grep -sq --line-regexp "$fstype" ; + if awk '($2=="/"){print $3}' /proc/mounts | grep -sq --line-regexp "${fstype}" then echo yes else @@ -1854,7 +1854,7 @@ find_kernel_binary() { do if [ -e "${i}" ] then - tmp_kernel_binary=$i + tmp_kernel_binary=${i} break fi done @@ -1889,7 +1889,7 @@ kconfig_set_opt() { then print_info 3 "$(get_indent ${indentlevel}) - Adding option '${optname}' with value '${optval}' to '${kconfig}'..." echo "${optname}=${optval}" >> "${kconfig}" \ - || gen_die "Failed to add '${optname}=${optval}' to '$kconfig'" + || gen_die "Failed to add '${optname}=${optval}' to '${kconfig}'" [ ! -f "${TEMP}/.kconfig_modified" ] && touch "${TEMP}/.kconfig_modified" elif [[ "${curropt}" != "*#*" && "${curropt#*=}" == "${optval}" ]] @@ -1899,7 +1899,7 @@ kconfig_set_opt() { print_info 3 "$(get_indent ${indentlevel}) - Setting option '${optname}' to '${optval}' in '${kconfig}'..." sed -i "${kconfig}" \ -e "s/^#\? \?${optname}[ =].*/${optname}=${optval}/g" \ - || gen_die "Failed to set '${optname}=${optval}' in '$kconfig'" + || gen_die "Failed to set '${optname}=${optval}' in '${kconfig}'" [ ! -f "${KCONFIG_MODIFIED_MARKER}" ] && touch "${KCONFIG_MODIFIED_MARKER}" fi @@ -164,7 +164,7 @@ unset _MODULES_LOAD for v in ${override_module_vars} do newvar=override_${v} - print_info 2 "Override $v, default (${!v}), new value (${!newvar})" + print_info 2 "Override ${v}, default (${!v}), new value (${!newvar})" eval "${v}='${!newvar}'" done unset v override_module_vars newvar |