在Debian / Ubuntu 系統下,先安裝下列套件
sudo apt update
sudo apt install build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \
gettext git libncurses5-dev libssl-dev python3-distutils rsync unzip zlib1g-dev \
file wget
透過下列2種不同的主機,可以下載目前最新版本的程式碼
git clone https://git.openwrt.org/openwrt/openwrt.git
You can find a mirror of the repository on GitHub:
git clone https://github.com/openwrt/openwrt.git
下載完成後, 進行 feeds 更新
./scripts/feeds update -a
./scripts/feeds install -a
再進行硬體的選擇後,進行編譯
make menuconfig
make -j9
# Download and update the sources
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git pull
# Select a specific code revision
git branch -a
git tag
git checkout v21.02.3
# Update the feeds
./scripts/feeds update -a
./scripts/feeds install -a
# Configure the firmware image and the kernel
make menuconfig
make -j$(nproc) kernel_menuconfig
# Build the firmware image
make -j$(nproc) defconfig download clean world