diff options
author | Dirk von Suchodoletz | 2007-07-01 14:07:25 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-07-01 14:07:25 +0200 |
commit | 435d181aed179d930571da5154988a997fd53145 (patch) | |
tree | f5d7824485b39e0764e903b8eb91a679d3335c49 /initramfs | |
parent | More hardware database fixes ... (diff) | |
download | core-435d181aed179d930571da5154988a997fd53145.tar.gz core-435d181aed179d930571da5154988a997fd53145.tar.xz core-435d181aed179d930571da5154988a997fd53145.zip |
Cleanups and simplifications ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1201 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rwxr-xr-x | initramfs/initrd-stuff/bin/hwautocfg | 10 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/bin/servconfig | 11 | ||||
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 52 |
3 files changed, 30 insertions, 43 deletions
diff --git a/initramfs/initrd-stuff/bin/hwautocfg b/initramfs/initrd-stuff/bin/hwautocfg index 1fce58ff..ce832426 100755 --- a/initramfs/initrd-stuff/bin/hwautocfg +++ b/initramfs/initrd-stuff/bin/hwautocfg @@ -285,18 +285,18 @@ fi [ $DEBUGLEVEL -eq 21 ] && echo "** 1st hwdetection finished at $(sysup)" # load ide drivers first, takes a while to initialize for driver in cmd64x hpt366 piix slc90e66 cs5520 it821x rz1000 \ - ahci triflex aec62xx cs5530 ns87415 sc1200 trm290 alim15x3 \ + ahci triflex aec62xx cs5530 cs5535 ns87415 sc1200 trm290 alim15x3 \ cy82c693 opti621 serverworks via82cxxx amd74xx pata_amd \ pdc202xx_new siimage atiixp hpt34x pdc202xx_old sis5513; do strinfile " ${driver}" /tmp/hwsetup.info && { ide="yes" - #modwaittime=$(expr 10 + ${modwaittime}) + #modwaittime=$((10 + ${modwaittime})) modprobe ${MODPRV} ${driver} & driverlist="${driverlist} ${driver}"; usleep ${modwaittime}; } done -# check for IDE/SCSI (SATA) -for driver in ata_piix sata_via sata_nv sata_sil sata_sis sata_svw \ - sata_sx4 sata_uli sata_vsc sata_qstor sata_promise sata_mv ahci; do +# check for IDE/SCSI (SATA); changes in newer kernels prefix pata/sata +for driver in ata_piix sata_via sata_mv sata_nv sata_sil sata_sis sata_svw \ + sata_sx4 sata_uli sata_vsc sata_qstor sata_promise ahci; do strinfile " ${driver}" /tmp/hwsetup.info && { #SCSIIDE="yes" modprobe ${MODPRV} ${driver} & diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig index 98bb6943..66fe5099 100755 --- a/initramfs/initrd-stuff/bin/servconfig +++ b/initramfs/initrd-stuff/bin/servconfig @@ -69,12 +69,12 @@ else fi while [ $len -le $smax ] ; do vdstr="$vdstr " - len=$(expr $len + 1) + len=$(($len + 1)) done len=$(expr length $host_name) while [ $len -le 30 ] ; do space="$space " - len=$(expr $len + 1) + len=$(($len + 1)) done echo " WELCOME TO $space \n (\l) @@ -135,8 +135,11 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then ;; *) # we expect nfs mounts here ... - nfsmnt ${vmimgserv}:${vmimgpath} /mnt/var/lib/vmware || { - error "${scfg_nfs}" nonfatal; noimg=yes; } + for proto in tcp udp fail; do + [ $proto = "fail" ] && { error "$scfg_nfs" nonfatal; noimg=yes; break;} + mount -n -t nfs -o ro,nolock,$proto ${vmimgserv}:${vmimgpath} \ + /mnt/var/lib/vmware && break + done ;; esac # if only the path is given expect a local source within exported diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index 3d4afbc0..8815ffe6 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -125,19 +125,19 @@ esac ############################################################################# # compute prefix bit number from netmask nm2pref () { -set `IFS="."; echo $1` +set $(IFS="."; echo $1) local n=0 local i for i in $1 $2 $3 $4 ; do case $i in 0) break ;; - 128) n=`expr $n + 1` ; break ;; - 192) n=`expr $n + 2` ; break ;; - 224) n=`expr $n + 3` ; break ;; - 240) n=`expr $n + 4` ; break ;; - 252) n=`expr $n + 6` ; break ;; - 254) n=`expr $n + 7` ; break ;; - 255) n=`expr $n + 8` ; continue ;; + 128) n=$(($n + 1)) ; break ;; + 192) n=$(($n + 2)) ; break ;; + 224) n=$(($n + 3)) ; break ;; + 240) n=$(($n + 4)) ; break ;; + 252) n=$(($n + 6)) ; break ;; + 254) n=$(($n + 7)) ; break ;; + 255) n=$(($n + 8)) ; continue ;; esac done echo $n @@ -195,23 +195,6 @@ else fi } ############################################################################# -# nfs mounter for root filesystem and other sources -nfsmnt () -{ -local nfsroot=$1 -local dest=$2 -local ret=0 -[ -z "$dest" ] && dest="/mnt" -# often nfs is just a module and not compiled directly into the kernel -[ -f /lib/modules/@@@KERNVER@@@/kernel/fs/nfs/nfs.ko ] && \ - { modprobe ${MODPRV} nfs || error "$error_modnfs"; } -# busybox mount has to be compiled with nfs mount support otherwise -# --> error "$error_mntt" -mount -n -t nfs -o ro,nolock,tcp $nfsroot $dest || \ - mount -n -t nfs -o ro,nolock,udp $nfsroot $dest || ret=1 -return $ret -} -############################################################################# # disk formatter and mounter. some proper error message output should be # added diskfm () { @@ -457,7 +440,7 @@ local count=0 [ -z $maxwait ] && maxwait=5000 while [ ! -e $file ] ; do echo "waiting ........." > /dev/null - count=$(expr $count + 1) + count=$(($count + 1)) [ $count -gt $maxwait ] && return 1 done return 0 @@ -805,8 +788,8 @@ local count=10 # should be executed before the normal runlevel scripts. Proper shutdown is # not needed!? for i in boot.slx ${D_INITSCRIPTS}; do - count=`expr $count + 1` - revcnt=`expr 41 - $count` + count=$(($count + 1)) + revcnt=$((41 - $count)) ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/S${count}$i # uncomment if proper shutdown of bootup scripts is required #ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i @@ -818,19 +801,20 @@ done include_in_fsroot_union () { union_id=0 # used to have guarantee differing names for the unions mount point union_type=$1 - for ROOTFS in `echo $2 |sed 's/,/ /g'`; do - union_id=$(( $union_id + 1 )) + for ROOTFS in $(echo $2 |sed 's/,/ /g'); do + union_id=$(($union_id + 1)) srvproto=$(uri_token $ROOTFS prot) case $srvproto in nfs) # nfsroot consists now of two different parts root_path=/$(uri_token $ROOTFS path) nfsserver=$(uri_token $ROOTFS server) - echo -e "NFS $ROOTFS parsed to $srvproto - $nfsserver - \ - $root_path" >> /tmp/felixtestlog mkdir -p /mnt/tmp/${root_path}_${union_id} - nfsmnt $nfsserver:$root_path /mnt/tmp/${root_path}_${union_id} || error \ - "Fehler beim mounten der zusatzunion (FIXME)" + for proto in tcp udp fail; do + [ $proto = "fail" ] && { error "$scfg_nfs"; break; } + mount -n -t nfs -o ro,nolock,$proto $nfsserver:$root_path \ + /mnt/tmp/${root_path}_${union_id} && break + done ;; *nbd) echo "Not working yet" |