From 48f5cf5cf24265caf3ffa83ab1321ab43cf24ae0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 23 May 2013 18:00:24 +0200 Subject: update to server setup script --- data/openslx-ng-install | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'data') diff --git a/data/openslx-ng-install b/data/openslx-ng-install index 0e71684e..7b8715b7 100755 --- a/data/openslx-ng-install +++ b/data/openslx-ng-install @@ -202,6 +202,97 @@ if [ "x$1" != "x--test" ] && check_password "root" "openslx-ng"; then done fi +print "" +print "Beginne Installation" + +# +# ---- Compile iPXE ---- +# +print "" +print "Erstelle iPXE Binary..." +sleep 3 +cd /opt/openslx/ipxe || error "cd /opt/openslx/ipxe failed" +cat > ipxelinux.ipxe << HEREEND +#!ipxe +set use-cached 1 +dhcp net0 +set net0.dhcp/next-server $SLX_LOCAL_ADDR +set net0.dhcp/filename ipxelinux.0 +imgload pxelinux.0 +boot pxelinux.0 +HEREEND +cd src || error "cd src failed" +[ -e "bin/undionly.kkkpxe" ] && unlink "bin/undionly.kkkpxe" +make bin/undionly.kkkpxe EMBED=../ipxelinux.ipxe,../pxelinux.0 +[ ! -e "bin/undionly.kkkpxe" -o "$(stat -c %s "bin/undionly.kkkpxe")" -lt 80000 ] && error "Error compiling ipxelinux.0" +cp "bin/undionly.kkkpxe" "/srv/openslx/tftp/ipxelinux.0" || error "Could not write to /srv/openslx/tftp/ipxelinux.0" + +# +# +# +if [[ "$SLX_VM_NFS_TYPE" == "L" ]]; then + # Write SMB Config +cat > "/etc/samba/smb.conf" << HEREEND +[global] + +workgroup = WORKGROUP +server string = OpenSLX-NG Test-Server + +wins support = no +dns proxy = no +name resolve order = host + +log file = /var/log/samba/log.%m +max log size = 100 +syslog only = no +syslog = 0 + +panic action = /usr/share/samba/panic-action %d + +security = user +encrypt passwords = true +passdb backend = tdbsam +obey pam restrictions = yes + +domain master = no + +[images] + comment = Directory where all the VMWare Images go + writeable = yes + locking = no + path = $SLX_VM_PATH + guest ok = no + valid users = vmware +HEREEND + # End SMB Config + chown -R vmware "$SLX_VM_PATH" + # NFS Config + echo "$SLX_VM_PATH *(ro,async,insecure,no_root_squash,no_subtree_check)" > "/etc/exports" + # End NFS Config + service samba restart + service nfs-kernel-server restart + # TODO: Persistent inbound blocking of tcp 139, udp 137,138 to speed up access from Windows Clients + update-rc.d samba defaults + update-rc.d nfs-kernel-server defaults +else # external NFS Server for VM Images is used. Disable NFS + Samba + service samba stop + service nfs-kernel-server stop + for LEVEL in S 0 1 2 3 4 5; do + update-rc.d samba disable "$LEVEL" + update-rc.d nfs-kernel-server disable "$LEVEL" + done +fi + +# +# ---- Create boottime system config ---- +# +print "" +print "Schreibe Bootzeit-Konfiguration für MiniLinux" +cat > "/srv/openslx/www/config" << HEREEND +SLX_VM_NFS='$SLX_VM_NFS' +HEREEND + SLX_LAST_INVOCATION="$(date)" save_defaults +print "Einrichtung abgeschlossen." -- cgit v1.2.3-55-g7522