Move vm scripts to ex/
[gruntmaster-daemon.git] / ex / makevm
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
This page took 0.010045 seconds and 4 git commands to generate.