diff options
author | Dirk von Suchodoletz | 2006-06-30 01:27:12 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-06-30 01:27:12 +0200 |
commit | ac5635ae692d39c7fe837155651049d432c93333 (patch) | |
tree | c3d34fbbc5f219fb8110d75595628e9e8bcbfbe3 /initrd/mkdxsinitrd | |
parent | bootsplash bugfix (diff) | |
download | core-ac5635ae692d39c7fe837155651049d432c93333.tar.gz core-ac5635ae692d39c7fe837155651049d432c93333.tar.xz core-ac5635ae692d39c7fe837155651049d432c93333.zip |
Initial support for busybox, update of hwsetup and hw configuration data
...
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@262 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/mkdxsinitrd')
-rwxr-xr-x | initrd/mkdxsinitrd | 115 |
1 files changed, 67 insertions, 48 deletions
diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 1f7c9117..44983e80 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -3,14 +3,14 @@ # Description: universal (distro independent) generator for initial # ramdisks for linux diskless clients # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 27-06-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 29-06-2006 # Nico Dietrich # Felix Endres # # Copyright: (c) 2003 - 2006 - RZ Universitaet Freiburg # (c) 2006 - odlx.org project # -# Version: 0.4.1a +# Version: 0.4.5a # debug level of script itself DEBUG=1 @@ -59,10 +59,11 @@ D_DEFAULTCOUNTRY="<set in ~/distro-config/distro file>" usage() { - echo -e "mkdxsinitrd [-gh] [-k kernel version] [-i path/file] \ + echo -e "mkdxsinitrd [-bgh] [-k kernel version] [-i path/file] \ [-f module(s)] [-n module(s)] [-r path] [-s splashsize]\n" echo "OPTIONEN" echo " -g Benutze glibc als Basisbibliothek in der ramdisk." + echo " -b Use busybox instead of separate binaries." echo " -h Zeige Informationen zur Benutzung." echo " -k Kernelversion" echo " mkdxsinitrd versucht die aktuellste Kernelversion zu finden." @@ -158,6 +159,8 @@ else -e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \ -e "s,@@@DATE@@@,${DATE},g;/^#[^!].*/d" \ initrd-stuff/${FILENAME} >> ${INSTDIR}/${FILENAME} + [ -n $use_busybox ] && sed -e "s,/bin/sh,/bin/ash," \ + -i ${INSTDIR}/${FILENAME} fi fi } @@ -265,7 +268,7 @@ done ######################################################################### # End of function declaration -while getopts :hgk:i:r:o:s:f:n:Sut:d:v:I:V:a: a ; do +while getopts :bhgk:i:r:o:s:f:n:Sut:d:v:I:V:a: a ; do case $a in \:|\?) case $OPTARG in @@ -286,6 +289,7 @@ while getopts :hgk:i:r:o:s:f:n:Sut:d:v:I:V:a: a ; do esac exit 1 ;; + b) use_busybox=1;; g) use_glibc=1;; k) KERNVER=$OPTARG;; i) INITRD_PATH=$OPTARG ;; @@ -414,55 +418,69 @@ mknod ${INSTDIR}/tmp/null c 1 3 &>/dev/null mknod ${INSTDIR}/tmp/kmsg c 1 11 &>/dev/null mknod ${INSTDIR}/tmp/ctl b 241 255 &>/dev/null -# find and copy a shell to be used within initialramfs -for bbins in bash ash sh; do - if cobi ${bbins} bin ; then - ln -fs ${bbins} ${INSTDIR}/bin/sh - [ "${bbins}" != "bash" ] && ln -fs ${bbins} ${INSTDIR}/bin/bash - break - else echo "Binary not found (${bbins})"; fi -done - -# find and copy ip setup binaries -for bbins in ip ifconfig; do - if cobi ${bbins} bin ; then - [ "${bbins}" = "ifconfig" ] && cobi route bin - break - else echo "Binary not found"; fi -done - -# needed standard binaries (in init, servconfig, hwautocfg, ... scripts) -for bbins in \ - cat chmod chown chroot cp expr fdisk killall ln ls mkdir mkfs.ext2 \ - modprobe mount portmap rmmod sed sort rm tar umount - do - cobi ${bbins} bin || echo "Program ${bbins} not found" -done +# test for the existance of busybox +if [ -x busybox -a "$use_busybox" = 1 ] ; then + cp busybox ${INSTDIR}/bin + for bbins in [ arping ash cat chmod chown chroot cp date \ + dd df dmesg echo expr fdisk free hwclock insmod ip \ + kill killall ln ls lsmod mkdir mke2fs mkfs.ext2 \ + mkfs.ext3 mknod modprobe mount mv ps rdate rm rmmod \ + sed sort switch_root tar test tftp time udhcpc \ + umount uname usleep vconfig vi; do + ln -s /bin/busybox ${INSTDIR}/bin/$bbins + done +else + # find and copy a shell to be used within initialramfs + for bbins in bash ash sh; do + if cobi ${bbins} bin ; then + ln -fs ${bbins} ${INSTDIR}/bin/sh + [ "${bbins}" != "ash" ] && ln -fs ${bbins} ${INSTDIR}/bin/ash + [ "${bbins}" != "bash" ] && ln -fs ${bbins} ${INSTDIR}/bin/bash + break + else echo "Binary not found (${bbins})"; fi + done -# one of the dhcp clients -for dhcp in dhclient dhcpcd pump ipconfig ; do - binfinder $dhcp && break; -done -cobi $dhcp bin -mkdir -p ${INSTDIR}/var/{lib,run} - -# tftp client binary for configuration via file - get machine-setup per -# tftp from dhcp (or specified other) server -#fixme: irgendwann mal nur konditional ... -for tftp in atftp tftp ; do - binfinder $tftp && break -done -cobi $tftp bin -cp /lib/libnss_files.so.2 ${INSTDIR}/lib + # find and copy ip setup binaries + for bbins in ip ifconfig; do + if cobi ${bbins} bin ; then + [ "${bbins}" = "ifconfig" ] && cobi route bin + break + else echo "Binary not found"; fi + done -# binaries useful for debugging purposes -if [ $IRFSDEBUG -gt 2 ] ; then + # needed standard binaries (in init, servconfig, hwautocfg, ... scripts) for bbins in \ - date lsmod lsof ps strace time - do + cat chmod chown chroot cp expr fdisk killall ln ls mkdir mkfs.ext2 \ + modprobe mount rmmod sed sort rm tar umount + do cobi ${bbins} bin || echo "Program ${bbins} not found" -done + done + + # binaries useful for debugging purposes + if [ $IRFSDEBUG -gt 2 ] ; then + for bbins in \ + date lsmod lsof ps strace time + do + cobi ${bbins} bin || echo "Program ${bbins} not found" + done + fi + + # tftp client binary for configuration via file - get machine-setup per + # tftp from dhcp (or specified other) server + #fixme: irgendwann mal nur konditional ... + for tftp in atftp tftp ; do + binfinder $tftp && break + done + cobi $tftp bin + cp /lib/libnss_files.so.2 ${INSTDIR}/lib fi + +# one of the dhcp clients +#for dhcp in dhclient dhcpcd pump ipconfig ; do +# binfinder $dhcp && break; +#done +#cobi $dhcp bin +#mkdir -p ${INSTDIR}/var/{lib,run} # type of hotplug/udev/dev (for etc directories see above!!) for bbins in udev udevd udevstart udevtrigger udevsend @@ -472,6 +490,7 @@ for bbins in udev udevd udevstart udevtrigger udevsend done # if nfs is used as clients root filesystem +cobi portmap bin mkdir -p ${INSTDIR}/var/lib/nfs/state # if nbd or dnbd is used as clients root filesystem |