mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Rename out to vm
This commit is contained in:
parent
cc1b0f8c08
commit
ad5de25e76
3 changed files with 15 additions and 11 deletions
2
rip_docker/vm-image-builder/.gitignore
vendored
2
rip_docker/vm-image-builder/.gitignore
vendored
|
@ -1 +1 @@
|
||||||
out
|
vm
|
|
@ -7,17 +7,18 @@ apt-get install -y qemu-utils wget nbdfuse
|
||||||
|
|
||||||
# Build the VM image
|
# Build the VM image
|
||||||
cd /build
|
cd /build
|
||||||
mkdir -p /build/out
|
rm -r /build/vm
|
||||||
|
mkdir -p /build/vm
|
||||||
./alpine-make-vm-image \
|
./alpine-make-vm-image \
|
||||||
--image-format qcow2 \
|
--image-format qcow2 \
|
||||||
--image-size 2G \
|
--image-size 2G \
|
||||||
--packages "$(cat packages)" \
|
--packages "$(cat packages)" \
|
||||||
--script-chroot \
|
--script-chroot \
|
||||||
/build/out/dangerzone.qcow2 -- ./configure.sh
|
/build/vm/dangerzone.qcow2 -- ./configure.sh
|
||||||
|
|
||||||
# Extract vmlinuz and initramfs
|
# Extract vmlinuz and initramfs
|
||||||
qemu-nbd -c /dev/nbd0 /build/out/dangerzone.qcow2
|
qemu-nbd -c /dev/nbd0 /build/vm/dangerzone.qcow2
|
||||||
mount /dev/nbd0 /mnt
|
mount /dev/nbd0 /mnt
|
||||||
cp /mnt/boot/vmlinuz-virt /build/out
|
cp /mnt/boot/vmlinuz-virt /build/vm
|
||||||
cp /mnt/boot/initramfs-virt /build/out
|
cp /mnt/boot/initramfs-virt /build/vm
|
||||||
umount /mnt
|
umount /mnt
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
ROOT=$(pwd)/out
|
ROOT=$(pwd)/vm
|
||||||
|
|
||||||
echo "[] Running vpnkit"
|
echo "[] Running vpnkit"
|
||||||
VPNKIT_SOCK=$ROOT/vpnkit.eth.sock
|
VPNKIT_SOCK=$ROOT/vpnkit.eth.sock
|
||||||
|
@ -9,8 +9,10 @@ vpnkit --ethernet=$VPNKIT_SOCK &
|
||||||
echo $! > $PIDFILE
|
echo $! > $PIDFILE
|
||||||
trap 'test -f $PIDFILE && kill `cat $PIDFILE` && rm $PIDFILE' EXIT
|
trap 'test -f $PIDFILE && kill `cat $PIDFILE` && rm $PIDFILE' EXIT
|
||||||
|
|
||||||
echo "[] Making disk image"
|
sleep 1
|
||||||
mkfile 1g $ROOT/disk.img
|
|
||||||
|
# echo "[] Making disk image"
|
||||||
|
# mkfile 1g $ROOT/disk.img
|
||||||
|
|
||||||
echo "[] Starting VM"
|
echo "[] Starting VM"
|
||||||
hyperkit \
|
hyperkit \
|
||||||
|
@ -19,8 +21,9 @@ hyperkit \
|
||||||
-c 2 \
|
-c 2 \
|
||||||
-s 0:0,hostbridge -s 31,lpc \
|
-s 0:0,hostbridge -s 31,lpc \
|
||||||
-l com1,stdio \
|
-l com1,stdio \
|
||||||
|
-s 1:0,ahci-hd,file://$ROOT/dangerzone.qcow2,format=qcow \
|
||||||
-s 2:0,virtio-vpnkit,path=$VPNKIT_SOCK \
|
-s 2:0,virtio-vpnkit,path=$VPNKIT_SOCK \
|
||||||
-s 3:0,ahci-hd,file://$ROOT/dangerzone.qcow2,format=qcow \
|
|
||||||
-s 4:0,virtio-blk,$ROOT/disk.img \
|
|
||||||
-U 9efa82d7-ebd5-4287-b1cc-ac4160a39fa7 \
|
-U 9efa82d7-ebd5-4287-b1cc-ac4160a39fa7 \
|
||||||
-f kexec,$ROOT/vmlinuz-virt,$ROOT/initramfs-virt,"earlyprintk=serial console=ttyS0 modules=loop,squashfs,sd-mod,usb-storage"
|
-f kexec,$ROOT/vmlinuz-virt,$ROOT/initramfs-virt,"earlyprintk=serial console=ttyS0 modules=loop,squashfs,sd-mod,usb-storage"
|
||||||
|
|
||||||
|
# -s 4:0,virtio-blk,$ROOT/disk.img \
|
Loading…
Reference in a new issue