The Edimax BR6104KP router (also available as Omnima Embedded Controller from http://www.omnima.co.uk/ with JTAG and serial already soldered in) has only 2MB onboard flash, which is too small for any usable Linux setup. The board has also two USB1.1 interfaces, and this patch introduces a new profile that builds two images: the flash image containing the LZMA loader and the kernel (less than 900KB), and a tar.gz archive of the root filesystem. The kernel looks to mount the rootfs as ext3 or ext2 on /dev/sda1.
The patches for include/image.mk and include/kernel-defaults.mk extend the existing functionality and should not hurt any existing profile. To use the new profile, choose in menuconfig: Target System: Infineon/ADMtek ADM5120 [2.6] Target Profile: Edimax BR-6104KP (USB Root FS) The patch was tested, and by default it supports the onboard switch and the USB storage. Other kernel modules should function as well. The next step will be to utilize the unused space in the onboard flash to store the persistent configuration, so that updating the rootfs would not hurt it. A copy of the patch is available at http://torrus.org/openwrt.trunk.13018.br6104kp-usbroot.20081021.patch It should work against the SVN trunk at revision 13018 Signed-off-by: Stanislav Sinyagin <[EMAIL PROTECTED]> Index: include/image.mk =================================================================== --- include/image.mk (revision 13021) +++ include/image.mk (working copy) @@ -63,12 +63,14 @@ ifeq ($(CONFIG_TARGET_ROOTFS_TGZ),y) define Image/mkfs/tgz $(TAR) -zcf $(BIN_DIR)/openwrt-$(BOARD)-rootfs.tgz --owner=root --group=root -C $(TARGET_DIR)/ . + $(call Image/Build,tgz) endef endif ifeq ($(CONFIG_TARGET_ROOTFS_CPIOGZ),y) define Image/mkfs/cpiogz ( cd $(TARGET_DIR); find . | cpio -o -H newc | gzip -9 >$(BIN_DIR)/openwrt-$(BOARD)-rootfs.cpio.gz ) + $(call Image/Build,cpio) endef endif else Index: include/kernel-defaults.mk =================================================================== --- include/kernel-defaults.mk (revision 13021) +++ include/kernel-defaults.mk (working copy) @@ -91,6 +91,10 @@ $(LINUX_CONFCMD) > $(LINUX_DIR)/.config.target $(SCRIPT_DIR)/metadata.pl kconfig $(TMP_DIR)/.packageinfo $(TOPDIR)/.config > $(LINUX_DIR)/.config.override $(SCRIPT_DIR)/kconfig.pl 'm+' $(LINUX_DIR)/.config.target $(LINUX_DIR)/.config.override > $(LINUX_DIR)/.config + if [ -f $(PLATFORM_DIR)/config/profile-$(PROFILE) ]; then \ + mv $(LINUX_DIR)/.config $(LINUX_DIR)/.config.pkginfo; \ + $(SCRIPT_DIR)/kconfig.pl '+' $(LINUX_DIR)/.config.pkginfo $(PLATFORM_DIR)/config/profile-$(PROFILE) > $(LINUX_DIR)/.config; \ + fi $(call Kernel/SetInitramfs) $(call Kernel/Configure/$(KERNEL)) rm -rf $(KERNEL_BUILD_DIR)/modules Index: target/linux/adm5120/router_le/profiles/Edimax.mk =================================================================== --- target/linux/adm5120/router_le/profiles/Edimax.mk (revision 13021) +++ target/linux/adm5120/router_le/profiles/Edimax.mk (working copy) @@ -22,6 +22,30 @@ Package set optimized for the Edimax BR-6104KP endef +define Profile/BR6104KP_USBROOTFS + NAME:=Edimax BR-6104KP (USB Root FS) + PACKAGES:=kmod-usb-core kmod-usb-adm5120 +endef + +define Profile/BR6104KP_USBROOTFS/Config + deselect squashfs + deselect USES_SQUASHFS + deselect jffs2 + deselect USES_JFFS2 + select PACKAGE_kmod-usb-core + select PACKAGE_kmod-usb-adm5120 + select PACKAGE_kmod-usb-storage + select PACKAGE_kmod-fs-ext2 + select PACKAGE_kmod-fs-ext3 + select DEFAULT_kmod-ledtrig-adm5120-switch +endef + +define Profile/BR6104KP_USBROOTFS/Description + Package set for the Edimax BR-6104KP with rootfs on USB drive. + The resut consists of a packed kernel image and the root filesystem + in a tar.gz archive. +endef + define Profile/BR6104WG NAME:=Edimax BR-6104Wg (Unofficial, No WiFi) endef @@ -40,5 +64,6 @@ $(eval $(call Profile,BR6104K)) $(eval $(call Profile,BR6104KP)) +$(eval $(call Profile,BR6104KP_USBROOTFS)) $(eval $(call Profile,BR6104WG)) $(eval $(call Profile,BR6114WG)) Index: target/linux/adm5120/router_le/base-files-BR6104KP_USBROOTFS/etc/config/fstab =================================================================== --- target/linux/adm5120/router_le/base-files-BR6104KP_USBROOTFS/etc/config/fstab (revision 0) +++ target/linux/adm5120/router_le/base-files-BR6104KP_USBROOTFS/etc/config/fstab (revision 0) @@ -0,0 +1,10 @@ +config mount + option target /home + option device /dev/sda1 + option fstype ext3 + option options rw,sync + option enabled 0 + +config swap + option device /dev/sda2 + option enabled 0 Index: target/linux/adm5120/image/router_le.mk =================================================================== --- target/linux/adm5120/image/router_le.mk (revision 13021) +++ target/linux/adm5120/image/router_le.mk (working copy) @@ -43,6 +43,7 @@ rm -f $(call imgname,$(1),$(2)).trx endef + define Image/Build/Infineon $(call Image/Build/Loader,$(2),gz,0x80500000,0x6D8,y,$(2)) $(call Image/Build/TRXNoloader,$(call imgname,$(1),$(2)).trx,$(1)) @@ -282,6 +283,19 @@ $(call Image/Build/Template/Edimax/$(1),br-6104kp) endef +define Image/Build/Profile/BR6104KP_USBROOTFS + touch $(KDIR)/dummymarker + $(call Image/Build/Loader,br-6104kp,gz,0x80500000,0x6D8,y,br-6104kp) + $(STAGING_DIR_HOST)/bin/trx -o \ + $(IMGNAME)-br-6104kp.trx -f $(KDIR)/vmlinux.lzma \ + -a 1024 -f $(KDIR)/dummymarker + $(STAGING_DIR_HOST)/bin/mkcsysimg -B br-6104kp \ + -r $(KDIR)/loader-br-6104kp.gz::0x1000 \ + -x $(IMGNAME)-br-6104kp.trx:0x10000 \ + $(IMGNAME)-br-6104kp-usbrootfs-xmodem.bin + rm -f $(IMGNAME)-br-6104kp.trx +endef + define Image/Build/Profile/BR6104WG $(call Image/Build/Template/Edimax/$(1),br-6104wg) endef @@ -338,6 +352,7 @@ # Edimax $(call Image/Build/Profile/BR6104K,$(1)) $(call Image/Build/Profile/BR6104KP,$(1)) + $(call Image/Build/Profile/BR6104KP_USBROOTFS,$(1)) $(call Image/Build/Profile/BR6104WG,$(1)) $(call Image/Build/Profile/BR6114WG,$(1)) # Infineon Index: target/linux/adm5120/config/profile-BR6104KP_USBROOTFS =================================================================== --- target/linux/adm5120/config/profile-BR6104KP_USBROOTFS (revision 0) +++ target/linux/adm5120/config/profile-BR6104KP_USBROOTFS (revision 0) @@ -0,0 +1,13 @@ +CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/sda1 rootfstype=ext3,ext2 init=/etc/preinit ro rootdelay=10" +CONFIG_JFFS2_FS=n +CONFIG_SQUASHFS=n +CONFIG_YAFFS_FS=n +CONFIG_MTD_ROOTFS_ROOT_DEV=n +CONFIG_MTD_ROOTFS_SPLIT=n +CONFIG_SCSI=y +CONFIG_BLK_DEV_SD=y +CONFIG_USB=y +CONFIG_USB_ADM5120_HCD=y +CONFIG_USB_STORAGE=y +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y _______________________________________________ openwrt-devel mailing list [email protected] http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
