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

RFC: feat(dracut): add option to disable automatic guessing of output file #2448

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,13 @@ for f in $(dropindirs_sort ".conf" "$confdir" "$dracutbasedir/dracut.conf.d"); d
[[ -e $f ]] && . "$f"
done

# check if automatic guessing of the output file is disabled.
if [[ $force_output_file == "yes" && -z $outfile ]]; then
printf "%s\n" "dracut[F]: dracut is configured with force_output_file=yes" >&2
printf "%s\n" "dracut[F]: so it is required to specify the file path of the generated initramfs image." >&2
exit 1
fi

# regenerate_all shouldn't be set in conf files
regenerate_all=$regenerate_all_l
if [[ $parallel_l == "yes" ]]; then
Expand Down
7 changes: 7 additions & 0 deletions man/dracut.conf.5.asc
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ Logging levels:
If set to _yes_, try to execute tasks in parallel (currently only supported
for _--regenerate-all_).

*force_output_file=*"__{yes|no}__"::
If set to _yes_, require to specify a file path for the generated initramfs
image, disabling automatic guessing of the location (default=no).
In some complex scenarios, distribution owners may want to disable the logic
for guessing the location of the output file, to prevent users from calling
dracut directly to create useless initramfs that won't be used at boot.

Files
-----
_/etc/dracut.conf_::
Expand Down
Loading