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

daniel daniel at dd-wrt.com
Tue Aug 23 03:59:34 PDT 2016


On 08/23/2016 09:35 AM, Felix Fietkau wrote:
> 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.
agree.
> 
>>    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.

The device I have has 3 partitions with a impractical size
(see the fdisk output in the commit message above).
It's possible that the mmc flash on my device has been altered from someone
else, before I got it.

If you are right, the patch is useless and can be dropped.
I am going to confirm this.

Is anyone here reading this capable of executing an 'fdisk -l' on a factory
ER-Pro device ?
> 
> - Felix
> 



More information about the Lede-dev mailing list