I have made my EA6200 boot into OpenWRT, with a kernel patch below:
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 63b6dbd..a9863b9 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -18,6 +18,12 @@ config MTD_ROOTFS_ROOT_DEV
bool "Automatically set 'rootfs' partition to be root filesystem"
default y
+config MTD_ROOTFS_ROOT_DEV_IGNORE_FORMER
+ bool "ignore the former 'rootfs' partition found"
+ depends on MTD_ROOTFS_ROOT_DEV
+ default n
+
+
config MTD_SPLIT_FIRMWARE
bool "Automatically split firmware partition for kernel+rootfs"
default y
diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
index 965ff37..180c4c3 100644
--- a/drivers/mtd/ubi/block.c
+++ b/drivers/mtd/ubi/block.c
@@ -452,7 +452,8 @@ int ubiblock_create(struct ubi_volume_info *vi)
if (!strcmp(vi->name, "rootfs") &&
config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV) &&
- ROOT_DEV == 0) {
+ (config_enabled(CONFIG_MTD_ROOTFS_ROOT_DEV_IGNORE_FORMER) ||
+ ROOT_DEV == 0)) {
pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n",
dev->ubi_num, dev->vol_id, vi->name);
ROOT_DEV = MKDEV(gd->major, gd->first_minor);
Sorry for this hacking style, I just want to point out where is the problem:
(1)kernel(linux-bcm53xx) will parse the partition table by reading MTD block, then it will get:
[ 6.118072] Creating 9 MTD partitions on "brcmnand.0":
[ 6.123205] 0x000000000000-0x000000080000 : "boot"
[ 6.129153] 0x000000080000-0x000000180000 : "nvram"
[ 6.135221] 0x000000180000-0x000000200000 : "nvram"
[ 6.141265] 0x000000200000-0x00000020001c : "firmware"
[ 6.148049] 0x00000020001c-0x000000600000 : "linux"
[ 6.153999] 0x000000600000-0x000001f00000 : "ubi"
[ 6.159838] 0x000001f00000-0x000008000000 : "firmware"
[ 6.166873] 0x000001f0001c-0x0000020d3650 : "linux"
[ 6.172874] 0x0000020d3650-0x000008000000 : "rootfs"
then kernel will set "0x0000020d3650-0x000008000000 : "rootfs" " as rootfs which is wrong.
(2)after (1) ubi driver will parse the ubi partition, then find a partition with roorfs lable. ubi driver can set this partition as rootfs, but it already got a "rootfs" in (1), so this time, the right rootfs will be ignore.
(3) then system boot fail because of getting the wrong rootfs partition.
---------------------
my patch just makes kernel to ignore the former rootfs partiton and use the rootfs in ubi partiton.
But I found another problem, the image I made just can boot once. In the next boot I got:
Boot version: v0.5.5
Device eth0: hwaddr 98-FC-11-F0-AF-BD, ipaddr 192.168.1.1, mask 255.255.255.0
gateway not set, nameserver not set
Invalid boot block on disk
Loader:raw, invalid tftp target filename (:)!
Could not load :: Invalid parameter
Invalid boot block on disk
nflash1.trx CRC check failed!
Changed to the other image 1
Loader:raw Filesys:raw Dev:nflash0.os2 File: Options:(null)
Loading: .... 4678976 bytes read
that means I system falls back to the default kernel.
Does some one know how to solve this problem ???
(Last edited by tekkamanninja on 16 May 2016, 16:57)