openwrt compilation experience【2021-01-28】
Compiler Environment
Kubuntu 20.10 (theoretically the same is true for other Ubuntu distributions)
first refer to the Openwrt Readme of L and install it
build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g+±multilib antlr3 gperf wget curl swig rsync
These bags (some systems come with them)
Also, it’s a good idea to have a ladder ready.
Compile repository
I use the official source code of openwrt. If the speed in China is slow, you can use gitee to speed up the clone.
Not only the openwrt source code needs to be accelerated, but the warehouses in openwrt/feed.conf.defaults also need to be accelerated. You can modify it to the warehouse directory under gitee or use other methods to speed up.
Compile configuration
Just use make menuconfig to select the package you need.
Refer to L's plug-in instructions.
In addition, in the generated .config file, the two user packages libustream-wolf and dnsmasq will report errors and need to be commented out.
Compilation process
- Install compilation tools
sudo apt install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 python2.7 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib antlr3 gperf wget curl swig rsync -y
- Download the openwrt repository
The git address can be replaced with your own openwrt warehouse.git clone https://git.openwrt.org/openwrt/openwrt.git/
- Enter the warehouse and switch to the version you need
cd openwrt git checkout remotes/origin/openwrt-19.07
- Edit feeds.conf.defaults repository to speed up
Replaced with your own accelerated repository.nano feeds.conf.default
- Then update with feeds first
./scripts/feeds update -a ./scripts/feeds install -a
- Generate configuration file
make menuconfig
- Modify .config file
Comment out these two linesnano .config
CONFIG_PACKAGE_libustream-wolfssl
CONFIG_PACKAGE_dnsmasq - To prevent errors during parallel compilation, run make download first
A lot of things will be downloaded here. It is recommended to use a proxy, but please note that there is a problem with the proxy, that is, pip cannot connect through socks when pysocks is not installed.make -j8 download V=s
- compile
Although the tutorial says that make download can prevent parallel compilation errors, I still have some inexplicable packages that cannot be compiled successfully during parallel compilation. There should be mutual dependencies. If the compilation is idle for a long time, it is recommended to compile with a single thread, otherwise it can be repeated several times. .make -j1 V=s