From bcbd48c5bd0dce46817f7686aa66c3a3dad56710 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Fri, 1 Sep 2006 19:21:06 +0000 Subject: More cleanups in servconfig ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@351 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/initrd-stuff/bin/servconfig | 85 +++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 38 deletions(-) (limited to 'initrd/initrd-stuff/bin/servconfig') diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 7ac87bb6..d16f8d68 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -1,9 +1,10 @@ #!/bin/sh # # universal (distro independent) configuration script for OpenSLX linux -# diskless clients (executed in stage3 within initial ramfs) +# diskless clients (executed in stage3 within initial ramfs). The file- +# system is setup when servconfig starts # -# Dirk von Suchodoletz , 31-08-2006 +# Dirk von Suchodoletz , 01-09-2006 # Michael Janczyk , 31-05-2006 # Lars Mueller , 23-06-2006 # Oliver Tappe , 23-06-2006 @@ -13,8 +14,8 @@ # check for configuration files to source -# functions common for all distros, messages contains all error and info -# output +# functions common for all distros, messages contains all error and +# info output . /etc/messages . /etc/functions # load distro specific configuration variables and functions. distro @@ -37,7 +38,7 @@ cp -a /etc/sysconfig/files/* /mnt 2>/dev/null & cat /etc/boot.local >> /mnt/etc/${D_BOOTLOCAL} } -# set greeting +# set greeting and add information on booted system (distro) len=$(expr length $DISTRO) dstr="$DISTRO)" while [ $len -le 11 ] ; do @@ -45,15 +46,15 @@ while [ $len -le 11 ] ; do len=$(expr $len + 1) done echo " - WELCOME TO \n (\l) - _____ ______ ______ __ __ _______ __ __ __ - / _ | _ | ___| | | | | ____| | | | | | - | | | | |_| | |_ | | | | |___ | | / / - | | | | ___/| _| | | ____ | | | | - | |_| | | | |___| | | | ____| | |__ / / - _____/|__| |______|__| |__| |_______|_____|__| |__| - - Diskless Workstation (v4.1/$dstr (c) + WELCOME TO \n (\l) + _____ ______ ______ __ __ _______ __ __ __ + / _ | _ | ___| | | | | ____| | | | | | + | | | | |_| | |_ | | | | |___ | | / / + | | | | ___/| _| | | ____ | | | | + | |_| | | | |___| | | | ____| | |___ / / + _____/|__| |______|__| |__| |_______|______|__| |__| + + Diskless Workstation (v4.1/$dstr (c) ">/mnt/etc/issue ####################################################################### @@ -73,17 +74,21 @@ cp -a /rootfs/* /mnt 2>/dev/null # vmware stuff first part: two scenarios # * VM images in /usr/share/vmware - then simply link # * VM images via additional mount (mount source NFS, NBD, ...) - if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then + # get source of vmware image server (get type, server and path) + if [ -n "${imgsrv}" ] ; then + vmimgprot=$(uri_token $imgsrv prot) + vmimgserv=$(uri_token $imgsrv server) + vmimgpath="/$(uri_token $imgsrv path)" + # on DHCP config systems vmware image server might be coded into the + # $vmware variable + elif strinstr "/" "$vmware" ; then + vmimgprot=$(uri_token $vmware prot) + vmimgserv=$(uri_token $vmware server) + vmimgpath="/$(uri_token $vmware path)" + fi + if [ -n "${vmimgserv}" ] ; then testmkd /mnt/var/lib/vmware - # mount the vmware image source or link it (compatibility to ver. 3) - if [ -d /mnt/usr/share/vmware ] ; then - ln -sf /usr/share/vmware /mnt/var/lib/vmware - elif [ -n "${imgsrv}" ] ; then - # get type, server and path of VMware image export - vmimgprot=$(uri_token $imgsrv prot) - vmimgserv=$(uri_token $imgsrv server) - vmimgpath="/$(uri_token $imgsrv path)" case "${vmimgsprot}" in *nbd) ;; @@ -93,6 +98,10 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then error "${scfg_nfs}" nonfatal; noimg=yes; } ;; esac + # if only the path is given expect a local source within exported + # system (allow compatibility to older 3.X versions) + elif [ -n "${vmimgpath}" ] ; then + ln -s ${vmimgpath} /mnt/var/lib/vmware 2>/dev/null fi fi @@ -100,9 +109,9 @@ fi # set localization if [ -z "$country" ] ; then error "$scfg_country" nonfatal - country=${D_DEFAULTCOUNTRY} + country="${D_DEFAULTCOUNTRY}" fi -localization ${country} +localization "${country}" ####################################################################### # setup passwd and shadow for local system users like root, bin, daemon @@ -170,8 +179,8 @@ config_cron # setup system log services - distro dependent function config_syslog config_syslog -# configure dbus - distro dependent function config_dreshal - handle all -# stuff regarding dependent services like dbus, resmgr, hal ... +# configure dbus - distro dependent function config_dreshal - handle +# all stuff regarding dependent services like dbus, resmgr, hal ... # (check for runlevel scripts, passwd entries, directories ...) config_dreshal @@ -187,9 +196,9 @@ if [ -d /mnt/misc ] ; then else echo -e "# /etc/auto.master - file generated by $0:\n\ /misc\t#/etc/auto.misc" >/mnt/etc/auto.master - echo -e "# /etc/auto.misc - file generated by $0:\nautomount for removable \ -devices is mostly deprecated, so /misc is not\nactivated in auto.master." \ - > /mnt/etc/auto.misc + echo -e "# /etc/auto.misc - file generated by $0:\nautomount for \ +removable devices is mostly deprecated, so /misc is not\nactivated in \ +auto.master." > /mnt/etc/auto.misc fi if [ -n "${automnt_src}" ] ; then # local directory and home directory server from machine-setup @@ -251,7 +260,7 @@ if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then echo -e "# /etc/yp.conf - file generated by $0:\n#\t\ $date\n\nypserver "$nis_servers >/mnt/etc/yp.conf # should be last in passwd file - strinfile "+:::" /mnt/etc/passwd||echo "+::::::" >>/mnt/etc/passwd + strinfile "+:::" /mnt/etc/passwd || echo "+::::::" >>/mnt/etc/passwd config_nis fi @@ -264,7 +273,6 @@ config_nscd # create needed directories and files if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then - # in the future other types of sources besides NFS should be supported for i in /var/X11R6/bin /etc/vmware/vmnet1 /etc/vmware/vmnet8 \ /var/run/vmware /etc/X11/sessions ; do testmkd /mnt/$i @@ -280,7 +288,6 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then error "$scfg_vmdir" nonfatal else # add special sessions to the display managers session menu - # check here that mount finished and the important files are available # default kdm session. Xdialog with WM and VMware images cp /mnt/var/lib/vmware/templ/runvmware \ /mnt/var/X11R6/bin >/dev/null 2>&1 @@ -311,7 +318,7 @@ Type=Application" >/mnt/etc/X11/sessions/default.desktop #session_name=$(cat ${i} | grep -iw "exec" \ # | awk -F "=" '{print $2}') session_name=$(cat ${i}|sed -n "/^[Ee]xec/p"|sed -e "s,Exec=,,") - #copy bacause of initrd + # copy bacause of initrd cp /mnt/var/X11R6/bin/desktop-session \ /mnt/var/X11R6/bin/${session_name} #ln -s /mnt/var/X11R6/bin/desktop-session \ @@ -326,13 +333,13 @@ fi # wait for completion of detection, setup process waitfor /tmp/tmpready 10000 # create some directories and correct permissions -tmpisdisk=`sed -n '/\/tmp/p' /tmp/fstab 2>/dev/null` +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 # scratch space (if defined in $scratch) and prepared on server if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then scrproto=$(uri_token $FILESRC prot) scrpath=$(uri_token $FILESRC path) - mkdir -p /tmp/scratch >/dev/null 2>&1 + testmkd /tmp/scratch # exports have to be per client!! case "$scrproto" in nbd) @@ -341,6 +348,7 @@ if [ -n "$scratch" -a -z "$tmpisdisk" ] ; then *) tmpserv=$(uri_token $scratch server) tmppath=$(uri_token $scratch path) + # fixme - use nfsmnt and pass info on rw mount -t nfs -o rw,nolock,intr,nodev,soft,timeo=2,nosuid \ ${tmpserv}:/${tmppath} /tmp/scratch >/dev/null 2>&1 && { mkdir -p /tmp/scratch/${clientip} >/dev/null 2>&1 @@ -438,7 +446,7 @@ if [ "x$start_xdmcp" != "xno" ] ; then start_xdmcp=kdm fi # just ensure lowercase - start_xdmcp=`echo $start_xdmcp|sed -e "y/'KGWXDM'/'kgwxdm'/"` + start_xdmcp=$(echo $start_xdmcp|sed -e "y/'GKWXDM'/'gkwxdm'/") case "$start_xdmcp" in wdm) # anywhere in use!? @@ -469,7 +477,8 @@ DisplayManager.*.setup:\t\t/etc/X11/xdm/Xsetup\n\ DisplayManager.*.chooser:\t/etc/X11/xdm/RunChooser\n\ DisplayManager.*.startup:\t/etc/X11/xdm/Xstartup\n\ DisplayManager.*.session:\t/etc/X11/xdm/Xsession\n\ -DisplayManager.*.reset:\t\t/etc/X11/xdm/Xreset" >/mnt/etc/X11/xdm/xdm-config +DisplayManager.*.reset:\t\t/etc/X11/xdm/Xreset" \ + >/mnt/etc/X11/xdm/xdm-config [ "$xdmcp" = "false" ] && echo -e \ "DisplayManager.requestPort:\t0\n" >>/mnt/etc/X11/xdm/xdm-config # distro specific function config_xdm (at least for runlevel links) -- cgit v1.2.3-55-g7522