1. Install Ubuntu
Download To http://www.ubuntu.org.cn/desktop/get-ubuntu/download/, version casually, I chose 10.10 32-bit version. The installation process will not be mentioned. graphical installation and the Chinese version are not supported. You can close this page. It can be installed in a virtual machine or on a physical machine. It is recommended that you install it on a physical machine if necessary. It may be said that virtual machines may be unpredictable sometimes, but there are many people in virtual machines. Question: When I set the user name and password in one step of the installation process, I chose to log on automatically because I am too lazy to enter the password every time. It is just a compilation system and there is no secret.
2. disable screen saver
After installation, select "Screen Saver" in the "System" menu "Preferences" in the upper left corner, and then remove "Activate screen saver when the computer is idle" in the lower left corner ", then press "close". The window does not contain "application" or "OK". Close it and save it. I am used to the attention of Windows users. Why do we need to do this? This is because some steps will take some time to complete during the compilation process. It is also troublesome to automatically enable the screen saver and re-enter the password to exit.
3. Switch to the root user
Select "application"-"attachment"-"terminal" in the upper-left corner to enter the command line, enter Sudo-Sh, pay attention to Case sensitivity, and enter the user password set when installing the system, you can switch to the root node. (The prompt is that * is not displayed when you enter the password. It is not displayed at all, and some people do not need to be alarmed ). Switching to root is to install or upgrade some necessary components. Some components require the root permission.
4. install components required for compilation
Apt-Get install g ++
Apt-Get install libncurses5-dev
Apt-Get install zlib1g-dev
Apt-Get install bison
Apt-Get install flex
Apt-Get install unzip
Apt-Get install Autoconf
Apt-Get install gawk
Apt-Get install make
Apt-Get install gettext
Apt-Get install gcc
Apt-Get install binutils
Apt-Get Install patch
Apt-Get install Bzip2
Apt-Get install libz-Dev
Apt-Get install asciidoc
Apt-Get install Subversion
After each line of carriage return, the system immediately checks whether to install or upgrade the component. The official wiki uses a single command. I separated it because it is easier to check whether the installation of each component is successful. If a command line is run, a lot of things are coming out consecutively, so I am too lazy to drag the scroll bar and look back. Separate the steps one by one to facilitate reading. I like it. The final asciidoc component in the middle needs to download more than 400 mb of things and wait. Before downloading an object, you will be prompted about how many MB objects to download. If you want to download the object, Press Y and press enter to download the object. Tip: If it prompts that the software package cannot be found, you may need to check the software name in the command again, because sometimes there is a number 1 in the middle of the letter, and it is easy to think of it as the letter L.
5. Exit root.
After the above installation is complete, this step is very important, that is, execute the exit command to exit the root. If you do not exit the root account, the system will be dizzy later. The next step is to download the source code. After downloading the source code as root, some will prompt that the root account cannot be used as the root account, however, the source code has been downloaded as root, and the "owner" of all files is root. After exiting the root account, the system will prompt you that you do not have the permission because the file is root, normal users cannot access the file, and only commands can be used to modify the file owner. Therefore, You need to exit root and execute the following download source code command as a normal user. In fact, when installing components at the beginning, you can add sudo in front of the command to achieve the temporary root identity, and then return to the general permission after the execution, but for the novice, you don't have to pursue this too much. If you have a feasible method, just try it out first.
6. Download the source code
There are two types: the latest version, but not the most stable version, namely the trunk version, and the backfire version. The source code download commands are:
Create a folder first:
Mkdir openwrt
CD openwrt
Download command for trunk: SVN Co SVN: // svn.openwrt.org/openwrt/trunk/
Backfire download command: SVN Co SVN: // svn.openwrt.org/openwrt/branches/backfire/
Select the desired version. And then wait for the download...
7. Start preparing for compilation
CD trunk or CD backfire
If it is not the code you just downloaded, you should regularly run SVN up to update the code to keep the code updated. You do not know when it will change.
Then update the software package:
./Scripts/feeds Update-
./Scripts/feeds install-
If you do not update the software package, you will find that you cannot see many software packages later, and you will not be able to integrate those unseen packages. Next, make defconfig, and then make menuconfig to enter the customization interface. You can choose to compile only the firmware of the specified device. Be sure to select your own device type, then you can specify the specific type. I don't know much about the configuration, but I don't know much about it. I just hit it a few times. If you don't understand some software packages, it means you don't need it, some software packages need to be installed separately after you install the official website version. If you see them, you can choose to integrate them. To make it appear in brackets, * Indicates integration. After the configuration is complete, exit and remember to save it. If you want to modify the source code, you should do so at this time. For example, you can modify large-capacity Flash files and find the modified files on the Internet. Then, you can find the files on the Ubuntu graphic interface, double-click to open the text editor and save the changes. If you want to integrate a Chinese package or other unofficial packages, I will not help you, because I will not.
8. Execute Compilation
Finally, execute make to start compilation. The first compilation is a long wait. If it is a dual-core CPU, the use of the make-J 2 command can speed up, but some people do not recommend this, the official wiki did not say this, I do not know whether it is good. However, I am a 4-core CPU. I used the make-J 4 command and found that the CPU usage has not improved significantly. After reading help, I found that no number can be added, by default, no number is used to limit the number of tasks simultaneously. After I use make-J to limit the number of tasks at the same time, the CPU usage is 100%, but the entire compilation process will fluctuate, at the beginning, it was 100%, followed by around 25% in a period of time (that is, only a single core), and sometimes 40% to 50% (almost using a dual-core), sometimes even almost no operation, CPU usage is low. However, the first compilation is particularly slow, and the first compilation is much faster. The tragedy is that the first time I use make-J to compile the result is a failure, and then make will succeed without parameters. Maybe this is why some people do not recommend it, however, because of the previous compilation, the second time is very fast. That is to say, if the J parameter can be used for acceleration, although it may fail, but because the second time does not take a long time, it may be possible to add the J parameter for acceleration in the first compilation. However, I did not compare the time difference between adding or not adding the-J parameter. If you are interested, compare them yourself.
9. After compilation is complete, the bin folder will appear. Go to the bin folder and find the desired bin.