如题
离线
$
$ sudo modprobe mtd
$ sudo modprobe mtdblock
$ sudo modprobe nandsim first_id_byte=0xec second_id_byte=0xa1 third_id_byte=0x00 fourth_id_byte=0x15
$ ls /dev/mtd
mtd0 mtd0ro mtdblock0
$
$ ls /dev/mtd* -l
crw------- 1 root root 90, 0 Feb 22 23:05 /dev/mtd0
crw------- 1 root root 90, 1 Feb 22 23:05 /dev/mtd0ro
brw-rw---- 1 root disk 31, 0 Feb 22 23:05 /dev/mtdblock0
$
$ cat /proc/mt
mtd mtrr
$ cat /proc/mtd
dev: size erasesize name
mtd0: 08000000 00020000 "NAND simulator partition 0"
$
可以的, 试一试这样
离线
好奇帮楼主测试了一下buildroot 生成ubi文件, 一次成功:
cd /addon/buildroot/output/images
sudo modprobe nandsim first_id_byte=0xad second_id_byte=0xda third_id_byte=0x10 fourth_id_byte=0x95
sudo dd if=rootfs.ubi of=/dev/mtd0
sudo modprobe ubi
sudo modprobe ubifs
sudo ubiattach --mtdn=0 --vid-hdr-offset=2048
sudo mkdir -p /mnt/ubifs/
sudo mount -t ubifs ubi0:rootfs /mnt/ubifs/
显示挂载ubi的文件系统:
$ ls /mnt/ubifs/ -l
total 0
drwxr-xr-x 2 root root 4960 Feb 23 11:34 bin
drwxr-xr-x 4 root root 608 Feb 19 11:32 dev
drwxr-xr-x 12 root root 2096 Feb 23 11:34 etc
drwxr-xr-x 5 root root 2960 Feb 19 11:32 lib
lrwxrwxrwx 1 root root 3 Feb 19 11:39 lib32 -> lib
lrwxrwxrwx 1 root root 11 Feb 19 11:50 linuxrc -> bin/busybox
drwxr-xr-x 2 root root 160 Feb 19 11:32 media
drwxr-xr-x 2 root root 160 Feb 19 11:32 mnt
drwxr-xr-x 2 root root 160 Feb 19 11:32 opt
drwxr-xr-x 2 root root 232 Feb 19 11:32 overlay
drwxr-xr-x 2 root root 160 Feb 19 11:32 proc
drwxr-xr-x 2 root root 232 Feb 19 11:32 rom
drwx------ 2 root root 160 Feb 19 11:32 root
drwxr-xr-x 3 root root 224 Feb 19 11:51 run
drwxr-xr-x 2 root root 4008 Feb 23 11:34 sbin
drwxr-xr-x 2 root root 160 Feb 19 11:32 sys
drwxrwxrwt 2 root root 160 Feb 19 11:32 tmp
drwxr-xr-x 7 root root 544 Feb 23 11:34 usr
drwxr-xr-x 4 root root 672 Feb 23 11:34 var
buildroot关于ubi文件系统的配置:
BR2_TARGET_ROOTFS_TAR_OPTIONS=""
BR2_TARGET_ROOTFS_UBI=y
BR2_TARGET_ROOTFS_UBI_PEBSIZE=0x20000
BR2_TARGET_ROOTFS_UBI_SUBSIZE=2048
# BR2_TARGET_ROOTFS_UBI_USE_CUSTOM_CONFIG is not set
BR2_TARGET_ROOTFS_UBI_OPTS=""
BR2_TARGET_ROOTFS_UBIFS=y
BR2_TARGET_ROOTFS_UBIFS_LEBSIZE=0x1f000
BR2_TARGET_ROOTFS_UBIFS_MINIOSIZE=0x800
BR2_TARGET_ROOTFS_UBIFS_MAXLEBCNT=2048
# BR2_TARGET_ROOTFS_UBIFS_RT_NONE is not set
# BR2_TARGET_ROOTFS_UBIFS_RT_ZLIB is not set
BR2_TARGET_ROOTFS_UBIFS_RT_LZO=y
BR2_TARGET_ROOTFS_UBIFS_NONE=y
# BR2_TARGET_ROOTFS_UBIFS_GZIP is not set
# BR2_TARGET_ROOTFS_UBIFS_BZIP2 is not set
# BR2_TARGET_ROOTFS_UBIFS_LZMA is not set
# BR2_TARGET_ROOTFS_UBIFS_LZO is not set
# BR2_TARGET_ROOTFS_UBIFS_XZ is not set
BR2_TARGET_ROOTFS_UBIFS_OPTS=""
# BR2_TARGET_ROOTFS_YAFFS2 is not set
离线
要的就是这个答案, 感谢楼上两位朋友!
离线
好强,还不太懂,向大佬学习。
离线