diff mbox

[OpenWrt-Devel] Ubnt EdgeRouter: Use mmcblk0p3 as ext4 rootfs for default ?

Message ID 56A2447F.6020209@dd-wrt.com
State RFC
Headers show

Commit Message

Daniel Danzberger Jan. 22, 2016, 3:02 p.m. UTC
On 01/21/2016 08:57 AM, John Crispin wrote:
> 
> 
> On 20/01/2016 17:15, daniel wrote:
>> The UBNT EdgeRouter has an internal mmc flash card.
>> (unlike the EdgeRouter Lite)
>>
>> The factory mmc flash card layout is:
>>
>> Device         Boot  Start     End Sectors  Size Id Type
>> /dev/mmcblk0p1 *        63   17135   17073  8.3M 83 Linux
>> /dev/mmcblk0p2       17199  149183  131985 64.5M 83 Linux
>> /dev/mmcblk0p3      149247 2246831 2097585    1G 83 Linux
>>
>> This patch edits the kernel command line to use the the 3rd partition
>> as rootfs (ext4).
>> I think this makes sense for a default configuration when installing
>> openwrt on the mmc flash card of the EdgeRouter.
>>
>> What do you think ?
>>
>> Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
>>
>>
>>
> 
> we use block2mtd so that sysupgrade works. your patch technically is
> fine but will break at least sysupgrade on this target.
> 

I changed the patch to use block2mtd.

While testing sysupgrade, I noticed that it's currently borken on this
device, because the /tmp/sysinfo/board_name file contains "ubnt,er200".
For sysupgrade to work, the file should contain "er".
However, deleting the file before running sysupgrade fixes the problem.

With this patch, I am now able to use the EdgeRouter properly with an
1 GB ext4 rootfs. But squashfs images won't work anymore due the change
of the rootfstype= in the kernel cmdline.

Maybe the squashfs image should be removed for the Edgerouter builds ?
Or is there a way to use different cmdlines for each image ?

> 
>> _______________________________________________
>> openwrt-devel mailing list
>> openwrt-devel@lists.openwrt.org
>> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
diff mbox

Patch

--- a/target/linux/octeon/image/Makefile
+++ b/target/linux/octeon/image/Makefile
@@ -23,7 +23,7 @@  define Image/BuildKernel/Initramfs/Template
        $(STAGING_DIR_HOST)/bin/patch-cmdline $(BIN_DIR)/$(IMG_PREFIX)-$(1)-vmlinux-initramfs.elf '$(strip $(2))'
 endef
 
-ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro block2mtd.block2mtd=/dev/mmcblk0p2,65536,rootfs,5 root=/dev/mtdblock3 rootfstype=squashfs rootwait
+ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro block2mtd.block2mtd=/dev/mmcblk0p3,512,rootfs,5 rootfstype=ext4 root=/dev/mtdblock3 rootwait
 ERLITE_CMDLINE:=-mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom) block2mtd.block2mtd=/dev/sda2,65536,rootfs,5 root=/dev/mtdblock3 rootfstype=squashfs rootwait
 
 define Image/BuildKernel
@@ -49,6 +49,7 @@  endef
 
 define Image/Build/ext4
        $(call Image/Build/sysupgrade,erlite,generic,ext4)
+       $(call Image/Build/sysupgrade,er,er,ext4)
 endef
 
 define Image/Build/squashfs