First, download the official website source code
[Email Protected]:~/project/pmt7620$mkdir openwrt-1407
[Email protected]:~/project/pmt7620/openwrt-1407$git clone Git://git.openwrt.org/14.07/openwrt.git.
[Email Protected]:~/project/pmt7620/openwrt-1407$ls
Bsdmakefile config/config.in docs/feeds.conf.default include/license Makefile package/readme rules.mk scripts/target/ toolchain/tools/
[Email protected]:~/project/pmt7620/openwrt-1407$ ls.
./ .. /. git/. Gitattributes. Gitignore
second, the initial to their own local warehouse
[Email protected]:~/project/pmt7620/openwrt-1407$rm-rf. git
[Email protected]:~/project/pmt7620/openwrt-1407$git Init
[Email protected]:~/project/pmt7620/openwrt-1407$git Add.
[Email protected]:~/project/pmt7620/openwrt-1407$git cm-m "Init Openwrt-1407"
third, add mt7620n M201 products
1, add M201 plate type
target/linux/ramips/base-files/lib/ramips.sh
Ramips_board_detect () {
* "Wrtnode")
Name= "Wrtnode"
;;
+ * "M201")
+ name= "m201"
+ ;;
2, target/linux/ramips/base-files/lib/upgrade/platform.sh
Wrtnode |\
+ m201 |\
3. Add M201.dts
CP Wrtnode.dts M201.dts
compatible = "m201", "RALINK,MT7620N-SOC";
Model = "M201";
4. Generate only M201 bin files after compilation
Target/linux/ramips/image/makefile
+ #Image/build/profile/mlw221=$ (call buildfirmware/default16m/$ (1), $ (1), mlw221,mlw221)
+ #Image/build/profile/mlwg2=$ (call buildfirmware/default16m/$ (1), $ (1), MLWG2,MLWG2)
+ #Image/build/profile/wmr300=$ (call buildfirmware/default8m/$ (1), $ (1), wmr-300,wmr300)
+ #Image/build/profile/rt-n14u=$ (call buildfirmware/default8m/$ (1), $ (1), rt-n14u,rt-n14u)
+ #Image/build/profile/wr8305rt=$ (call buildfirmware/default8m/$ (1), $ (1), WR8305RT,WR8305RT)
+ #Image/build/profile/wrtnode=$ (call buildfirmware/default16m/$ (1), $ (1), Wrtnode,wrtnode)
+image/build/profile/m201=$ (call buildfirmware/default16m/$ (1), $ (1), m201,m201)
+ #Image/build/profile/zbt-wa05=$ (call buildfirmware/default8m/$ (1), $ (1), zbt-wa05,zbt-wa05)
+#$ (call image/build/profile/mlw221,$ (1))
+# $ (call image/build/profile/mlwg2,$ (1))
+# $ (call image/build/profile/wmr300,$ (1))
+# $ (call image/build/profile/rt-n14u,$ (1))
+# $ (call image/build/profile/wr8305rt,$ (1))
+# $ (call image/build/profile/wrtnode,$ (1))
+ $ (call image/build/profile/m201,$ (1))
+#
5. Add a separate compilation option in Target profile
target/linux/ramips/mt7620n/profiles/
CP 00-default.mk M201.MK
Define profile/m201
name:=m201 mt7620n Board Profile
Packages:=\
Kmod-usb-core KMOD-USB2 kmod-usb-ohci \
Kmod-ledtrig-usbdev
Endef
Define Profile/m201/description
Package set for M201 mt7620n Iot Board
64MB DDR2 + 8MB Flash.
Endef
$ (eval $ (call profile,m201))
6. Add Network Configuration
Vim Target/linux/ramips/base-files/etc/uci-defaults/02_network
Wrtnode | \
m201)
Ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
;;
Iv. Configuring and compiling the M201 project
1. Download and install feeds (feeds is the package kit PACKAGES/LUCI required for OPENWRT environment)
[Email protected]:~/project/pmt7620/openwrt-1407$./scripts/feeds update-a
Generate feeds/tmp/. config. config.old
[Email protected]:~/project/pmt7620/openwrt-1407$./scripts/feeds install-a
Installing all packages from feed packages.
Build package/feeds/staging_dir/only after the installation, in the subsequent make menuconfig, the relevant configuration can be selected.
2, do the simplest configuration: Make Menuconfig
Target System (Ralink rt288x/rt3xxx)--->
Subtarget (mt7620n based boards)--->
Target Profile (M201 mt7620n board profiles)--->
3. Compiling
Make v=99 compiles for a long time, because many things are downloaded online
New bin/build_dir/dl/after compiling
Note: The bin directory is generated under the product firmware package, the Build_dir directory is the unpacked package, the kernel is inside, the DL directory will be based on the content of your configuration will be downloaded in real-time some of the corresponding package.
4, add DL to git warehouse management, you can track which packages have been downloaded git add dl/comments. Gitignore #/dl
Five, add to the server for Management
* Create a bare repository (does not include workspaces)
git clone--bare openwrt-1407/openwrt-1407.git
* uploaded to the server for Gitosis management
1, scp-r openwrt-1407.git [email Protected]:/home/win
2, sudo mv/home/win/openwrt-1407.git/home/git/repositories/
3, sudo chown-r git:git/home/git/repositories/openwrt-1407.git
4,/home/server/git/git-manager/gitosis-admin/: Modify and push gitosis.conf
+[group openwrt-1407]
+members = Lin Zhou Win
+writable = openwrt-1407
Six, colleagues download
1, first execute $ssh-keygen all the way to the end of the return. After successful, the id_rsa.pub and Id_rsa two files will be produced in the ~/.ssh/directory.
The Id_rsa.pub public key file is sent to the Server Manager for authorization to download.
2. Win colleague download git clone [email protected]:openwrt-1407.git
Vii. Creating a Product development Branch
1, although the project M201 as master, but later will be added other similar products, so or branch to manage better
2, win create local m201 development Branch
Git checkout-b m201-mt7620n
3. Submit to the remote repository
Git push Origin m201-mt7620n:m201-mt7620n
Git branch-r can see the remote branch
4, Zhou colleague Download m201-mt7620n branch
git clone [email protected]:openwrt-1407.git-b m201-mt7620n
viii. Compilation Configuration
1. Download and install feeds (feeds is the package kit PACKAGES/LUCI required for OPENWRT environment)
./scripts/feeds update-a//note failed, need to be re-executed
./scripts/feeds Install-a
Only after the installation, in the subsequent make menuconfig, the relevant configuration can be selected.
2. Configuration
Make Menuconfig
Make Kernel_config
Some general configuration and some special configurations are required for the project.
3. Compiling
Make v=99//compile process will download some things online, solid compilation for a long time, and may even interrupt
When configuring a small amount of firmware generated in the bin/xxx/directory, I did not configure too many builds only 2.8M, with the configuration of multiple firmware on the big.
Make V=s 2>&1 | Tee Build.log | Grep-i Error
Build an internal openwrt git repository