]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut): --printconfig does not work without --force
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Fri, 12 Dec 2025 08:57:24 +0000 (09:57 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Fri, 12 Dec 2025 14:23:36 +0000 (09:23 -0500)
```
$ dracut --printconfig
dracut[F]: Will not override existing initramfs (/boot/initrd-6.17.0-2-default) without --force
```

Follow-up for 8e24c4bf06850da1bc89022081b7e793548d9b0b

dracut.sh

index ee89e13be1dc6e63814c9ffa0a8b2e555c150d4d..45044254592d0436190a685b4df531815ceeca1b 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -2541,7 +2541,7 @@ if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then
     exit 1
 fi
 
-if ! [[ $print_cmdline ]]; then
+if ! [[ $print_cmdline ]] && ! [[ $printconfig ]]; then
     inst "$DRACUT_TESTBIN"
     if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${dracutsysrootdir:+-r "$dracutsysrootdir"} -R "$DRACUT_TESTBIN" &> /dev/null; then
         unset DRACUT_RESOLVE_LAZY
@@ -2706,7 +2706,7 @@ if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then
     fi
 fi
 
-if [[ ! $print_cmdline ]]; then
+if ! [[ $print_cmdline ]] && ! [[ $printconfig ]]; then
     if [[ -f $outfile && ! $force ]]; then
         dfatal "Will not override existing initramfs ($outfile) without --force"
         exit 1