[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
export PS4="dhclient.$interface.$$ + "
exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
echo "$line"
done >/tmp/dhclient.$netif.dhcpopts
echo online > /sys/class/net/$netif/uevent
- /sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
+ initqueue --onetime --name netroot-$netif netroot $netif
;;
*) echo "dhcp: $reason";;
esac
# We don't need to check for ip= errors here, that is handled by the
# cmdline parser script
#
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
# Run dhclient
do_dhcp() {
- # /sbin/dhclient-script will mark the netif up and generate the online
+ # dhclient-script will mark the netif up and generate the online
# event for nfsroot
# XXX add -V vendor class and option parsing per kernel
echo "Starting dhcp for interface $netif"
echo online > /sys/class/net/$netif/uevent
- /sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
+ initqueue --onetime --name netroot-$netif netroot $netif
}
# Handle static ip configuration
fi >> /tmp/net.$netif.resolv.conf
echo online > /sys/class/net/$netif/uevent
- /sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
+ initqueue --onetime --name netroot-$netif netroot $netif
}
-PATH=$PATH:/sbin:/usr/sbin
-
export PS4="ifup.$1.$$ + "
exec >>/run/initramfs/initlog.pipe 2>>/run/initramfs/initlog.pipe
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
# start bridge if necessary
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
if [ "$ethname" = "$bondname" ] ; then
- DO_BOND_SETUP=yes /sbin/ifup $bondname
+ DO_BOND_SETUP=yes ifup $bondname
else
ip link set $ethname up
fi
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
handler=${netroot%%:*}
handler=${handler%%4}
-handler="/sbin/${handler}root"
+handler=$(command -v ${handler}root)
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
die "No handler for netroot type '$netroot'"
fi
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
# do not ask, if we already have root
[ -f /sysroot/proc ] && exit 0
keypath="${tmp#*:}"
else
info "No key found for $device. Will try later."
- /sbin/initqueue --unique --onetime --settled \
+ initqueue --unique --onetime --settled \
--name cryptroot-ask-$luksname \
- /sbin/cryptroot-ask "$@"
+ $(command -v cryptroot-ask) "$@"
exit 0
fi
unset tmp
{ flock -s 9;
/bin/plymouth ask-for-password \
--prompt "$prompt" --number-of-tries=5 \
- --command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
+ --command="$(command -v cryptsetup) luksOpen -T1 $device $luksname"
} 9>/.console.lock
unset sluksname prompt
for luksid in $LUKS; do
luksid=${luksid##luks-}
{
- printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
- printf 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
- printf 'RUN+="/sbin/initqueue --unique --onetime '
- printf -- '--name cryptroot-ask-%%k /sbin/cryptroot-ask '
- printf '$env{DEVNAME} luks-$env{ID_FS_UUID}"\n'
+ printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
+ printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
+ printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
+ printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
+ printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID}"\n'
} >> /etc/udev/rules.d/70-luks.rules
- printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1\n' $luksid \
+ printf -- '[ -e /dev/disk/by-uuid/*%s* ]\n' $luksid \
>> $hookdir/initqueue/finished/90-crypt.sh
{
- printf '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
- printf 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
+ printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
+ printf -- 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
} >> $hookdir/emergency/90-crypt.sh
done
else
- echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue' \
- '--unique --onetime --name cryptroot-ask-%%k' \
- '/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' \
+ printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s' \
+ '--unique --onetime --name cryptroot-ask-%k' \
+ '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"' \
+ $(command -v initqueue) $(command -v cryptroot-ask) \
>> /etc/udev/rules.d/70-luks.rules
fi
fi
{
- printf 'RUN+="/sbin/initqueue --unique --onetime '
+ printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
printf -- '--name probe-keydev-%%k '
- printf '/sbin/probe-keydev /dev/%%k %s %s"\n' \
- "${keypath}" "${luksdev}"
+ printf -- '%s /dev/%%k %s %s"\n' \
+ $(command -v probe-keydev) "${keypath}" "${luksdev}"
} >&7
done
unset arg keypath keydev luksdev
udevproperty rd_NO_DM=1
fi
-if [ ! -x /sbin/mdadm ] || ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd; then
+if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd; then
info "rd.md.imsm=0: no MD RAID for imsm/isw raids"
udevproperty rd_NO_MDIMSM=1
fi
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
[ -f /tmp/root.info ] && . /tmp/root.info
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
if getargbool 0 rd.live.debug -y rdlivedebug; then
exec > /tmp/liveroot.$$.out
_do_insmodpost=1
done
-[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
+[ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh
unset _do_insmodpost
if [ "$lvmwritten" ]; then
rm -f /etc/lvm/lvm.conf
- ln -s /sbin/lvm-cleanup $hookdir/pre-pivot/30-lvm-cleanup.sh 2>/dev/null
- ln -s /sbin/lvm-cleanup $hookdir/pre-pivot/31-lvm-cleanup.sh 2>/dev/null
+ ln -s $(command -v lvm-cleanup) $hookdir/pre-pivot/30-lvm-cleanup.sh 2>/dev/null
+ ln -s $(command -v lvm-cleanup) $hookdir/pre-pivot/31-lvm-cleanup.sh 2>/dev/null
fi
unset lvmwritten
rm -f /etc/udev/rules.d/64-lvm*.rules
else
for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
- printf '[ -e "/dev/%s" ] || exit 1\n' $dev \
+ printf '[ -e "/dev/%s" ]\n' $dev \
>> $hookdir/initqueue/finished/lvm.sh
{
printf '[ -e "/dev/%s" ] || ' $dev
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
info "Autoassembling MD Raid"
-/sbin/mdadm -As --auto=yes --run 2>&1 | vinfo
+mdadm -As --auto=yes --run 2>&1 | vinfo
udevadm control --stop-exec-queue
# and activate any containers
mdadm -IR $md 2>&1 | vinfo
-ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
-ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
+ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue
done
unset udevinfo
-ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
-ln -s /sbin/mdraid-cleanup $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
+ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
+ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
udevadm control --start-exec-queue
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# We get called like this:
-# /sbin/fcoe-up <network-device> <dcb|nodcb>
+# fcoe-up <network-device> <dcb|nodcb>
#
# Note currently only nodcb is supported, the dcb option is reserved for
# future use.
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Huh? Missing arguments ??
[ -z "$1" -o -z "$2" ] && exit 1
netif=$1
dcb=$2
-/sbin/ip link set "$netif" up
+ip link set "$netif" up
wait_for_if_up "$netif"
if [ "$dcb" = "dcb" ]; then
unset fcoe_mac
unset fcoe_interface
fcoe_mac=$(cat ${nic}/address)
- [ -n "$fcoe_mac" ] && . /sbin/fcoe-genrules.sh
+ [ -n "$fcoe_mac" ] && . $(command -v fcoe-genrules.sh)
fi
done
done
if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then
warn "Invalid FCoE DCB option: $fcoe_dcb"
fi
- . /sbin/fcoe-genrules.sh
+ . $(command -v fcoe-genrules.sh)
done
fi
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Huh? Empty $1?
[ -z "$1" ] && exit 1
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Huh? Empty $1?
[ -z "$1" ] && exit 1
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
-PATH=$PATH:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Huh? Empty $1?
[ -z "$1" ] && exit 1
# Start rpcbind or rpcbind
# FIXME occasionally saw 'rpcbind: fork failed: No such device' -- why?
-[ -x /sbin/portmap ] && [ -z "$(pidof portmap)" ] && portmap
-[ -x /sbin/rpcbind ] && [ -z "$(pidof rpcbind)" ] && rpcbind
+command -v portmap >/dev/null && [ -z "$(pidof portmap)" ] && portmap
+command -v rpcbind >/dev/null && [ -z "$(pidof rpcbind)" ] && rpcbind
if [ "$nfs" = "nfs4" ]; then
[ ! -d /var/lib/nfs/rpc_pipefs/nfs ] && \
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
[ -s /.resume -a -b "$resume" ] && {
# First try user level resume; it offers splash etc
case "$splash" in
a_splash="-P splash=n"
;;
esac
- [ -x /usr/sbin/resume ] && /usr/sbin/resume $a_splash "$resume"
+ [ -x $(command -v resume) ] && command resume $a_splash "$resume"
# parsing the output of ls is Bad, but until there is a better way...
ls -lH "$resume" | (
# echo 0x5022000000000000 > /sys/bus/ccw/drivers/zfcp/0.0.4000/0x5005076300c213e9/unit_add
CONFIG=/etc/zfcp.conf
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [ -f "$CONFIG" ]; then
if [ ! -d /sys/bus/ccw/drivers/zfcp ]; then
template=/etc/templates/rsyslog.conf
if [ -n "$server" ]; then
rsyslog_config "$server" "$template" "$filters" > $conf
- /sbin/rsyslogd -c3
+ rsyslogd -c3
fi
if [ -f /tmp/syslog.server ]; then
read syslogtype < /tmp/syslog.type
- if [ -e "/sbin/${syslogtype}-stop" ]; then
+ if command -v "${syslogtype}-stop" >/dev/null; then
${syslogtype}-stop
else
warn "syslog-cleanup: Could not find script to stop syslog of type \"$syslogtype\". Syslog will not be stopped."
done
[ $i -eq 10 ] && kill %1 >/dev/null 2>&1
- while pidof -x /sbin/loginit >/dev/null 2>&1; do
- for pid in $(pidof -x /sbin/loginit); do
+ while pidof -x $(command -v loginit) >/dev/null 2>&1; do
+ for pid in $(pidof -x $(command -v loginit)); do
kill $HARD $pid >/dev/null 2>&1
done
HARD="-9"
if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
getarg quiet && DRACUT_QUIET="yes"
mkfifo /run/initramfs/initlog.pipe
- /sbin/loginit $DRACUT_QUIET </run/initramfs/initlog.pipe >/dev/console 2>&1 &
+ loginit $DRACUT_QUIET </run/initramfs/initlog.pipe >/dev/console 2>&1 &
exec >/run/initramfs/initlog.pipe 2>&1
else
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
# Copyright 2008-2010, Red Hat, Inc.
# Harald Hoyer <harald@redhat.com>
+PATH=/usr/sbin:/usr/bin:/sbin:/bin
+
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
while [ $# -gt 0 ]; do
job=${job##*/}
fi
+exe=$1
+shift
+
+[ -x "$exe" ] || exe=$(command -v $exe)
if [ -n "$onetime" ]; then
{
echo '[ -e "$job" ] && rm "$job"'
- echo "$@"
+ echo "$exe $@"
} > "/tmp/$$-${job}.sh"
else
- echo "$@" > "/tmp/$$-${job}.sh"
+ echo "$exe $@" > "/tmp/$$-${job}.sh"
fi
mv -f "/tmp/$$-${job}.sh" "$hookdir/initqueue${qname}/${job}.sh"