Skip to content

Commit

Permalink
Merge pull request #323 from aafeijoo-suse/059-bsc1213648
Browse files Browse the repository at this point in the history
feat(dracut): add option to disable automatic guessing of output file (bsc#1213648)
  • Loading branch information
aafeijoo-suse authored Apr 16, 2024
2 parents 145cde9 + f2e2d08 commit 4900899
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,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 @@ -315,6 +315,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
1 change: 1 addition & 0 deletions suse/README.susemaint
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ PR Commit message
---- --------------
2342 fix(systemd-sysext): handle confexts and correct extensions search path
2404 fix(multipath): explicitly check if hostonly_cmdline is yes
2448 feat(dracut): add option to disable automatic guessing of output file
2451 fix(base): correct handling of quiet in loginit
2524 fix(dracut.sh): abort if Bash is in POSIX mode
2526 fix(systemd-pcrphase): rename systemd-pcrphase binary to systemd-pcrextend
Expand Down

0 comments on commit 4900899

Please sign in to comment.