aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-07-23 22:56:28 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-07-24 00:56:47 +0200
commit81b8f5d615cec53aaf93e6bc11540d45a92d038d (patch)
treea40bfa1f1e3023db71641f68e147e50d415b0485 /defaults/linuxrc
parentdefaults/initrd.scripts: openLUKS(): Fix style (diff)
downloadgenkernel-81b8f5d615cec53aaf93e6bc11540d45a92d038d.tar.gz
genkernel-81b8f5d615cec53aaf93e6bc11540d45a92d038d.tar.bz2
genkernel-81b8f5d615cec53aaf93e6bc11540d45a92d038d.zip
defaults/linuxrc: Make use of PATH
Don't use absolute paths. Use 'hash' to test if command is available. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'defaults/linuxrc')
-rw-r--r--defaults/linuxrc16
1 files changed, 8 insertions, 8 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc
index f1357f67..7e3b388c 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -40,11 +40,11 @@ echo 1 > /proc/sys/kernel/printk
if [ ! -s /etc/ld.so.cache ]
then
# Looks like we were unable to run ldconfig during initramfs generation
- [ -x /sbin/ldconfig ] && run /sbin/ldconfig
+ hash ldconfig >/dev/null 2>&1 && run ldconfig
fi
# Set up symlinks
-run /bin/busybox --install -s
+run busybox --install -s
gk_ver="$(cat /etc/build_id)"
gk_build_date="$(cat /etc/build_date)"
@@ -460,7 +460,7 @@ fi
if [ "${GK_BOOTFONT_DISABLED}" = '0' -a -e /lib/console/font ]
then
- [ -x /usr/sbin/setfont ] && run /usr/sbin/setfont /lib/console/font -C ${CONSOLE} 2>&1
+ hash setfont >/dev/null 2>&1 && run setfont /lib/console/font -C ${CONSOLE} 2>&1
fi
quiet_kmsg
@@ -578,7 +578,7 @@ run mdev -s || bad_msg "mdev -s failed"
cd /
# Start iSCSI
-if [ -e /bin/iscsistart ]
+if hash iscsistart >/dev/null 2>&1
then
start_iscsi
fi
@@ -1148,7 +1148,7 @@ FSTAB
do
tarname=$(basename ${targz})
good_msg "Adding additional package ${tarname}"
- (cd ${NEW_ROOT} ; /bin/tar -xf ${targz})
+ (cd ${NEW_ROOT} ; tar -xf ${targz})
done
fi
fi
@@ -1359,15 +1359,15 @@ init=${REAL_INIT:-/sbin/init}
if ! mountpoint "${CHROOT}" 1>/dev/null 2>&1
then
bad_msg "${CHROOT} was not a mountpoint"
-elif chroot "${CHROOT}" /usr/bin/test ! -x /${init#/}
+elif chroot "${CHROOT}" test ! -x /${init#/}
then
bad_msg "init=${init} does not exist in the rootfs!"
elif [ $$ != 1 ]
then
bad_msg "PID was not 1! switch_root would fail"
else
- good_msg "Switching to real root: /sbin/switch_root -c /dev/console ${CHROOT} ${init} ${init_opts}"
- exec /sbin/switch_root -c "/dev/console" "${CHROOT}" "${init}" ${init_opts}
+ good_msg "Switching to real root: switch_root -c /dev/console ${CHROOT} ${init} ${init_opts}"
+ exec switch_root -c "/dev/console" "${CHROOT}" "${init}" ${init_opts}
fi
# If we get here, something bad has happened