mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-29 10:12:38 +02:00
Move qcow2 build script into separate file
This commit is contained in:
parent
ad5de25e76
commit
c467831c3d
5 changed files with 12 additions and 12 deletions
|
@ -2,12 +2,12 @@
|
|||
|
||||
Thanks, [alpine-make-vm-image](https://github.com/alpinelinux/alpine-make-vm-image) project. License: MIT
|
||||
|
||||
To build the VM image:
|
||||
To build the qcow2 VM image:
|
||||
|
||||
```sh
|
||||
docker run \
|
||||
--privileged --cap-add=ALL \
|
||||
-v $(pwd):/build ubuntu:latest /build/build.sh
|
||||
-v $(pwd):/build ubuntu:latest /build/build-qcow2.sh
|
||||
```
|
||||
|
||||
This will create a VM image file called `dangerzone.qcow2`.
|
||||
This will create a VM image file called `vm/dangerzone.qcow2`.
|
||||
|
|
|
@ -10,9 +10,9 @@ cd /build
|
|||
rm -r /build/vm
|
||||
mkdir -p /build/vm
|
||||
./alpine-make-vm-image \
|
||||
--image-format qcow2 \
|
||||
--image-format raw \
|
||||
--image-size 2G \
|
||||
--packages "$(cat packages)" \
|
||||
--packages "podman openssh" \
|
||||
--script-chroot \
|
||||
/build/vm/dangerzone.qcow2 -- ./configure.sh
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
podman
|
||||
openssh
|
|
@ -1,11 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
ROOT=$(pwd)/vm
|
||||
HYPERKIT=/Applications/Docker.app/Contents/Resources/bin/com.docker.hyperkit
|
||||
VPNKIT=/Applications/Docker.app/Contents/Resources/bin/com.docker.vpnkit
|
||||
|
||||
echo "[] Running vpnkit"
|
||||
VPNKIT_SOCK=$ROOT/vpnkit.eth.sock
|
||||
PIDFILE=$ROOT/vpnkit.pid
|
||||
vpnkit --ethernet=$VPNKIT_SOCK &
|
||||
$VPNKIT --ethernet=$VPNKIT_SOCK &
|
||||
echo $! > $PIDFILE
|
||||
trap 'test -f $PIDFILE && kill `cat $PIDFILE` && rm $PIDFILE' EXIT
|
||||
|
||||
|
@ -15,13 +17,13 @@ sleep 1
|
|||
# mkfile 1g $ROOT/disk.img
|
||||
|
||||
echo "[] Starting VM"
|
||||
hyperkit \
|
||||
$HYPERKIT \
|
||||
-A -u \
|
||||
-m 2G \
|
||||
-c 2 \
|
||||
-s 0:0,hostbridge -s 31,lpc \
|
||||
-l com1,stdio \
|
||||
-s 1:0,ahci-hd,file://$ROOT/dangerzone.qcow2,format=qcow \
|
||||
-s 3:0,ahci-cd,$ROOT/dangerzone.raw \
|
||||
-s 2:0,virtio-vpnkit,path=$VPNKIT_SOCK \
|
||||
-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"
|
||||
|
|
Loading…
Reference in a new issue