Compile openwrt for Xiaomi mini router

Not long ago, I bought a Xiaomi mini router. After a lot of tossing, I finally flashed the openwrt system. But after normal use, I found that there are still places that can't meet my needs, and some software is useless after installation, so I came up with the idea of ​​compiling a set of openwrt system, and implemented it when I had an idea.

First, download the source code of openwrt on github:

  $ git clone https://github.com/openwrt/openwrt.git

Enter the directory, check the README content, and install the software packages required in the compilation process as needed. Otherwise, the compilation command will not pass at all. Moreover, the README prompts not all the software to be installed. In short, it prompts what software is missing. , go to install, so that it can be compiled.

Select the module to be compiled:
mainly select the CPU architecture, select the model, select the device, and then select the packages and drivers to be installed according to personal needs. The basis of my choice: I don't need to support IPv6, I don't need drivers for other models of routers except Xiaomi mini, I don't need some miscellaneous software, I need iptables, ssh, libstdc++, tcpdump, etc. Anyway, it's a personal requirement.

Start compiling:
In this step, I walked through many pits. I didn’t know how long it took to compile for the first time. After waiting for a long time, I didn’t finish compiling. Finally, I went to sleep. Forced shutdown, the compilation failed, the reason is unknown;
I got a virtual machine for the second time, and only allocated 10G of storage, I thought: I only install a system with a command line interface, which does not take up much space and does not consume much memory, only It is used to compile openwrt, then 10G space should be enough, so I finished the process and started compiling. After a while, an error was reported: The directory cannot be created, the reason is that the directory is full, and the df command looks at it, it is really full, I am dizzy, The second compilation failed;
the third time, copy the entire openwrt directory of the second compilation to the new virtual machine, this time reserve 14G of space, start compiling, report an error, the g++ compilation tool reports an error, find it I didn't understand why, but I finally checked the online posts, and I probably understood that the cross-compilation chain was wrong, and the third compilation failed; for
the fourth time, copy the .config file from the third compilation to a brand new one. openwrt directory, compile, and report an error: Can't locate Data/Dumper.pm, check the network, and know that the perl-Data-Dumper software is not installed, install the software, the fourth compilation fails; the fifth time, install the Software, recompile, compile error:

enum uci_type' declared inside parameter list [-Werror]
const char *sct, const char *opt, enum uci_type type)
... ...
a lot of errors about uci

I checked on Baidu, I don't know the reason, so I re-make menuconfig and removed the item that designed UCI.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324433355&siteId=291194637