dracut: Support /usr/bin as 'systemctl' path

On openSUSE the initrd has systemctl in /usr/bin, check this path as
well.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Lorenz Hüdepohl <dev@stellardeath.org>
Closes #11487
This commit is contained in:
Lorenz Hüdepohl 2021-01-21 21:59:24 +01:00 committed by GitHub
parent 0ae733c7a4
commit 984362a71e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ Before=zfs-import.target
[Service] [Service]
Type=oneshot Type=oneshot
ExecStart=/bin/sh -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')" ExecStart=/bin/sh -c "systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
[Install] [Install]
WantedBy=zfs-import.target WantedBy=zfs-import.target

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise # only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
[ -e /bin/systemctl ] || return 0 [ -e /bin/systemctl ] || [ -e /usr/bin/systemctl ] || return 0
# This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems # This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems