一,下载源代码
包含命令:
git clone git://git.openwrt.org/openwrt.git
cd openwrt
git remote add oxnas https://git.gitorious.org/openwrt-oxnas/openwrt-oxnas.git
git fetch oxnas
git checkout oxnas/master
git rebase origin/master
更新feeds
cp feeds.conf.default feeds.conf
scripts/feeds update -a
scripts/feeds install -a
openwrt@localhost:~# git clone git://git.openwrt.org/openwrt.git
Cloning into 'openwrt'...
remote: Counting objects: 293564, done.
remote: Compressing objects: 100% (83234/83234), done.
remote: Total 293564 (delta 200296), reused 288766 (delta 196956)
Receiving objects: 100% (293564/293564), 107.28 MiB | 4.18 MiB/s, done.
Resolving deltas: 100% (200296/200296), done.
Checking connectivity... done.
scripts/feeds update -a
openwrt@localhost:/openwrt$ scripts/feeds update -a
Updating feed 'packages' from 'https://github.com/openwrt/packages.git' ...
Already up-to-date.
Create index file './feeds/packages.index'
Updating feed 'luci' from 'https://github.com/openwrt/luci.git' ...
Already up-to-date.
Create index file './feeds/luci.index'
Updating feed 'routing' from 'https://github.com/openwrt-routing/packages.git' ...
Already up-to-date.
Create index file './feeds/routing.index'
Source of feed telephony has changed, replacing copy
Updating feed 'telephony' from 'http://git.openwrt.org/feed/telephony.git' ...
Cloning into './feeds/telephony'...
remote: Counting objects: 166, done.
remote: Compressing objects: 100% (147/147), done.
remote: Total 166 (delta 16), reused 45 (delta 3)
Receiving objects: 100% (166/166), 94.42 KiB | 78.00 KiB/s, done.
Resolving deltas: 100% (16/16), done.
Checking connectivity... done.
Create index file './feeds/telephony.index'
Collecting package info: done
Updating feed 'management' from 'https://github.com/openwrt-management/packages.git' ...
Already up-to-date.
Create index file './feeds/management.index'
openwrt@localhost:/openwrt$ scripts/feeds install -a
Collecting package info: package/feeds/packages/libexif^Cmake[1]: *** Deleting file `/openwrt/tmp/info/.packageinfo-feeds_packages_libexif'
make[1]: *** wait: No child processes. Stop.
make[1]: *** Waiting for unfinished jobs....
make[1]: *** wait: No child processes. Stop.
make: *** wait: No child processes. Stop.
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes. Stop.
Installing all packages from feed packages.
Installing package 'acl'
Installing package 'attr'
Installing package 'aiccu'
Installing package 'alpine'
Installing package 'libpam'
WARNING: No feed for package 'libcrypto' found, maybe it's already part of the standard packages?
Installing package 'alsa-lib'
Installing package 'alsa-utils'
Installing package 'apache'
Installing package 'apr'
Installing package 'apr-util'
Installing package 'expat'
。。。。。要下载不少软件。。。。。
到此为止,源代码都已经下载好了
二,编译源码
包含命令:
make menuconfig
按空格选中,M为编译为ipk,*为编译到ROM中去,注意,只要比较重要的标记为*
在Target System选PLXTECH/Oxford NAS782x/OX82x
Target System (PLXTECH/Oxford NAS782x/OX82x) --->
Target Profile (PogoPlug Pro) --->
Kernel modules --->
Filesystems --->
<*> kmod-fs-ext4..................................... EXT4 filesystem support ext文件系统支持
<*> kmod-fs-vfat..................................... VFAT filesystem support fat32文件系统支持,ntfs不选,因为有ntfs-3g
Wireless Drivers ---> 这里有无线驱动
Native Language Support --->
<*> kmod-nls-utf8...................................................... UTF-8 utf8支持
File Transfer --->
<*> aria2....................................... lightweight download utility
<*> curl.................................. A client-side URL transfer utility
<*> vsftpd............................. A fast and secure FTP server (no TLS)
<*> wget............... Non-interactive network downloader (with SSL support)
<*> wget-nossl...... Non-interactive network downloader (without SSL support)
SSH --->
<*> openssh-server............................................ OpenSSH server
LuCI --->
1. Collections --->
-*- luci
5. Translations --->
<*> luci-i18n-chinese....................... Chinese (by Chinese Translators)
4. Themes --->
<*> luci-theme-bootstrap........................... Bootstrap Theme (default)
Utilities --->
Filesystem --->
-*- e2fsprogs.................................. Ext2/3/4 filesystem utilities
<*> nfs-utils.......................... updated mount utility (includes nfs4)
-*- ntfs-3g.................................... Stable Read/Write NTFS Driver ntfs支持
<*> ntfs-3g-utils...... ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
添加需要的组件,比如luci、transmission、samba之类的。 开始正式编译可以使用的固件。。。。make V=99 又一次漫长的等待后
openwrt@localhost:/openwrt/bin/oxnas$ ls -l
total 61104
-rw-r--r-- 1 openwrt openwrt 852 Jan 8 14:34 md5sums
-rw-r--r-- 1 openwrt openwrt 545344 Jan 8 13:47 openwrt-oxnas-ox820-u-boot.bin
-rw-r--r-- 1 openwrt openwrt 6960 Jan 8 14:33 openwrt-oxnas-pogoplug-pro.dtb
-rw-r--r-- 1 openwrt openwrt 1643280 Jan 8 14:34 openwrt-oxnas-pogoplug-pro-fit-uImage.bin
-rw-r--r-- 1 openwrt openwrt 5745880 Jan 8 14:34 openwrt-oxnas-pogoplug-pro-fit-uImage-initramfs.itb
-rw-r--r-- 1 openwrt openwrt 6389760 Jan 8 14:34 openwrt-oxnas-pogoplug-pro-squashfs-sysupgrade.tar
-rw-r--r-- 1 openwrt openwrt 6815744 Jan 8 14:34 openwrt-oxnas-pogoplug-pro-squashfs-ubinized.bin
-rw-r--r-- 1 openwrt openwrt 6422528 Jan 8 14:34 openwrt-oxnas-pogoplug-pro-u-boot-initramfs.itb
-rw-r--r-- 1 openwrt openwrt 1635040 Jan 8 14:34 openwrt-oxnas-uImage
-rw-r--r-- 1 openwrt openwrt 5737640 Jan 8 14:34 openwrt-oxnas-uImage-initramfs
-rwxr-xr-x 1 openwrt openwrt 20314192 Jan 8 14:34 openwrt-oxnas-vmlinux-initramfs.elf
-rwxr-xr-x 1 openwrt openwrt 1634976 Jan 8 14:33 openwrt-oxnas-zImage
-rwxr-xr-x 1 openwrt openwrt 5737576 Jan 8 14:34 openwrt-oxnas-zImage-initramfs
drwxr-xr-x 5 openwrt openwrt 4096 Jan 8 14:01 packages
进openwrt/bin/oxnas目录可以看到以上编译好的,
openwrt-oxnas-pogoplug-pro-squashfs-sysupgrade.tar
这个包大小差不多是6M多点,这是因为我们有很多软件没有选择,如果把所有的常用软件都装上(比如transmission,aria2,samba,vsftp,ssh,openV**,php,nginx,mysql….),能达到20M已经算很大了