Run user programs as nobody:nogroup
[gruntmaster-daemon.git] / ex / makevm
CommitLineData
fdb99417 1#!/bin/bash
5cb2e97f
MG
2GROUP=$(getent group www-data | cut -f3 -d:)
3USER=$(getent passwd www-data | cut -f3 -d:)
4
fdb99417 5rm -rf vm/ vm.squashfs
2a6db364
MG
6mkdir -p vm/proc/
7mount /proc -o bind vm/proc
e6b9e086 8multistrap -f ex/vm.conf
fdb99417 9ln -s vm/usr/bin/mawk vm/bin/awk
fdb99417 10echo '/sbin/poweroff -f' > vm/.bash_logout
56e0b658
MG
11cat > vm/etc/fstab <<EOF
12virtfs /mnt 9p trans=virtio,auto 0 0
13tmpfs /tmp tmpfs defaults 0 0
14EOF
fdb99417
MG
15cat > vm/.profile <<EOF
16mount -a
17stty -F /dev/ttyS1 -echo
18cd /mnt
19export PS1="# "
20EOF
21cat > vm/etc/initramfs-tools/modules <<EOF
22squashfs
239p
249pnet
259pnet_virtio
26EOF
df00c00b 27install gruntmaster-exec gruntmaster-compile vm/usr/bin/
4e08f696 28sed -i -e "s/USER => 65534/USER => $USER/" -e "s/GROUP => 65534/GROUP => $GROUP/" vm/usr/bin/gruntmaster-exec
fdb99417
MG
29chroot vm update-initramfs -d -k 3.2.0-4-amd64
30chroot vm update-initramfs -c -k 3.2.0-4-amd64
2a6db364 31umount vm/proc
fdb99417 32mksquashfs vm vm.squashfs -comp lzo
This page took 0.024993 seconds and 4 git commands to generate.