]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-systemd/rootfs-generator.sh: use strstr rather than grep
authorHarald Hoyer <harald@redhat.com>
Tue, 21 Apr 2015 14:35:34 +0000 (16:35 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 21 Apr 2015 14:35:34 +0000 (16:35 +0200)
grep on /proc/cmdline is overkill and would add a requirement for grep

modules.d/98dracut-systemd/rootfs-generator.sh

index f3c7d1f237dfd0d23ae305946429fc8478a04f96..a68e73b8c188409b3560d4a132c220ad79c3a222 100755 (executable)
@@ -92,7 +92,7 @@ esac
 
 if [ "${root%%:*}" = "block" ]; then
    generator_wait_for_dev "${root#block:}" "$RDRETRY"
-   grep -q 'root=' /proc/cmdline || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
+   strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
 fi
 
 exit 0