summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
Diffstat (limited to 'initramfs/initrd-stuff/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions18
1 files changed, 18 insertions, 0 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions
index 543b1887..1690b03b 100644
--- a/initramfs/initrd-stuff/etc/functions
+++ b/initramfs/initrd-stuff/etc/functions
@@ -195,6 +195,24 @@ else
fi
}
#############################################################################
+# replacement for which command to find executables inside stage4 rootfs
+binfinder()
+{
+local program="$1"
+local s4path
+local notfound=1
+for s4path in bin sbin usr/bin usr/sbin usr/local/bin \
+ usr/local/sbin usr/bin/X11; do
+ if [ -f "/mnt/$s4path/$program" ] && \
+ [ -x "/mnt/$s4path/$program" ]; then
+ printf '%s\n' "/$s4path/$program"
+ notfound=0
+ break
+ fi
+done
+return $notfound
+}
+#############################################################################
# disk formatter and mounter. some proper error message output should be
# added
diskfm () {