[OpenWrt-Devel] [PATCH 1/2] imx6: bootscript: enable UBI fastmap support

Koen Vandeputte koen.vandeputte at ncentric.com
Fri Oct 4 10:16:26 EDT 2019


On 04.10.19 14:30, Koen Vandeputte wrote:
>
> On 03.10.19 00:21, Tim Harvey wrote:
>> UBI Fastmap support is stable in the 4.4 kernel so lets take
>> advantage of it to shave off 5-10 seconds of boot time.
>>
>> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
>> ---
>>   target/linux/imx6/image/bootscript-ventana | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/target/linux/imx6/image/bootscript-ventana 
>> b/target/linux/imx6/image/bootscript-ventana
>> index 941afb5..8451caf 100644
>> --- a/target/linux/imx6/image/bootscript-ventana
>> +++ b/target/linux/imx6/image/bootscript-ventana
>> @@ -1,4 +1,4 @@
>> -echo "Gateworks Ventana OpenWrt Boot script v1.01"
>> +echo "Gateworks Ventana OpenWrt Boot script v1.02"
>>     # set some defaults
>>   # set some defaults
>> @@ -51,6 +51,8 @@ if itest.s "x${dtype}" == "xnand" ; then
>>       echo "mtdparts:${mtdparts}"
>>       setenv fsload ubifsload
>>       setenv root "ubi0:ubi ubi.mtd=2 rootfstype=squashfs,ubifs"
>> +    # enable UBI fastmap support
>> +    setenv bootargs "${bootargs} ubi.fm_autoconvert=1"
>>   else
>>       echo "Booting from block device ${bootdev}..."
>>       setenv fsload "${fs}load ${dtype} ${disk}:1"
>
> Hi Tim,
>
> Shouldn't this patch also enable the required kernel symbol? 
> (MTD_UBI_FASTMAP)
>
> Next to that, even in kernel 4.19 I'm reading following regarding this 
> feature:
>
> Important: this feature is experimental so far and the on-flash │
> format for fastmap may change in the next kernel versions
>
>
> Hi Richard,
>
> Apologies for dragging you in here.
>
> How stable is this fastmap format?
>
> Will it leave Experimental state in the near future?
>
>
> Thanks,
>
> Koen
>

I'm also seeing this warning:


[    0.000000] Kernel command line: console=ttymxc1,115200 ubi0:ubi 
ubi.mtd=2 rootfstype=squashfs,ubifs ubi.fm_autoconvert=1

[    2.356304] ubi0: default fastmap pool size: 95
[    2.360850] ubi0: default fastmap WL pool size: 47
[    2.365684] ubi0: attaching mtd2
[    2.551317] random: crng init done
[    2.786708] ubi0: scanning is finished

[    2.795380] ubi0 warning: ubi_eba_init: cannot reserve enough PEBs 
for bad PEB handling, reserved 38, need 40        <---

[    2.806651] ubi0: attached mtd2 (name "ubi", size 239 MiB)
[    2.812151] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 
bytes
[    2.819051] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.825855] ubi0: VID header offset: 2048 (aligned 2048), data 
offset: 4096
[    2.832825] ubi0: good PEBs: 1912, bad PEBs: 0, corrupted PEBs: 0
[    2.838937] ubi0: user volume: 3, internal volumes: 1, max. volumes 
count: 128
[    2.846175] ubi0: max/mean erase counter: 4/1, WL threshold: 4096, 
image sequence number: 1659699605
[    2.855327] ubi0: available PEBs: 0, total reserved PEBs: 1912, PEBs 
reserved for bad PEB handling: 38
[    2.864657] ubi0: background thread "ubi_bgt0d" started, PID 826
[    2.871496] block ubiblock0_1: created from ubi0:1(rootfs)
[    2.877025] ubiblock: device ubiblock0_1 (rootfs) set to be root 
filesystem


It doesn't seem to be a coincidence that it's missing 2 PEB's while 
fastmap uses 2 of them


Koen


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list