From 6f2d425076a2470a833208b72992c048a34135b6 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jan 2014 14:36:43 +0100 Subject: [rootfs-stage31] fix permission for FUTURE_ROOT --- remote/rootfs/rootfs-stage31/data/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index b5759491..ae65d9da 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -26,7 +26,7 @@ busybox mount -n -t tmpfs -o 'mode=755' run "/run" # preparations for mounting stage3.2 FUTURE_ROOT="/dev/shm/uniontmp" mkdir -p "$FUTURE_ROOT" /rorootfs -busybox mount -n -t tmpfs none "$FUTURE_ROOT" +busybox mount -n -t tmpfs -o 'mode=755' none "$FUTURE_ROOT" mkdir -p "$FUTURE_ROOT/opt/openslx" # let kernel know that mdev is to be used for hotplug -- cgit v1.2.3-55-g7522 From b8ff672764c7f1d76294bced8f079c446ec83b18 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jan 2014 14:41:12 +0100 Subject: [rootfs-stage31] remove annoying error messages --- remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig b/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig index 3f8029a7..580b23ed 100755 --- a/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig +++ b/remote/rootfs/rootfs-stage31/data/bin/activate_sysconfig @@ -64,7 +64,7 @@ HEREEND local TEMP_EXTRACT_DIR="/tmp/config.tgz.tmp" mkdir -p "${TEMP_EXTRACT_DIR}" tar xf "${CONFIG}.tgz" -C "${TEMP_EXTRACT_DIR}" || { echo "Could not untar ${CONFIG}.tgz to ${TEMP_EXTRACT_DIR}"; return 1; } - chown -R 0:0 "${TEMP_EXTRACT_DIR}" + chown -R 0:0 "${TEMP_EXTRACT_DIR}" 2>/dev/null cd "${TEMP_EXTRACT_DIR}" tar -cp * | tar -xp -C "${FUTURE_ROOT}" } -- cgit v1.2.3-55-g7522 From 2886b95ce44f678ce6bea5bf9b6dead40643059f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jan 2014 14:57:38 +0100 Subject: [stage4] renamed nfs-mount to mount-stage4. Added new 'stage4.target'. --- .../data/etc/systemd/system/mount-stage4.service | 10 ++++ .../data/etc/systemd/system/nfs-mount.service | 11 +--- .../data/etc/systemd/system/stage4.target | 3 + .../data/opt/openslx/scripts/systemd-mount_export | 60 -------------------- .../data/opt/openslx/scripts/systemd-mount_stage4 | 64 ++++++++++++++++++++++ .../system/basic.target.wants/mount-stage4.service | 1 + .../system/basic.target.wants/nfs-mount.service | 1 - 7 files changed, 79 insertions(+), 71 deletions(-) create mode 100644 remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service mode change 100644 => 120000 remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service create mode 100644 remote/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target delete mode 100755 remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export create mode 100755 remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 create mode 120000 server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/mount-stage4.service delete mode 120000 server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/nfs-mount.service diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service new file mode 100644 index 00000000..15725f8f --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/mount-stage4.service @@ -0,0 +1,10 @@ +[Unit] +Description=Mount Openslx Stage 4 +DefaultDependencies=no +Wants=setup-dnbd3.service +After=setup-dnbd3.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/opt/openslx/scripts/systemd-mount_stage4 diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service deleted file mode 100644 index 3deb3def..00000000 --- a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Mount NFS Share [TEST] -DefaultDependencies=no -Wants=setup-dnbd3.service -After=setup-dnbd3.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/opt/openslx/scripts/systemd-mount_export diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service new file mode 120000 index 00000000..c1792e42 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/nfs-mount.service @@ -0,0 +1 @@ +mount-stage4.service \ No newline at end of file diff --git a/remote/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target new file mode 100644 index 00000000..465a324c --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/etc/systemd/system/stage4.target @@ -0,0 +1,3 @@ +[Unit] + +Description=OpenSLX Stage 4 diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export deleted file mode 100755 index 4c8597a9..00000000 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -# Needs full bash - -. /opt/openslx/config - -[ -z "${SLX_STAGE4}" ] && { echo "SLX_STAGE4 is not set in /opt/openslx/config." && exit 1; } - -MOUNTPOINT="/opt/openslx/mnt/stage4" -mkdir -p "$MOUNTPOINT" - -if [[ "$SLX_STAGE4" == dnbd3* ]]; then - # dnbd3 it is - if [ -z "${SLX_DNBD3_SERVERS}${SLX_DNBD3_PRIO_SERVERS}" ]; then - slxlog --echo "mount-stage4" "dnbd3 stage4 configured, but SLX_DNBD3(_PRIO)_SERVERS empty or not set in /opt/openslx/config." - exit 1 - fi - # Determine revision - if [ -z "$SLX_STAGE4_RID" ] || echo "$SLX_STAGE4_RID" | grep -v -q -E "^[0-9]+$"; then - SLX_STAGE4_RID="0" - fi - # Randomize list - SERVERS=$(for SERVER in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //') - IMAGE=$(echo $SLX_STAGE4 | awk '{printf $2}') - [ -e /var/run/dnbd3.socket ] || sleep 2 # Ugly, service should only start when dnbd3 daemon is up and running - RET=1337 - for SRV in $SLX_DNBD3_PRIO_SERVERS $SERVERS; do - echo "Requesting $IMAGE from $SRV" - dnbd3=$(dnbd3-client -h "$SRV" -i "$IMAGE" -r "$SLX_STAGE4_RID") - RET=$? - [ "$RET" -eq "0" ] && break - echo "... didn't work ($RET)" - sleep 1 - done - if [ "$RET" -ne "0" ]; then - slxlog --echo "mount-stage4" "Could not get stage4 via dnbd3 ($IMAGE : $SLX_STAGE4_RID) ($SLX_DNBD3_PRIO_SERVERS / $SERVERS)" - exit $RET - fi - echo "Mounting $dnbd3 to $MOUNTPOINT" - if ! mount -t squashfs -o ro "$dnbd3" "$MOUNTPOINT"; then - slxlog --echo "mount-stage4" "Could not mount stage4 from '$dnbd3' to '$MOUNTPOINT' ($SRV, $IMAGE)" - exit 1 - fi -else - # Try nfs - echo "Mounting ${SLX_STAGE4} to $MOUNTPOINT" - if ! mount -t nfs -o ro,async,nolock,vers=3 "$SLX_STAGE4" "$MOUNTPOINT"; then - slxlog --echo "mount-stage4" "Could not mount stage4 from '$SLX_STAGE4' to '$MOUNTPOINT'" - exit 1 - fi -fi - -echo "Appending $MOUNTPOINT to /" -if ! mount -o "remount,add:1:$MOUNTPOINT=ro" /; then - slxlog --echo "mount-stage4" "Could not append mounted stage4 at '$MOUNTPOINT' to aufs at /" - exit 1 -fi - -# dbus reload needed eg. for gnome etc. and perhaps other service files which stage4 needs: -systemctl reload dbus.service - diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 new file mode 100755 index 00000000..abc28f73 --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_stage4 @@ -0,0 +1,64 @@ +#!/bin/bash +# Needs full bash + +. /opt/openslx/config + +[ -z "${SLX_STAGE4}" ] && { echo "SLX_STAGE4 is not set in /opt/openslx/config." && exit 1; } + +MOUNTPOINT="/opt/openslx/mnt/stage4" +mkdir -p "$MOUNTPOINT" + +if [[ "$SLX_STAGE4" == dnbd3* ]]; then + # dnbd3 it is + if [ -z "${SLX_DNBD3_SERVERS}${SLX_DNBD3_PRIO_SERVERS}" ]; then + slxlog --echo "mount-stage4" "dnbd3 stage4 configured, but SLX_DNBD3(_PRIO)_SERVERS empty or not set in /opt/openslx/config." + exit 1 + fi + # Determine revision + if [ -z "$SLX_STAGE4_RID" ] || echo "$SLX_STAGE4_RID" | grep -v -q -E "^[0-9]+$"; then + SLX_STAGE4_RID="0" + fi + # Randomize list + SERVERS=$(for SERVER in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //') + IMAGE=$(echo $SLX_STAGE4 | awk '{printf $2}') + [ -e /var/run/dnbd3.socket ] || sleep 2 # Ugly, service should only start when dnbd3 daemon is up and running + RET=1337 + for SRV in $SLX_DNBD3_PRIO_SERVERS $SERVERS; do + echo "Requesting $IMAGE from $SRV" + dnbd3=$(dnbd3-client -h "$SRV" -i "$IMAGE" -r "$SLX_STAGE4_RID") + RET=$? + [ "$RET" -eq "0" ] && break + echo "... didn't work ($RET)" + sleep 1 + done + if [ "$RET" -ne "0" ]; then + slxlog --echo "mount-stage4" "Could not get stage4 via dnbd3 ($IMAGE : $SLX_STAGE4_RID) ($SLX_DNBD3_PRIO_SERVERS / $SERVERS)" + exit $RET + fi + echo "Mounting $dnbd3 to $MOUNTPOINT" + if ! mount -t squashfs -o ro "$dnbd3" "$MOUNTPOINT"; then + slxlog --echo "mount-stage4" "Could not mount stage4 from '$dnbd3' to '$MOUNTPOINT' ($SRV, $IMAGE)" + exit 1 + fi +else + # Try nfs + echo "Mounting ${SLX_STAGE4} to $MOUNTPOINT" + if ! mount -t nfs -o ro,async,nolock,vers=3 "$SLX_STAGE4" "$MOUNTPOINT"; then + slxlog --echo "mount-stage4" "Could not mount stage4 from '$SLX_STAGE4' to '$MOUNTPOINT'" + exit 1 + fi +fi + +echo "Appending $MOUNTPOINT to /" +if ! mount -o "remount,add:1:$MOUNTPOINT=ro" /; then + slxlog --echo "mount-stage4" "Could not append mounted stage4 at '$MOUNTPOINT' to aufs at /" + exit 1 +fi + +# dbus reload needed eg. for gnome etc. and perhaps other service files which stage4 needs: +systemctl reload dbus.service + +# tell systemd that stage4 was reached. +systemctl start stage4.target & + +exit 0 diff --git a/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/mount-stage4.service b/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/mount-stage4.service new file mode 120000 index 00000000..80390894 --- /dev/null +++ b/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/mount-stage4.service @@ -0,0 +1 @@ +../mount-stage4.service \ No newline at end of file diff --git a/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/nfs-mount.service b/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/nfs-mount.service deleted file mode 120000 index 1936daef..00000000 --- a/server/modules/stage4-at-boot/etc/systemd/system/basic.target.wants/nfs-mount.service +++ /dev/null @@ -1 +0,0 @@ -../nfs-mount.service \ No newline at end of file -- cgit v1.2.3-55-g7522 From 26ade341b010bccbbd9ecba37404ebdc0b5f2407 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 16 Jan 2014 15:48:45 +0100 Subject: [xorg] xprintidle deleted from REQUIRED_CONTENT_PACKAGES (and in Debian also from REQUIRED_INSTALLED_PACKAGES) --- remote/modules/xorg/xorg.conf.debian | 2 -- remote/modules/xorg/xorg.conf.opensuse | 1 - remote/modules/xorg/xorg.conf.ubuntu | 1 - 3 files changed, 4 deletions(-) diff --git a/remote/modules/xorg/xorg.conf.debian b/remote/modules/xorg/xorg.conf.debian index b1c26ae9..2cc9d6f1 100644 --- a/remote/modules/xorg/xorg.conf.debian +++ b/remote/modules/xorg/xorg.conf.debian @@ -1,5 +1,4 @@ REQUIRED_INSTALLED_PACKAGES=" - xprintidle " REQUIRED_CONTENT_PACKAGES=" xserver-xorg$UBUNTU_XORG_PKG_SUFFIX @@ -34,7 +33,6 @@ REQUIRED_CONTENT_PACKAGES=" @xserver-xorg-video-geode$UBUNTU_XORG_PKG_SUFFIX @xserver-xorg-video-s3$UBUNTU_XORG_PKG_SUFFIX @xserver-xorg-video-tdfx$UBUNTU_XORG_PKG_SUFFIX - xprintidle " REQUIRED_DIRECTORIES+=" /usr/lib diff --git a/remote/modules/xorg/xorg.conf.opensuse b/remote/modules/xorg/xorg.conf.opensuse index ef353a4c..1e6f5ff1 100644 --- a/remote/modules/xorg/xorg.conf.opensuse +++ b/remote/modules/xorg/xorg.conf.opensuse @@ -37,7 +37,6 @@ REQUIRED_CONTENT_PACKAGES=" libpixman-1-0 xrandr vaapi-intel-driver - xprintidle " REQUIRED_LIBRARIES=" libI810XvMC diff --git a/remote/modules/xorg/xorg.conf.ubuntu b/remote/modules/xorg/xorg.conf.ubuntu index e62a50f8..69c3e64c 100644 --- a/remote/modules/xorg/xorg.conf.ubuntu +++ b/remote/modules/xorg/xorg.conf.ubuntu @@ -33,7 +33,6 @@ REQUIRED_CONTENT_PACKAGES=" @xserver-xorg-video-geode$UBUNTU_XORG_PKG_SUFFIX @xserver-xorg-video-s3$UBUNTU_XORG_PKG_SUFFIX @xserver-xorg-video-tdfx$UBUNTU_XORG_PKG_SUFFIX - xprintidle " REQUIRED_DIRECTORIES+=" /usr/lib -- cgit v1.2.3-55-g7522 From bac6b30ace401645f4e4457dd7166a6d3d960fa5 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 16 Jan 2014 16:31:29 +0100 Subject: [mltk] added -h and --help - options --- mltk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mltk b/mltk index ca736592..fadc10cc 100755 --- a/mltk +++ b/mltk @@ -183,6 +183,9 @@ read_params() { if [[ "$1" != -* ]]; then TARGET="$1" shift + elif [[ "$1" == "-h" || "$1" == "--help" ]]; then + print_usage + exit 1 elif [[ "$1" != "-n" ]]; then perror "A target is required. None given." fi -- cgit v1.2.3-55-g7522 From 3acc147967d614fa87a3ee9858c390547b60cea1 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jan 2014 16:45:42 +0100 Subject: updated to the new year! --- mltk | 2 +- openslx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mltk b/mltk index ca736592..6a378773 100755 --- a/mltk +++ b/mltk @@ -1,7 +1,7 @@ #!/bin/bash # ----------------------------------------------------------------------------- # -# Copyright (c) 2011 - OpenSLX GmbH +# Copyright (c) 2014 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING diff --git a/openslx b/openslx index ca79800a..e5026bab 100755 --- a/openslx +++ b/openslx @@ -1,7 +1,7 @@ #!/bin/bash # ----------------------------------------------------------------------------- # -# Copyright (c) 2011 - OpenSLX GmbH +# Copyright (c) 2014 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING -- cgit v1.2.3-55-g7522 From f8011e550137d1fced894ce4861e6d170eff9bd5 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Fri, 17 Jan 2014 12:51:28 +0100 Subject: [packagemanager.inc] minor improvements to output message when a package appears to not be installed or is a meta-package --- remote/includes/packagemanager.inc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/remote/includes/packagemanager.inc b/remote/includes/packagemanager.inc index 6f0d86dd..edd3949e 100644 --- a/remote/includes/packagemanager.inc +++ b/remote/includes/packagemanager.inc @@ -60,7 +60,9 @@ install_packages() { local INSTALLED_PACKAGES="" for PKG in ${PACKAGE_LIST}; do - # check if installed + # check if installed: + # this is done mainly for performance reasons, even though + # reinstalling all packages is a valid possibility too... if [ "x$PACKET_HANDLER" == "xdpkg" ]; then dpkg -l ${PKG} > /dev/null 2>&1 elif [ "x$PACKET_HANDLER" == "xrpm" ]; then @@ -71,15 +73,19 @@ install_packages() { local LRET=$? if [ "x$LRET" == "x0" ]; then - # check if it is completly installed, - # not just leftover configuration files - local INSTALL_STATUS=$(dpkg -l $PKG | grep $PKG | cut -c1-2) - if [[ $INSTALL_STATUS != "ii" ]]; then - pinfo "$PKG not installed!" + # check if it is completly installed, not just leftover configuration files + if [ "x$PACKET_HANDLER" == "xdpkg" ]; then + local INSTALL_STATUS=$(dpkg -l $PKG | grep $PKG | cut -c1-2) + if [[ $INSTALL_STATUS != "ii" ]]; then + pinfo "$PKG is either missing or a meta-package! Installing it to be sure..." + install_package $PKG + else + # package installed + pdebug "$PKG installed!" + fi + elif [ "x$PACKET_HANDLER" == "xrpm" ]; then + # TODO: blindly install again for now install_package $PKG - else - # package installed - pdebug "$PKG installed!" fi else # package not installed @@ -87,7 +93,7 @@ install_packages() { install_package $PKG fi done - [ ! -z "$INSTALLED_PACKAGES" ] && pinfo "Packages installed: ${INSTALLED_PACKAGES}" + [ ! -z "$INSTALLED_PACKAGES" ] && pinfo "New packages installed: ${INSTALLED_PACKAGES}" } # -- cgit v1.2.3-55-g7522 From 3f8dde8d0cfb4784f83a26c58063feb36f566f5a Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 17 Jan 2014 13:28:00 +0100 Subject: [vm*] Add hdd adapter type override option, to quickly fix vms where the vmdk header containse wrong information --- .../data/opt/openslx/scripts/vmchooser-run_virt | 1 + .../opt/openslx/vmchooser/vmware/run-virt.include | 43 +++++++++++++++------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt index bef43dd1..8e4e57a8 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -316,6 +316,7 @@ vmostype=$(grep -io '