diff options
author | Dirk von Suchodoletz | 2006-09-03 15:59:27 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2006-09-03 15:59:27 +0200 |
commit | 42afca10fa4df79e7dfd7ddfe4df21df82ac159c (patch) | |
tree | 325bcad9dcccee0faea4ca88cf135e9c6a2ec07b /initrd/initrd-stuff/bin | |
parent | More cleanups in servconfig ... (diff) | |
download | core-42afca10fa4df79e7dfd7ddfe4df21df82ac159c.tar.gz core-42afca10fa4df79e7dfd7ddfe4df21df82ac159c.tar.xz core-42afca10fa4df79e7dfd7ddfe4df21df82ac159c.zip |
VMware environment: loopfile and mount will be placed in /etc/vmware
now to avoid problems with nfs and unionfs. Cleanups in vmware-prep
script. Introduced new debug level for script runtime calculation, see
DebugLevel for further information. Code cleanups in major initramfs
scripts, improved /tmp handling in hwautocfg and init ... Removed imgsrv
variable (from machine-setup), just merged with the vmware variable (put
the vmware image source here ...)
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@352 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initrd/initrd-stuff/bin')
-rwxr-xr-x | initrd/initrd-stuff/bin/dhcpmkconfig | 16 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 17 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/screenres | 2 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 57 |
4 files changed, 57 insertions, 35 deletions
diff --git a/initrd/initrd-stuff/bin/dhcpmkconfig b/initrd/initrd-stuff/bin/dhcpmkconfig index b2ef4e3a..ded4caaa 100755 --- a/initrd/initrd-stuff/bin/dhcpmkconfig +++ b/initrd/initrd-stuff/bin/dhcpmkconfig @@ -1,14 +1,14 @@ #!/bin/sh # -# Description: universal (distro independent) IP configuration writer for -# several dhcp clients. The result is written in unified form -# to the /etc/machine-setup file +# 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 # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 09-07-2006 -# Lars Mueller, 23-06-2006 -# Oliver Tappe, 23-06-2006 +# Dirk von Suchodoletz <dvs@OpenSLX.com>, 03-09-2006 +# Lars Mueller, 23-06-2006 +# Oliver Tappe, 23-06-2006 # -# Copyright: (c) 2006 - RZ Universitaet Freiburg +# (c) 2006 - RZ Universitaet Freiburg # client variable should be exported via calling function cfgfile="/tmp/confviadhcp" @@ -20,7 +20,7 @@ enabled\n# via kernel command line)." # heavy debugging output in level 3 and above ... and on 13 #FIXME: DEBUGLEVEL is not propagated to this file (at least for Ubuntu) [ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0 -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 13 ] && \ +[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 13 ] && \ set -x case $0 in *dhcpcd*) diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index aeb8d5a5..03d078db 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -3,7 +3,7 @@ # universal (distro independent) hardware autoconfiguration script for # OpenSLX linux diskless clients, using hwconfig from knoppix as base tool # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 31-08-2006 +# Dirk von Suchodoletz <dvs@OpenSLX.com>, 03-09-2006 # # (c) 2003 - 2006 - RZ Universitaet Freiburg # (c) 2006 - OpenSLX.org @@ -218,8 +218,11 @@ done . /etc/sysconfig/config . /etc/distro-functions +# script run timer +[ $DEBUGLEVEL -eq 8 ] && echo "** HW setup started at $(sysup)" + # heavy debugging output in level 3 and above and specific for 11 -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 11 ] && \ +[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 11 ] && \ set -x # set X11 configuration file @@ -405,8 +408,11 @@ for hd in $(cat /tmp/hwsetup.info|sed -n -e '/HD$/,/device:/p'| \ for hdpartnr in $(cat /tmp/hd_part | \ sed -n -e "/ 44 /p"|sed -e "s/[[:space:]].*//") ; do # ext2fs_check_if_mount message supressed - ( mkfs.ext2 -Fq $hdpartnr 2>/dev/null; mount -n -o nocheck,noexec \ - $hdpartnr /mnt/tmp 2>/dev/null; + ( mkfs.ext2 -Fq $hdpartnr 2>/dev/null + umount /mnt/tmp 2>/dev/null + # if mounting of temp partion fails fall back to tmpfs on /tmp + mount -n -o nocheck,noexec $hdpartnr /mnt/tmp 2>/dev/null || \ + mount -n -t tmpfs none /mnt/tmp echo "$hdpartnr is mounted to /tmp" > /tmp/tmpready ) & echo -e "$hdpartnr\t/tmp\t\text2\t\tdefaults\t 0 0" >> /tmp/fstab part44=yes @@ -446,4 +452,7 @@ fi waitfor /tmp/xready 10000 cp /etc/xorg.conf ${D_XF86CONFFILE} +# script run timer +[ $DEBUGLEVEL -eq 8 ] && echo "** HW setup finished at $(sysup)" + echo "finished" > /tmp/hwcfg diff --git a/initrd/initrd-stuff/bin/screenres b/initrd/initrd-stuff/bin/screenres index 8518b22e..4a9f5fd9 100755 --- a/initrd/initrd-stuff/bin/screenres +++ b/initrd/initrd-stuff/bin/screenres @@ -28,7 +28,7 @@ [ -z "$DEBUGLEVEL" ] && DEBUGLEVEL=0 [ $DEBUGLEVEL -gt 1 ] && DEBUG="yes" # heavy debugging output in level 3 and above ... -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 14 ] && set -x +[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 14 ] && set -x # Define some default output values if the script fails to find better values # Empty defaults, s.t. hwautocfg defines the defaults diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index d16f8d68..17ab8511 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,7 +4,7 @@ # diskless clients (executed in stage3 within initial ramfs). The file- # system is setup when servconfig starts # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 01-09-2006 +# Dirk von Suchodoletz <dvs@OpenSLX.com>, 03-09-2006 # Michael Janczyk <mj0>, 31-05-2006 # Lars Mueller <lm@OpenSLX.com>, 23-06-2006 # Oliver Tappe <ot@OpenSLX.com>, 23-06-2006 @@ -25,8 +25,11 @@ # get location of logfile definition . /mnt/etc/${D_SYSCONFDIR}/logfile -# heavy debugging output in level 3 and above ... -[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 10 -o $DEBUGLEVEL -eq 12 ] && \ +# script run timer +[ $DEBUGLEVEL -eq 8 ] && echo "** SW setup started at $(sysup)" + +# heavy debugging output in level 3 and below 8 ... +[ $DEBUGLEVEL -gt 3 -a $DEBUGLEVEL -lt 8 -o $DEBUGLEVEL -eq 12 ] && \ set -x ####################################################################### @@ -38,31 +41,13 @@ cp -a /etc/sysconfig/files/* /mnt 2>/dev/null & cat /etc/boot.local >> /mnt/etc/${D_BOOTLOCAL} } -# set greeting and add information on booted system (distro) -len=$(expr length $DISTRO) -dstr="$DISTRO)" -while [ $len -le 11 ] ; do - dstr="$dstr " - len=$(expr $len + 1) -done -echo " - WELCOME TO \n (\l) - _____ ______ ______ __ __ _______ __ __ __ - / _ | _ | ___| | | | | ____| | | | | | - | | | | |_| | |_ | | | | |___ | | / / - | | | | ___/| _| | | ____ | | | | - | |_| | | | |___| | | | ____| | |___ / / - _____/|__| |______|__| |__| |_______|______|__| |__| - - Diskless Workstation (v4.1/$dstr (c) <OpenSLX.ORG> -">/mnt/etc/issue - ####################################################################### # read and unify configuration options - default configuration file, # from dhcp, ldap ... # wait for the appearance of configuration from several sources cfgcomplete . /etc/machine-setup +[ $DEBUGLEVEL -eq 8 ] && echo "** Config info is complete at $(sysup)" # copy additional configuration and var files and directories # admins can place there files in /var/lib/openslx/config/... @@ -70,6 +55,30 @@ cfgcomplete # ... in the near future ... cp -a /rootfs/* /mnt 2>/dev/null +# set greeting and add information on booted system (distro) +len=$(expr length $DISTRO) +dstr="$DISTRO)" +while [ $len -le 16 ] ; do + dstr="$dstr " + len=$(expr $len + 1) +done +len=$(expr length $host_name) +while [ $len -le 30 ] ; do + space="$space " + len=$(expr $len + 1) +done +echo " + WELCOME TO $space \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| + + Diskless Workstation (v4.1/$dstr (c) <OpenSLX.ORG project> +">/mnt/etc/issue + ####################################################################### # vmware stuff first part: two scenarios # * VM images in /usr/share/vmware - then simply link @@ -332,6 +341,7 @@ fi # there might be the chance that we have a disk partition available, so # wait for completion of detection, setup process waitfor /tmp/tmpready 10000 +[ $DEBUGLEVEL -eq 8 ] && echo "** Setup of /tmp completed at $(sysup)" # create some directories and correct permissions tmpisdisk=$(sed -n '/\/tmp/p' /tmp/fstab 2>/dev/null) # if there is no local disk partition for /tmp then try to mount a rw @@ -487,5 +497,8 @@ DisplayManager.*.reset:\t\t/etc/X11/xdm/Xreset" \ esac fi +# script run timer +[ $DEBUGLEVEL -eq 8 ] && echo "** SW setup finished at $(sysup)" + # servconfig finished successfully echo "finished" > /tmp/svcfg |