diff options
author | Simon Rettberg | 2020-12-04 08:56:46 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-12-04 08:56:46 +0100 |
commit | 7c1c635fa863d0a2ecaacb19e0f48e56fc7ab382 (patch) | |
tree | 5b3bb1528a0e672db968bd50df0f8d890a21a5a3 /core/rootfs | |
parent | [vbox-src] Make xmlstarlet calls namespace-agnostic (diff) | |
download | mltk-7c1c635fa863d0a2ecaacb19e0f48e56fc7ab382.tar.gz mltk-7c1c635fa863d0a2ecaacb19e0f48e56fc7ab382.tar.xz mltk-7c1c635fa863d0a2ecaacb19e0f48e56fc7ab382.zip |
[rootfs-stage31] Remove unused stage4 code
Diffstat (limited to 'core/rootfs')
-rw-r--r-- | core/rootfs/rootfs-stage31/data/inc/setup_stage4 | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/core/rootfs/rootfs-stage31/data/inc/setup_stage4 b/core/rootfs/rootfs-stage31/data/inc/setup_stage4 deleted file mode 100644 index a00117f2..00000000 --- a/core/rootfs/rootfs-stage31/data/inc/setup_stage4 +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/ash - -[ -z "${SLX_STAGE4}" ] && { echo "SLX_STAGE4 is not set in /opt/openslx/config." && exit 1; } - -MOUNTPOINT="/rorootfs/" -mkdir -p "$MOUNTPOINT" - - -# first load module -insmod /lib/modules/dnbd3/dnbd3.ko - -# 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=$(/opt/openslx/bin/dnbd3-client -h "$SRV" -i "$IMAGE" -r "$SLX_STAGE4_RID" -d /dev/dnbd0) - RET=$? - [ "$RET" -eq "0" ] && break - echo "... didn't work ($RET)" - sleep 1 -done -if [ "$RET" -ne "0" ]; then - drop_shell "Omg" - slxlog --echo "mount-stage4" "Could not get stage4 via dnbd3 ($IMAGE : $SLX_STAGE4_RID) ($SLX_DNBD3_PRIO_SERVERS / $SERVERS)" - exit $RET -fi -echo "Mounting /dev/dnbd0 to $MOUNTPOINT" -if ! busybox mount -t squashfs -o ro /dev/dnbd0 "$MOUNTPOINT"; then - slxlog --echo "mount-stage4" "Could not mount stage4 from '$dnbd3' to '$MOUNTPOINT' ($SRV, $IMAGE)" - exit 1 -fi - -busybox mount -n -t aufs -o "br:${FUTURE_ROOT}:${MOUNTPOINT}=ro" none /mnt || drop_shell "Problem building aufs." -mkdir -p /mnt/opt/openslx/uniontmp /mnt/tmp -FUTURE_ROOT="/mnt" - -cp /etc/hostname /etc/hosts "${FUTURE_ROOT}/etc/" -cp /etc/resolv.conf "${FUTURE_ROOT}/opt/openslx/" - -# if booting with splash, suppress kernel output in stage32 -if [ $SPLASH -eq 1 ]; then - if grep -q -E "^ *kernel.printk" "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf"; then - sed -i 's/^ *kernel\.printk.*/kernel\.printk = 1 1 0 1/g' "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf" - else - echo "kernel.printk = 1 1 0 1" >> "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf" - fi -fi - -# Kinda specific for virtualization environment: Autologin and run VM for benchmarks -if [ -n "$SLX_BENCHMARK_VM" ]; then - # Enable KDM autologin for demo user - sed -i 's/^AutoLoginUser=.*//;s/^AutoLoginEnable=.*/AutoLoginEnable=true\nAutoLoginUser=demo/' "${FUTURE_ROOT}/etc/kde4/kdm/kdmrc" - # Running the VM automatically has to be taken care of by run-virt and vmchooser. SLX_BENCHMARK_VM should contain - # a numeric value for the index in vmchooser -fi - |