fix: use find_binary

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>
master
Zoltán Böszörményi 2021-02-07 15:01:49 +01:00 committed by Jóhann B. Guðmundsson
parent bbe1434fca
commit 433a9ec014
9 changed files with 12 additions and 12 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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" \

View File

@ -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

View 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