ubuntu16.04 install openwrt19.07

##openwrt Virtual machine Internet configuration, mainly because the virtual machine network card automatically obtains the IP address, the network card configuration in the virtual machine settings.
#Step 1: Prepare ubuntu software or compiler for openwrt compilation;
There is a pit in Libirary of openwrt-19.07 version, libopenssh and libmetassh cannot be selected at the same time.
The third item is required to enable SSH on the web: Gateway ports [checked] help Allow remote hosts to connect to local SSH forwarded ports

用163源
sudo sed -i 's@//.*/ubuntu@//mirrors.163.com/ubuntu@g' /etc/apt/sources.list
sudo apt -y update

[64位系统]sudo apt -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev patch unzip zlib1g-dev subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev curl vim
[32位系统] sudo apt -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip libz-dev subversion flex node-uglify git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev curl vim

#The second step, download the openwrt installation file;
git clone https://git.lede-project.org/source.git lede-v17.01.07 #download the stable version 17.01.07;
then enter the lede directory tar -xvf file, then Copy the folder and place it in the sune root directory;
cd into the directory
git branch -a
git checkout openwrt-19.07
git to check which version has been downloaded;

cd openwrt #Step
3: Update related files; compile first and then update.
./scripts/feeds update –a #If it shows that there is no execution permission, chmod +x scripts/feeds, the firmware cannot be pinged after the first compilation
#If the dependency is missing, download it separately; for example:
./scripts/feeds update luci
# Wait until everything is OK and then install.
/scripts/feeds install -a

make download V=99 #After downloading the content to be downloaded in advance,

#Fifth step: Configure the compilation menu
[][][][][You can search for the content to be installed through vi .config, and then manually change =y to compile and install [][][][]][[ ]
make menuconfig
make menuconfig configure openwrt.
Target System (MTK/Ralink APSOC) --->
Subtarget (MT7621 based boards) --->
() MT7620 based boards
(x) MT7621 based boards
() MT7628 based boards

#Select Target Profile
Target Profile (MQmaker Witi Board Profile) --->
      (   ) Default Profile
      ( x ) MQmaker Witi Board Profile

#Select the type of Images
Target Images  --->
      [ * ] ramdisk  --->
      .....
      [ * ] squashfs --->

#6th step: start compiling
make V=99 -j8 V=99 must be used so that the files copied before are useful.
If there are frequent errors during the compilation process and the compilation cannot continue, in addition to manually downloading the source, you can try: make dirclean, and then recompile
some files that cannot be downloaded during the compilation process, and need to be copied to the dl file gcc-linaro-4.8-2014.04. tar.xz.

#7th step: cross-compilation toolchain configuration
vim /etc/bash.bashrc
export PATH=$PATH:/home/sune/openwrt-19.07/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin
export STAGING_DIR= After
saving /home/sune/openwrt-19.07/staging_dir , execute the following command:
source /etc/bash.bashrc
mips-openwrt-linux-gcc –v test it

Step 8: Compile the program and
use the sh batch file for program management;
use the Makefile file to write the executable program into the mipsel device;

#8th step:
The compiled file. openwrt-ramips-mt7621-witi-squashfs-sysupgrade.bin; copy to the same directory as tftp to
open the serial port debugging
and then start the menu, press 2, press Y, and then set the router IP address, 192.168.1.1; server (computer ) Ip address; 192.168.1.5;
Then copy the upgraded firmware name including .bin to the upgrade file name; don’t press Enter, open the tftp software, and then press Enter to start the upgrade.
After the upgrade, enter ifconfig through the serial port window to check the IP address of the device. The default should be 192.168.200.1;

The difference between the files formed after opwrt compilation

Bin files generated after OpenWrt compilation: jffs2 and squashfs, factory and sysupgrade
OpenWrt will generate multiple bin files after compilation, such as

openwrt-ar71xx-generic-tl-wr841nd-jffs2-factory.bin      8126464
openwrt-ar71xx-generic-tl-wr841nd-jffs2-sysupgrade.bin      4980740
openwrt-ar71xx-generic-tl-wr841nd-squashfs-factory.bin     8126464
openwrt-ar71xx-generic-tl-wr841nd-squashfs-sysupgrade.bin     3538948

There are two different formats in the bin file name, jffs2 and squashfs. The difference between the two formats of firmware is that after the squashfs format bin file is installed, it will occupy a certain amount of space to store some necessary files of the system. These files are only readable, and their role is to help restore the system. When OpenWrt crashes, you can use the firstboot script to rebuild the initial system based on these files, while jffs2 will not store such files, which has the advantage of saving space. Generally, the squashfs format firmware is used to facilitate the restoration of the system to the initial state.
There are two files for each format, factory and sysupgrade. The difference between the two is that the factory has some more verification items, which are used to upgrade on the basis of the original firmware. If it is already OpenWrt, just use the sysupgrade file. . And, when upgrading on the basis of the original firmware, first use the factory file, and then need to use the sysupgrade file again, choose not to keep the original configuration for the upgrade.

Default wan port IP address: change witi-openwrt/targetnux/ramips/base-files/etc/uci-defaults$ vi 02_network before compiling

#openwrt can embed zabbix_server zabbix_sender zabbix_proxy;
openwrt can be programmed in source code state, and then compiled?

The source luci file of openwrt is packaged in feeds;

The .po file is the language pack, the language pack file of the open source software Drupal;
#Copy the modbus related files to /usr/lib (copy the lib
file) and /usr/include (copy the include/modbus folder). And copy the contents of mipsel_modbus to the main board of openwrt accordingly.

#########################################################

opwrt installs stty serial port API program;

opwrt opkg source address changed: /etc/opkg.conf The download address is: if the automatic program cannot download the source, then manually download and then manually install.

src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci
src/gz barrier_breaker_base http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management

It can’t be installed even if you change the source. You need to download coreutils-stty_8.16-1_ramips_24kec.ipk from the packages, and then install it with opkg install.
Note that you need to add --nodeps after the installation command

####
####
#########################################################

Guess you like

Origin blog.51cto.com/13300270/2615752