Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dracut.sh): do not ignore invalid config file or dir path #1622

Merged
merged 1 commit into from
Dec 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -888,20 +888,26 @@ export DRACUT_LOG_LEVEL=warning
[[ $dracutbasedir ]] || dracutbasedir="$dracutsysrootdir"/usr/lib/dracut

# if we were not passed a config file, try the default one
if [[ ! -f $conffile ]]; then
if [[ -z $conffile ]]; then
if [[ $allowlocal ]]; then
conffile="$dracutbasedir/dracut.conf"
else
conffile="$dracutsysrootdir/etc/dracut.conf"
fi
elif [[ ! -f $conffile ]]; then
printf "%s\n" "dracut: Configuration file '$conffile' not found." >&2
exit 1
fi

if [[ ! -d $confdir ]]; then
if [[ -z $confdir ]]; then
if [[ $allowlocal ]]; then
confdir="$dracutbasedir/dracut.conf.d"
else
confdir="$dracutsysrootdir/etc/dracut.conf.d"
fi
elif [[ ! -d $confdir ]]; then
printf "%s\n" "dracut: Configuration directory '$confdir' not found." >&2
exit 1
fi

# source our config file
Expand Down