valldrac / onionwall-vagrant

Vagrant config for building and developing OnionWall.

Home Page:https://gitlab.com/valldrac/onionwall-vagrant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vagrantfile for OnionWall development

To generate a flashable firmare of OnionWall you need to setup the OpenWrt buildroot on a compatible OS and filesystem (case sensitive).

This Vagrant environment makes the process very easy on just about every platform.

Bootstrapping the Vagrant Box

$ git clone --recursive https://gitlab.com/valldrac/onionwall-vagrant.git
$ cd onionwall-vagrant
$ vagrant up

The buildroot will be available in the VM path /onionwall when the provisioning script is complete.

Building OnionWall

To proceed and build the firmware run this single command. It will SSH for you into the buildroot and will make all the magic:

$ make firmware

When finished, check out the image file with suffix squashfs-sysupgrade.bin in the host directory firmware/bin/targets and refer to https://gitlab.com/valldrac/onionwall/wikis/Flashing how-to.

If the build fails, re-run make with V=s for debugging output.

Customizing OnionWall

The directory with the source code is configured as rsynced shared folder. It is synchronized automatically to the buildroot by the Makefile. This way lets you to edit the sources directly in the host while being completely isolated from the build process.

If you want to customize the image through menuconfig try:

$ make menuconfig

The above executes menuconfig in the buildroot and copies the config file back into the source tree. This file includes only the changes compared to the default configuration of OpenWrt.

Patching the kernel

Follow https://openwrt.org/docs/guide-developer/build-system/use-patches-with-buildsystem:

$ vagrant ssh
$ cd /onionwall
$ make package/kernel/mac80211/{clean,prepare} V=s QUILT=1
$ cd build_dir/target-mips_24kc_musl-1.1.16/linux-ar71xx_generic/compat-wireless-2017-01-31
$ quilt push -a
$ quilt new 999-ath9k_random_mac_address.patch
$ quilt edit drivers/net/wireless/ath/ath9k/hw.c
$ quilt refresh
$ cd /onionwall
$ make package/kernel/mac80211/update V=s
$ make package/kernel/mac80211/{clean,compile} package/index V=s

Copy patch file back to the source tree:

$ vagrant scp default:/onionwall/package/kernel/mac80211/patches/999-ath9k_random_mac_address.patch onionwall/package/kernel/mac80211/patches 

Cleaning up

$ make clean

Cleans the directory firmware and dot-files generated by Makefile, but it avoids touching the buildroot.

Additional targets to clean up the mess:

  • make dirclean runs make clean both in the host and in the buildroot.
  • make distclean runs make clean and deletes the buildroot completely in the VM.

Remember you can recreate the Vagrant box at any time with make clean && vagrant destroy && vagrant up.

About

Vagrant config for building and developing OnionWall.

https://gitlab.com/valldrac/onionwall-vagrant


Languages

Language:Shell 50.1%Language:Makefile 49.9%