mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Move vm-builder up a dir, and start replacing Docker Desktop with building hyperkit and vpnkit manually
This commit is contained in:
parent
e4c241a0d1
commit
fd1dec7438
25 changed files with 177 additions and 16 deletions
23
BUILD.md
23
BUILD.md
|
@ -54,23 +54,32 @@ Create a .rpm:
|
||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
|
|
||||||
Install [Docker Desktop](https://www.docker.com/products/docker-desktop).
|
Ensure you have the git submodules checked out:
|
||||||
|
|
||||||
Install python@3.9 from Homebrew:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
brew install python@3.9 create-dmg
|
git submodule init
|
||||||
|
git submodule update
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't have it already, install poetry (`pip3 install --user poetry`). Then install dependencies:
|
Install Xcode from the App Store.
|
||||||
|
|
||||||
|
Install Python 3.9.9 [[from python.org])(https://www.python.org/downloads/release/python-399/).
|
||||||
|
|
||||||
|
Install Python dependencies:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
pip3 install --user poetry
|
||||||
poetry install
|
poetry install
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure [Docker Desktop](https://www.docker.com/products/docker-desktop) and vagrant (`brew install vagrant`) are installed.
|
Install [Homebrew](https://brew.sh/) dependencies:
|
||||||
|
|
||||||
Run this to build a custom Alpine Linux ISO for Dangerzone, and copy it into the `share` folder:
|
```
|
||||||
|
brew install vagrant create-dmg
|
||||||
|
brew install wget opam pkg-config
|
||||||
|
```
|
||||||
|
|
||||||
|
Run this to compile hyperkit and vpnkit, and build a custom Alpine Linux ISO for Dangerzone, and copy it into the `share` folder:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./install/macos/make-vm.sh
|
./install/macos/make-vm.sh
|
||||||
|
|
|
@ -1,17 +1,28 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Extract hyperkit and vpnkit from Docker Desktop
|
# Compile hyperkit
|
||||||
|
cd vendor/hyperkit/
|
||||||
|
make || { echo 'Failed to compile hyperkit' ; exit 1; }
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Compile vpnkit
|
||||||
|
cd vendor/vpnkit/
|
||||||
|
unset OPAMROOT
|
||||||
|
make || { echo 'Failed to compile vpnkit' ; exit 1; }
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# Copy binaries to share
|
||||||
mkdir -p share/bin
|
mkdir -p share/bin
|
||||||
cp /Applications/Docker.app/Contents/Resources/bin/com.docker.hyperkit share/bin/hyperkit
|
cp vendor/hyperkit/build/hyperkit share/bin/hyperkit
|
||||||
cp /Applications/Docker.app/Contents/Resources/bin/com.docker.vpnkit share/bin/vpnkit
|
cp vendor/vpnkit/build/vpnkit share/bin/vpnkit
|
||||||
|
|
||||||
# Build ISO
|
# Build ISO
|
||||||
cd install/vm-builder
|
cd vm-builder
|
||||||
vagrant up
|
vagrant up
|
||||||
vagrant ssh -- /vagrant/build-iso.sh
|
vagrant ssh -- /vagrant/build-iso.sh
|
||||||
vagrant halt
|
vagrant halt
|
||||||
cd ../..
|
cd ..
|
||||||
|
|
||||||
# Copy the ISO to resources
|
# Copy the ISO to resources
|
||||||
mkdir -p share/vm
|
mkdir -p share/vm
|
||||||
cp install/vm-builder/vm/* share/vm
|
cp vm-builder/vm/* share/vm
|
||||||
|
|
1
vm-builder/.vagrant/bundler/global.sol
Normal file
1
vm-builder/.vagrant/bundler/global.sol
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"dependencies":[["vagrant-vmware-desktop",["= 3.0.1"]]],"checksum":"0ad00f1ec196455770fca952e89c309b84036297f2a9b4b560b24f477e0315e1","vagrant_version":"2.2.19"}
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>disallowUpgrade</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,5 @@
|
||||||
|
.encoding = "UTF-8"
|
||||||
|
cloneOf0 = "/Users/user/.vagrant.d/boxes/generic-VAGRANTSLASH-alpine314/3.5.2/vmware_desktop/generic-alpine314-vmware.vmx"
|
||||||
|
numCloneOf = "1"
|
||||||
|
sentinel0 = "generic-alpine314-vmware-cl1.vmdk"
|
||||||
|
numSentinels = "1"
|
|
@ -0,0 +1,106 @@
|
||||||
|
.encoding = "UTF-8"
|
||||||
|
bios.bootorder = "hdd,cdrom"
|
||||||
|
checkpoint.vmstate = ""
|
||||||
|
cleanshutdown = "TRUE"
|
||||||
|
config.version = "8"
|
||||||
|
cpuid.corespersocket = "1"
|
||||||
|
displayname = "vm-builder: default"
|
||||||
|
ehci.pcislotnumber = "-1"
|
||||||
|
ehci.present = "FALSE"
|
||||||
|
ethernet0.addresstype = "generated"
|
||||||
|
ethernet0.connectiontype = "nat"
|
||||||
|
ethernet0.present = "TRUE"
|
||||||
|
ethernet0.virtualdev = "e1000"
|
||||||
|
extendedconfigfile = "generic-alpine314-vmware.vmxf"
|
||||||
|
filesearchpath = ".;/Users/user/.vagrant.d/boxes/generic-VAGRANTSLASH-alpine314/3.5.2/vmware_desktop"
|
||||||
|
floppy0.present = "FALSE"
|
||||||
|
guestos = "otherlinux-64"
|
||||||
|
gui.fullscreenatpoweron = "FALSE"
|
||||||
|
gui.viewmodeatpoweron = "windowed"
|
||||||
|
hgfs.linkrootshare = "TRUE"
|
||||||
|
hgfs.maprootshare = "TRUE"
|
||||||
|
ide0:0.clientdevice = "TRUE"
|
||||||
|
ide0:0.devicetype = "cdrom-raw"
|
||||||
|
ide0:0.filename = "auto detect"
|
||||||
|
ide0:0.present = "TRUE"
|
||||||
|
invmteam = "FALSE"
|
||||||
|
isolation.tools.hgfs.disable = "FALSE"
|
||||||
|
memsize = "2048"
|
||||||
|
monitor.phys_bits_used = "42"
|
||||||
|
msg.autoanswer = "true"
|
||||||
|
numa.autosize.cookie = "20001"
|
||||||
|
numa.autosize.vcpu.maxpervirtualnode = "2"
|
||||||
|
numvcpus = "2"
|
||||||
|
nvme0.present = "FALSE"
|
||||||
|
nvram = "generic-alpine314-vmware.nvram"
|
||||||
|
parallel0.autodetect = "FALSE"
|
||||||
|
parallel0.bidirectional = ""
|
||||||
|
parallel0.filename = ""
|
||||||
|
parallel0.present = "FALSE"
|
||||||
|
parallel0.startconnected = "FALSE"
|
||||||
|
pcibridge0.pcislotnumber = "17"
|
||||||
|
pcibridge0.present = "TRUE"
|
||||||
|
pcibridge4.functions = "8"
|
||||||
|
pcibridge4.pcislotnumber = "21"
|
||||||
|
pcibridge4.present = "TRUE"
|
||||||
|
pcibridge4.virtualdev = "pcieRootPort"
|
||||||
|
pcibridge5.functions = "8"
|
||||||
|
pcibridge5.pcislotnumber = "22"
|
||||||
|
pcibridge5.present = "TRUE"
|
||||||
|
pcibridge5.virtualdev = "pcieRootPort"
|
||||||
|
pcibridge6.functions = "8"
|
||||||
|
pcibridge6.pcislotnumber = "23"
|
||||||
|
pcibridge6.present = "TRUE"
|
||||||
|
pcibridge6.virtualdev = "pcieRootPort"
|
||||||
|
pcibridge7.functions = "8"
|
||||||
|
pcibridge7.pcislotnumber = "24"
|
||||||
|
pcibridge7.present = "TRUE"
|
||||||
|
pcibridge7.virtualdev = "pcieRootPort"
|
||||||
|
policy.vm.mvmtid = ""
|
||||||
|
powertype.poweroff = "hard"
|
||||||
|
powertype.poweron = "hard"
|
||||||
|
powertype.reset = "hard"
|
||||||
|
powertype.suspend = "hard"
|
||||||
|
proxyapps.publishtohost = "FALSE"
|
||||||
|
remotedisplay.vnc.enabled = "FALSE"
|
||||||
|
remotedisplay.vnc.ip = "127.0.0.1"
|
||||||
|
remotedisplay.vnc.port = "5993"
|
||||||
|
replay.filename = ""
|
||||||
|
replay.supported = "FALSE"
|
||||||
|
sata0.present = "FALSE"
|
||||||
|
scsi0.pcislotnumber = "16"
|
||||||
|
scsi0.present = "TRUE"
|
||||||
|
scsi0.virtualdev = "lsilogic"
|
||||||
|
scsi0:0.filename = "generic-alpine314-vmware-cl1.vmdk"
|
||||||
|
scsi0:0.present = "TRUE"
|
||||||
|
scsi0:0.redo = ""
|
||||||
|
serial0.autodetect = "FALSE"
|
||||||
|
serial0.filename = ""
|
||||||
|
serial0.filetype = ""
|
||||||
|
serial0.pipe.endpoint = ""
|
||||||
|
serial0.present = "FALSE"
|
||||||
|
serial0.startconnected = "FALSE"
|
||||||
|
serial0.trynorxloss = ""
|
||||||
|
serial0.yieldonmsrread = ""
|
||||||
|
softpoweroff = "FALSE"
|
||||||
|
sound.autodetect = "TRUE"
|
||||||
|
sound.filename = "-1"
|
||||||
|
sound.present = "FALSE"
|
||||||
|
sound.startconnected = "FALSE"
|
||||||
|
svga.guestbackedprimaryaware = "TRUE"
|
||||||
|
svga.vramsize = "134217728"
|
||||||
|
tools.synctime = "TRUE"
|
||||||
|
tools.upgrade.policy = "upgradeAtPowerCycle"
|
||||||
|
usb.pcislotnumber = "-1"
|
||||||
|
usb.present = "FALSE"
|
||||||
|
uuid.action = "create"
|
||||||
|
uuid.bios = ""
|
||||||
|
uuid.location = ""
|
||||||
|
vc.uuid = ""
|
||||||
|
virtualhw.productcompatibility = "hosted"
|
||||||
|
virtualhw.version = "12"
|
||||||
|
vmci0.id = "1861462631"
|
||||||
|
vmci0.pcislotnumber = "35"
|
||||||
|
vmci0.present = "TRUE"
|
||||||
|
vmotion.checkpointfbsize = "134217728"
|
||||||
|
vmotion.checkpointsvgaprimarysize = "134217728"
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<Foundry>
|
||||||
|
<VM>
|
||||||
|
<ClientMetaData>
|
||||||
|
<clientMetaDataAttributes/>
|
||||||
|
<HistoryEventList/></ClientMetaData>
|
||||||
|
<VMId type="string">52 59 c0 38 41 3e 81 21-fb fe 13 82 cc 38 5e 9d</VMId>
|
||||||
|
<vmxPathName type="string">generic-alpine314-vmware.vmx</vmxPathName></VM></Foundry>
|
|
@ -0,0 +1 @@
|
||||||
|
{"name":"generic/alpine314","version":"3.5.2","provider":"vmware_desktop","directory":"boxes/generic-VAGRANTSLASH-alpine314/3.5.2/vmware_desktop"}
|
|
@ -0,0 +1 @@
|
||||||
|
502
|
1
vm-builder/.vagrant/machines/default/vmware_desktop/id
Normal file
1
vm-builder/.vagrant/machines/default/vmware_desktop/id
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/Users/user/code/dangerzone/install/vm-builder/.vagrant/machines/default/vmware_desktop/1a6cd45d-9c66-466a-8102-8e7fbbe66804/generic-alpine314-vmware.vmx
|
|
@ -0,0 +1 @@
|
||||||
|
8055cfc1c36c4fe0af1dc2f53d5369ae
|
|
@ -0,0 +1 @@
|
||||||
|
/Users/user/code/dangerzone/install/vm-builder
|
9
vm-builder/.vagrant/rgloader/loader.rb
Normal file
9
vm-builder/.vagrant/rgloader/loader.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# This file loads the proper rgloader/loader.rb file that comes packaged
|
||||||
|
# with Vagrant so that encoded files can properly run with Vagrant.
|
||||||
|
|
||||||
|
if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
|
||||||
|
require File.expand_path(
|
||||||
|
"rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
|
||||||
|
else
|
||||||
|
raise "Encoded files can't be read outside of the Vagrant installer."
|
||||||
|
end
|
|
@ -2,11 +2,10 @@
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
config.vm.box = "generic/alpine313"
|
config.vm.box = "generic/alpine314"
|
||||||
config.vm.synced_folder "../../dangerzone-converter", "/opt/dangerzone-converter"
|
config.vm.synced_folder "../../dangerzone-converter", "/opt/dangerzone-converter"
|
||||||
config.vm.synced_folder ".", "/vagrant"
|
config.vm.synced_folder ".", "/vagrant"
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
sed -i 's/3.13/3.14/' /etc/apk/repositories
|
|
||||||
apk update
|
apk update
|
||||||
apk add alpine-sdk build-base apk-tools alpine-conf busybox fakeroot syslinux xorriso squashfs-tools sudo
|
apk add alpine-sdk build-base apk-tools alpine-conf busybox fakeroot syslinux xorriso squashfs-tools sudo
|
||||||
apk add mtools dosfstools grub-efi
|
apk add mtools dosfstools grub-efi
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ALPINE_TAG=v3.14.1
|
ALPINE_TAG=v3.14.3
|
||||||
|
|
||||||
# Set up podman
|
# Set up podman
|
||||||
sudo modprobe fuse
|
sudo modprobe fuse
|
Loading…
Reference in a new issue