Building the firmware
As mentioned before, we will download the latest version of OpenWrt and build it for x86. On a modern Ubuntu/Debian distribution, you just need to follow these steps:
- Prepare the build environment:
sudo apt update
sudo apt install build-essential clang flex g++ gawk gcc-multilib gettext git libncurses5-dev libssl-dev python3-distutils rsync unzip zlib1g-dev
- Check out the most recent version of the firmware:
git clone --depth 1 --branch v21.02.3 https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
- Update the feeds:
/scripts/feeds update -a
/scripts/feeds install -a
- Configure the firmware image and the kernel:
make menuconfig #here you can select cross compilation to other hardware if you'd like
make -j $(nproc) kernel_menuconfig
# Build the firmware image
make -j $(nproc) defconfig download clean world #the -j parallelize compilation for your CPU
The make menuconfig
command will allow us to select the target hardware that we prefer...