]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: use find_binary
authorZoltán Böszörményi <zboszor@pr.hu>
Sun, 7 Feb 2021 14:01:49 +0000 (15:01 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Tue, 9 Feb 2021 07:09:28 +0000 (07:09 +0000)
Use find_binary instead of type -P because the former works if
dracutsysrootdir is set.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
modules.d/00systemd/module-setup.sh
modules.d/02caps/module-setup.sh
modules.d/05busybox/module-setup.sh
modules.d/50gensplash/module-setup.sh
modules.d/50plymouth/module-setup.sh
modules.d/90lvm/module-setup.sh
modules.d/98syslog/module-setup.sh
modules.d/99memstrack/module-setup.sh
modules.d/99squash/module-setup.sh

index bbce31a28c8e74b2d8e35f1535ad6d154c7d2f2a..15ddd0a16bc0628feb54d18f5ffbfd663f215733 100755 (executable)
@@ -227,8 +227,8 @@ install() {
     ln_r $systemdutildir/systemd "/sbin/init"
 
     inst_binary true
-    ln_r $(type -P true) "/usr/bin/loginctl"
-    ln_r $(type -P true) "/bin/loginctl"
+    ln_r $(find_binary true) "/usr/bin/loginctl"
+    ln_r $(find_binary true) "/bin/loginctl"
     inst_rules \
         70-uaccess.rules \
         71-seat.rules \
index fb16526a8765e356834281f6c2f0790396cf41cf..d1ce6cdc211a5df5a11abd2f9f2f37707804db2f 100755 (executable)
@@ -15,7 +15,7 @@ depends() {
 install() {
     if ! dracut_module_included "systemd"; then
         inst_hook pre-pivot 00 "$moddir/caps.sh"
-        inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
+        inst $(find_binary capsh 2>/dev/null) /usr/sbin/capsh
         # capsh wants bash and we need bash also
         inst /bin/bash
     else
index 5d88c5d140cb1863c7e591a826b0b760359e37ec..20b36c1640383df3f1379dc53c0d8a3b9078f515 100755 (executable)
@@ -16,7 +16,7 @@ depends() {
 install() {
     local _i _path _busybox
     local _progs=()
-    _busybox=$(type -P busybox)
+    _busybox=$(find_binary busybox)
     inst $_busybox /usr/bin/busybox
     for _i in $($_busybox --list); do
         [[ ${_i} == busybox ]] && continue
index 67faff12ca2288ff67ce597d99693331b30722c7..ec6af885b2c929297535f13c7b9dd5db12916a50 100755 (executable)
@@ -40,7 +40,7 @@ install() {
         return ${_ret}
     }
 
-    type -P splash_geninitramfs >/dev/null || return 1
+    find_binary splash_geninitramfs >/dev/null || return 1
 
     _opts=''
     if [[ ${DRACUT_GENSPLASH_THEME} ]]; then
index 081d24e0b8d295d148afb4c65711a9eccff9e53b..821a9f716586a5590badf642964b3cdede5be615 100755 (executable)
@@ -2,7 +2,7 @@
 
 pkglib_dir() {
     local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/"
-    if type -P dpkg-architecture &>/dev/null; then
+    if find_binary dpkg-architecture &>/dev/null; then
         _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
     fi
     for _dir in $_dirs; do
index 1eeba79d77e44bc94b0e8207275647e7dfaa2034..ccb55d4d636e1dbfc862ec4bfcc03ae443f92d06 100755 (executable)
@@ -119,7 +119,7 @@ install() {
 
     inst_libdir_file "libdevmapper-event-lvm*.so"
 
-    if [[ $hostonly ]] && type -P lvs &>/dev/null; then
+    if [[ $hostonly ]] && find_binary lvs &>/dev/null; then
         for dev in "${!host_fs_types[@]}"; do
             [ -e /sys/block/${dev#/dev/}/dm/name ] || continue
             dev=$(</sys/block/${dev#/dev/}/dm/name)
index aa0c8eaf1cad334a88c72ff2b1008a0c2d838810..2435c4d556686589be7ec30015120f9b50402050 100755 (executable)
@@ -15,12 +15,12 @@ depends() {
 install() {
     local _i
     local _installs
-    if type -P rsyslogd >/dev/null; then
+    if find_binary rsyslogd >/dev/null; then
         _installs="rsyslogd"
         inst_libdir_file rsyslog/lmnet.so rsyslog/imklog.so rsyslog/imuxsock.so rsyslog/imjournal.so
-    elif type -P syslogd >/dev/null; then
+    elif find_binary syslogd >/dev/null; then
         _installs="syslogd"
-    elif type -P syslog-ng >/dev/null; then
+    elif find_binary syslog-ng >/dev/null; then
         _installs="syslog-ng"
     else
         derror "Could not find any syslog binary although the syslogmodule" \
index 45044d82c6f6371cd525f3843776fab3fd3cb6ed..7c6b1fbf042f93ac221512b29070245fe3c99911 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 check() {
-    if type -P memstrack >/dev/null; then
+    if find_binary memstrack >/dev/null; then
         dinfo "memstrack is available"
         return 0
     fi
index 9a61a59dbbd6f0f1ed3fd25ac1443417de6d85f7..12dae379110beb1003c4d1890f82a1710f4f7b43 100644 (file)
@@ -6,7 +6,7 @@ check() {
         return 1
     fi
 
-    if ! type -P mksquashfs >/dev/null || ! type -P unsquashfs >/dev/null ; then
+    if ! find_binary mksquashfs >/dev/null || ! find_binary unsquashfs >/dev/null ; then
         derror "dracut-squash module requires squashfs-tools"
         return 1
     fi