From 2879d8906ed019d0e8f1c1ed108623a76d593380 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 5 May 2007 22:43:26 +0000 Subject: * added option -S to mkdxsinitrd in order to pass in the system name * replaced $DISTRO by $DISTRO_NAME and $DISTRO_VER * added $SYSTEM_NAME and used it at a couple of places where $DISTRO was used before * removed the two tries to fetch the config-tgz without any system name, as these are never generated by the demuxer anyway. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1007 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/bin/servconfig | 7 +++---- initramfs/initrd-stuff/etc/functions | 22 +++++++++++----------- initramfs/initrd-stuff/init | 20 +++++++++++--------- 3 files changed, 25 insertions(+), 24 deletions(-) (limited to 'initramfs/initrd-stuff') diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig index 42fb0f4a..4b9ee775 100755 --- a/initramfs/initrd-stuff/bin/servconfig +++ b/initramfs/initrd-stuff/bin/servconfig @@ -58,10 +58,9 @@ cfgcomplete # ... in the near future ... cp -a /rootfs/* /mnt 2>/dev/null -# set greeting and add information on booted system (distro) -distroname=${DISTRO%-*} -len=$(expr length ${SLXVERSION}${distroname}) -vdstr="V${SLXVERSION}/${distroname})" +# set greeting and add information on booted system +len=$(expr length ${SLXVERSION}${SYSTEM_NAME}) +vdstr="V${SLXVERSION}/${SYSTEM_NAME})" while [ $len -le 28 ] ; do vdstr="$vdstr " len=$(expr $len + 1) diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index fa10b8f9..b01884f4 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -63,7 +63,7 @@ trigger_device_events () { } ############################################################################# -# mini udev of busybox (most probably obsolete: or distro specific +# mini udev of busybox (most probably obsolete: or distro specific # udev_hotplug) runudev () { if [ -x /bin/mdev ] ; then @@ -243,7 +243,7 @@ done brctl addif ${bridge} ${pdev} } ############################################################################# -# replace @@@serverip@@@ with real serverip. Allows the usage of a variable +# replace @@@serverip@@@ with real serverip. Allows the usage of a variable # for the server ip address (e.g. in machine-setup or kernel commandline) checkip () { @@ -341,7 +341,7 @@ echo "dhcp finished at $(sysup)" > /tmp/dhcp-done ############################################################################# # function for retrieving configuration file (machine-setup) via tftp from a -# predefined server or given source (file=tftp-server:/path via kernel +# predefined server or given source (file=tftp-server:/path via kernel # command line) # tftpget is helper function for fileget tftpgetunpack () { @@ -376,7 +376,7 @@ if [ -n "$filesrc" ] ; then tftpgetunpack $tftp $cfgfile $tftpserver else # predefined value for openslx environment; it is expected that this - # directory is just below the tftpboot/tftproot (path to which the + # directory is just below the tftpboot/tftproot (path to which the # daemon is restricted to) local cfgdir="client-config" local tftpserver=$(checkip ${serverip}) @@ -385,8 +385,8 @@ else echo -e "\n## Configuration via fileget: Hierarchy is distro client \ and as last\n# distro/default" >> /tmp/confviafile mac=$(echo $macaddr|sed "s/:/-/g") - for cfgfile in $cfgdir/$DISTRO/01-$mac.tgz $cfgdir/$DISTRO/default.tgz \ - $cfgdir/01-$mac.tgz $cfgdir/default.tgz ; do + for cfgfile in $cfgdir/$SYSTEM_NAME/01-$mac.tgz \ + $cfgdir/$SYSTEM_NAME/default.tgz ; do tftpgetunpack $cfgfile $tftpserver && break done fi @@ -403,7 +403,7 @@ testmkd () { } ############################################################################# -# function for writing a syslog-ng.conf file. First parameter is absolute +# function for writing a syslog-ng.conf file. First parameter is absolute # destination (incl. /mnt prefix) # sysngwriter $dest $start_syslog sysngwriter () { @@ -482,7 +482,7 @@ return 0 } ############################################################################# -# ldconfig is needed if rootfilesystem is composed of several parts search +# ldconfig is needed if rootfilesystem is composed of several parts search # for ldconfig and execute it # check that /mnt/etc/ld.so.conf is never lost ldconfig () { @@ -876,14 +876,14 @@ include_in_fsroot_union () { if [ "X$union_type" == "XUnionFS" ]; then [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && echo "Using unionctl to mount ${root_path}_${union_id} (type: $union_type)" unionctl /mnt/ --add --after 1 --mode ro /mnt/tmp/${root_path}_${union_id} - elif [ "X$union_type" == "XAUFS" ]; then + elif [ "X$union_type" == "XAUFS" ]; then #unionctl for aufs is a sh script needing tools not included in our initrd [ "$DEBUGLEVEL" -gt 2 -a "$DEBUGLEVEL" != 8 ] && echo "Using aufs-mount to mount ${root_path}_${union_id} (type: $union_type)" mount -n -o remount,add:1:/mnt/tmp/${root_path}_${union_id}=ro none /mnt else error $init_loadunions nonfatal fi - done + done } # kdmrc template started from distro specific functions files @@ -1084,7 +1084,7 @@ config_samba () { config_portmap () { : } -# start nis/ypbind +# start nis/ypbind config_nis () { : } diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 9e829375..02dd457a 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -37,7 +37,9 @@ export date="${slxconf_date}" export DEBUGLEVEL=0 export KERNEL="${slxconf_kernver}" export NWMODULES="${slxconf_listnwmod}" -export DISTRO="${slxconf_distro}" +export DISTRO_NAME="${slxconf_distro_name}" +export DISTRO_VER="${slxconf_distro_ver}" +export SYSTEM_NAME="${slxconf_system_name}" export SLXVERSION="${slxconf_slxver}" # do not use dnbd cache file @@ -480,9 +482,9 @@ fi union_type="" # try to use unionfs for rw access if available -if [ -n "${unionfs}" ]; then +if [ -n "${unionfs}" ]; then modprobe ${MODPRV} unionfs && union_type="UnionFS" - if [ -z "$union_type" ]; then + if [ -z "$union_type" ]; then error "$init_loadufs" nonfatal unset unionfs # if unionfs is not available, check for aufs and inform user @@ -490,9 +492,9 @@ if [ -n "${unionfs}" ]; then fi fi # try to use aufs for rw access if available -if [ -n "${aufs}" ]; then +if [ -n "${aufs}" ]; then modprobe ${MODPRV} aufs && union_type="AUFS" - if [ -z "$union_type" ]; then + if [ -z "$union_type" ]; then error "$init_loadaufs" nonfatal unset aufs # if aufs is not available, check for unionfs and inform user @@ -509,13 +511,13 @@ if [ -n "${unionfs}" -o -n "${aufs}" ] ; then if [ "$union_type" == "UnionFS" ]; then mount -n -t unionfs -o dirs=${rwdir}/uniontmp:/rorootfs=${nfsro}ro \ none /mnt - elif [ "$union_type" == "AUFS" ]; then + elif [ "$union_type" == "AUFS" ]; then mount -n -t aufs -o br:/${rwdir}/uniontmp:/rorootfs=ro none /mnt fi mkdir -p /mnt/uniontmp mount -n --move ${rwdir}/uniontmp /mnt/uniontmp chmod 0755 /mnt/uniontmp /mnt - # run ldconfig if switched on via kernel command line (token ldsc) or + # run ldconfig if switched on via kernel command line (token ldsc) or # triggered by unionized root filesystem ldcfg # runlevel directories should contain no links @@ -643,12 +645,12 @@ if [ -z "$uniondirs" ]; then # does it contain "://"? if [ "$aufs" != "${aufs#*://}" ]; then uniondirs="$aufs" - fi + fi elif [ "$union_type" == "UnionFS" ]; then # does it contain "://"? if [ "$unionfs" != "${unionfs#*://}" ]; then uniondirs="$unionfs" - fi + fi fi fi # if locations are given that should be unioned with the fs root, do it -- cgit v1.2.3-55-g7522