mirror of
https://github.com/outbackdingo/openwrt-builder.git
synced 2026-01-27 10:19:59 +00:00
823b24fbf98db873203cc36836d3adb8eb70862d
Openwrt
Build OpenWRT system image
How to
Container image to build Openwrt image based on https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem To build own container image:
sudo yum install -y git podman
git clone https://github.com/danpawlik/openwrt-builder
cd openwrt-builder
podman build -t openwrt-builder -f Dockerfile
Example
How to use:
mkdir -p openwrt-builder && chmod 0777 openwrt-builder
podman run --name openwrt -it -u user -v $(pwd)/openwrt-builder:/home/user/openwrt-builder:z,rw quay.io/dpawlik/openwrt:f38 bash
Then inside the container (from https://openwrt.org/docs/guide-developer/toolchain/use-buildsystem):
git clone https://git.openwrt.org/openwrt/openwrt.git ~/openwrt-builder/openwrt && cd ~/openwrt-builder/openwrt
Update the feeds:
./scripts/feeds update -a && ./scripts/feeds install -a
If you have own config file, replace it. For example:
# for AX3200
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7622/extended-full > ~/openwrt-builder/openwrt/.config
# or official
curl -SL https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/config.buildinfo > ~/openwrt-builder/openwrt/.config
# alternative configs
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/ramips/mt7621/extended-full > ~/openwrt-builder/openwrt/.config
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/qualcommax/ax3600/extended-full > ~/openwrt-builder/openwrt/.config
Configure the firmware image and the kernel:
make menuconfig
Then:
# make kernel_menuconfig
make -j$(nproc) kernel_menuconfig
Build the firmware image:
make -j $(nproc) defconfig download clean world
With Ansible
- Install Ansible:
sudo dnf install -y ansible-core git
- Clone builder project
git clone https://github.com/danpawlik/openwrt-builder && cd openwrt-builder
- Run Ansible playbook
ansible-playbook -i ansible/inventory.yaml ansible/openwrt-build.yaml
Description
Languages
Shell
47.7%
Makefile
44.5%
Dockerfile
7.8%