Add support for grml2hd
authorUlrich Dangel <uli@spamt.net>
Sun, 28 Mar 2010 14:34:49 +0000 (16:34 +0200)
committerUlrich Dangel <uli@spamt.net>
Sun, 28 Mar 2010 15:12:21 +0000 (17:12 +0200)
grml2hd/common.sh [new file with mode: 0644]
grml2hd/grml2hd-common [new file with mode: 0644]
grml2hd/grub/deploy.sh [new file with mode: 0644]
grml2hd/grub/runit.sh [new file with mode: 0755]
grml2hd/lilo/deploy.sh [new file with mode: 0644]
grml2hd/lilo/runit.sh [new file with mode: 0755]
grml2hd/runit.sh [new file with mode: 0755]

diff --git a/grml2hd/common.sh b/grml2hd/common.sh
new file mode 100644 (file)
index 0000000..15bce77
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+. /etc/grml/autoconfig.functions
+
+STATUS=$(getbootparam status)
+sfdisk /dev/sda <<EOF
+1
+;
+EOF
+
+sed -i "s#^PARTITION=.*#PARTITION=/dev/sda1#" /etc/grml2hd/config
+sed -i "s#^BOOT_PARTITION=.*#BOOT_PARTITION=/dev/sda#" /etc/grml2hd/config
+echo 'BOOT_MANAGER="grub"' >> /etc/grml2hd/config
+echo 'BOOT_APPEND="'netscript=$STATUS/DONE'"' >> /etc/grml2hd/config
+echo "GRML2HD_FINALIZE='no'" >> /etc/grml2hd/customization
+GRML2HD_NONINTERACTIVE='yes' grml2hd
+shutdown -h now
diff --git a/grml2hd/grml2hd-common b/grml2hd/grml2hd-common
new file mode 100644 (file)
index 0000000..63da871
--- /dev/null
@@ -0,0 +1,23 @@
+CMDLINE="$CMDLINE_COMMON noprompt netscript=$URL_PREFIX:$COMMON_PORT/$NAME/deploy.sh status=$URL_PREFIX:$STATUS_PORT/ common=$URL_PREFIX:$COMMON_PORT/common.sh"
+IMAGE=$(tempfile)
+KVM_PARAMS="-hda $IMAGE"
+TIMEOUT_TIME=300
+TEST_NAME=grml2hd-$NAME
+BAILOUT_CMD='rm -f $IMAGE ; kill -9 $TEST_PID $PARENT 2>/dev/null'
+
+# create sample image file
+dd if=/dev/zero of=$IMAGE bs=1024 count=2120000 2>/dev/null
+
+# run the test (will create a bootable device
+run_test
+timeout
+wait $KVM_PID
+
+# start second kvm
+kvm -vnc :0 -hda $IMAGE  &
+TEST_PID=$!
+
+
+wait $SERVER_PID
+kill -9 $TEST_PID
+rm -f $IMAGE
diff --git a/grml2hd/grub/deploy.sh b/grml2hd/grub/deploy.sh
new file mode 100644 (file)
index 0000000..3af731a
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/zsh
+
+. /etc/grml/autoconfig.functions
+
+STATUS=$(getbootparam status)
+COMMON_SRC=$(getbootparam common)
+
+echo 'BOOT_MANAGER="grub"' >> /etc/grml2hd/config
+
+wget $COMMON_SRC -O /tmp/common.sh
+chmod +x /tmp/common.sh
+/tmp/common.sh
diff --git a/grml2hd/grub/runit.sh b/grml2hd/grub/runit.sh
new file mode 100755 (executable)
index 0000000..5ab65e6
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. $FRAMEWORK
+
+NAME=grub
+. ./grml2hd-common
diff --git a/grml2hd/lilo/deploy.sh b/grml2hd/lilo/deploy.sh
new file mode 100644 (file)
index 0000000..7643d9a
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/zsh
+
+. /etc/grml/autoconfig.functions
+
+COMMON_SRC=$(getbootparam common)
+
+wget $COMMON_SRC -O /tmp/common.sh
+chmod +x /tmp/common.sh
+/tmp/common.sh
diff --git a/grml2hd/lilo/runit.sh b/grml2hd/lilo/runit.sh
new file mode 100755 (executable)
index 0000000..8839df8
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. $FRAMEWORK
+
+NAME=grub
+. ./grml2hd-common
+
diff --git a/grml2hd/runit.sh b/grml2hd/runit.sh
new file mode 100755 (executable)
index 0000000..db99029
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+for i in grub lilo ; do
+    PARENT=$$ $i/runit.sh
+done