diff options
author | Dirk von Suchodoletz | 2007-04-28 14:37:27 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-04-28 14:37:27 +0200 |
commit | 953a3090ab7cb1f55ebf5e335aa531a9086d79f4 (patch) | |
tree | cb81391ece935e8106e72e8909aea0b72eaceab2 /initramfs | |
parent | Simplification of (u)sleep (applets in busybox) (diff) | |
download | core-953a3090ab7cb1f55ebf5e335aa531a9086d79f4.tar.gz core-953a3090ab7cb1f55ebf5e335aa531a9086d79f4.tar.xz core-953a3090ab7cb1f55ebf5e335aa531a9086d79f4.zip |
Further simplifications and cleanups (because of busybox switchover)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@939 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rwxr-xr-x | initramfs/initrd-stuff/bin/dhcpmkconfig | 22 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwautocfg | 2 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 62 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/messages | 7 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/messages.de | 7 |
5 files changed, 28 insertions, 72 deletions
diff --git a/initramfs/initrd-stuff/bin/dhcpmkconfig b/initramfs/initrd-stuff/bin/dhcpmkconfig index 57f6ddee..9726d51b 100755 --- a/initramfs/initrd-stuff/bin/dhcpmkconfig +++ b/initramfs/initrd-stuff/bin/dhcpmkconfig @@ -1,15 +1,18 @@ #!/bin/sh +# Copyright (c) 2003 - 2006 - RZ Uni Freiburg +# Copyright (c) 2006, 2007 - OpenSLX GmbH # -# universal (distro independent) IP configuration writer for several dhcp -# clients used within OpenSLX initramfs. The result is written in unified -# form to the /etc/machine-setup file +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 09-01-2007 -# Lars Mueller, 23-06-2006 -# Oliver Tappe, 23-06-2006 -# Michael Janczyk, 09-01-2007 +# General information about OpenSLX can be found under http://openslx.org # -# (c) 2006 - RZ Universitaet Freiburg +# Universal (distro independent) IP configuration writer for several dhcp +# clients used within OpenSLX initramfs. The result is written in unified +# form to the /etc/machine-setup file # client variable should be exported via calling function cfgfile="/tmp/confviadhcp" @@ -52,9 +55,6 @@ enabled via kernel command\n# line)." >>$cfgfile >>$cfgfile fi ;; - *pump*) - dhcl="pump"; echo -e "$cfgmsg\n$infomsg" >>$cfgfile - ;; *udhcpc*) dhcl="udhcpc"; echo -e "$cfgmsg\n$infomsg" >>$cfgfile # if $cfgfile is changed change target for set output accordingly diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg index 7b023015..1d3381a1 100755 --- a/initramfs/initrd-stuff/bin/hwautocfg +++ b/initramfs/initrd-stuff/bin/hwautocfg @@ -10,7 +10,7 @@ # # General information about OpenSLX can be found under http://openslx.org # -# universal (distro independent) hardware autoconfiguration script for +# Universal (distro independent) hardware autoconfiguration script for # OpenSLX linux diskless clients, using hwconfig from knoppix as base tool ############################################################################# diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index f42c4d0b..060a8efe 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -253,44 +253,17 @@ local gw=$3 local bc=$4 local if=$5 local ret=0 -for ipcfg in ip ifconfig none; do - test -x /bin/$ipcfg && break; -done -case $ipcfg in - # the standard linux ip configuration tool - ip) - 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; } - ;; - # traditional ifconfig/route - if a distro does not provide ip - ifconfig) - if [ "$ip" = "0.0.0.0" ]; then - ifconfig $if up || ret=1 - else - ifconfig $if $ip netmask $nm broadcast $bc || ret=1 - fi - [ "$gw" != "0.0.0.0" ] && route add default gw $gw - MAC=$(ifconfig $if|sed -n "/HWaddr [0-9A-F]\{2\}:.*/p" \ - | sed -e "s/.*HWaddr //;y/ABCDEF/abcdef/") - # if multicast is required for dnbd - [ -n "$nbdhost" -a "$ip" != 127.0.0.1 ] && { nbdhost=$(checkip $nbdhost) - [ $(echo $nbdhost|sed "s,\..*,,") -ge 224 ] && \ - route add -net 224.0.0.0 netmask 240.0.0.0 dev $if; } - ;; - none) - error "$error_iptool" - ret=1 - ;; -esac +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 @@ -358,7 +331,7 @@ fi rundhcp () { local vci="$1" -for dhcp in dhclient dhcpcd udhcpc none; do +for dhcp in dhclient udhcpc none; do test -e /bin/$dhcp && break; done if [ "$dhcp" = "none" ] ; then @@ -367,8 +340,7 @@ else # ensure the interface is up - might produce conflicts - nbd could # fail!! [ -n "$noipyet" ] && \ - ipsetup 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255 eth0 \ - 2>/dev/null + ip link set dev eth0 up [ -f /lib/modules/@@@KERNVER@@@/kernel/net/packet/af_packet.ko ] && \ loadmod /lib/modules/@@@KERNVER@@@/kernel/net/packet/af_packet.ko \ "needed for dhcp"; @@ -383,13 +355,7 @@ case $dhcp in dhclient -cf /etc/dhclient.conf -lf /var/lib/dhcp/dhclient.leases \ -q eth0 >/dev/null 2>&1 || error "$error_dhclient" ;; - dhcpcd) - [ -n $vci ] && vci="-i $vci" - ln -s /bin/dhcpmkconfig /bin/dhcpcd.exe - dhcpcd $vci -L /var/lib/dhcp -c /bin/dhcpcd.exe -T -t 30 eth0 \ - >/dev/null 2>&1 || error "$error_dhcpcd" - ;; - # udhcpc is part of busybox + # udhcpc is a busybox applet udhcpc) [ -n $vci ] && vci="-V $vci" testmkd /usr/share/udhcpc diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages index 39f6c2bb..e550401b 100644 --- a/initramfs/initrd-stuff/etc/messages +++ b/initramfs/initrd-stuff/etc/messages @@ -9,7 +9,7 @@ # # General information about OpenSLX can be found at http://openslx.org # -# messages file for all error and info messages generated during client +# Messages file for all error and info messages generated during client # bootup (within initialramfs) for OpenSLX linux diskless clients version 4 # this file could be used for localization of error messages @@ -113,9 +113,6 @@ error_nfe="\n -> This error is not fatal - continuing ...\n" error_shell="\n -> Running shell for debugging purposes now ...\n" error_modload="Failed to load module " error_modnfs="needed for mounting rootfs" -error_iptool=" No tool for local IP configuration found. You should at \ -least add\n one of the following programs to your ramdisk: ip \ -ipconfig\n ifconfig." error_portm=" Portmapper should be present, if normal mount \ command is used. Please\n check your initial ramdisk setup (mkdxsinitrd)." error_mntt=" No suitable mount tool found." @@ -128,8 +125,6 @@ error_dhcp=" The following problems could produce that error:\n\ was loaded nor present in kernel.\n You might want to run 'lsmod'." error_dhclient=" Fatal error occured while trying to run dhclient.\n\ $error_dhcp" -error_dhcpcd=" Fatal error occured while trying to run dhcpcd.\n$error_dhcp" -error_pump=" Config via pump not implemented yet.\n$error_dhcp" error_ldapcfg=" The configuration via ldap is not implemented yet." error_errdcfg=" Did not get any configuration data via dhcp until now ..." error_errfcfg=" Did not get any configuration data via tftp until now ..." diff --git a/initramfs/initrd-stuff/etc/messages.de b/initramfs/initrd-stuff/etc/messages.de index 5bd8835e..37aae04c 100644 --- a/initramfs/initrd-stuff/etc/messages.de +++ b/initramfs/initrd-stuff/etc/messages.de @@ -9,7 +9,7 @@ # # General information about OpenSLX can be found at http://openslx.org # -# messages file for all error and info messages generated during client +# Messages file for all error and info messages generated during client # bootup (within initialramfs) for OpenSLX linux diskless clients version 4 # this file could be used for localization of error messages @@ -119,9 +119,6 @@ error_nfe="\n -> Dieser Fehler ist nicht schwerwiegend - setze fort ...\n" error_shell="\n -> Fuehre Shell aus zum Debuggen ...\n" error_modload="Es schlug fehl, folgendes Modul zu laden:" error_modnfs="gebraucht zum einhaengen des Wurzel Dateisystems" -error_iptool=" Kein Wergzeug fuer die lokale IP Konfiguration gefunden.\ - Sie sollten wenigstens eins der folgenden Programme in ihre ramdisk laden:\n\ - ip ipconfig ifconfig." error_portm=" Der Portmapper sollte praesent sein, wenn normale ,,mount''-Befehle \ verwendet werden. \nBitte pruefen Sie die Einrichtung ihres Initialramfs \ (slxmkramfs/mkdxsinitrd)." @@ -136,8 +133,6 @@ error_dhcp=" Die folgenden Probleme koennten den Fehler verursachen:\n\ 'lsmod' ausfuehren." error_dhclient=" Schwerer Fehler aufgetreten beim Aufrufen von dhclient.\n\ $error_dhcp" -error_dhcpcd=" Schwerer Fehler aufgetreten beim Aufrufen von dhcpcd.\n$error_dhcp" -error_pump=" Konfiguration mit pump ist noch nicht implementiert.\n$error_dhcp" error_ldapcfg=" Die Konfiguration via ldap ist noch nicht implementiert." error_errdcfg=" Bis jetzt noch keine Konfigurationsdaten bekommen via dhcp .." error_errfcfg=" Bis jetzt noch keine Konfigurationsdaten bekommen via tftp ..." |