diff options
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 53 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 19 |
2 files changed, 13 insertions, 59 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 060a8efe..829cfd5f 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -243,32 +243,6 @@ done brctl addif ${bridge} ${pdev} } ############################################################################# -# configure IP address statically - first argument the ip address, second the -# netmask, then gateway and broadcast address and last interface. All -# arguments have to be present. -ipsetup () { -local ip=$1 -local nm=$2 -local gw=$3 -local bc=$4 -local if=$5 -local ret=0 -ip link set dev $if up 2>/dev/null || ret=1 -ip addr add $ip/`nm2pref $nm` broadcast $bc dev $if 2>/dev/null -if [ "$gw" != "0.0.0.0" ] ; then - ip route add default via $gw 2>/dev/null -fi -MAC=$(ip link show dev $if|sed -n "/ether [0-9e-f]\{2\}:.*/p" \ - | sed -e "s/.*ether //;s/ .*//") -# if multicast is required for dnbd -[ -n "$nbdhost" -a "$ip" != 127.0.0.1 ] && { nbdhost=$(checkip $nbdhost) - [ $(echo $nbdhost|sed "s,\..*,,") -ge 224 ] && \ - ip route add 224.0.0.0/4 dev $if; } -# if something got wrong with the setup of the primary ethernet interface -[ $ret -gt 0 -a $if = "eth0" ] && error "$init_noeth" -return $ret -} -############################################################################# # replace @@@serverip@@@ with real serverip. Allows the usage of a variable # for the server ip address (e.g. in machine-setup or kernel commandline) checkip () @@ -279,7 +253,6 @@ else echo $1 fi } - ############################################################################# # nfs mounter for root filesystem and other sources nfsmnt () @@ -1029,47 +1002,38 @@ WallpaperMode=NoWallpaper" \ checkgraphix () { : } - # overwrite xorg configuration set by hwautocfg displayvars () { : } - # function for ntp configuration config_ntp () { : } - # function for afs config_afs () { : } - # function for atd config_atd () { : } - # function for configuration of cron services config_cron () { : } - # syslog service config_syslog () { : } - # secure shell service config_sshd () { : } - # snmp agent for remote monitoring config_snmp () { : } - # consolefont consolefont () { : @@ -1078,83 +1042,66 @@ consolefont () { config_acpi () { : } - # configure xdm as display manager config_xdm () { : } - # configure kdm as display manager config_kdm () { : } - # configure gdm as display manager config_gdm () { : } - # configure hal, dbus, resmgr and services like that config_dreshal () { : } - # configure automounter, simple NFSv3 imports only config_automount () { : } - # configure print services / start requested printer daemon config_printer () { : } - # configure bluetooth services config_bt () { : } - # create a compliant runlevel script, needed for boot.slx and vmware-prep d_mkrlscript () { : } - # start name service caching daemon config_nscd () { : } - # prepare virtual machine environment (vmware, vmplayer) config_vmware () { : } - # configure automounter config_automount () { : } - # configure samba service (not winbind, but nmbd, smbd) config_samba () { : } - - # start portmapper (needed at least for nfs and nis services) config_portmap () { : } - # start nis/ypbind config_nis () { : } - # configure nfsv4 stuff config_nfsv4 () { : } - # configure keyboard layout keytable () { : diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 42044d53..a2867471 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -295,12 +295,15 @@ else fi # load network adaptor modules hwautocfg nwmod +#error "$init_noeth" -# set up loopback networking (ipsetup - function defined in /etc/functions) +# set up loopback networking [ $DEBUGLEVEL -eq 20 ] && echo "** starting ip config at $(sysup)" -ipsetup 127.0.0.1 255.0.0.0 0.0.0.0 127.255.255.255 lo +ip link set dev lo up +ip addr add 127.0.0.1/8 dev lo +ip link set dev eth0 up -# Xen bridge config +# XEN bridge config [ -n "$xenbr" ] && xenbr_config # analyze ip information from the kernel command line and put parts @@ -319,8 +322,9 @@ if [ -n "$ipinfo" ] ; then echo -e "# ip configuration written by $0 script\nclientip=$clientip\n\ subnet_mask=$subnet_mask\ngateway=$gateway\nserverip=$serverip" \ >>/etc/machine-setup - # set static ip address via function ipsetup - ipsetup $clientip $subnet_mask $gateway 255.255.255.255 eth0 + # set static ip address + ip addr add $clientip/$(nm2pref $subnet_mask) dev eth0 + ip route add default via $gateway else noipyet="yes" fi @@ -333,7 +337,8 @@ if [ -n "$noipyet" ] ; then [ -f /tmp/confviadhcp ] && . /tmp/confviadhcp [ -z "$clientip" -o -z "$subnet_mask" -o -z "$gateway" \ -o -z "$broadcast_address" ] && error "$init_errdhcp" - ipsetup $clientip $subnet_mask $gateway $broadcast_address eth0 + ip addr add $clientip/$(nm2pref $subnet_mask) broadcast $broadcast_address \ + dev eth0 fi # check if serverip is set as variable @@@serverip@@@ sed "s,@@@serverip@@@,$serverip," -i /etc/machine-setup @@ -380,6 +385,8 @@ if [ -n "${nbdmod}" ] ; then clientopt="-c /dnbd/cache" waitfor /tmp/cache 10000 fi + [ $(echo $nbdhost|sed "s,\..*,,") -ge 224 ] && \ + ip route add 224.0.0.0/4 dev eth0 waitfor /dev/dnbd0 10000 || error "$init_nbddev" while ! dnbd-client -b $nbdhost -d /dev/dnbd0 $clientopt ; do usleep 100 |