OpenWrt:
1. OpenWrt 系统的编译:
https://wiki.openwrt.org/doc/start
https://wiki.openwrt.org/doc/howto/buildroot.exigence
sudo apt-get update
sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip
12.09版本安装:(不要使用trunk版本,trunk版本测试版不稳定,使用稳定版本如12.09、14.07、15.05,安装过程出现错误请善用搜索引擎,12.09软件安装包目前官方不提供支持,最好使用最新的稳定版)
git clone git://git.openwrt.org/12.09/openwrt.git
git clone git://git.openwrt.org/12.09/packages.git
修改feeds.conf.default,将luci那一行替换为
src-git luci https://github.com/openwrt/luci.git;luci-0.11
复制feeds.conf.default一份改名为feeds.conf
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
make menuconfig
luci中选择Collections -> luci,translations -> luci-i18n-chinese
编译USB支持软件包:https://wiki.openwrt.org/doc/howto/usb.storage,在make menuconfig中选中如下包:
kmod-usb-storage required … Kernel support for USB Mass Storage devices.
kmod-fs-<file_system> required … the file system you formatted your partition in. Common examples include kmod-fs-ext4, kmod-fs-hfs, kmod-fs-hfsplus, kmod-fs-msdos, kmod-fs-ntfs, kmod-fs-reiserfs and kmod-fs-xfs.
kmod-usb-storage-extras optional … Kernel support for some more drivers, such as for SmartMedia card readers.
block-mount recommended & required (if using fstab UCI configuration or luci Mount Points) … Scripts used to mount and check block devices (filesystems and swap) and hotplug capability (recognition when device is plugged in).
kmod-scsi-core Any mass storage is a generic SCSI device.
清空编译结果的几种方法:
a. make clean:清空目录/bin和/build_dir。
b. make dirclean:清空目录/bin,/build_dir,/staging_dir,/toolchain (=the cross-compile tools)和/logs。这个命令是基础的“完全清理”操作。
c. make distclean:删除所有编译和配置的文件,包含所有下载的feeds和package,也清空/.config,toolchain和其他资源。这个命令要小心使用。交叉编译的几种方法:
https://github.com/airplug/airplug/wiki/Cross-compiling-for-OpenWRT
https://wiki.openwrt.org/doc/devel/crosscompile
使用第二种方法交叉编译rtptools。
注意:PATH和STAGING_DIR设置一定要定位到OpenWrt-SDK目录下相应位置。需要对host2ip.c文件patch -p0 < rtptools-01-host2ip-no-nis-on-uClibc.patch。path文件在https://github.com/maximeh/buildroot/tree/master/package/rtptools
OVS:
1. Open vSwitch 的安装:https://github.com/pichuang/openvwrt/tree/dev,https://github.com/schuza/openvswitch#installation-in-openwrt
2. OVS 命令使用时不能设置外部控制器
3. OVS 默认使用 in-band 模式,ovs-appctl bridge/dump-flows br0 会出现隐藏流表,需要设置 ovs-vsctl set controller br0 connection-mode=out-of-band。