[LEDE-DEV] [PATCH 1/2] Octeon: Use ext4 on mmcblk0p3 per default for ER.

Felix Fietkau nbd at nbd.name
Tue Aug 23 00:35:19 PDT 2016


On 2016-08-22 14:06, Daniel Danzberger wrote:
> This patch defaults the rootfs to ext4 on the Ubnt Edgerouter.
> The Edgerouter Lite is not affacted by this patch.
> 
> Why EXT4 and not squashfs + jiffs ?
> -----------------------------------
> The internal mmc flash is badly partitioned.
> 
> Disk /dev/mmcblk0: 3.7 GiB, 3959422976 bytes, 7733248 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> 
> 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
> 
> block2mtd requires a block size that is a divisor of the device size.
> Both p2 and p3 can only be divided by the sector size 512,
> but Jiffs won't work with a blocksize of 512 bytes.
> 
> This also fixes a boot hang, when the kernel tries to mount /root.
> The old commandline was: block2mtd.block2mtd=/dev/mmcblk0p2,65536,rootfs,15
> 
> This line caused the following error message and stopped booting:
> "block2mtd: erasesize must be a divisor of device size"
> 
> Signed-off-by: Daniel Danzberger <daniel at dd-wrt.com>
> ---
>  target/linux/octeon/image/Makefile | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/target/linux/octeon/image/Makefile b/target/linux/octeon/image/Makefile
> index ab91d06..da0d072 100644
> --- a/target/linux/octeon/image/Makefile
> +++ b/target/linux/octeon/image/Makefile
> @@ -14,8 +14,9 @@ define Device/Default
>    KERNEL := kernel-bin | strip-kernel | patch-cmdline
>    IMAGES := sysupgrade.tar
>    IMAGE/sysupgrade.tar/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@
> +  IMAGE/sysupgrade.tar/ext4 := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@
pad-rootfs does not make sense for ext4.

>    IMAGE/sysupgrade.tar := sysupgrade-tar
> -  FILESYSTEMS := squashfs
> +  FILESYSTEMS := squashfs ext4
>  endef
>  
>  define Build/strip-kernel
> @@ -29,7 +30,7 @@ define Device/generic
>  endef
>  TARGET_DEVICES += generic
>  
> -ER_CMDLINE:=-mtdparts=phys_mapped_flash:640k(boot0)ro,640k(boot1)ro,64k(eeprom)ro block2mtd.block2mtd=/dev/mmcblk0p2,65536,rootfs,15 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,15 rootfstype=ext4 root=/dev/mtdblock3 rootwait
This change does not make any sense to me. As far as I know, at least
the ER-PRO only ships with 2 partitions on mmc, not 3.

- Felix



More information about the Lede-dev mailing list