mirror of
https://github.com/outbackdingo/openwrt-builder.git
synced 2026-01-27 18:19:53 +00:00
880e5eb365f490fa433d7583f9d778673986cf44
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 config
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
Optionally add MediaTek feed:
cat << EOF >> feeds.conf.default
src-git mtksdk https://git01.mediatek.com/openwrt/feeds/mtk-openwrt-feeds
EOF
git add feeds.conf.default ; git commit -m 'Add MediaTek feed'
Update the feeds:
./scripts/feeds update -a && ./scripts/feeds install -a
If you have own config file, replace it. For example:
# for BPI-R4
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7988a/extended > ~/openwrt-builder/openwrt/.config
# for AX3200
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/mediatek/mt7622/extended > ~/openwrt-builder/openwrt/.config
# or official
curl -SL https://downloads.openwrt.org/snapshots/targets/mediatek/mt7622/config.buildinfo > ~/openwrt-builder/openwrt/.config
### alternative configs ###
# Xiaomi 4A Giga Edition
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/ramips/mt7621/extended > ~/openwrt-builder/openwrt/.config
# AX3600
curl -SL https://raw.githubusercontent.com/danpawlik/openwrt-builder/master/configs/qualcommax/ax3600/extended > ~/openwrt-builder/openwrt/.config
Build
Configure the firmware image and the kernel:
make menuconfig
Then:
make -j$(nproc) kernel_menuconfig
Build the firmware image:
make -j $(nproc) defconfig download clean world
To get more verbosity:
make -j1 V=s defconfig download clean world
With Ansible - WIP
- 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%