From b6dfee201e2217e826551957bb5b4139f96c2b7c Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 2 Apr 2015 17:17:35 +0200 Subject: [hdd-boot] michi's werk --- server/configs/curitiba/cups-curitiba | 1 - server/configs/curitiba/pam-curitiba | 1 - .../configs/curitiba/ubuntu-13.04-pulseaudio-fix | 1 - server/configs/curitiba/ubuntu-13.10-unity-fix | 1 - .../opt/openslx/dnbd3-cache/alt-servers | 2 +- .../hdd-boot/opt/openslx/scripts/systemd-hdd_boot | 52 ++++++++++++---------- 6 files changed, 29 insertions(+), 29 deletions(-) delete mode 120000 server/configs/curitiba/cups-curitiba delete mode 120000 server/configs/curitiba/pam-curitiba delete mode 120000 server/configs/curitiba/ubuntu-13.04-pulseaudio-fix delete mode 120000 server/configs/curitiba/ubuntu-13.10-unity-fix diff --git a/server/configs/curitiba/cups-curitiba b/server/configs/curitiba/cups-curitiba deleted file mode 120000 index 99418604..00000000 --- a/server/configs/curitiba/cups-curitiba +++ /dev/null @@ -1 +0,0 @@ -../../modules/cups-curitiba/ \ No newline at end of file diff --git a/server/configs/curitiba/pam-curitiba b/server/configs/curitiba/pam-curitiba deleted file mode 120000 index 476a0cb2..00000000 --- a/server/configs/curitiba/pam-curitiba +++ /dev/null @@ -1 +0,0 @@ -../../modules/pam-curitiba/ \ No newline at end of file diff --git a/server/configs/curitiba/ubuntu-13.04-pulseaudio-fix b/server/configs/curitiba/ubuntu-13.04-pulseaudio-fix deleted file mode 120000 index 92979703..00000000 --- a/server/configs/curitiba/ubuntu-13.04-pulseaudio-fix +++ /dev/null @@ -1 +0,0 @@ -../../modules/ubuntu-13.04-pulseaudio-fix/ \ No newline at end of file diff --git a/server/configs/curitiba/ubuntu-13.10-unity-fix b/server/configs/curitiba/ubuntu-13.10-unity-fix deleted file mode 120000 index 15cde030..00000000 --- a/server/configs/curitiba/ubuntu-13.10-unity-fix +++ /dev/null @@ -1 +0,0 @@ -../../modules/ubuntu-13.10-unity-fix \ No newline at end of file diff --git a/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/alt-servers b/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/alt-servers index 3d9801ca..b6347315 100644 --- a/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/alt-servers +++ b/server/modules/dnbd3-cache/opt/openslx/dnbd3-cache/alt-servers @@ -1 +1 @@ --200.17.202.46 SLXBOX DNBD3 SERVER +-132.230.4.1 SLXBOX DNBD3 SERVER diff --git a/server/modules/hdd-boot/opt/openslx/scripts/systemd-hdd_boot b/server/modules/hdd-boot/opt/openslx/scripts/systemd-hdd_boot index c1c19b78..f975b697 100755 --- a/server/modules/hdd-boot/opt/openslx/scripts/systemd-hdd_boot +++ b/server/modules/hdd-boot/opt/openslx/scripts/systemd-hdd_boot @@ -1,5 +1,5 @@ #!/bin/bash - +set -x # Downloading all in SLX_BASE_PATH to /boot Example: Ubuntu_1404_x64 # wget -N, update if the file has been changed boot_download () { @@ -34,9 +34,11 @@ if [ -d /cache/export/dnbd3 -a -d /mnt/vmstore ]; then image_name=$(echo $(basename "$FILE") | cut -d "." -f1) cd /mnt/vmstore for XML in $(grep -rIl --include "*.xml" "$image_name" .); do - cp $XML /boot/vmstore + xmldir=$(dirname $XML) + mkdir -p /boot/vmstore/${xmldir} + cp $XML /boot/vmstore/${xmldir}/ done - cd - + cd - >/dev/null done fi @@ -47,59 +49,61 @@ if ! grep -qs '/mnt/vmstore' /proc/mounts; then fi # if SLX_BASE_PATH already exists, just update. Does not make the menu again. -[ -d /boot/$SLX_BASE_PATH ] && { boot_download; echo "$SLX_BASE_PATH updated"; exit 0; } || boot_download +[ -d /boot/$SLX_BASE_PATH ] && { boot_download; echo "$SLX_BASE_PATH updated"; } || { boot_download; echo "New base $SLX_BASE_PATH downloaded to HDD"; } # Installing GRUB #Find disk of /boot -BOOT_DISK=$(df | grep /boot | awk '{print $1}' | tr -d '[0-9]') +BOOT_DISK=$(df | grep /boot | awk '{print $1}' | tr -d '[0-9]' | cut -c 6-) BOOT_PART=$(df | grep /boot | awk '{print $1}' | tr -dc '[0-9]') [ -z "$BOOT_DISK" ] && { echo "BOOT DISK could not be found, exiting."; exit 1; } #Check if disk is msdos or GPT -if sgdisk $BOOT_DISK | grep -qs 'invalid GPT'; then +if sgdisk /dev/$BOOT_DISK | grep -qs 'invalid GPT'; then BOOT_TYPE='msdos' else BOOT_TYPE='gpt' fi if [ ! -d /boot/grub ]; then - # First, copy grub.cfg - [ -e /opt/openslx/hdd-boot/grub.cfg ] && cp -r /opt/openslx/hdd-boot/grub.cfg /boot/grub/ - grub-install --boot-directory=/boot $BOOT_DISK + grub-install --boot-directory=/boot /dev/$BOOT_DISK update-grub-gfxpayload RET=$? [ $RET != 0 ] && { echo "Could not install GRUB"; exit 1; } || echo "GRUB successfully installed" + + # First, copy grub.cfg + [ -e /opt/openslx/hdd-boot/grub.cfg ] && cp -r /opt/openslx/hdd-boot/grub.cfg /boot/grub/ fi -#GRUB ok, so lets make the menu -echo " BOOT DISK is $BOOT_DISK" #Just for test -case $BOOT_DISK in - /dev/sda) GRUB_DISK=hd0 ;; - /dev/sdb) GRUB_DISK=hd1 ;; - /dev/sdc) GRUB_DISK=hd2 ;; - /dev/sdd) GRUB_DISK=hd3 ;; - /dev/sde) GRUB_DISK=hd4 ;; - *) echo "GRUB_DISK was not found" +#Add new base to grub.cfg +if ! grep -qs "menuentry '$SLX_BASE_PATH'" /boot/grub/grub.cfg; then + + #GRUB ok, so lets make the menu + echo "BOOT DISK is $BOOT_DISK" #Just for test + case $BOOT_DISK in + sda) GRUB_DISK=hd0 ;; + sdb) GRUB_DISK=hd1 ;; + sdc) GRUB_DISK=hd2 ;; + sdd) GRUB_DISK=hd3 ;; + sde) GRUB_DISK=hd4 ;; + *) echo "GRUB_DISK was not found" exit 1 ;; -esac - -echo "GRUB_DISK $GRUB_DISK" #Just for test + esac -[ -e /boot/grub/grub.cfg ] || { echo "Could not find grub.cfg"; exit 1; } + [ -e /boot/grub/grub.cfg ] || { echo "Could not find grub.cfg"; exit 1; } cat <> /boot/grub/grub.cfg ######################### menuentry '$SLX_BASE_PATH' { - linux ($GRUB_DISK,${BOOT_TYPE}$BOOT_PART)/$SLX_BASE_PATH/kernel hdd_boot=$BOOT_PART $KCL + linux ($GRUB_DISK,${BOOT_TYPE}$BOOT_PART)/$SLX_BASE_PATH/kernel hdd_boot=${BOOT_DISK}$BOOT_PART $KCL initrd ($GRUB_DISK,${BOOT_TYPE}$BOOT_PART)/$SLX_BASE_PATH/initramfs-stage31 } ######################### EOF -echo "GRUB INSTALLED =) =)" +fi true -- cgit v1.2.3-55-g7522