Move vm scripts to ex/
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 22 Jan 2015 22:20:36 +0000 (00:20 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 22 Jan 2015 22:20:36 +0000 (00:20 +0200)
MANIFEST
ex/makevm [new file with mode: 0755]
ex/runvm [new file with mode: 0755]
ex/vm.conf [new file with mode: 0644]
makevm [deleted file]
runvm [deleted file]
vm.conf [deleted file]

index f298b65..8ba39c9 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,5 +1,8 @@
 Changes
 COPYING
+ex/makevm
+ex/runvm
+ex/vm.conf
 gruntmaster-compile
 gruntmaster-exec
 gruntmasterd
@@ -19,10 +22,8 @@ lib/Gruntmaster/Daemon/Runner/Interactive.pm
 lib/Gruntmaster/Daemon/Runner/Verifier.pm
 log.conf
 Makefile.PL
-makevm
 MANIFEST
 README
-runvm
 t/00-compile.t
 t/01-jobs.t
 t/perlcriticrc
@@ -97,4 +98,3 @@ t/problems/square/meta.yml
 t/problems/square/tests/ac/meta.yml
 t/problems/square/tests/ac/prog.cpp
 t/problems/square/ver.cpp
-vm.conf
diff --git a/ex/makevm b/ex/makevm
new file mode 100755 (executable)
index 0000000..433370f
--- /dev/null
+++ b/ex/makevm
@@ -0,0 +1,23 @@
+#!/bin/bash
+[ `id -u` -eq 0 ] || echo 'This script must be run as root' && exit 1
+rm -rf vm/ vm.squashfs
+multistrap -f vm.conf
+ln -s vm/usr/bin/mawk vm/bin/awk
+echo 'virtfs /mnt 9p trans=virtio,auto 0 0' > vm/etc/fstab
+echo '/sbin/poweroff -f' > vm/.bash_logout
+cat > vm/.profile <<EOF
+mount -a
+stty -F /dev/ttyS1 -echo
+cd /mnt
+export PS1="# "
+EOF
+cat > vm/etc/initramfs-tools/modules <<EOF
+squashfs
+9p
+9pnet
+9pnet_virtio
+EOF
+cp gruntmaster-exec gruntmaster-compile vm/usr/bin/
+chroot vm update-initramfs -d -k 3.2.0-4-amd64
+chroot vm update-initramfs -c -k 3.2.0-4-amd64
+mksquashfs vm vm.squashfs -comp lzo
diff --git a/ex/runvm b/ex/runvm
new file mode 100755 (executable)
index 0000000..208aedc
--- /dev/null
+++ b/ex/runvm
@@ -0,0 +1,15 @@
+#!/bin/bash
+ROOT=/home/marius/git/gruntmaster-daemon
+
+qemu-system-x86_64 \
+       -enable-kvm -cpu host -m 256MB \
+       -nodefaults -nographic \
+       -kernel $ROOT/vm/boot/vmlinuz-3.2.0-4-amd64 \
+       -initrd $ROOT/vm/boot/initrd.img-3.2.0-4-amd64 \
+       -append 'root=/dev/vda console=ttyS0,38400 quiet init=/bin/bash --login' \
+       -drive file=$ROOT/vm.squashfs,if=virtio,readonly \
+       -virtfs local,id=virtfs0,path=.,security_model=none,mount_tag=virtfs \
+       -chardev stdio,id=stdio,signal=on \
+       -chardev pipe,id=hostpipe,path=$1 \
+       -serial chardev:stdio \
+       -serial chardev:hostpipe
diff --git a/ex/vm.conf b/ex/vm.conf
new file mode 100644 (file)
index 0000000..9f4b68f
--- /dev/null
@@ -0,0 +1,13 @@
+[General]
+directory=vm/
+cleanup=true
+bootstrap=Debian
+aptsources=Debian
+
+[Debian]
+packages=linux-image-3.2.0-4-amd64 mawk libbsd-resource-perl libipc-signal-perl g++
+source=http://ftp.ro.debian.org/debian
+keyring=debian-archive-keyring
+suite=wheezy
+components=main
+omitdebsrc=true
diff --git a/makevm b/makevm
deleted file mode 100755 (executable)
index 433370f..0000000
--- a/makevm
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-[ `id -u` -eq 0 ] || echo 'This script must be run as root' && exit 1
-rm -rf vm/ vm.squashfs
-multistrap -f vm.conf
-ln -s vm/usr/bin/mawk vm/bin/awk
-echo 'virtfs /mnt 9p trans=virtio,auto 0 0' > vm/etc/fstab
-echo '/sbin/poweroff -f' > vm/.bash_logout
-cat > vm/.profile <<EOF
-mount -a
-stty -F /dev/ttyS1 -echo
-cd /mnt
-export PS1="# "
-EOF
-cat > vm/etc/initramfs-tools/modules <<EOF
-squashfs
-9p
-9pnet
-9pnet_virtio
-EOF
-cp gruntmaster-exec gruntmaster-compile vm/usr/bin/
-chroot vm update-initramfs -d -k 3.2.0-4-amd64
-chroot vm update-initramfs -c -k 3.2.0-4-amd64
-mksquashfs vm vm.squashfs -comp lzo
diff --git a/runvm b/runvm
deleted file mode 100755 (executable)
index 208aedc..0000000
--- a/runvm
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-ROOT=/home/marius/git/gruntmaster-daemon
-
-qemu-system-x86_64 \
-       -enable-kvm -cpu host -m 256MB \
-       -nodefaults -nographic \
-       -kernel $ROOT/vm/boot/vmlinuz-3.2.0-4-amd64 \
-       -initrd $ROOT/vm/boot/initrd.img-3.2.0-4-amd64 \
-       -append 'root=/dev/vda console=ttyS0,38400 quiet init=/bin/bash --login' \
-       -drive file=$ROOT/vm.squashfs,if=virtio,readonly \
-       -virtfs local,id=virtfs0,path=.,security_model=none,mount_tag=virtfs \
-       -chardev stdio,id=stdio,signal=on \
-       -chardev pipe,id=hostpipe,path=$1 \
-       -serial chardev:stdio \
-       -serial chardev:hostpipe
diff --git a/vm.conf b/vm.conf
deleted file mode 100644 (file)
index 9f4b68f..0000000
--- a/vm.conf
+++ /dev/null
@@ -1,13 +0,0 @@
-[General]
-directory=vm/
-cleanup=true
-bootstrap=Debian
-aptsources=Debian
-
-[Debian]
-packages=linux-image-3.2.0-4-amd64 mawk libbsd-resource-perl libipc-signal-perl g++
-source=http://ftp.ro.debian.org/debian
-keyring=debian-archive-keyring
-suite=wheezy
-components=main
-omitdebsrc=true
This page took 0.03254 seconds and 4 git commands to generate.