]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
chore: use command instead of type consistently
authorJo Zzsi <jozzsicsataban@gmail.com>
Mon, 11 Nov 2024 13:32:25 +0000 (08:32 -0500)
committerLaszlo <laszlo.gombos@gmail.com>
Mon, 11 Nov 2024 16:40:34 +0000 (11:40 -0500)
87 files changed:
modules.d/01fips-crypto-policies/fips-crypto-policies.sh
modules.d/01fips/fips-boot.sh
modules.d/01fips/fips-load-crypto.sh
modules.d/01fips/fips-noboot.sh
modules.d/01fips/fips.sh
modules.d/01systemd-networkd/networkd-config.sh
modules.d/01systemd-networkd/networkd-run.sh
modules.d/30convertfs/convertfs.sh
modules.d/35connman/cm-config.sh
modules.d/35connman/cm-lib.sh
modules.d/35connman/cm-run.sh
modules.d/35network-legacy/dhclient-script.sh
modules.d/35network-legacy/dhcp-multi.sh
modules.d/35network-legacy/ifup.sh
modules.d/35network-manager/nm-config.sh
modules.d/35network-manager/nm-lib.sh
modules.d/35network-manager/nm-run.sh
modules.d/45url-lib/url-lib.sh
modules.d/80cms/cms-write-ifcfg.sh
modules.d/80cms/cmsifup.sh
modules.d/80cms/cmssetup.sh
modules.d/80lvmmerge/lvmmerge.sh
modules.d/80lvmthinpool-monitor/start-thinpool-monitor.sh
modules.d/90btrfs/btrfs_device_ready.sh
modules.d/90btrfs/btrfs_finished.sh
modules.d/90btrfs/btrfs_timeout.sh
modules.d/90crypt/crypt-run-generator.sh
modules.d/90crypt/cryptroot-ask.sh
modules.d/90crypt/parse-crypt.sh
modules.d/90dmraid/dmraid.sh
modules.d/90dmsquash-live-autooverlay/create-overlay.sh
modules.d/90dmsquash-live-ntfs/mount-ntfs-3g.sh
modules.d/90dmsquash-live/dmsquash-generator.sh
modules.d/90dmsquash-live/dmsquash-live-root.sh
modules.d/90dmsquash-live/iso-scan.sh
modules.d/90kernel-modules/insmodpost.sh
modules.d/90livenet/livenet-generator.sh
modules.d/90livenet/livenetroot.sh
modules.d/90lvm/lvm_scan.sh
modules.d/90mdraid/mdraid-cleanup.sh
modules.d/90mdraid/mdraid-needshutdown.sh
modules.d/90mdraid/mdraid-waitclean.sh
modules.d/90mdraid/mdraid_start.sh
modules.d/90multipath/multipathd-needshutdown.sh
modules.d/90multipath/multipathd-stop.sh
modules.d/90multipath/multipathd.sh
modules.d/90overlayfs/mount-overlayfs.sh
modules.d/90overlayfs/prepare-overlayfs.sh
modules.d/95cifs/cifs-lib.sh
modules.d/95cifs/cifsroot.sh
modules.d/95cifs/parse-cifsroot.sh
modules.d/95fcoe/fcoe-up.sh
modules.d/95fstab-sys/mount-sys.sh
modules.d/95iscsi/iscsiroot.sh
modules.d/95iscsi/parse-iscsiroot.sh
modules.d/95nbd/nbd-generator.sh
modules.d/95nbd/nbdroot.sh
modules.d/95nfs/nfs-lib.sh
modules.d/95nfs/nfsroot-cleanup.sh
modules.d/95nfs/nfsroot.sh
modules.d/95nfs/parse-nfsroot.sh
modules.d/95rootfs-block/mount-root.sh
modules.d/95rootfs-block/rootfallback.sh
modules.d/95virtfs/mount-virtfs.sh
modules.d/95virtiofs/mount-virtiofs.sh
modules.d/98dracut-systemd/dracut-cmdline-ask.sh
modules.d/98dracut-systemd/dracut-cmdline.sh
modules.d/98dracut-systemd/dracut-emergency.sh
modules.d/98dracut-systemd/dracut-initqueue.sh
modules.d/98dracut-systemd/dracut-mount.sh
modules.d/98dracut-systemd/dracut-pre-mount.sh
modules.d/98dracut-systemd/dracut-pre-pivot.sh
modules.d/98dracut-systemd/dracut-pre-trigger.sh
modules.d/98dracut-systemd/dracut-pre-udev.sh
modules.d/98dracut-systemd/parse-root.sh
modules.d/98dracut-systemd/rootfs-generator.sh
modules.d/98syslog/parse-syslog-opts.sh
modules.d/98syslog/rsyslogd-start.sh
modules.d/98syslog/rsyslogd-stop.sh
modules.d/98syslog/syslog-cleanup.sh
modules.d/98usrmount/mount-usr.sh
modules.d/99base/dracut-lib.sh
modules.d/99base/init.sh
modules.d/99base/initqueue.sh
modules.d/99fs-lib/fs-lib.sh
modules.d/99memstrack/memstrack-start.sh
modules.d/99shutdown/shutdown.sh

