summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/init
diff options
context:
space:
mode:
authorDirk von Suchodoletz2006-04-07 06:41:50 +0200
committerDirk von Suchodoletz2006-04-07 06:41:50 +0200
commit03c9f97c49c93f1979a0f568c1f9b22c619d9590 (patch)
tree78f50c284e8b2c67cdda8a1304bcf816b87e80fc /initrd/initrd-stuff/init
parentminor corrections ... (diff)
downloadcore-03c9f97c49c93f1979a0f568c1f9b22c619d9590.tar.gz
core-03c9f97c49c93f1979a0f568c1f9b22c619d9590.tar.xz
core-03c9f97c49c93f1979a0f568c1f9b22c619d9590.zip
fix for ip= line configuration problem with etherboot
git-svn-id: http://svn.openslx.org/svn/openslx/ld4@172 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/init')
-rwxr-xr-xinitrd/initrd-stuff/init23
1 files changed, 14 insertions, 9 deletions
diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init
index a3af01d5..859bbbfb 100755
--- a/initrd/initrd-stuff/init
+++ b/initrd/initrd-stuff/init
@@ -2,11 +2,11 @@
# Description: main script for new type of initial ramdisk for
# linux diskless clients version 4
#
-# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 06-04-2006
+# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 07-04-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
-# Version: 0.2.4c
+# Version: 0.2.4d
# functions common for all distros, messages contains all error and info
# output
@@ -183,12 +183,16 @@ ipsetup 127.0.0.1 255.0.0.0 0.0.0.0 127.255.255.255 lo
# analyze ip information from the kernel command line and put parts
# of it into several variables
if [ -n "$IPINFO" ] ; then
- IP=`echo $IPINFO|sed -e "s/:.*//"`
- SERVER=`echo $IPINFO|sed -e "s/[0-9\.]\{3,\}://;s/:.*//"`
- GW=`echo $IPINFO|sed -e "s/[0-9\.]\{3,\}:[0-9\.]\{3,\}://;s/:.*//"`
- # remove last colon after netmask if it was left there ...
- IPINFO=`echo $IPINFO|sed -e "s/:$//"`
- NM=`echo $IPINFO|sed -e "s/.*://"`
+ getip () {
+ val=$IPINFO; i=$(expr $1 - 1);
+ while [ $i -gt 0 ] ; do
+ val=${val#*:} ; i=$(expr $i - 1);
+ done;
+ echo $val|sed "s/:.*//"; }
+ IP=$(getip 1)
+ SERVER=$(getip 2)
+ GW=$(getip 3)
+ NM=$(getip 4)
echo -e "# ip configuration written by $0 script\nclientip=$IP\n\
sub_netmask=$NM\ngateway=$GW\nserverip=$SERVER" \
>>/etc/machine-setup
@@ -442,5 +446,6 @@ umount -n /proc
[ -n "${UNIONFS}" ] && mount -n --move /root /mnt/mnt
# unset old environment variables
unset debug date initrd ip nfsroot vci
-# new style of pivoting
+unset KERNEL NWMODULES
+# new style of pivoting (exec -c would set an empty environment in bash)
exec run-init -c dev/console /mnt /sbin/init || error "$init_runinit"