nor_mtd_dd_rw_jffs2运行报错
error getting mtd part number: $part
get_mtd_biggest_part for $DEVICE_TYPE: Backtrace :: $PARTITION ::
Error when trying to find mtd part range
一路追踪:
- part=`get_mtd_partition_number.sh "nor"` || die "error getting mtd part number: $part"
- in get_mtd_partition_number.sh PARTITION=`get_mtd_biggest_part $DEVICE_TYPE` || die "get_mtd_biggest_part for $DEVICE_TYPE: Backtrace :: $PARTITION :: "
- in mtd_common.sh PART_RANGE=`find_mtd_part_range "$DEVICE_TYPE"` || die "Error when trying to find mtd part range"
- in mtd_common.sh find_mtd_part_range() {......
TYPE=`find_part_type $PART`
- in mtd_common.sh find_part_type() {
PART=$1
MTD_DEV="mtdblock$PART"
if [[ -e /sys/class/mtd/mtd$PART/type ]]; then
TYPE=`cat /sys/class/mtd/mtd$PART/type`
if [[ $TYPE == 'nand' ]]; then
PART_TYPE='nand'
else
if [[ `ls /sys/class/mtd/mtd$PART/device/driver/ | grep 'flash'` ]]; then
PART_TYPE="nor"
elif [[ `ls /sys/class/mtd/mtd$PART/device/driver/ | grep 'qspi'` ]];then
PART_TYPE="qspi"
elif [[ `ls /sys/class/mtd/mtd$PART/device/driver/ | grep 'ospi'` ]];then
PART_TYPE="qspi"
elif [[ `ls /sys/class/mtd/mtd$PART/device/driver/ | grep 'spi'` ]];then
if [[ `cat /proc/mtd |grep -E "mtd$PART |mtd${PART}: "|grep -i qspi ` ]];then
PART_TYPE="qspi"
else
PART_TYPE="spi"
fi
else
die "/sys/class/mtd/mtd$PART/device/driver doesn't exist"
fi
fi
else
die "/sys/class/mtd/mtd$PART/type doesn't exist"
fi
echo $PART_TYPE
}
TYPE=`cat /sys/class/mtd/mtd0/type`
TYPE=nor
ls /sys/class/mtd/mtd0/device/driver/
bind e2000000.nor uevent unbind
mtd_common.sh
所以grep 'flash'要改为 grep 'nor'
if [[ `ls /sys/class/mtd/mtd$PART/device/driver/ | grep 'nor'` ]]; then
因为build-in driver
所以将blk_device_prepare_format.sh
############# Do the work ###########################################
if [[ "$DEV_NODE" =~ "mtd" ]]; then
do_cmd printout_mtdinfo "$DEV_NODE"
do_cmd modprobe mtdblock
do_cmd modprobe ubi
do_cmd modprobe ubifs
fi
改为
############# Do the work ###########################################
if [[ "$DEV_NODE" =~ "mtd" ]]; then
do_cmd printout_mtdinfo "$DEV_NODE"
#do_cmd modprobe mtdblock
#do_cmd modprobe ubi
#do_cmd modprobe ubifs
fi