From 1c43a24f2ed440a2a717173bda896e18fbcdc058 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Thu, 1 Jun 2006 00:15:02 +0000 Subject: better(?) handling of vm-stuff integration (not tested), use versions three days ago if anything fails ... git-svn-id: http://svn.openslx.org/svn/openslx/ld4@245 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initrd/initrd-stuff/bin/servconfig | 106 ++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 44 deletions(-) (limited to 'initrd/initrd-stuff/bin/servconfig') diff --git a/initrd/initrd-stuff/bin/servconfig b/initrd/initrd-stuff/bin/servconfig index 592fbb04..bb39e72a 100755 --- a/initrd/initrd-stuff/bin/servconfig +++ b/initrd/initrd-stuff/bin/servconfig @@ -4,7 +4,7 @@ # for linux diskless clients (executed within initial # ramdisk) # -# Author(s): Dirk von Suchodoletz , 26-05-2006 +# Author(s): Dirk von Suchodoletz , 01-06-2006 # Michael Janczyk, 31-05-2006 # # Copyright: (c) 2006 - RZ Universitaet Freiburg @@ -71,6 +71,21 @@ sed -e "s/\$serverip/$serverip/;s/\$clientip/$clientip/" \ cp /etc/machine-setup.new /etc/machine-setup . /etc/machine-setup +####################################################################### +# 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 + # 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 + # # more general mount script should be used here!? + ( nfsmnt ${imgsrv} /mnt/var/lib/vmware || error "$scfg_nfs" nonfatal ) & + fi +fi + ####################################################################### # set localization if [ -z "$country" ] ; then @@ -254,9 +269,23 @@ config_sshd config_snmp ####################################################################### -# vmware stuff: two scenarios -# * VM images in /usr/share/vmware - then simply link -# * VM images via additional mount (mount source NFS, NBD, ...) +# NIS +# setup nis configuration if needed +if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then + echo $nis_domain >/mnt/etc/defaultdomain + 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 + config_nis +fi + +####################################################################### +# name service caching daemon if networked user database +config_nscd + +####################################################################### +# vmware stuff second part: setting up the environment # create needed directories and files if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then @@ -265,20 +294,15 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then /var/run/vmware /etc/X11/sessions ; do testmkd /mnt/$i done + # moved up within this file!! # mount the vmware image source or link it (compatibility to ver. 3) - if [ -d /mnt/usr/share/vmware ] ; then - ln -sf /usr/share/vmware /var/lib/vmware - elif [ -n "${imgsrv}" ] ; then - # more general mount script should be used here!? - ( nfsmnt ${imgsrv} /mnt/var/lib/vmware || error "$scfg_nfs" nonfatal ) & - fi + #if [ -d /mnt/usr/share/vmware ] ; then + # ln -sf /usr/share/vmware /var/lib/vmware + #elif [ -n "${imgsrv}" ] ; then + # # more general mount script should be used here!? + # ( nfsmnt ${imgsrv} /mnt/var/lib/vmware || error "$scfg_nfs" nonfatal ) & + #fi # generate a runlevel script - # - # - # HACK!!! - # Links not created because of non existing vmware dir (see above ->&) - # replace awk and grep, etc ... - # d_mkrlscript init vmware-prep "Starting preparation of vmware environment" sed "s,^#.*,,;/^$/d;s,^,\t," /etc/vmware-prep >> \ /mnt/etc/${D_INITDIR}/vmware-prep @@ -286,6 +310,19 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then chmod u+x /mnt/etc/${D_INITDIR}/vmware-prep cp /mnt/var/lib/vmware/templ/runvmware /mnt/var/X11R6/bin chmod 755 /mnt/var/X11R6/bin/runvmware >/dev/null 2>&1 + config_vmware + chmod 1777 /mnt/var/run/vmware + # define a variable where gdm/kdm should look for additional sessions + export vmsessions=/var/lib/vmware/vmsessions + # create default.desktop for kdm + echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=Default\n\ +Name[de]=Standard\nExec=defaultwm\nTryExec=/var/X11R6/bin/defaultwm\n\ +Type=Application" >/mnt/etc/X11/sessions/default.desktop + rm /mnt/etc/vmware/not_configured 2>/dev/null + # add special sessions to the display managers session menu + # check here that mount finished and the important files are available + waitfor 5000 /mnt/var/lib/vmware/templ/runvmware || \ + error "$scfg_vmdir" nonfatal # default kdm session. Xdialog with WM and VMware images cp /mnt/var/lib/vmware/templ/defaultwm /mnt/var/X11R6/bin chmod 755 /mnt/var/X11R6/bin/defaultwm >/dev/null 2>&1 @@ -297,40 +334,21 @@ if [ "x$vmware" != "x" ] && [ "x$vmware" != "xno" ] ; then > /mnt/var/X11R6/bin/desktop-session chmod 755 /mnt/var/X11R6/bin/desktop-session sessions=$(ls /mnt/var/lib/vmware/vmsessions/*.desktop 2>/dev/null) + # fixme: the following part is to be tested!! if [ -n "${sessions}" ]; then for i in /mnt/var/lib/vmware/vmsessions/*.desktop; do - session_name=$(cat ${i} | grep -iw "exec" \ - | awk -F "=" '{print $2}') - ln -sf /var/X11R6/bin/desktop-session /var/X11R6/bin/${session_name} + #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 + cp /mnt/var/X11R6/bin/desktop-session \ + /mnt/var/X11R6/bin/${session_name} + #ln -s /mnt/var/X11R6/bin/desktop-session \ + # /mnt/var/X11R6/bin/${session_name} done fi - config_vmware - chmod 1777 /mnt/var/run/vmware - # define a variable where gdm/kdm should look for additional sessions - export vmsessions=/var/lib/vmware/vmsessions - # create default.desktop for kdm - echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=Default\n\ -Name[de]=Standard\nExec=defaultwm\nTryExec=/var/X11R6/bin/defaultwm\n\ -Type=Application" >/mnt/etc/X11/sessions/default.desktop - rm /mnt/etc/vmware/not_configured 2>/dev/null fi -####################################################################### -# NIS -# setup nis configuration if needed -if [ "x$nis_domain" != "x" ] && [ "x$nis_servers" != "x" ] ; then - echo $nis_domain >/mnt/etc/defaultdomain - 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 - config_nis -fi - -####################################################################### -# name service caching daemon if networked user database -config_nscd - ####################################################################### # preparation of /tmp directory (partition 44, nfs scratch, ramdisk) waitfor /tmp/tmpready 10000 -- cgit v1.2.3-55-g7522