summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-02-28 00:08:58 +0100
committerDirk von Suchodoletz2008-02-28 00:08:58 +0100
commit6ca4b7999c3f75a4598db6c675934408d3aa3c2a (patch)
treedfd16dfe745199af4308b2c67ed3ea3743d02430 /initramfs
parent* fixed incorrect use of quotes (spotted by Dirk) (diff)
downloadcore-6ca4b7999c3f75a4598db6c675934408d3aa3c2a.tar.gz
core-6ca4b7999c3f75a4598db6c675934408d3aa3c2a.tar.xz
core-6ca4b7999c3f75a4598db6c675934408d3aa3c2a.zip
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
Diffstat (limited to 'initramfs')
-rw-r--r--initramfs/cdboot/README.isolinux1
-rwxr-xr-xinitramfs/cdboot/init24
2 files changed, 13 insertions, 12 deletions
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\