openwrt is a linux system running on embedded devices. OpenWrt's file system is writable, and developers do not need to recompile after each modification. It is a popular router system at present, and it is about 3-4M after compilation. It is best to use Ubuntu as the compilation server. The following compilation is successful under Ubuntu12.10.
1. Install the basic software
sudo apt-get install subversion libtool autoconf automake gcc-multilib bison screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core git build-essential libncurses5-dev zlib1g-dev gawk quilt asciidoc libz-dev
2. Download the source code
svn co svn://svn.openwrt.org.cn/dreambox/trunk openwrt
3. Install the extension
cp feeds.conf.default feeds.conf #Configure software sources ./scripts/feeds update -a #Update software sources ./scripts/feeds install -a #Install software sources
4. Kernel customization
make V=s defconfig #Test build environment
错误:undefined reference to `kconf_id_lookup'
The Ubuntu15 kernel is too new, resulting in this error. It is recommended to use ubuntu12 for compilation.
make menuconfig #Customize the compilation environment
Select build items:
#Target
Target System -- Atheros AR7xxx/AR9xxx
Target Profile -- TP-LINK TL-WR842N/ND
#SDK
Build OpenWrt SDK #SDK
Build OpenWrt Toolchain #toolkit, development program
#Lights
LuCI -- Collections -- luci #web management interface (Lua configuration interface), written by lua
LuCI -- Translations -- luci-i18n-chinese #中文package
LuCI -- Applications -- luci-app-ddns #Add ddns
#Sys
Base System -- block-mount #USB挂载
Kernel modules -- Filesystems -- kmod-fs-ext4 #hard disk support
Kernel modules -- USB Support -- kmod-usb-storage-extras #USB extension support
Utilities -- Filesystem -- badblocks #Automount tool
5. Compile
make or make V=99 (recommended)
mistake:
1. Could not resolve hostname `svn.nomi.cz'
The source is blocked and the domain name cannot be accessed.
vi package/hotplug2/Makefile
PKG_SOURCE_URL:=http://svn.nomi.cz/svn/isteve/hotplug2 The domain name does not exist. Search found that hotplug2 can be downloaded through googlecode, address: http://hotplug2.googlecode.com/svn/trunk. This address has been blocked, so FANQIANG needs to be downloaded to the local and build its own SVN server. Modify the Makefile to point to this machine, and modify PKG_VER=1.
The generated firmware is in the bin/ar71xx directory with the name:
ar71xx/openwrt-ar71xx-generic-tl-wr842n-v1-jffs2-factory.bin
ar71xx/openwrt-ar71xx-generic-tl-wr842n-v1-squashfs-factory.bin
jffs2 is suitable for systems with power outages
squashfs compresses the ROM into a file and enters it into the router. The official recommendation is squashfs, because this format can restore the factory settings after flashing even if the configuration is messed up. The second is to save space after compression.
The router in hand is the original firmware and needs to use XXX-factory.bin firmware to flash OpenWrt. If the router has already flashed OpenWrt, select the upgrade firmware XXXX-sysupgrade.bin, and upgrade it in the upgrade interface.
6. Burn the firmware
The web management interface uploads firmware and updates. Note: Most home routers do not support flashing openwrt, because the flash and other configurations are low. The author TP-LINK WR720N becomes a brick.
After installing OpenWrt for the first time, you need to set a password to log in using SSH. The method is to use telnet login or Web login to set the password.
Method 1: telnet
telnet 192.168.1.1
passwd#Set root password
Method 2: Manage the interface, modify the page
system->administration->SSH Access. After SSH is enabled, telnet is disabled by default
Terminal login:
It can also operate at the terminal, it is simply a small computer, and there is no sense of excitement. It is overkill to use it as a fool router.
7. Installer
scp hello [email protected]:/root
8. Package Manager
opkg is the package manager provided by openWrt.
opkg update | install | remove #Install and remove packages
opkg install hello.ipk #Process packages with .ipk suffix
9. Customize the admin page
luCI is the router's web management interface. If you are not satisfied with the native page, you can customize it at will. The admin page is a CGI service written in Lua language.
Home Directory: /www
Modify OpenWrt version information:
/etc/openwrt_release/version.lua
Content Template:
/view/themes/openwrtcn/header.htm Modify map
/view/themes/openwrtcn/footer.htm Modify footer
Logo:
/luci-static/openwrtcn/logo.jpg Logo replacement
The picture below is a router from a treasure