Unattended build of OpenWRT vagrant boxes.
To create the Box run it with the URL to the combined image
./build-virtualbox -u https://downloads.openwrt.org/releases/21.02.2/targets/x86/64/openwrt-21.02.2-x86-64-generic-ext4-combined.img.gz -b OpenWRT-21.02.2.box
The box will be export into OpenWRT-<VERSION>.box.
Import into vagrant
vagrant box add --name openwrt --provider=virtualbox OpenWRT-<VERSION>.box
Create a new VM based on the OpenWRT Box and start it
vagrant init openwrt
vagrant up
There are some customizations to ensure vagrant will work properly, see Vagrantfile
- At first the OpenWRT combined image will be downloaded and converted into a VirtualBox.
- A VirtualBox Maschine will be set up an prepare with the converted disk image and a serial port, which listen on port 22023.
- The maschine starts.
- The expect script setup-box.exp wait for some key phrases on serial line and start the setup script setup-box.sh.
- When the VM halts vagrant will export the box into the file OpenWRT-<VERSION>.box.
- Remove the VM and the disk image.
- sha256sum
- sha384sum
- sha512sum
- socat
- vagrant
- VirtualBox
- wget