]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut-systemd): install grep if initqueue is used
authorBenjamin Drung <benjamin.drung@canonical.com>
Fri, 31 Oct 2025 11:42:39 +0000 (12:42 +0100)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Fri, 31 Oct 2025 12:31:57 +0000 (08:31 -0400)
TEST-13-SYSROOT emits this error on Ubuntu:

```
dracut-initqueue[248]: /usr/bin/dracut-initqueue: 1: /lib/dracut/hooks/initqueue/finished/devexists-\x2fdev\x2fdisk\x2fby-label\x2fdracut.sh: grep: not found
```

`parse-root.sh` injects a grep call into
`$hookdir/initqueue/finished/devexists-${root_name}.sh`. Therefore the
`grep` command needs to be installed if initqueue is used.

modules.d/77dracut-systemd/module-setup.sh

index f149f51c39eaba5a5643c138e63d4d8b8d72ba86..663cba1eb65ecab8a2b0759a6da37850ba0de792 100755 (executable)
@@ -51,6 +51,10 @@ install() {
     inst_script "$moddir/rootfs-generator.sh" "$systemdutildir"/system-generators/dracut-rootfs-generator
 
     inst_hook cmdline 00 "$moddir/parse-root.sh"
+    if dracut_module_included initqueue; then
+        # parse-root.sh injects grep call into initqueue/finished/devexists-${root_name}.sh
+        inst grep
+    fi
 
     for i in \
         dracut-cmdline.service \