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