Skip to content

Commit

Permalink
chore: remove unnecessary shellcheck disable for SC2154
Browse files Browse the repository at this point in the history
  • Loading branch information
LaszloGombos authored and aafeijoo-suse committed Aug 24, 2023
1 parent 1664563 commit 0b81e8e
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 25 deletions.
1 change: 0 additions & 1 deletion dracut-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ find_binary() {
[[ -z ${1##/*} ]] || _delim="/"

if [[ $1 == *.so* ]]; then
# shellcheck disable=SC2154
for l in $libdirs; do
_path="${l}${_delim}${1}"
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &> /dev/null; }; then
Expand Down
11 changes: 0 additions & 11 deletions dracut-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ if ! is_func dinfo > /dev/null 2>&1; then
dlog_init
fi

# shellcheck disable=SC2154
if ! [[ $initdir ]]; then
dfatal "initdir not set"
exit 1
Expand All @@ -59,10 +58,8 @@ if ! [[ $kernel ]]; then
export kernel
fi

# shellcheck disable=SC2154
srcmods="$dracutsysrootdir/lib/modules/$kernel/"

# shellcheck disable=SC2154
[[ $drivers_dir ]] && {
if ! command -v kmod &> /dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
Expand Down Expand Up @@ -108,7 +105,6 @@ fi
# to check for required installed binaries
# issues a standardized warning message
require_binaries() {
# shellcheck disable=SC2154
local _module_name="${moddir##*/}"
local _ret=0

Expand Down Expand Up @@ -154,7 +150,6 @@ require_any_binary() {
# to check for required kernel modules
# issues a standardized warning message
require_kernel_modules() {
# shellcheck disable=SC2154
local _module_name="${moddir##*/}"
local _ret=0

Expand All @@ -180,7 +175,6 @@ dracut_need_initqueue() {
}

dracut_module_included() {
# shellcheck disable=SC2154
[[ " $mods_to_load $modules_loaded " == *\ $*\ * ]]
}

Expand Down Expand Up @@ -317,7 +311,6 @@ dracut_install() {
dracut_instmods() {
local _ret _silent=0
local i
# shellcheck disable=SC2154
[[ $no_kernel == yes ]] && return
for i in "$@"; do
[[ $i == "--silent" ]] && _silent=1
Expand Down Expand Up @@ -391,7 +384,6 @@ inst_fsck_help() {
# be applied, else will ignore hostonly mode and try to install all
# given modules.
optional_hostonly() {
# shellcheck disable=SC2154
if [[ $hostonly_mode == "strict" ]]; then
printf -- "%s" "$hostonly"
else
Expand Down Expand Up @@ -443,7 +435,6 @@ inst_rule_programs() {
# shellcheck disable=SC2013
for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do
_bin=""
# shellcheck disable=SC2154
if [[ -x ${udevdir}/$_prog ]]; then
_bin="${udevdir}"/$_prog
elif [[ ${_prog/\$env\{/} == "$_prog" ]]; then
Expand Down Expand Up @@ -884,7 +875,6 @@ check_mount() {
local _moddep

[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
# shellcheck disable=SC2154
[ "${#host_fs_types[@]}" -le 0 ] && return 1

# If we are already scheduled to be loaded, no need to check again.
Expand All @@ -896,7 +886,6 @@ check_mount() {

[[ $2 ]] || mods_checked_as_dep+=" $_mod "

# shellcheck disable=SC2154
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
return 1
fi
Expand Down
5 changes: 0 additions & 5 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,6 @@ if ! [[ $outfile ]]; then
fi

if [[ $uefi == "yes" ]]; then
# shellcheck disable=SC2154
if [[ -n $uefi_secureboot_key && -z $uefi_secureboot_cert ]] || [[ -z $uefi_secureboot_key && -n $uefi_secureboot_cert ]]; then
printf "%s\n" "dracut[F]: Need 'uefi_secureboot_key' and 'uefi_secureboot_cert' both to be set." >&2
exit 1
Expand Down Expand Up @@ -1278,7 +1277,6 @@ trap 'exit 1;' SIGINT
readonly initdir="${DRACUT_TMPDIR}/initramfs"
mkdir -p "$initdir"
# shellcheck disable=SC2154
if [[ $early_microcode == yes ]] || { [[ $acpi_override == yes ]] && [[ -d $acpi_table_dir ]]; }; then
readonly early_cpio_dir="${DRACUT_TMPDIR}/earlycpio"
mkdir "$early_cpio_dir"
Expand Down Expand Up @@ -1335,7 +1333,6 @@ else
unset enhanced_cpio
fi
# shellcheck disable=SC2154
if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then
dfatal "Cannot find module directory $srcmods"
dfatal "and --no-kernel was not specified"
Expand Down Expand Up @@ -1889,7 +1886,6 @@ mkdir -p "${initdir}"/lib/dracut
if [[ $kernel_only != yes ]]; then
mkdir -p "${initdir}/etc/cmdline.d"
mkdir -m 0755 "${initdir}"/lib/dracut/hooks
# shellcheck disable=SC2154
for _d in $hookdirs; do
# shellcheck disable=SC2174
mkdir -m 0755 -p "${initdir}/lib/dracut/hooks/$_d"
Expand Down Expand Up @@ -2458,7 +2454,6 @@ else
fi
fi
# shellcheck disable=SC2154
if ((maxloglvl >= 5)) && ((verbosity_mod_l >= 0)); then
if [[ $allowlocal ]]; then
"$dracutbasedir/lsinitrd.sh" "${DRACUT_TMPDIR}/initramfs.img" | ddebug
Expand Down
1 change: 0 additions & 1 deletion install.d/51-dracut-rescue.install
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ case "$COMMAND" in
fi
done

# shellcheck disable=SC2154
if [[ $dracut_rescue_image != "yes" ]]; then
[[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
&& echo "Skipping, 'dracut_rescue_image' not set to 'yes' in any dracut configuration file"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

# shellcheck disable=SC2154
case "$root" in
live:/dev/*)
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/create-overlay %s"\n' \
Expand Down
1 change: 0 additions & 1 deletion modules.d/90dmsquash-live-autooverlay/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ installkernel() {
install() {
inst_multiple awk blkid cat grep mkdir mount parted readlink rmdir tr umount
inst_multiple -o mkfs.btrfs mkfs.ext4 mkfs.xfs
# shellcheck disable=SC2154
inst_hook pre-udev 25 "$moddir/create-overlay-genrules.sh"
inst_script "$moddir/create-overlay.sh" "/sbin/create-overlay"
dracut_need_initqueue
Expand Down
2 changes: 0 additions & 2 deletions modules.d/95cifs/cifsroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ NEWROOT="$3"

cifs_to_var "$root"

# shellcheck disable=SC2154
mount.cifs "//$server/$path" "$NEWROOT" -o "$options" && { [ -e /dev/root ] || ln -s null /dev/root; }

# inject new exit_if_exists
# shellcheck disable=SC2016
# shellcheck disable=SC2154
echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > "$hookdir"/initqueue/cifs.sh
# force udevsettle to break
: > "$hookdir"/initqueue/work
2 changes: 0 additions & 2 deletions modules.d/95rootfs-block/block-genrules.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh

# shellcheck disable=SC2154
if [ "${root%%:*}" = "block" ]; then
{
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
Expand All @@ -10,7 +9,6 @@ if [ "${root%%:*}" = "block" ]; then
} >> /etc/udev/rules.d/99-root.rules

# shellcheck disable=SC2016
# shellcheck disable=SC2154
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
"${root#block:}" "${root#block:}" > "$hookdir"/initqueue/settled/blocksymlink.sh

Expand Down
1 change: 0 additions & 1 deletion test/test-functions
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ while (($# > 0)); do
) < /dev/null 2>&1 | tee "test${TEST_RUN_ID:+-$TEST_RUN_ID}.log"
elif [[ $V == "2" ]]; then
set -o pipefail
# shellcheck disable=SC2154
(
test_setup && test_run
ret=$?
Expand Down

0 comments on commit 0b81e8e

Please sign in to comment.