diff options
-rw-r--r-- | initrd/distro-specs/gentoo/functions-gentoo | 20 | ||||
-rw-r--r-- | initrd/distro-specs/gentoo/servconf | 19 | ||||
-rw-r--r-- | initrd/distro-specs/suse-10.0/functions-suse-10.0 | 32 | ||||
-rw-r--r-- | initrd/distro-specs/ubuntu/functions-ubuntu | 7 | ||||
-rw-r--r-- | initrd/distro-specs/ubuntu/servconf | 19 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/hwautocfg | 7 | ||||
-rwxr-xr-x | initrd/initrd-stuff/bin/servconfig | 11 | ||||
-rw-r--r-- | initrd/initrd-stuff/etc/functions | 33 | ||||
-rwxr-xr-x | initrd/initrd-stuff/init | 72 | ||||
-rwxr-xr-x | initrd/mkdxsinitrd | 72 |
10 files changed, 159 insertions, 133 deletions
diff --git a/initrd/distro-specs/gentoo/functions-gentoo b/initrd/distro-specs/gentoo/functions-gentoo new file mode 100644 index 00000000..5f7afa09 --- /dev/null +++ b/initrd/distro-specs/gentoo/functions-gentoo @@ -0,0 +1,20 @@ +# initialize boot.ld - skript to be executed during early system startup +# (before most of the normal boot init scripts) +# this script should operate like a normal runlevel script +d_mkbootld () { +case "$1" in + init) + echo -e "#!/sbin/runskript\n# skeleton of /etc/${D_INITDIR}/boot.ld \ +written from $0" >/mnt/etc/${D_INITDIR}/boot.ld + echo -e '\n\nstart() {' \ + >>/mnt/etc/${D_INITDIR}/boot.ld + echo -e '\tebegin "Running post configuration required by initrd"' \ + >>/mnt/etc/${D_INITDIR}/boot.ld + chmod u+x /mnt/etc/${D_INITDIR}/boot.ld + ;; + close) + echo -e "\teend ${?}\n}" \ + >>/mnt/etc/${D_INITDIR}/boot.ld + ;; +esac +} diff --git a/initrd/distro-specs/gentoo/servconf b/initrd/distro-specs/gentoo/servconf deleted file mode 100644 index 36c10d3c..00000000 --- a/initrd/distro-specs/gentoo/servconf +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# Description: configuration script for Gentoo to configure -# linux diskless clients (executed within initial -# ramdisk after genconfig) -# -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 13-12-2005 -# Blabla -# Blub -# -# Copyright: (c) 2003, 2005 - RZ Universitaet Freiburg -# -# Version: 0.3.5k - -# check for configuration files to source - -# ldap, dhcp, file - - diff --git a/initrd/distro-specs/suse-10.0/functions-suse-10.0 b/initrd/distro-specs/suse-10.0/functions-suse-10.0 index 3016d222..8b63085f 100644 --- a/initrd/distro-specs/suse-10.0/functions-suse-10.0 +++ b/initrd/distro-specs/suse-10.0/functions-suse-10.0 @@ -1,8 +1,9 @@ # Description: configuration script for SuSE 10.0 to configure -# linux diskless clients (executed within initial -# ramdisk after genconfig) +# linux diskless clients (included by init, hwautocfg, +# servconfig, ... within initial ramdisk after inclusion +# of the main functions file) # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 18-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 # Blabla # Blub # @@ -41,9 +42,9 @@ if [ -f /mnt/etc/init.d/ntp ] ; then >>/mnt/etc/passwd testmkd /mnt/var/lib/ntp/var/run/ntp &>/dev/null if [ "x$start_ntp" = "xinitial" ] ; then - echo -e "# entry added by $0: $date" \ + echo -e "\t# entry added by $0: $date" \ >>/mnt/etc/${D_INITDIR}/boot.ld - echo "ntpdate -s -b $ntp_servers >${LOGFILE} 2>&1 &" \ + echo -e "\tntpdate -s -b $ntp_servers >${LOGFILE} 2>&1 &" \ >>/mnt/etc/${D_INITDIR}/boot.ld else rllinker "ntp" "$start" "$stop" @@ -171,15 +172,15 @@ sed -e "s,DISPLAYMANAGER=.*,DISPLAYMANAGER=\"$start_xdmcp\"," \ -e "s,.*_XSERVER.*,DISPLAYMANAGER_STARTS_XSERVER=\"$dm\"," \ /mnt/etc/sysconfig/displaymanager > /etc/displaymanager cp /etc/displaymanager /mnt/etc/sysconfig/displaymanager +# start the display manager as early as possible +ln -sf /etc/init.d/xdm /mnt/etc/init.d/boot.d/S12boot.xdm +ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/S01xdm +ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/K20xdm } # configure X display manager (runlevel links and kind of manager) config_xdm () { config_dm_entry yes -# echo -e "#!/bin/sh\n# entry added by $0: $date\n\ -#(sleep 1; /etc/init.d/xdm start) &" >>/mnt/etc/${D_INITDIR}/boot.ld -ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/S01xdm -ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/K20xdm } # configure gdm as display manager @@ -300,10 +301,6 @@ else [server-Standard]\nname=Standard server\ncommand=/usr/X11R6/bin/X\n\ flexible=true\nhandled=true" >>/mnt/etc/opt/gnome/gdm/gdm.conf fi -# start the display manager as early as possible -ln -sf /etc/init.d/xdm /mnt/etc/init.d/boot.d/S01boot.xdm -ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/S01xdm -ln -sf /etc/init.d/xdm /mnt/etc/init.d/rc5.d/K20xdm } # configure gdm as display manager @@ -314,7 +311,7 @@ config_dm_entry yes # consolefont consolefont () { -echo -e "setfont ${CONSOLE_FONT} >${LOGFILE} 2>&1" \ +echo -e "\tsetfont ${CONSOLE_FONT} >${LOGFILE} 2>&1\n" \ >>/mnt/etc/${D_INITDIR}/boot.ld } @@ -363,18 +360,19 @@ fi # initialize boot.ld - skript to be executed during early system startup # (before most of the normal boot init scripts) # this script should operate like a normal runlevel script -d_bootld () { +d_mkbootld () { case "$1" in init) echo -e "#!/bin/sh\n# skeleton of /etc/${D_INITDIR}/boot.ld written \ from $0" >/mnt/etc/${D_INITDIR}/boot.ld - echo -e '\n\n. /etc/rc.status\nrc_reset\ncase "$1" in start)' \ + echo -e '\n. /etc/rc.status\nrc_reset\ncase "$1" in\n start)' \ >>/mnt/etc/${D_INITDIR}/boot.ld echo -e '\techo -n "Running post configuration required by initrd"' \ >>/mnt/etc/${D_INITDIR}/boot.ld + chmod u+x /mnt/etc/${D_INITDIR}/boot.ld ;; close) - echo -e "\trc_status -v\n\t;;\n stop)\n\t;;esac\nrc_exit" \ + echo -e "\trc_status -v\n\t;;\n stop)\n\t;;\nesac\nrc_exit" \ >>/mnt/etc/${D_INITDIR}/boot.ld ;; diff --git a/initrd/distro-specs/ubuntu/functions-ubuntu b/initrd/distro-specs/ubuntu/functions-ubuntu index 47826957..02d696f1 100644 --- a/initrd/distro-specs/ubuntu/functions-ubuntu +++ b/initrd/distro-specs/ubuntu/functions-ubuntu @@ -204,18 +204,19 @@ fi # initialize boot.ld - skript to be executed during early system startup # (before most of the normal boot init scripts) # this script should operate like a normal runlevel script (fixme!!) -d_bootld () { +d_mkbootld () { case "$1" in init) echo -e "#!/bin/sh\n# skeleton of /etc/${D_INITDIR}/boot.ld written \ from $0" >/mnt/etc/${D_INITDIR}/boot.ld - echo -e '\n\ncase "$1" in start)' \ + echo -e '\n\ncase "$1" in\n start)' \ >>/mnt/etc/${D_INITDIR}/boot.ld echo -e '\techo -n "Running post configuration required by initrd"' \ >>/mnt/etc/${D_INITDIR}/boot.ld + chmod u+x /mnt/etc/${D_INITDIR}/boot.ld ;; close) - echo -e "\t;;\n stop)\n\t;;esac\nexit 0" \ + echo -e "\t;;\n stop)\n\t;;\nesac\nexit 0" \ >>/mnt/etc/${D_INITDIR}/boot.ld ;; diff --git a/initrd/distro-specs/ubuntu/servconf b/initrd/distro-specs/ubuntu/servconf deleted file mode 100644 index 9e711042..00000000 --- a/initrd/distro-specs/ubuntu/servconf +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# Description: configuration script for Debian/Sarge to configure -# linux diskless clients (executed within initial -# ramdisk after genconfig) -# -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 13-12-2005 -# Blabla -# Blub -# -# Copyright: (c) 2003, 2005 - RZ Universitaet Freiburg -# -# Version: 0.3.5k - -# check for configuration files to source - -# ldap, dhcp, file - - diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg index 8630dfb3..e19f533a 100755 --- a/initrd/initrd-stuff/bin/hwautocfg +++ b/initrd/initrd-stuff/bin/hwautocfg @@ -369,7 +369,8 @@ data via dhcp until now ..." nonfatal waitfor /tmp/ldap-done 10000 || error " Did not get any configuration \ data via ldap until now ..." nonfatal . /etc/machine-setup -waitfor /tmp/fscmpl 20000 +# wait for completion of clients root filesystem in /mnt +waitfor /tmp/fscmpl 40000 # run localizator and configure keyboard and console fonts DEFKEYTABLE="de-latin1-nodeadkeys" localization $country @@ -378,9 +379,9 @@ if [ -z "${KEYTABLE}" ] ; then '${DEFKEYTABLE}' defined\nin $0." KEYTABLE=${DEFKEYTABLE} fi -echo -e "# entry added by $0: $date" \ +echo -e "\t# entry added by $0: $date" \ >>/mnt/etc/${D_INITDIR}/boot.ld -echo -e "loadkeys -q ${KEYTABLE}\n" >>/mnt/etc/${D_INITDIR}/boot.ld +echo -e "\tloadkeys -q ${KEYTABLE}\n" >>/mnt/etc/${D_INITDIR}/boot.ld [ -n "${CONSOLE_FONT}" ] && consolefont # run X11 / Xorg configurator . /etc/sysconfig/xserver >/dev/null 2>&1 || error " The xserver \ diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index bff7518e..5f782bc5 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -10,7 +10,7 @@ # # Copyright: (c) 2006 - RZ Universitaet Freiburg # -# Version: 0.0.1b +# Version: 0.0.2a # check for configuration files to source @@ -89,11 +89,6 @@ test -n "$domain_name_servers" && { # delete and create runlevel links for initial booting (SuSE, Debian, # ...) case ${DISTRO} in - suse*) - ${SUSESPECIFICSUBDIR} = "boot.d/" - ;; -esac -case ${DISTRO} in suse*|debian*|ubuntu*) for i in ${D_RCDIRS} ${D_INITBOOTD} ; do rm -f /mnt/etc/$i/* @@ -104,8 +99,8 @@ case ${DISTRO} in for i in boot.ld ${D_INITSCRIPTS}; do count=`expr $count + 1` revcnt=`expr 41 - $count` - ln -sf /etc${D_INITDIR}/$i /mnt/etc/init.d/${SUSESPECIFICSUBDIR}S${count}$i - ln -sf /etc${D_INITDIR}/$i /mnt/etc/init.d/${SUSESPECIFICSUBDIR}K${revcnt}$i + ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/S${count}$i + ln -sf /etc${D_INITDIR}/$i /mnt/etc/${D_INITBOOTD}/K${revcnt}$i done ;; gentoo*) diff --git a/initrd/initrd-stuff/etc/functions b/initrd/initrd-stuff/etc/functions index e0e3bfbd..9418b637 100644 --- a/initrd/initrd-stuff/etc/functions +++ b/initrd/initrd-stuff/etc/functions @@ -1,18 +1,35 @@ +# Description: common function script for the configuration of +# linux diskless clients (included by init, hwautocfg, +# servconfig, ... within initial ramdisk) +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 +# Blabla +# Blub +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg +# +# Version: 0.4.1b + + + ####################################################################### # produce error message and if $2 is empty run (debug) shell error() { local message="An error occured during execution of $0 script:\n\n$1\n" -# check if LOGFILE is already defined -[ -z "${LOGFILE}" ] && LOGFILE="/dev/null" # check if LOGFILE is really writeable -[ -n "${LOGFILE}" ] && [ -w /mnt/${LOGFILE} ] || LOGFILE="/dev/null" +if [ -n "${LOGFILE}" ] ; then + [ "${LOGFILE}" != "/dev/null" ] && \ + [ -w /mnt/${LOGFILE} ] || LOGFILE="/dev/null" +else LOGFILE="/dev/null" +fi # if nonfatal error else fatal error message and shell if [ -n "$2" ] ; then -[ "$DEBUGLEVEL" -ge 1 ] && \ - echo -e "{$message} This error is not fatal - continuing ...\n" \ - >> /mnt/${LOGFILE} -[ "$DEBUGLEVEL" -gt 1 ] && \ - echo -e "{$message} This error is not fatal - continuing ...\n" + [ "$DEBUGLEVEL" -ge 1 ] && \ + echo -e "$message This error is not fatal - continuing ...\n" \ + >> ${LOGFILE} + [ "$DEBUGLEVEL" -gt 1 ] && \ + echo -e "$message This error is not fatal - continuing ...\n" + [ "$DEBUGLEVEL" -gt 2 ] && usleep 20 else echo -e "Running shell for debugging purposes now ...\n" /bin/sh diff --git a/initrd/initrd-stuff/init b/initrd/initrd-stuff/init index 9247e539..0e3111f6 100755 --- a/initrd/initrd-stuff/init +++ b/initrd/initrd-stuff/init @@ -1,6 +1,20 @@ +#!/bin/sh +# Description: main script for new type of initial ramdisk for +# linux diskless clients version 4 +# +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 +# Bla +# Blub +# +# Copyright: (c) 2006 - RZ Universitaet Freiburg +# +# Version: 0.2.1a + # functions common for all distros -. /etc/functions || ( echo -e "The functions file contains a lot of script \ -functionality. Without this\ninit script will not run." && exit 1 ) +errmsg="functions file contains a lot of script \ +functionality. Without this\ninit script will not run." +. /etc/functions || ( echo -e "The main $errmsg" && exit 1 ) +. /etc/distro-functions || ( echo "The distro $errmsg" && exit 1 ) # configuration settings (several file and directory variables) . /etc/sysconfig/config || ( echo -e " The distribution \ specific configuration file could not be found" && exit 1 ) @@ -81,9 +95,11 @@ in $0\ncountry=\"${COUNTRY}\"" >> /etc/machine-setup UNIONFS=1;; # dnbd server:port dnbdroot=*) - DNBDOPT=${opts#dnbdroot=};; + NBD=dnbd # name of kernel module + NBDOPT=${opts#dnbdroot=};; # nbd server:port,filesystem (filesystem is optional) nbdroot=*) + NBD=nbd # name of kernel module NBDOPT=${opts#nbdroot=};; # ip configuration client-ip:server-ip:gateway:netmask ip=*) @@ -178,23 +194,41 @@ if [ -n "$noipyet" ] ; then fi [ -n "$LDAP" ] && ldapconf & -# if root filesystem should be imported via traditional network block device -if [ -n "${NBDOPT}" ] ; then - modprobe ${MODPRV} nbd || error " Failed to load module nbd.ko. It is \ -needed if you intend to use\n network block device (NBD) for the client \ +# if root filesystem should be imported via (d) network block device +if [ -n "${NBD}" ] ; then + modprobe ${MODPRV} ${NBD} || error " Failed to load module ${NBD}.ko. It \ +is needed if you intend to use\n network block device (D)NBD for the client \ as root filesystem." nbdhost=${NBDOPT%:*} nbdopt=${NBDOPT#*:} nbdport=${NBDOPT%,*} nbdfs=${NBDOPT#*,} - echo "Diskless client using nbd server $nbdhost:$nbdport,$nbdfs" - nbd-client $nbdhost $nbdport /dev/nbd0 + echo "Diskless client using ${NBD} server $nbdhost:$nbdport,$nbdfs" if [ -z "$nbdfs" ]; then RFST=ext2; else RFST=$nbdfs; - modprobe ${MODPRV} ${RFST} + modprobe ${MODPRV} ${RFST} || error " Failed to load the requested \ +filesystem module for the client root\n filesystem ontop of the (D)NBD." fi + case "${NBD}" in + # network block device present in standard kernel + nbd) + nbd-client $nbdhost $nbdport /dev/nbd0 + RDEV=/dev/nbd0 + ;; + # dnbd by Thorsten Zitterell + dnbd) + mkdir /dnbd + mount -t tmpfs tmpfs /dnbd + while ! dnbd-client -b $dnbdhost -d /dev/dnbd0; do # -c /dnbd/cache + usleep 10 + done + echo $? + RDEV=/dev/dnbd0 + usleep 20 + ;; + esac fi # if root filesystem should be imported via udp based distributed network @@ -242,23 +276,27 @@ module\n does not match the running kernel. If you do not want to see this \ UNIONFS=""; } fi +# setup of client root filesystem dependent on the availability of UnionFS +msg="Starting ldconfig - switch it off via kernel cmdline option 'noldsc'" if [ -n "${UNIONFS}" ] ; then - echo -n "Using UnionFS for rw access" + echo "Using UnionFS for rw access" mkdir -p ${RWDIR}/union ${RWDIR}/uniontmp mount -n -t tmpfs none ${RWDIR}/uniontmp mount -n --move /mnt /root mount -n -t unionfs -o dirs=${RWDIR}/uniontmp=rw:/root=ro none /mnt mkdir -p /mnt/uniontmp mount -n --move ${RWDIR}/uniontmp /mnt/uniontmp - [ -z "${NOLDSC}" ] && ldconfig /etc/ld.so.cache & + # run ldconfig if not switched off via kernel command line + [ -z "${NOLDSC}" ] && echo $msg && ldconfig /etc/ld.so.cache & else - echo -n "Using bind mounts to ramdisk for rw access" + echo "Using bind mounts to ramdisk for rw access" mount -n -t tmpfs -o size=${TMPFSSIZE} ramfs ${RWDIR} for path in ${D_BINDMPTS} ; do mkdir -p ${RWDIR}/${path} >/dev/null 2>&1 mount -n --bind ${RWDIR}/${path} /mnt/${path} done - [ -z "${NOLDSC}" ] && ldconfig /tmp/ld.so.cache & + # see above ... + [ -z "${NOLDSC}" ] && echo $msg && ldconfig /tmp/ld.so.cache & for path in ${D_RODIRSINRW}; do if [ -d /mnt/${path} ] ; then LIST=${path}" "$LIST @@ -334,9 +372,9 @@ if [ -z "${NOLDSC}" ] ; then ld.so.cache did not finish in time." fi else - [ "${DEBUGLEVEL}" -gt 0 ] && echo -e "You decided not to recreate \ -/etc/ld.so.cache file. That might cause errors\nif libraries are installed \ -after this file was created on server." >> /mnt/${LOGFILE} + error " You decided not to recreate \ +/etc/ld.so.cache file. That might cause errors\n if libraries are installed \ +after this file was created on server." nonfatal fi # save machine configuration cp /etc/machine-setup /mnt/etc diff --git a/initrd/mkdxsinitrd b/initrd/mkdxsinitrd index 47d2ffb2..2865b183 100755 --- a/initrd/mkdxsinitrd +++ b/initrd/mkdxsinitrd @@ -3,7 +3,7 @@ # Description: universal (distro independent) generator for initial # ramdisks for linux diskless clients # -# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 16-01-2006 +# Author(s): Dirk von Suchodoletz <dirk@goe.net>, 20-01-2006 # Blabla # Blub # @@ -66,17 +66,21 @@ repco() local FILENAME=$1 # do not forget to define all variables which should be replaced within # the start and configuration scripts -if [ -d ${FILENAME} ] ; then - mkdir -p; +if [ -d initrd-stuff/${FILENAME} ] ; then + [ -d ${INSTDIR}/${FILENAME} ] || mkdir -p ${INSTDIR}/${FILENAME} else - sed -e "s,@@@INSTDIR@@@,${INSTDIR},g" \ - -e "s,@@@NWMODULES@@@,${NWMODULES},g" \ - -e "s,@@@KERNVER@@@,${KERNVER},g" \ - -e "s,@@@COMDIRINDXS@@@,${COMDIRINDXS},g" \ - -e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \ - -e "s,@@@DISTRO@@@,${DISTRO},g" \ - -e "s,@@@NETIF@@@,${NET_IF},g" \ - ${FILENAME} >> ${INSTDIR}/${FILENAME} + if file initrd-stuff/${FILENAME}| grep "ELF" &>/dev/null ; then + cp initrd-stuff/${FILENAME} ${INSTDIR}/${FILENAME} + else + sed -e "s,@@@INSTDIR@@@,${INSTDIR},g" \ + -e "s,@@@NWMODULES@@@,${NWMODULES},g" \ + -e "s,@@@KERNVER@@@,${KERNVER},g" \ + -e "s,@@@COMDIRINDXS@@@,${COMDIRINDXS},g" \ + -e "s,@@@COMETCEXCL@@@,${COMETCEXCL},g" \ + -e "s,@@@DISTRO@@@,${DISTRO},g" \ + -e "s,@@@NETIF@@@,${NET_IF},g" \ + initrd-stuff/${FILENAME} >> ${INSTDIR}/${FILENAME} + fi fi } @@ -159,10 +163,6 @@ resolve_modules() { --set-version $kernel_version --ignore-install \ --show-depends $module 2> /dev/null \ | sed -ne 's:.*insmod /\?::p' ) - if [ -z "$module_list" ]; then - echo "Cannot determine dependencies of module $module." \ - "Is modules.dep up to date?" - fi echo "$module_list" done \ | awk ' # filter duplicates: we must not reorder modules here! @@ -265,26 +265,23 @@ mkdir -p ${INSTDIR}/etc/sysconfig # source configuration file for the distribution used #DISTRO=debian -if [ -z "${DISTRO}" ] ; then - for i in ${ROOTDIR}/bin/lsb_release ${ROOTDIR}/usr/bin/lsb_release; do - if [ -e $i ] ; then - DISTRO=`. $i -a | grep "Distributor" | sed "s/.*\t//"` - echo $DISTRO - DISTRO_VER=`. $i -a | grep "Release:" | sed "s/.*\t//"` - break - fi - done -fi +# fixmee!! Funktion knallt, wenn lsb_release nicht da!! +#if [ -z "${DISTRO}" ] ; then +# for i in ${ROOTDIR}/bin/lsb_release ${ROOTDIR}/usr/bin/lsb_release; do +# if [ -e $i ] ; then +# DISTRO=`. $i -a | grep "Distributor" | sed "s/.*\t//"` +# echo $DISTRO +# DISTRO_VER=`. $i -a | grep "Release:" | sed "s/.*\t//"` +# break +# fi +# done +#fi if [ -z "${DISTRO}" ] ; then if [ -e ${ROOTDIR}/etc/SuSE-release ] ; then DISTRO=suse DISTRO_VER=`grep "VERSION" /etc/SuSE-release | sed "s/.*= //"` - fi -fi - -if [ -z "${DISTRO}" ] ; then - if [ -e ${ROOTDIR}/etc/debian-version ] ; then + elif [ -e ${ROOTDIR}/etc/debian-version ] ; then DISTRO=debian DISTRO_VER=`cat ${ROOTDIR}/etc/debian-version` fi @@ -342,11 +339,6 @@ for bbins in ip ifconfig; do else echo "Binary not found"; fi done -# copy and replace variable names -find initrd-stuff -exec repco '{}' \; - -# distro dependet stuff for etc, booting !? - # needed standard binaries for bbins in \ cat chmod chown chroot cp expr killall ln mkdir modprobe \ @@ -383,6 +375,7 @@ mkdir -p ${INSTDIR}/var/lib/nfs/state #if nfs - dann modul suchen, kopieren +# distro specific additional stuff case "${DISTRO}" in debian*) cp /lib/libnss_compat.so.2 ${INSTDIR}/lib;; @@ -421,12 +414,13 @@ for module in `resolve_modules ${KERNVER} af_packet ${NWMODULES} ${FSMODULES}`; done cp /lib/modules/${KERNVER}/modules.* ${INSTDIR}/lib/modules/${KERNVER} -#die beiden repco-zeilen koennen hier bald weg, weil oben schon alles kopiert wird. - -#repco initrd-stuff/init ${INSTDIR}/init +# initial ramdisk scripts: init, functions, servconfig, hwautocfg, ... +# copy and replace variable names +for dirs in `find initrd-stuff/* ! -regex ".*/\..*"` ; do + repco ${dirs##initrd-stuff/} +done chmod 755 ${INSTDIR}/init ${INSTDIR}/bin/servconfig \ ${INSTDIR}/bin/hwautocfg ${INSTDIR}/bin/dhcpmkconfig -#repco initrd-stuff/etc/functions ${INSTDIR}/etc/functions ######################################################################### # End of file copy procedures |