当前位置:网站首页>Compile your own openwrt firmware using Tencent cloud lightweight application server
Compile your own openwrt firmware using Tencent cloud lightweight application server
2022-06-23 03:10:00 【Qingyang】
Use Tencent cloud lightweight application server to compile your own Openwrt The firmware
Preface
Some time ago, I used my old notebook at home to create a one arm route to play , Limited by the performance limitation of single arm routing as the master routing , So I started with a USB3.0 To Gigabit network card , To form the primary route of the dual network cards , Realize my own needs , But the firmware used by the big guys in the group is incompatible bug The network card runs for more than ten hours usb The network card will restart , So I compiled a firmware myself , I don't have any suitable tutorials on the Internet , There are certain twists and turns in the middle . So here I will record the use Tencent cloud Of Lightweight application servers Compilation process , Let us not go into the pit .
compile OpenWrt I spent most of my time building the compilation environment , Because compiling requires a lot of dependencies , Fortunately Lean Big has helped me tidy up , Just follow the steps .
Preparation
- One server ( It's OK to have no virtual machine ) It is recommended to buy a server . The address is in the relevant link .
- lean What is recommended is Ubuntu 20.04 LTS x64 System , Pay attention to the system when purchasing or installing virtual machines .
- Have a certain practical ability , Reach for the party 、 If the disabled see here, they can stop looking .
Environment building
Here we use the lightweight application server of Tencent cloud in Hong Kong , You don't have to follow the system steps , Remember to select the image as required . adopt ssh Tools login ubuntu. After logging in, you need to update the source , Tencent is its own source by default , Very fast .
This is the server configuration I selected .
If you use it for a short time, you can buy it for one month , The higher the configuration, the faster the compilation ( It mainly depends on the number of cores )
Be careful :
- Do not use root The user compiles !!!
- Compiled firmware , Default login IP 192.168.1.1, password password
Dependent installation
sudo apt update
sudo apt-get -y 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
When the installation is complete , It takes a little time , Just a few minutes .
Source download
git clone https://github.com/coolsnowwolf/lede
Download the source code , then cd lede Entry directory . Here again , It is recommended to use the lightweight application server of Tencent cloud in Hong Kong , Or you can open a global agent by yourself ( There is no explanation here ). If you do not use a server or agent in Hong Kong, the compilation may fail because some sources are blocked .
cd lede ./scripts/feeds update -a ./scripts/feeds install -a make defconfig
make defconfig It will check whether the required compilation tools are complete , And generate the default compilation configuration file .config
Configure compile options
Input... At the terminal :
make menuconfig
The interface looks like this .
In the later stage, I will see if the students' needs are explained
After entering, you can use the up and down keys on the keyboard to select the platform you want to compile , such as X86 platform , Or other platforms , Then select some necessary software packages . In the selection process , Press Enter Is to enter the configuration , English input method press Y Is to determine the choice , Press N Yes deselect , After all selections are configured , Press two Esc Is to opt out , Finally, save and exit to generate .config The configuration file .
Download the source code
After the configuration is completed, you need to download the software you selected and the necessary files ,OpenWrt Only compile and configure instructions , Various dependent code packages are stored in upstream websites and code warehouses , Compiling will download a lot of source code
make -j8 download V=s ---- download dl library
In this step, if an agent is used, the network speed and stability of the agent will determine the time , If it is a server in Hong Kong , Just a minute .
Compiling system
install screen
It is recommended to use screen To hang the compiled process in the background , Prevent the terminal from being disconnected for various reasons ( It is usually network fluctuation or misoperation ) Losing session compilation will break , Use screen There will be no such problem if it is hung in the background .
install screen:
sudo apt install screen
screen Use -S Command to create a session :
screen -S openwrt
Press on the keyboard Ctrl +A +D It can be attached to the background , If you need to view the background session input :
screen -ls
Execute the above command and you will see that we are attached to the background openwrt conversation , Switch to openwrt conversation :
screen -r openwrt
If you have only one conversation, you can omit the following openwrt, Default to the first , If more than one is compiling , When you create a new window , Use different names to distinguish .
Compilation and thread
make V=s -j1
-j1 Followed by the number of threads . Single thread is recommended for the first compilation , If you have confidence in yourself , There are only a few cores in the server configuration , Start compiling the firmware you want , Whether it is simple or complex is up to you the final say .
Last
Author site
The personal blog address is :https://www.hipyt.cn/
Links to this article
边栏推荐
- Goframe framework (RK boot): Based on cloud native environment, distinguish configuration files (config)
- Reading redis source code (III) initialization and event cycle
- Flowable refactoring process editor to obtain user information
- Application of map function in JS
- Installing serverstatus probe using pagoda
- PowerShell automated reinstallation of cloudbase init to version 1.1.2
- The difference between the use of return, break and continue in the if statement in JS
- Account protection and use scheme
- Reading redis source code (IV) command request processing flow
- Pnas: amygdala individual specific functional connectivity: Fundamentals of precision psychiatry
猜你喜欢

Soft exam information system project manager_ Contract Law_ Copyright_ Implementation Regulations - Senior Information System Project Manager of soft exam 030

Soft exam information system project manager_ Information system comprehensive testing and management - Senior Information System Project Manager of soft test 027
随机推荐
What is the difference between JS undefined and null
Application of map function in JS
Pond sampling
February 3, 2022: a group of people (two or more) want to meet at the same place
February 2, 2022: the closest binary search tree value II. Given a non empty two
How to set jewelry label paper
Transformation solution of digital intelligent supply chain platform for project management in engineering industry
Extract NTDs with volume shadow copy service dit
The difference between the use of return, break and continue in the if statement in JS
SAP mm initial transaction code MEK1 maintenance pb00 price
Online signature with canvas
Drill down into handler, looper, messagequeue
February 4, 2022: combined total IV. Give you a number composed of different integers
"Tianzhou II" successfully docked! Three minutes to understand the shocking black technology on "Tianzhou II"! Headlines
Reading redis source code (V) master-slave replication and sentinel mechanism
Handlebars dynamic adjustment
Integrated solution for intelligent supply chain platform management in rubber industry
2022-01-27: heater. Winter has come. Your task is to design a
JS counts the number of times a string appears in another string
2022-01-28: for example, {5, 3, 1, 4} all number pairs are: (5,3), (5,1)