diff options
| author | Jonathan Bauer | 2013-08-02 17:27:28 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2013-08-02 17:27:28 +0200 |
| commit | 3ba5a58e5b04b771e6ee99ee6d6f772991c1c236 (patch) | |
| tree | 0d91e40266c79ac1f06cf07cef82fe70563f9a34 /remote/modules/vmchooser/data/etc | |
| parent | [rootfs-stage32] add find and grep to config file (diff) | |
| download | tm-scripts-3ba5a58e5b04b771e6ee99ee6d6f772991c1c236.tar.gz tm-scripts-3ba5a58e5b04b771e6ee99ee6d6f772991c1c236.tar.xz tm-scripts-3ba5a58e5b04b771e6ee99ee6d6f772991c1c236.zip | |
[vmchooser] moved all vmchooser specific files and scripts to /opt/openslx. Renamed 'var/lib/virt' to 'mnt/vmstore'. Added bwlehrpool theme for vmchooser#
Diffstat (limited to 'remote/modules/vmchooser/data/etc')
| -rw-r--r-- | remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf | 25 | ||||
| -rwxr-xr-x | remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env | 112 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser.conf | 4 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/etc/systemd/system/mount-vm-store.service (renamed from remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.service) | 0 | ||||
| l--------- | remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/mount-vm-store.service | 1 | ||||
| l--------- | remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/var-lib-virt.service | 1 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service | 2 |
7 files changed, 2 insertions, 143 deletions
diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf b/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf deleted file mode 100644 index ec757ce4..00000000 --- a/remote/modules/vmchooser/data/etc/openslx/vmchooser/smb.conf +++ /dev/null @@ -1,25 +0,0 @@ -# basic samba configuration file for OpenSLX host-internal networking -[global] - workgroup = OPENSLX - netbios name = HOMESERVER - security = SHARE - server string = Home and Print Provider - bind interfaces only = Yes - interfaces = NWIF - pid directory = PIDDIR - -[userhome] - comment = Home Directory of USER - path = /home/USER - create mask = 0700 - guest ok = No - read only = No - -[scratch] - comment = Host System Temp Folder - path = /tmp - create mask = 0700 - guest ok = Yes - read only = No - browseable = Yes - diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env b/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env deleted file mode 100755 index e2a3e063..00000000 --- a/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser-env +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh - -export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin - -#source config file with vars (e.g. ipaddr, macaddr, hostname) -. /opt/openslx/config - -#from plugins/vmchooser/40-started-hw-config/run-virt.sh -#TODO: extra systemd-service for hwinfo -hwinfo --cdrom | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.cdrom -hwinfo --floppy | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.floppy - -#from plugins/vmchooser/XX_vmchooser.sh -VMCHOOSER_CONF_DIR=/etc/openslx/vmchooser - -mkdir -p ${VMCHOOSER_CONF_DIR}/loopimg -mkdir -p ${VMCHOOSER_CONF_DIR}/fd-loop -m 1777 - -# mount a clean tempfs (bug in UnionFS prevents loopmount to work) -grep -qE "unionfs |aufs " /proc/mounts && \ -mount -n -o size=1500k -t tmpfs vm-loopimg ${VMCHOOSER_CONF_DIR}/loopimg - -# create an empty floppy image of 1.4MByte size -dd if=/dev/zero of=${VMCHOOSER_CONF_DIR}/loopimg/fd.img count=2880 bs=512 2>/dev/null -chmod 0777 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img - -# use dos formatter copied into stage3 -mkdosfs ${VMCHOOSER_CONF_DIR}/loopimg/fd.img >/dev/null 2>&1 #|| error -mount -n -t msdos -o loop,umask=000 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img \ - ${VMCHOOSER_CONF_DIR}/fd-loop - -#pvs integration -#if [ $vmchooser_pvs -ne 0 ]; then -# sed -i /usr/share/xsessions/default.desktop \ -# -e "s,vmchooser$,vmchooser --pvs," -#fi - -# setup more scratch space for virtual machines, if configured -mkdir -p /tmp/virt -mkdir -p /var/log/samba - -# enable normal users to setup the extended virtual machine redo file space -# and image source via network block device (NBD only at the moment) -# allow to start/stop samba on virtual devices (latter one ignores multiple -# independent daemons) - -#cat >> /mnt/etc/sudoers << EOF -# allow to start and stop the special /tmp redo file space (RAM + NBD/NFS server RAID) -#ALL ALL=NOPASSWD: /sbin/losetup /dev/loop* -#ALL ALL=NOPASSWD: /sbin/mdadm -C /dev/md0 -l linear --raid-devices=2 /dev/loop* /dev/* -#ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/sbin/nbd-client * * /dev/nbd* -# allow to configure and start/stop samba services -#ALL ALL=NOPASSWD: /opt/openslx/rootfs/bin/sed -i /etc/*/smb.conf -e * -#ALL ALL=NOPASSWD: /usr/sbin/nmbd -s /etc/*/smb.conf -#ALL ALL=NOPASSWD: /usr/sbin/smbd -s /etc/*/smb.conf -#ALL ALL=NOPASSWD: /opt/openslx/rootfs/usr/bin/killall nmbd smbd -#EOF - -#from plugins/vmchooser/80-after-plugins/virtualization.sh - -# change free mem -mem_free=$(grep -i "^memfree:" /proc/meminfo | awk '{print $2}') -mem_cached=$(grep -i "^cached:" /proc/meminfo | awk '{print $2}') -mem_swapcached=$(grep -i "^swapcached:" /proc/meminfo | awk '{print $2}') -[ -z "$mem_free" ] && mem_free="2048000" -[ -z "$mem_cached" ] && mem_cached="0" -[ -z "$mem_swapcached" ] && mem_swapcached="0" -totalmem="$[ ( $mem_free + $mem_cached + $mem_swapcached ) / 1024 ]" -echo "totalmem=${totalmem}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - -# cpu cores -CPU_CORES=$(grep '^processor.*:' /proc/cpuinfo | wc -l) -if [ "${CPU_CORES}" -gt "1" 2>/dev/null ]; then - echo "cpu_cores=${CPU_CORES}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf -else - echo 'cpu_cores=1' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf -fi - -# arch -echo "host_arch=$(uname -m)" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - -# VT enabled cpu? -if grep -q ^flags.*\\\<vmx\\\> /proc/cpuinfo; then - echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - echo 'kvm_module="kvm_intel"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - elif grep -q ^flags.*\\\<svm\\\> /proc/cpuinfo; then - echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - echo 'kvm_module="kvm_amd"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - else - echo "vtflag=0" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf -fi - -# write mac -echo "hostmacaddr=${SLX_PXE_MAC}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf -# ip addr -echo "hostip=${SLX_PXE_CLIENT_IP}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf -# hostname -echo "hostname=${SLX_HOSTNAME}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - -# get further hw information -j=0 -for i in $(cat /etc/openslx/hwinfo.cdrom); do - echo "cdrom_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - j=$(expr $j + 1) -done - -j=0 -for i in $(cat /etc/openslx/hwinfo.floppy); do - echo "floppy_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - j=$(expr $j + 1) -done - diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser.conf b/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser.conf deleted file mode 100644 index 3dd30ebc..00000000 --- a/remote/modules/vmchooser/data/etc/openslx/vmchooser/vmchooser.conf +++ /dev/null @@ -1,4 +0,0 @@ -pool=default -theme=unifr -pvs=0 -path=/var/lib/virt diff --git a/remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.service b/remote/modules/vmchooser/data/etc/systemd/system/mount-vm-store.service index cfaa7af8..cfaa7af8 100644 --- a/remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.service +++ b/remote/modules/vmchooser/data/etc/systemd/system/mount-vm-store.service diff --git a/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/mount-vm-store.service b/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/mount-vm-store.service new file mode 120000 index 00000000..d6a88c27 --- /dev/null +++ b/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/mount-vm-store.service @@ -0,0 +1 @@ +../mount-vm-store.service
\ No newline at end of file diff --git a/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/var-lib-virt.service b/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/var-lib-virt.service deleted file mode 120000 index f51adef6..00000000 --- a/remote/modules/vmchooser/data/etc/systemd/system/network.target.wants/var-lib-virt.service +++ /dev/null @@ -1 +0,0 @@ -../var-lib-virt.service
\ No newline at end of file diff --git a/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service b/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service index 001d90f3..1a5a980a 100644 --- a/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service +++ b/remote/modules/vmchooser/data/etc/systemd/system/vmchooser.service @@ -6,4 +6,4 @@ Before=graphical.target [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/etc/openslx/vmchooser/vmchooser-env +ExecStart=/opt/openslx/scripts/systemd-vmchooser_env |
