91542781451ef2e4cc29b567558aca559b7cf703
[gruntmaster-daemon.git] / ex / makevm
1 #!/bin/bash
2 GROUP=$(getent group www-data | cut -f3 -d:)
3 USER=$(getent passwd www-data | cut -f3 -d:)
4
5 rm -rf vm/ vm.squashfs
6 multistrap -f ex/vm.conf
7 ln -s vm/usr/bin/mawk vm/bin/awk
8 echo '/sbin/poweroff -f' > vm/.bash_logout
9 cat > vm/etc/fstab <<EOF
10 virtfs /mnt 9p trans=virtio,auto 0 0
11 tmpfs /tmp tmpfs defaults 0 0
12 EOF
13 cat > vm/.profile <<EOF
14 mount -a
15 stty -F /dev/ttyS1 -echo
16 cd /mnt
17 export PS1="# "
18 EOF
19 cat > vm/etc/initramfs-tools/modules <<EOF
20 squashfs
21 9p
22 9pnet
23 9pnet_virtio
24 EOF
25 install gruntmaster-exec gruntmaster-compile vm/usr/bin/
26 sed -i -e "s/setgid 65534/setgid $GROUP/" -e "s/setuid 65534/setuid $USER/" vm/usr/bin/gruntmaster-exec
27 chroot vm update-initramfs -d -k 3.2.0-4-amd64
28 chroot vm update-initramfs -c -k 3.2.0-4-amd64
29 mksquashfs vm vm.squashfs -comp lzo
This page took 0.042759 seconds and 3 git commands to generate.