Testcase: IKCONFIG=y, IKCONFIG_PROC=y 1. CONFIG_MTD_UBI_FASTMAP=y 2. ./test.sh 1 # generate ubi image 1. CONFIG_MTD_UBI_FASTMAP=y 2. ./test.sh 3. CONFIG_MTD_UBI_FASTMAP=n 4. ./test.sh Situation I. Attach UBI image with no existed old fastmap 1. CONFIG_MTD_UBI_FASTMAP=n A. set fm_autoconvert a. ubiattach => scan all, no fastmap generated b. ubiattach -f => scan all, no fastmap generated B. not set fm_autoconvert a. ubiattach => scan all, no fastmap generated b. ubiattach -f => scan all, no fastmap generated 2. CONFIG_MTD_UBI_FASTMAP=y A. set fm_autoconvert a. ubiattach => scan all, fastmap generated b. ubiattach -f => scan all, no fastmap generated B. not set fm_autoconvert a. ubiattach => scan all, no fastmap generated b. ubiattach -f => scan all, no fastmap generated Situation II. Attach UBI image with existed old fastmap 1. CONFIG_MTD_UBI_FASTMAP=n A. set fm_autoconvert a. ubiattach => scan all, no fastmap generated b. ubiattach -f => scan all, no fastmap generated B. not set fm_autoconvert a. ubiattach => scan all, no fastmap generated b. ubiattach -f => scan all, no fastmap generated 2. CONFIG_MTD_UBI_FASTMAP=y A. set fm_autoconvert a. ubiattach => scan fast, fastmap generated b. ubiattach -f => scan all, no fastmap generated B. not set fm_autoconvert a. ubiattach => scan fast, fastmap updated b. ubiattach -f => scan all, no fastmap generated
Created attachment 301481 [details] test.sh
Created attachment 301482 [details] mtd-utils modifications
Apply mtd-utils modifications to mtd-utils, and compile ubiattach.
用法: 加载ubi模块或内核命令行参数是mtd=xxx的第5个参数控制fastmap是否打开,0为关闭,1为使能 CONFIG_MTD_UBI_FASTMAP=Y $ ID="0x20,0xa5,0x00,0x26" # 2G nand flash $ modprobe nandsim id_bytes=$ID parts=4096 # 两个1G的分区 $ modprobe ubi mtd=1,0,0,1,1 mtd=2,0,0,2,0 fm_autoconvert=1 # 预期 mtd1 -> ubi1(开启fastmap) mtd2 -> ubi2(不开启fastmap)成功 $ modprobe -r ubi # 移除模块,或 ubidetach $ modprobe ubi mtd=1,0,0,1,0 mtd=2,0,0,2,1 fm_autoconvert=1 # 预期 mtd1(旧的镜像) -> ubi1(关闭fastmap) mtd2(旧的镜像) -> ubi2(开启fastmap)成功
(In reply to wangzhaolong1 from comment #4) > 用法: > > 加载ubi模块或内核命令行参数是mtd=xxx的第5个参数控制fastmap是否打开,0为关闭,1为使能 > > CONFIG_MTD_UBI_FASTMAP=Y > > $ ID="0x20,0xa5,0x00,0x26" # 2G nand flash > > $ modprobe nandsim id_bytes=$ID parts=4096 # 两个1G的分区 > > $ modprobe ubi mtd=1,0,0,1,1 mtd=2,0,0,2,0 fm_autoconvert=1 > # 预期 mtd1 -> ubi1(开启fastmap) mtd2 -> ubi2(不开启fastmap)成功 > > $ modprobe -r ubi # 移除模块,或 ubidetach > > $ modprobe ubi mtd=1,0,0,1,0 mtd=2,0,0,2,1 fm_autoconvert=1 > # 预期 mtd1(旧的镜像) -> ubi1(关闭fastmap) mtd2(旧的镜像) -> ubi2(开启fastmap)成功 I'm sorry!!I misplaced it.