2014年2月20日 星期四

Porting QCA953x to official openwrt source tree (kamikaze)

Steps:
1. Create qca953x folder under target/linux/. Use existing atheros folder as the example.
2. Do the patch between original 2.6.31 and the version Vendor provided. Put the patch file under target/linux/qca953x/patches.
3. List out missing folders and files and put them under target/linux/qca953x/files accordingly.
4. Copy over the .config file in the vendor kernel to target/linux/qca953x/config-default
5. include/target.mk
    Take out "+" in the kconfig.pl command
6. Because 2.6.31 does not have asm-mips at its usual path, additional CFLAGS path amendment is needed. The desired header files are located at arch/mips/include/asm.
    - package/bridge-utils/002-brctl_cflags.patch and 001-libbridge_cflags.patch (CFLAGS)
       Add $(KERNEL_HEADERS)/arch/mips/include
    - rule.mk (TARGET_CFLAGS)
      Add -I$(BUILD_DIR_BASE)/linux-$(BOARD)/linux-$(LINUX_VERSION)/arch/mips/include -I$(BUILD_DIR_TOOLCHAIN)/linux/arch/mips/include
    - Add "mknod ttyS0 c 4 64" in package/base-files/etc/preinit if using ttyS0 as the console device node.

Note:
If ever want to...
1. Add gcc ? Check out toolchain/gcc/Config.version and Config.in
2. Avoid root exclusion ? Check out include/prereq-build.mk