Hey all, I'm hoping someone can point me in the right direction.
I'm starting with a TP-LINK MR-3220. I'm trying to change the size of the MTD partitions because I need more kernel space and less rootfs space for my particular build. In the code below I'm trying to move 0x20000 from rootfs to the kernel. So far I've...
1. Edited the mktplinkfw.c file and changed
{
.id = "TL-MR3220v1",
.hw_id = HWID_TL_MR3220_V1,
.hw_rev = 1,
.fw_max_len = 0x3c0000,
.kernel_la = 0x80060000,
.kernel_ep = 0x80060000,
.rootfs_ofs = 0x160000, // was 0x140000
}, {
2. edited target/linux/ar71xx/files/arch/mips/ar71xx/mach-tl-mr3x20.c and changed:
static struct mtd_partition tl_mr3x20_partitions[] = {
{
.name = "u-boot",
.offset = 0,
.size = 0x020000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "kernel",
.offset = 0x020000,
.size = 0x160000, //was 0x140000
}, {
.name = "rootfs",
.offset = 0x180000, //was 0x160000
.size = 0x270000, //was 0x290000
}, {
.name = "art",
.offset = 0x3f0000,
.size = 0x010000,
.mask_flags = MTD_WRITEABLE,
}, {
.name = "firmware",
.offset = 0x020000,
.size = 0x3d0000,
}
};
3. rebuild openwrt using make.
When load the factory.bin on to the router I see:
spi0.0: no WRT160NL signature found
Creating 5 MTD partitions on "spi0.0":
0x000000000000-0x000000020000 : "u-boot"
0x000000020000-0x000000160000 : "kernel" <<----- should be 0x20000 - 0x180000
0x000000160000-0x0000003f0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
split_squashfs: no squashfs found in "spi0.0" <<----- NOT GOOD
0x0000003f0000-0x000000400000 : "art"
0x000000020000-0x0000003f0000 : "firmware"
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: Found an AR7240 built-in switch
eth1: Atheros AG71xx at 0xb9000000, irq 4
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ar71xx-ehci ar71xx-ehci: Atheros AR91xx built-in EHCI controller
ar71xx-ehci ar71xx-ehci: new USB bus registered, assigned bus number 1
ar71xx-ehci ar71xx-ehci: irq 3, io mem 0x1b000000
ar71xx-ehci ar71xx-ehci: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-usbat
Atheros AR71xx hardware watchdog driver version 0.1.0
TCP westwood registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x8af1 instead <<---- NOT GOOD either
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x13ff instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xda37 instead
The MTD size of the kernel is 0x140000 not the 0x160000 I requested. Because of that, I'm guessing the rootfs cannot be found, and things go downhill from there. Is there another file i need to edit to get this to work?
Thanks for your help.
-pete
(Last edited by ClubPetey on 27 Apr 2011, 19:25)