From 6ca4b7999c3f75a4598db6c675934408d3aa3c2a Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 27 Feb 2008 23:08:58 +0000 Subject: Some changes to cdboot init. The next busybox should contain the ipcalc applet (to replace shell code in functions) and do not need the hostid applet. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1582 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/cdboot/README.isolinux | 1 - initramfs/cdboot/init | 24 +++++++++++++----------- tools/busybox.config | 6 +++--- 3 files changed, 16 insertions(+), 15 deletions(-) delete mode 100644 initramfs/cdboot/README.isolinux diff --git a/initramfs/cdboot/README.isolinux b/initramfs/cdboot/README.isolinux deleted file mode 100644 index 307d279c..00000000 --- a/initramfs/cdboot/README.isolinux +++ /dev/null @@ -1 +0,0 @@ -Part of syslinux package of HPA. Needed to create a ISO boot image. diff --git a/initramfs/cdboot/init b/initramfs/cdboot/init index 88cb04a3..40368351 100755 --- a/initramfs/cdboot/init +++ b/initramfs/cdboot/init @@ -1,5 +1,5 @@ #!/bin/ash -# Copyright (c) 2007 - OpenSLX GmbH +# Copyright (c) 2008 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -9,11 +9,12 @@ # # General information about OpenSLX can be found at http://openslx.org # -# Main script for cd-boot demo initial ramdisk - preloading environment for +# Main script for cd-boot demo initial ramfs - preloading environment for # for running OpenSLX linux stateless clients version 4 for testing ############################################################################# -# compute prefix bit number from netmask +# helper function: compute prefix bit number from netmask +# fixme: replace with ipcalc -p $ip $netmask nm2pref () { set $(IFS="."; echo $1) local n=0 @@ -130,22 +131,21 @@ ip link set dev lo up ip addr add 127.0.0.1/8 dev lo ip link set dev $nwif up || echo "I did not find any usable network adaptor." -# start udhcpc here +# start udhcpc, if no lease could be optained, start debug shell mkdir -p /usr/share/udhcpc echo -e "#!/bin/ash\nunset infomsg HOME IFS mask lease interface DEBUGLEVEL \ BOOT_IMAGE\nset >/tmp/ipstuff" >/usr/share/udhcpc/default.script chmod u+x /usr/share/udhcpc/default.script modprobe -q af_packet [ -n $vci ] && vci="-V $vci" -udhcpc -n -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null || \ - echo "No answer from a DHCP server received"; /bin/ash +udhcpc -n -q $vci -s /usr/share/udhcpc/default.script -i $nwif 2>/dev/null if test -e /tmp/ipstuff ; then . /tmp/ipstuff for i in $dns ; do echo "nameserver $i" >> /etc/resolv.conf done else - echo "Did not get any proper IP configuration" + echo "Did not get any proper IP configuration"; /bin/ash fi ip addr add $ip/$(nm2pref $subnet) dev $nwif ip route add default via $router @@ -153,10 +153,12 @@ ip route add default via $router # at this point a little selection script could be downloaded, which lets the # user choose what kind of SLX client he wants to get -# get kernel and initramfs -( wget -q -c -O /tmp/kernel ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/kernel && \ -wget -q -c -O /tmp/iramfs ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/iramfs ) || \ -/bin/ash +# get kernel and initramfs, if something fails start debug shell +( wget -q -c -O /tmp/kernel \ + ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/kernel 2>/dev/null && \ +wget -q -c -O /tmp/iramfs \ + ftp://openslx:OpenS1X@archive.ruf.uni-freiburg.de/iramfs 2>/dev/null ) || \ + /bin/ash # start the new kernel with initialramfs and cmdline kexec -l /tmp/kernel --initrd=/tmp/iramfs --append="ip=$ip:$siaddr:$router:$subnet\ diff --git a/tools/busybox.config b/tools/busybox.config index e76a8114..aca058db 100644 --- a/tools/busybox.config +++ b/tools/busybox.config @@ -172,7 +172,7 @@ CONFIG_FALSE=y # CONFIG_FOLD is not set CONFIG_HEAD=y # CONFIG_FEATURE_FANCY_HEAD is not set -CONFIG_HOSTID=y +# CONFIG_HOSTID is not set CONFIG_ID=y # CONFIG_INSTALL is not set # CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set @@ -611,8 +611,8 @@ CONFIG_FEATURE_IP_TUNNEL=y # CONFIG_IPROUTE is not set # CONFIG_IPTUNNEL is not set # CONFIG_IPRULE is not set -# CONFIG_IPCALC is not set -# CONFIG_FEATURE_IPCALC_FANCY is not set +CONFIG_IPCALC=y +CONFIG_FEATURE_IPCALC_FANCY=y # CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set # CONFIG_NAMEIF is not set # CONFIG_FEATURE_NAMEIF_EXTENDED is not set -- cgit v1.2.3-55-g7522