Skip to content

Commit

Permalink
fix(dracut.sh): give warning if drivers, force_drivers or filesystems…
Browse files Browse the repository at this point in the history
… is empty

If drivers, force_drivers or filesystems is empty, dracut may be blocked.
Thus give warning to indicate users to manually interrupt.
  • Loading branch information
chenjiayi committed Jan 7, 2024
1 parent 4980bad commit ec7b366
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,10 @@ if [[ $no_kernel != yes ]]; then
fi
if [[ $drivers ]]; then
if [[ -z ${drivers// /} ]]; then
dwarn "drivers is empty, dracut may be blocked."
fi
# shellcheck disable=SC2086
hostonly='' instmods $drivers
fi
Expand All @@ -1960,6 +1964,10 @@ if [[ $no_kernel != yes ]]; then
hostonly='' instmods -c $add_drivers
fi
if [[ $force_drivers ]]; then
if [[ -z ${force_drivers// /} ]]; then
dwarn "force_drivers is empty, dracut may be blocked."
fi
# shellcheck disable=SC2086
hostonly='' instmods -c $force_drivers
rm -f "$initdir"/etc/cmdline.d/20-force_driver.conf
Expand All @@ -1968,6 +1976,10 @@ if [[ $no_kernel != yes ]]; then
done
fi
if [[ $filesystems ]]; then
if [[ -z ${filesystems// /} ]]; then
dwarn "force_drivers is empty, dracut may be blocked."
fi
# shellcheck disable=SC2086
hostonly='' instmods -c $filesystems
fi
Expand Down

0 comments on commit ec7b366

Please sign in to comment.