]>
Commit | Line | Data |
---|---|---|
fdb99417 | 1 | #!/bin/bash |
5cb2e97f MG |
2 | GROUP=$(getent group www-data | cut -f3 -d:) |
3 | USER=$(getent passwd www-data | cut -f3 -d:) | |
4 | ||
fdb99417 | 5 | rm -rf vm/ vm.squashfs |
2a6db364 MG |
6 | mkdir -p vm/proc/ |
7 | mount /proc -o bind vm/proc | |
e6b9e086 | 8 | multistrap -f ex/vm.conf |
fdb99417 | 9 | ln -s vm/usr/bin/mawk vm/bin/awk |
fdb99417 | 10 | echo '/sbin/poweroff -f' > vm/.bash_logout |
56e0b658 MG |
11 | cat > vm/etc/fstab <<EOF |
12 | virtfs /mnt 9p trans=virtio,auto 0 0 | |
13 | tmpfs /tmp tmpfs defaults 0 0 | |
14 | EOF | |
fdb99417 MG |
15 | cat > vm/.profile <<EOF |
16 | mount -a | |
17 | stty -F /dev/ttyS1 -echo | |
18 | cd /mnt | |
19 | export PS1="# " | |
20 | EOF | |
21 | cat > vm/etc/initramfs-tools/modules <<EOF | |
22 | squashfs | |
23 | 9p | |
24 | 9pnet | |
25 | 9pnet_virtio | |
26 | EOF | |
6f7e6b07 MG |
27 | cat >> vm/etc/sudoers <<EOF |
28 | Defaults>nobody closefrom=5 | |
29 | Defaults>nobody !env_check | |
30 | Defaults>nobody env_keep="ONLINE_JUDGE PATH HOME" | |
31 | EOF | |
df00c00b | 32 | install gruntmaster-exec gruntmaster-compile vm/usr/bin/ |
fdb99417 MG |
33 | chroot vm update-initramfs -d -k 3.2.0-4-amd64 |
34 | chroot vm update-initramfs -c -k 3.2.0-4-amd64 | |
2a6db364 | 35 | umount vm/proc |
fdb99417 | 36 | mksquashfs vm vm.squashfs -comp lzo |