summaryrefslogtreecommitdiffstats
path: root/initrd/mkdxsinitrd
diff options
context:
space:
mode:
authorNico Dietrich2006-01-23 16:09:37 +0100
committerNico Dietrich2006-01-23 16:09:37 +0100
commit740497ea941f6eeefda9347803b15b6512672350 (patch)
tree3e05b63fa99fd82723bca3ce05ec891a25f0311e /initrd/mkdxsinitrd
parentkleine bugfixes in mkdxsinitrd (diff)
downloadcore-740497ea941f6eeefda9347803b15b6512672350.tar.gz
core-740497ea941f6eeefda9347803b15b6512672350.tar.xz
core-740497ea941f6eeefda9347803b15b6512672350.zip
which durch binfinder ersetzt, hw_random blacklisted
git-svn-id: http://svn.openslx.org/svn/openslx/dxs/ld4@32 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/mkdxsinitrd')
-rwxr-xr-xinitrd/mkdxsinitrd22
1 files changed, 19 insertions, 3 deletions
diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd
index a2bfe7d5..01172185 100755
--- a/initrd/mkdxsinitrd
+++ b/initrd/mkdxsinitrd
@@ -47,16 +47,31 @@ D_DEFAULTCOUNTRY="<set in ~/distro-config/distro file>"
# End of global variable declaration, nothing needed to be changed at
# default below that line
+# replaces which to find executables inside ROOTDIR
+binfinder()
+{
+ local PROGRAM="$1"
+ local RET=1
+ for ELEMENT in sbin bin usr/bin usr/local/bin usr/bin/X11; do
+ if [ -f "${ROOTDIR}/$ELEMENT/$PROGRAM" ] && [ -x "${ROOTDIR}/$ELEMENT/$PROGRAM" ]; then
+ printf '%s\n' "${ROOTDIR}/$ELEMENT/$PROGRAM"
+ RET=0
+ break
+ fi
+ done
+ return "$RET"
+}
+
# copy some binary to given destination. Takes binary in $1 and
# destination in $2
cobi()
{
local DEST=$2
-local FPTB=`which $1`
+local FPTB=`binfinder $1`
if [ -z ${FPTB} ] ; then
return 1;
else
- cp ${ROOTDIR}/${FPTB} ${INSTDIR}/${DEST}
+ cp ${FPTB} ${INSTDIR}/${DEST}
fi
}
@@ -85,6 +100,7 @@ fi
}
+
# Resolve dynamic library dependencies. Returns a list of symbolic links
# to shared objects and shared object files for the binaries in $*.
# stolen from SuSE mkinitrd
@@ -349,7 +365,7 @@ done
# one of the dhcp clients
for dhcp in dhclient dhcpcd pump ipconfig ; do
- which $dhcp && break;
+ binfinder $dhcp && break;
done
cobi $dhcp bin
mkdir -p ${INSTDIR}/var/{lib,run}