index 7d1e13f6ff2c347f8f286a6c2fce96af946ecd7d..fae560941eecb189b67386e44f5d91f7959da322 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ] || [ -z "$fipsmode" ]; then
     # Do nothing if not in FIPS mode
index d703a10b4d388af081f9057b8cf7ff3184e2af51..16fbcbc7d9c0c1ccb53ac7ba24189169fe6dafca 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
     :
index d1d90c8958ae64f67a92bbf5eb2afdfb4ea02ae1..aebdc0f4c5a755595d42c90382297f2ad6ede8f3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
     :
index 319da90d8fa6e6923eb4691eaa93612816f45abc..10ed66936034b72937605bc81ed2c52e553f77ff 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
     :
index a3366a7f38f05d9cf91447a24bb63ec9ca823747..1f23a78929c64e789096b726cf7843d286d364b2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 # systemd lets stdout go to journal only, but the system
 # has to halt when the integrity check fails to satisfy FIPS.
index 48038aaad1f7fce179660e76c74b8b67eaba88cc..6339c7cb2ad924b10905aa76ee7dffbd4b0ba195 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getcmdline > /dev/null || . /lib/dracut-lib.sh
 
 # Just in case we're running before it
 systemctl start systemd-network-generator.service
index a32b8394ab6da6b989c8ec10fbe4bf02bd8441fe..a3ea0f6c47fc6d50deea259c468fa4fac119c4b1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type source_hook > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v source_hook > /dev/null || . /lib/dracut-lib.sh
 
 for ifpath in /sys/class/net/*; do
     ifname="${ifpath##*/}"
index 1052e5cb1a2ac3017638c3e92752985023b1f295..73587886afa4c6830b81ee4f7ef139777da5ed84 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type ismounted > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v ismounted > /dev/null || . /lib/dracut-lib.sh
 
 ROOT="$1"
 
index 67f6909d46815552f0efe80639cc78acdcf9db75..dce848276788c22772769643da1e4f1d410c35f8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type cm_generate_connections > /dev/null 2>&1 || . /lib/cm-lib.sh
+command -v cm_generate_connections > /dev/null || . /lib/cm-lib.sh
 
 if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
     echo rd.neednet >> /etc/cmdline.d/connman.conf
