diff options
author | Dirk von Suchodoletz | 2006-12-17 19:55:55 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-12-17 19:55:55 +0100 |
commit | c392fef97b564badfd0e4d7e9181768034211d15 (patch) | |
tree | c0273d60ee852f618dba5a8c8024264bea97507f /initramfs | |
parent | Move settings.local to settings.local.example. (diff) | |
download | core-c392fef97b564badfd0e4d7e9181768034211d15.tar.gz core-c392fef97b564badfd0e4d7e9181768034211d15.tar.xz core-c392fef97b564badfd0e4d7e9181768034211d15.zip |
Improved "watchdog" for auto power off, if stage3 does not complete
after around two minutes. Removed klibc stuff (ipconfig, nfsmount) which
was never really in use (klibc is deprecated and the busybox approach
seems much more promising to keep the initramfs small and flexible).
Little cleanups ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@564 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 44 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/messages | 6 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 25 | ||||
-rwxr-xr-x | initramfs/mkdxsinitrd | 9 |
4 files changed, 28 insertions, 56 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index aa0a8225..24685df1 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -2,7 +2,7 @@ # (included by init, hwautocfg, servconfig, ... within OpenSLX initial # ramfs) # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 15-12-2006 +# Dirk von Suchodoletz <dvs@OpenSLX.com>, 17-12-2006 # Felix Endres, 30-04-2006 # <mj0@uni-freiburg.de> (xenbr), 12-12-2006 # Tobias Maier @@ -264,7 +264,7 @@ local nm=$2 local gw=$3 local bc=$4 local if=$5 -for ipcfg in ip ipconfig ifconfig none; do +for ipcfg in ip ifconfig none; do test -x /bin/$ipcfg && break; done case $ipcfg in @@ -281,12 +281,7 @@ case $ipcfg in [ -n "$nbdhost" ] && [ `echo $nbdhost|sed "s,\..*,,"` -ge 224 ] && \ ip route add 224.0.0.0/4 dev eth0 ;; - # the klibc ip configuration / dhcp client tool - ipconfig) - # fixme: to be checked - ipconfig $ip::$gw:$nm:$if:none - MAC="" - ;; + # the klibc ip configuration / dhcp client tool is deprecated # traditional ifconfig/route - if a distro does not provide ip ifconfig) if [ "$ip" = "0.0.0.0" ]; then @@ -326,28 +321,12 @@ local nfsroot=$1 local dest=$2 local ret=0 [ -z "$dest" ] && dest="/mnt" -for mnt in nfsmount mount none; do - test -x /bin/$mnt && break; -done # often nfs is just a module and not compiled directly into the kernel [ -f /lib/modules/@@@KERNVER@@@/kernel/fs/nfs/nfs.ko ] && \ loadmod /lib/modules/@@@KERNVER@@@/kernel/fs/nfs/nfs.ko "$error_modnfs" -case $mnt in - # the klibc nfs mount tool (includes portmap) - nfsmount) - nfsmount -o ro $nfsroot $dest || ret=1 - ;; - # the standard mount; portmap is needed ... - mount) - portmap || { echo "$error_portm"; ret=1; } - # fixme: busybox mount uses nfs ... - mount -n -t nfs -o ro,nolock $nfsroot $dest || ret=1 - killall -9 portmap 2>/dev/null - ;; - none) - error "$error_mntt" - ;; -esac +# busybox mount has to be compiled with nfs mount support otherwise +# --> error "$error_mntt" +mount -n -t nfs -o ro,nolock $nfsroot $dest || ret=1 return $ret } ############################################################################# @@ -384,7 +363,7 @@ fi rundhcp () { local vci="$1" -for dhcp in dhclient dhcpcd pump ipconfig udhcpc none; do +for dhcp in dhclient dhcpcd pump udhcpc none; do test -e /bin/$dhcp && break; done if [ "$dhcp" = "none" ] ; then @@ -416,15 +395,6 @@ case $dhcp in pump) error "$error_pump" ;; - ipconfig) - [ $DEBUGLEVEL -gt 1 -a "$DEBUGLEVEL" != 8 ] && \ -echo -e "# You are using ipconfig as dhcp \ -client. With this tool you only get the\n# basic IP settings from the \ -server. No vendor specific, self defined\n# dhcp options are possible this \ -way. use dhclient instead or get them via\n# tftp (to be enabled via kernel \ -command line)." >> /etc/machine-setup - error "$error_ipconf" - ;; # udhcpc is part of busybox udhcpc) [ -n $vci ] && vci="-V $vci" diff --git a/initramfs/initrd-stuff/etc/messages b/initramfs/initrd-stuff/etc/messages index 2136cc0f..1eb35d79 100644 --- a/initramfs/initrd-stuff/etc/messages +++ b/initramfs/initrd-stuff/etc/messages @@ -2,10 +2,10 @@ # bootup (within initialramfs) for OpenSLX linux diskless clients version 4 # this file could be used for localization of error messages # -# Dirk von Suchodoletz <dvs@openslx.com>, 29-10-2006 +# Dirk von Suchodoletz <dvs@openslx.com>, 17-10-2006 # # (c) 2006 - RZ Universitaet Freiburg -# (c) 2006 - OpenSLX.org +# (c) 2006 - OpenSLX.ORG Project # messages from (slx) init init_errmsg="functions file contains a lot of script \ @@ -109,8 +109,6 @@ 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_ipconf=" Config via ipconfig (from klibc) 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/init b/initramfs/initrd-stuff/init index f29f10ba..13ea98ae 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -2,7 +2,7 @@ # main script for new type of initial ramdisk for OpenSLX linux diskless # clients version 4 # -# Dirk von Suchodoletz <dirk@goe.net>, 15-12-2006 +# Dirk von Suchodoletz <dirk@goe.net>, 17-12-2006 # <mj0@uni-freiburg.de> (xenbr), 27-09-2006 # # (c) 2006 - RZ Universitaet Freiburg @@ -200,16 +200,18 @@ done # at this point a timer should be started to ensure an automated reboot # or halt of the machine if SLX init does not succeed (e.g. missing kernel # module for the network adaptor) -# fixme/testme!! -errorhalt () { if [ "${DEBUGLEVEL}" -lt 4 ] ; then - [ ! -f /proc/version ] && mount -n -t proc proc /proc - [ ! -f /proc/sysrq-trigger ] && echo -e $init_nosysrq - sleep 120 - echo "o" > /proc/sysrq-trigger + [ -x /bin/busybox ] && shtype=a + cat<<EOF > /bin/watchdog +#!/bin/${shtype}sh +echo \$$ > /tmp/watchdogpid +[ ! -f /proc/version ] && mount -n -t proc proc /proc +sleep 120 +echo "o" > /proc/sysrq-trigger +EOF + chmod u+x /bin/watchdog + watchdog & fi -} -errorhalt & # check if at least one type of IP configuration is availabe if [ -z "$DHCP" -a -z "$LDAP" -a -z "$IPINFO" ] ; then @@ -569,7 +571,10 @@ umount -n /sys || error "$init_errsys" nonfatal umount -n /proc/bus/usb >/dev/null 2>&1 mount -n --move /dev /mnt/dev chmod a+rwxt /mnt/dev/shm -killall -9 udevd sleep usleep 2>/dev/null +killall -9 udevd 2>/dev/null +# kill the watchdog (errhalt) +[ -f /tmp/watchdog ] && kill $(cat /tmp/watchdogpid) 2>/dev/null +# runtimer [ $DEBUGLEVEL -eq 8 ] && echo "** SLX init ended near $(sysup)" umount -n /proc # unset old environment variables diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index 8aca056b..a55d6ef9 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -4,7 +4,7 @@ # ramdisks for linux diskless clients (stage2 system # setup) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 15-12-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 17-12-2006 # Nico Dietrich # Felix Endres # <mj0@uni-freiburg.de> (xenbr), 12-12-2006 @@ -578,14 +578,13 @@ else cobi ${bbins} bin &>/dev/null || \ echo "Program ${bbins} not found; could be most probably ignored" done + # if nfs is used as clients root filesystem + cobi portmap bin + mkdir -p ${INSTDIR}/var/lib/nfs/state fi mkdir -p ${INSTDIR}/var/{lib,run} -# if nfs is used as clients root filesystem -cobi portmap bin -mkdir -p ${INSTDIR}/var/lib/nfs/state - # if nbd or dnbd is used as clients root filesystem if [ -n "${FSMODULES}" ] ; then for i in ${FSMODULES}; do |