index 69901f37f86479b35c3cd45b36a3af8f5b4403ac..e781d0ad6b2e21cbf3af7d2eaf87e80ec61fe133 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getcmdline > /dev/null || . /lib/dracut-lib.sh
 
 cm_generate_connections() {
     if getargbool 0 rd.neednet; then
index a9dcf05b08cda532949c1154eccebeeb7f89aea0..bea407d6600242abd374ac28b618a35ee496d506 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type source_hook > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v source_hook > /dev/null || . /lib/dracut-lib.sh
 
 if [ -e /tmp/cm.done ]; then
     return
index 6cbc9c21c389e715fab991a71ad848b681cb3149..6751f2d6062aa5d4381dd62e576b5b6b78c587b3 100755 (executable)
@@ -2,8 +2,8 @@
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type ip_to_var > /dev/null 2>&1 || . /lib/net-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v ip_to_var > /dev/null || . /lib/net-lib.sh
 
 # We already need a set netif here
 netif=$interface
index f293b2738144181fccf1741d62c074d26fa96e87..f8104c33e0326ee5f28178284c741637298d15e2 100755 (executable)
@@ -6,7 +6,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
 # File to start dhclient requests on different interfaces in parallel
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 . /lib/net-lib.sh
 
 netif=$1
index 9827e2e8ce1868e8f90e3aa20a2882a55d2519c3..1cd27b14db89dbac7ee67caf4190899cc373bae3 100755 (executable)
@@ -7,8 +7,8 @@
 # or it is for manually bring up network ie. for kdump scp vmcore
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type ip_to_var > /dev/null 2>&1 || . /lib/net-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v ip_to_var > /dev/null || . /lib/net-lib.sh
 
 # Huh? No $1?
 [ -z "$1" ] && exit 1
index 394230fb13df3fd5136b1917f1b43d491174d559..feba8e5ac8700fefbad694b259dd0a77eb0da882 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh
+command -v nm_generate_connections > /dev/null || . /lib/nm-lib.sh
 
 if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
     echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
index f0941de38dfacb42e507f1b60fabb56204c4ef54..9a05cbc0ce633c2cb5b4d1002909b1fe032224f2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getcmdline > /dev/null || . /lib/dracut-lib.sh
 
 nm_generate_connections() {
     rm -f /run/NetworkManager/system-connections/*
index 14b9cb1ade0211a5c310bb680cfc25474e125a4d..ebc60877204e117cc9fec36e80ee0c8ca240d0a3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type source_hook > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v source_hook > /dev/null || . /lib/dracut-lib.sh
 
 if [ -z "$DRACUT_SYSTEMD" ]; then
     # Only start NM if networking is needed
index 7c3ef1e5c76205ec93f59488dfc170b6fdc9262d..f8d5480f3539019a2298bfdbd5c83ed5956da8b7 100755 (executable)
@@ -4,7 +4,7 @@
 # Authors:
 #   Will Woods <wwoods@redhat.com>
 
-type mkuniqdir > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v mkuniqdir > /dev/null || . /lib/dracut-lib.sh
 
 # fetch_url URL [OUTFILE]
 #   fetch the given URL to a locally-visible location.
index 9126309212966213abc727522cebe1bf394c1848..9b5d4adbf7b98b178ea0cf7f64f5f055356c7dee 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 OLD_UMASK=$(umask)
 umask 0022
index 285e20d121e7d61402185f1d2246f780573af9b0..12a1312e72618f857e5c5426ae0a61a4c4f72f38 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 DEVICE=$1
 
@@ -35,7 +35,7 @@ IFACES="$IFACES $DEVICE"
 echo "$IFACES" >> /tmp/net.ifaces
 
 if [ -x /usr/libexec/nm-initrd-generator ] || [ -x /usr/lib/nm-initrd-generator ]; then
-    type nm_generate_connections > /dev/null 2>&1 || . /lib/nm-lib.sh
+    command -v nm_generate_connections > /dev/null || . /lib/nm-lib.sh
     nm_generate_connections
     nm_reload_connections
 else
index 8050f2b409bc752387287fe1d75154326462e0f3..f861a451a1fcceacf0793e65bf735199cead8400 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type zdev_parse_dasd_list > /dev/null 2>&1 || . /lib/s390-tools/zdev-from-dasd_mod.dasd
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v zdev_parse_dasd_list > /dev/null || . /lib/s390-tools/zdev-from-dasd_mod.dasd
 
 function dasd_settle() {
     local dasd_status
index b8dbfa860ccff431c1092d56fec91dee554b63ee..4c2ef972f19653b67d6b8de9e211d6dde3c3608e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 do_merge() {
     sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' \
index 7d244c6018c20a95d0160d0db21c29c95e621fe1..4f5a2e3bda47fe5bf58a05577cd0a3e5516ccc99 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 LVS=$(getargs rd.lvm.lv)
 
index 93d07587b2bc0000c8e0f40b8b29b8d430d5e049..53911872ea74614e8e1b6bd3379f8f0a9692b766 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 btrfs_check_complete() {
     local _rootinfo _dev
index 4606f8ae551f39d19fcfb338afbc7d2d347d0ea4..45aaf91a01fcd74dd085f5bbbb1ba5336b2a6acb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 btrfs_check_complete() {
     local _rootinfo _dev
index 326231b7f5dd5ab5a1bf802db69a8f1d51f141a3..45bd45772f2b7b35e985714b699786c67255a912 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 info "Scanning for all btrfs devices"
 /sbin/btrfs device scan > /dev/null 2>&1
index fd36d7804634c2ae9a7dd20e777c7f789d78beac..210f6ea56e76fc110d275a588e329c6d506308cf 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getargs > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type crypttab_contains > /dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
+command -v getargs > /dev/null || . /lib/dracut-lib.sh
+command -v crypttab_contains > /dev/null || . /lib/dracut-crypt-lib.sh
 
 dev=$1
 luks=$2
index f8608fdf732052f64c40dc17743b204ed8e66ac8..5adb69148dfca6771853d2f993c975d8796151e0 100755 (executable)
@@ -6,7 +6,7 @@ NEWROOT=${NEWROOT:-"/sysroot"}
 # do not ask, if we already have root
 [ -f "$NEWROOT"/proc ] && exit 0
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 mkdir -p -m 0700 /run/cryptsetup
 
index 244cb102bae9d506a5deb854e7524bc3f2114ccd..e5c3c233e7ba2478315faa1c8c6ac35441c1b308 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type crypttab_contains > /dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
+command -v crypttab_contains > /dev/null || . /lib/dracut-crypt-lib.sh
 
 _cryptgetargsname() {
     debug_off
index b22a7cd0d1d44211c28f3c7b4053c9fcf8c88b67..495a011c9a40869ec77f643893a099fd10937925 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 devenc=$(str_replace "$1" '/' '\2f')
 
index 24dec7de4ba8f9e2b4ed2b0d9fdded1814645434..00d76d64e42e63906422235cf01c59b65f7c0cef 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if getargbool 0 rd.live.debug; then
     exec > /tmp/create-overlay.$$.out
index 289205c3caf92351537e7a05012ce19a678cf0cf..7f08cf5b158cd3d4c9bd091f55db61998f24413a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type vwarn > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v vwarn > /dev/null || . /lib/dracut-lib.sh
 
 # Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot
 # at the first glance, but ends with lots and lots of squashfs
index cd554b222a5d02ae93e75e3b42dd855d881f40dc..bbb232f257ae9f2b23c88e99f1f69aace38f3a7e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 [ -z "$root" ] && root=$(getarg root=)
 
index b7a74618e92fa9b1c6141606ba0c8814600622d4..11234f6d8a98b3ef3abec9439f135365c3ba3ed4 100755 (executable)
@@ -1,8 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type det_fs > /dev/null 2>&1 || . /lib/fs-lib.sh
-
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v det_fs > /dev/null || . /lib/fs-lib.sh
 command -v unpack_archive > /dev/null || . /lib/img-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
index fa06b33cd37960218b558564132c619c96011cd1..b7ff90b8b4e51a0d2a9ca85032a613f32466b38a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
index 9420c848e65db5f821a850acc246b5a1d17d8846..bf8f1248de36010659305a7e5b4a7419d7dc51f9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getargs > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getargs > /dev/null || . /lib/dracut-lib.sh
 
 for modlist in $(getargs rd.driver.post); do
     (
index fd6eaf46c7edb62c5b9f7441d440ec0cb142fdea..59af8515a02d6066c358136dde8cdc153f24b66a 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 [ -z "$root" ] && root=$(getarg root=)
 
index d8ea4bc3aa72220fd9dacc1bc0d2d09cd85b4ad4..56d0223bde2bea8f79668b2844df29b0a1c24b23 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # livenetroot - fetch a live image from the network and run it
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type fetch_url > /dev/null 2>&1 || . /lib/url-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v fetch_url > /dev/null || . /lib/url-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 RETRIES=${RETRIES:-100}
index 2d7d2f9d7cd082d92a47d8e008f12bcc39dd96a2..42e947c0f49fdfe14c95931e26d502da5a670221 100755 (executable)
@@ -3,7 +3,7 @@
 # run lvm scan if udev has settled
 
 extraargs="$*"
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 VGS=$(getargs rd.lvm.vg)
 LVS=$(getargs rd.lvm.lv)
index ce507335335fcd0e723d2616f060a89d673ce182..15a642df0e48b43ad2cdee2eebbe99581c9b7a81 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 containers=""
 for md in /dev/md[0-9_]*; do
index f248c4bb6d0bf49d3891b2dd710350ae0a4e9dcd..902fb3daa7fd7e7ad49fcd08a5970e7c18fe07c0 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 for md in /dev/md[0-9_]*; do
     [ -b "$md" ] || continue
index 9317962565d982fa4bf0916ac803299540fa18e7..ba0e543b2f257fa70402c71a9361b35428334443 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if getargbool 0 rd.md.waitclean; then
-    type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+    command -v getarg > /dev/null || . /lib/dracut-lib.sh
     containers=""
     for md in /dev/md[0-9_]*; do
         [ -b "$md" ] || continue
index 2645f1c43c2a2176244239f88877a3f73fbab084..1ab14d4d53e7d573151cc2fc5a03b28aec920017 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getargs > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getargs > /dev/null || . /lib/dracut-lib.sh
 
 _md_start() {
     local _udevinfo
index 6dc68bb662042cd8f0408a4a62cd33e857283499..bb67d3eed45dbe759abc1441eedeef0765f00987 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type need_shutdown > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v need_shutdown > /dev/null || . /lib/dracut-lib.sh
 
 for i in $(multipath -l -v1); do
     if dmsetup table "$i" | sed -n '/.*queue_if_no_path.*/q1'; then
index 05181b4b7d9b04fcd8eea10a4d55b115860c6a07..bd72647569ade83e7e9abdfafb5b92e3394cf35f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type pidof > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v pidof > /dev/null || . /lib/dracut-lib.sh
 
 if [ -e /etc/multipath.conf ]; then
     pkill multipathd > /dev/null 2>&1
index 1e26c1d266aa3a07e1111e82c7da830f975c1287..e17fd92103707448b36503aa3028ad3cb50a96b1 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then
     # mpathconf requires /etc/multipath to already exist
index a3f689166d16cb2abfae49bc18ae73d4629dfc50..dc1e04e8d8e1ad6f35c9d57f6c5016150ac32ac8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
 getargbool 0 rd.live.overlay.readonly && readonly_overlay="--readonly" || readonly_overlay=""
index 757d44455acfbad7d07aeeac7d2a730db36a3640..da12a936a6f8218b7130591ebc068665b21a1a44 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
 getargbool 0 rd.live.overlay.reset && reset_overlay="yes"
index 9564534a35a75335f340016bcec9a2f4e59caecf..29eecbcf068aff7f75eddf27ab4a7f05757e681b 100755 (executable)
@@ -5,7 +5,7 @@
 # CIFSROOT is something like: cifs://[<username>[:<password>]]@<host>/<path>
 # NETIF is used to get information from DHCP options, if needed.
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 cifs_to_var() {
     local cifsuser
index f54213f5b03e4e5d0cd4202834332d75c0b5a942..6460a8774f042a1a72b6b4e200d18af98b4debb8 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type cifs_to_var > /dev/null 2>&1 || . /lib/cifs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v cifs_to_var > /dev/null || . /lib/cifs-lib.sh
 
 [ "$#" = 3 ] || exit 1
 
index 19ccf90696f5c59c8e3ea82423d8279ef4660207..d617cc986c5ac3d00e66f216c762ecffdec838c5 100755 (executable)
@@ -9,8 +9,8 @@
 # respectively.
 #
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type cifs_to_var > /dev/null 2>&1 || . /lib/cifs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v cifs_to_var > /dev/null || . /lib/cifs-lib.sh
 
 # This script is sourced, so root should be set. But let's be paranoid
 [ -z "$root" ] && root=$(getarg root=)
index 3c6654c50ab161c4ce64f183d4256ec54c36c421..fbcdb8a6eeaa9b43c01892aa050cc8c799364b23 100755 (executable)
@@ -7,8 +7,8 @@
 # future use.
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type ip_to_var > /dev/null 2>&1 || . /lib/net-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v ip_to_var > /dev/null || . /lib/net-lib.sh
 
 # Huh? Missing arguments ??
 [ -z "$1" ] || [ -z "$2" ] && exit 1
index bb4bcdb33f0e2b1026b27f19d5168af2b7059ae6..780d61e82c471d3442b1579ff9c26d65e8d38753 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type det_fs > /dev/null 2>&1 || . /lib/fs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v det_fs > /dev/null || . /lib/fs-lib.sh
 
 fstab_mount() {
     local _dev _mp _fs _opts _pass
index 5c65357482a2a94a0921172b5e91fe4f3e9d6fbb..79123db504490e1d950837e3886f5506a64da3cf 100755 (executable)
@@ -6,9 +6,9 @@
 # iscsistart needs this.
 #
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type parse_iscsi_root > /dev/null 2>&1 || . /lib/net-lib.sh
-type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v parse_iscsi_root > /dev/null || . /lib/net-lib.sh
+command -v write_fs_tab > /dev/null || . /lib/fs-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
index 08e98a0a8fc871f46168ac1488aa16891daf2f88..7a584a5fe3cfaf50f1a1e29076143571de7a8e7c 100755 (executable)
@@ -31,7 +31,7 @@ fi
 
 [ -n "$iscsiroot" ] && [ -n "$iscsi_firmware" ] && die "Mixing iscsiroot and iscsi_firmware is dangerous"
 
-type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh
+command -v write_fs_tab > /dev/null || . /lib/fs-lib.sh
 
 # Root takes precedence over netroot
 if [ "${root%%:*}" = "iscsi" ]; then
@@ -146,7 +146,7 @@ fi
 
 for nroot in $(getargs netroot); do
     [ "${nroot%%:*}" = "iscsi" ] || continue
-    type parse_iscsi_root > /dev/null 2>&1 || . /lib/net-lib.sh
+    command -v parse_iscsi_root > /dev/null || . /lib/net-lib.sh
     parse_iscsi_root "$nroot" || return 1
     netroot_enc=$(str_replace "$nroot" '/' '\2f')
     echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh
index 38603bf8189260680befea3095b2f65fcdf133ed..89c1cf5fadbfc357b2878a3198746cd36e01a2d6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 [ -z "$root" ] && root=$(getarg root=)
 
index 35e24fabefdd5d54939e74a4c4542223256ff396..8e2fd810508cd339748c033838b9fea5c0386776 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
@@ -102,7 +102,7 @@ if [ "$root" = "block:/dev/root" ] || [ "$root" = "dhcp" ]; then
     wait_for_dev -n /dev/root
 
     if [ -z "$DRACUT_SYSTEMD" ]; then
-        type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh
+        command -v write_fs_tab > /dev/null || . /lib/fs-lib.sh
 
         write_fs_tab /dev/root "$nbdfstype" "$fsopts"
 
index 52fa97b505f282a8cad1c2f82d8603361117fe5a..5394815a027712157b74ce6b247fc5a8983468a2 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type get_ip > /dev/null 2>&1 || . /lib/net-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v get_ip > /dev/null || . /lib/net-lib.sh
 
 # TODO: make these things not pollute the calling namespace
 
index 3b164de691c8b97563935e00d47f20b7416ec900..f78534b952d95b8ca31199a466a19d8e036d407b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type incol2 > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v incol2 > /dev/null || . /lib/dracut-lib.sh
 
 [ -f /tmp/nfs.rpc_pipefs_path ] && read -r rpcpipefspath < /tmp/nfs.rpc_pipefs_path
 [ -z "$rpcpipefspath" ] && rpcpipefspath=var/lib/nfs/rpc_pipefs
index a47ec8fb1e284b4a71bb1063cfffab4d7ea5abd6..319c784c91948bcd1c390277b3bf177f26b9f94d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type nfs_to_var > /dev/null 2>&1 || . /lib/nfs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v nfs_to_var > /dev/null || . /lib/nfs-lib.sh
 
 [ "$#" = 3 ] || exit 1
 
index c7e7267807638a2ea32151626a9becabf749bdfd..5ac7decacb360d2c89fe103befbab5a0145ddac3 100755 (executable)
@@ -23,7 +23,7 @@
 # NFSv3 is used.
 #
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 . /lib/nfs-lib.sh
 
 # This script is sourced, so root should be set. But let's be paranoid
index 20b15dc5a662486558d4ad8efdef3f467c926453..48687f66f8e7643ea64cf2b09d47180b9901917f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type det_fs > /dev/null 2>&1 || . /lib/fs-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
+command -v det_fs > /dev/null || . /lib/fs-lib.sh
 
 mount_root() {
     local _rflags_ro
index ce4ee850cf3d6060346419f08c1fd19eb063ae07..d056aaace12f6e1acb072a1f8f4e5c92322b3d6c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 for root in $(getargs rootfallback=); do
     root=$(label_uuid_to_dev "$root")
index b7cb9ee9d00366584564a41ee90fb6fb70ebe5cf..1798113ffd8cc5da2c6e0b5a4bd0367438f706a8 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 filter_rootopts() {
     rootopts=$1
index 3f499cdc8bf53b899bd3a7228308c3519f8f818b..1e5bab5330b6299345bb759c355c139a8a2c1f58 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type ismounted > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v ismounted > /dev/null || . /lib/dracut-lib.sh
 
 if [ "${fstype}" = "virtiofs" ] || [ "${root%%:*}" = "virtiofs" ]; then
     if ! load_fstype virtiofs; then
index 895cd90d2f7e45da666e4ccf1eeac98286cc891d..29321a8c9cfc4b081551928504f1cd22f6b694c6 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 getarg "rd.cmdline=ask" || exit 0
 
index e1c9cbb4aaadb2734ee840f6ac10392aa1233c97..8d60eab9347f2af662bab9cef03976ed1f41c004 100755 (executable)
@@ -3,7 +3,7 @@
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 [ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release
 [ -n "$DRACUT_VERSION" ] && info "dracut-$DRACUT_VERSION"
index 7d013ed6275b7f0e6731faed12c036a451419de6..5702148dffe9faeb0750ba51a63b9657d2f35a4d 100755 (executable)
@@ -4,7 +4,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index 7e74576e857cebe974107acdf3ed3e3cc256f3a9..5e079193840063a91e1e4f96bc62eb623aa5bdbf 100755 (executable)
@@ -4,7 +4,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index ebc0d0e5022d050cd41e8fda6732c8fde69a9998..18ba3dcda42f9da9441195cd9de84665e55f936a 100755 (executable)
@@ -3,7 +3,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index 06d2411973005222fbbb7d721b541070311805e7..77a19aab828c7b07f955f37f7922359d5515ef21 100755 (executable)
@@ -4,7 +4,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index c6f68b207309e63c6aa514b3bfa24b22a5057694..80e8c6843f2ff1a25f5c42c1c83efbd29e4242c8 100755 (executable)
@@ -4,7 +4,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index 54dd3d21bf2265adc1e347d4c3a7ef9a3b679acd..bdb0b150da0e405d0a2b63aebe2d8a320d69f8c1 100755 (executable)
@@ -4,7 +4,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index 9565cdc2648a6cfb27f13a9fe1bd0bb3e9be0f87..1c40fa67602ea7b68b6ccb4a9ec569e889424a50 100755 (executable)
@@ -3,7 +3,7 @@ export DRACUT_SYSTEMD=1
 if [ -f /dracut-state.sh ]; then
     . /dracut-state.sh 2> /dev/null
 fi
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 source_conf /etc/conf.d
 
index 90f145afa86ba983d89466d11fce0cf4bf5ef527..350951b53dbcabf895fd3ff38cd8700871252ac2 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 root=$(getarg root=)
 case "${root#block:}" in
index cef3f49054d210c8d30c23e0f3265d3a7740cced..53077a75edb15b5597c9e69f9f3cc4d9dbb1a43d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 generator_wait_for_dev() {
     local _name
index ccefd9de7d99c9e77ea585d613d9527a92ed71aa..c2f8012e8067d4f8b4704069106c584d5591c2a6 100755 (executable)
@@ -7,7 +7,7 @@
 #sysloglevel=level  What level has to be logged
 #syslogtype=rsyslog|syslog|syslogng
 #                   Don't auto detect syslog but set it
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 detect_syslog() {
     syslogtype=""
index 19a7229a9c3110fe8c50c9a1cf272f65e231c9de..9682a8b77ac30fe306c3c0a8f129018ea3b1314f 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Triggered by initqueue/online and starts rsyslogd with bootparameters
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 # prevent starting again if already running
 if [ -f /var/run/syslogd.pid ]; then
index 3fc2a5f70b49ed1b3d5e25b6178aad1775406aec..4f42090fbd872f4c3fc93f05094e16438a9f143f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 # Kills rsyslogd
 
index 2d08d8a7e86a31a237c4a05e38204db2dc93d897..16332919e2c7fe616785dfc56533298a5790c74b 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Just cleans up a previously started syslogd
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if [ -f /tmp/syslog.server ]; then
     read -r syslogtype < /tmp/syslog.type
index 0a3eb324f50fc056fe180f83fcde212081cc3408..1de51bef3d76896b8b8a47095156c3e51a500f60 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-type info > /dev/null 2>&1 || . /lib/dracut-lib.sh
-type fsck_single > /dev/null 2>&1 || . /lib/fs-lib.sh
+command -v info > /dev/null || . /lib/dracut-lib.sh
+command -v fsck_single > /dev/null || . /lib/fs-lib.sh
 
 filtersubvol() {
     local _oldifs
index fe69a6b9d4a625b5cbd0076c9a357981e5935930..e49e27f5cc66da15eb32e6665541ee864a4df5fd 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type wait_for_dev > /dev/null 2>&1 || . /lib/dracut-dev-lib.sh
+command -v wait_for_dev > /dev/null || . /lib/dracut-dev-lib.sh
 
 export DRACUT_SYSTEMD
 export NEWROOT
@@ -803,7 +803,7 @@ wait_for_loginit() {
 }
 
 # pidof version for root
-if ! command -v pidof > /dev/null 2> /dev/null; then
+if ! command -v pidof > /dev/null; then
     pidof() {
         debug_off
         local _cmd
index cc50653e9e62ea0f3a7936fadd57545083785a8c..1451c4b84fd593ad4f9f949010d3bc72fe44b6b3 100755 (executable)
@@ -33,7 +33,7 @@ if [ ! -d /sys/kernel ]; then
 fi
 
 RD_DEBUG=""
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 setdebug
 
index 2c49079340543ab6c94fa8131cf445f65932bd07..46a00d2ad4824730cc82ea03df54d306d97ff983 100755 (executable)
@@ -7,7 +7,7 @@
 
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 while [ $# -gt 0 ]; do
     case "$1" in
index b1f269260751925c4f0e4e9253b4623da7b22592..e11f3c1779656ae28b95db3b0d63a18f1a836253 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 fsck_ask_reboot() {
     info "note - fsck suggests reboot, if you"
@@ -162,7 +162,7 @@ fsck_batch() {
     local _ret
     local _out
 
-    [ $# -eq 0 ] || ! type fsck > /dev/null 2>&1 && return 255
+    [ $# -eq 0 ] || ! command -v fsck > /dev/null && return 255
 
     info "Checking filesystems (fsck -M -T -a):"
     for _dev in "$@"; do
index 45f65c2d7af6b990c8367d5b0224287d89e8a152..b780761740fe98a6d0745243691eb17ad41bdf56 100755 (executable)
@@ -3,7 +3,7 @@
 # memdebug=4 and memdebug=5 requires debug fs to be mounted.
 # And there is no need to umount it.
 
-type getargnum > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getargnum > /dev/null || . /lib/dracut-lib.sh
 
 # "sys/kernel/tracing" has the priority if exists.
 get_trace_base() {
index bce725648d8ec1454e933799d7fa9c946811b039..aa7069942dcdba98f993be918400b5d156c87258 100755 (executable)
@@ -17,7 +17,7 @@ ACTION="$1"
 
 export TERM=linux
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
-type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
+command -v getarg > /dev/null || . /lib/dracut-lib.sh
 
 if [ "$(stat -c '%T' -f /)" = "tmpfs" ]; then
     mount -o remount,rw /