设为首页收藏本站
查看: 28820|回复: 5

定制ARM Linux文件系统:添加应用程序到文件系统/修改系统配置

[复制链接]

231

主题

64

回帖

2145

积分

管理员

积分
2145
玉米糊 发表于 2014-8-1 11:14:36 | 显示全部楼层 |阅读模式
光盘中提供的文件系统 ubi 可以进行简单的制定和修改,这里以向 MYD-SAM9X5 UBI文件系统根目录添加应用程序 helloworld 为例,说明制定文件系统的详细步骤。

1、编写demo程序helloworld
首先在 Ubuntu 编写一个简单的程序 helloworld,如果有自己的程序可以跳过这一步。

(1)创建并编辑 helloworld.c
[mw_shl_code=bash,true]$ vi helloworld.c[/mw_shl_code]
向 helloworld.c 中输入如下内容后保存退出:
[mw_shl_code=cpp,true]#include <stdio.h>
int main(int argc, char *argv[])
{
        int i;
        printf("========== Hello World ==========\n");
        printf("argc: %d\n", argc);
        for(i = 0; i < argc; i++)
        {
                printf("argv[%d]: %s\n", i, argv);
        }
        return 0;
}[/mw_shl_code]
(2)编译helloworld.c
添加交叉编译工具路径到PATH中:
[mw_shl_code=bash,true]$ export PATH=$PATH:/usr/local/arm-2010q1/bin/[/mw_shl_code]
利用交叉编译工具进行编译:
[mw_shl_code=bash,true]$ arm-none-linux-gnueabi-gcc -o helloworld helloworld.c[/mw_shl_code]
生成的 helloworld 便是可以在目标板上运行的应用程序。

2、在PC机Linux平台上挂载UBIFS文件系统
UBIFS是nokia工程师在the university of Szeged大学帮助下开发的新的Flash file system。UBIFS可以认为是JFFS2文件系统的下一代。UBIFS文件系统是专门为大容量FLASH嵌入式移动设备设计的,挂载UBIFS文件系统必须有mtd接口,而普通的PC机通常都不用mtd管理磁盘,所以这里需要用到nandsim模拟器,用一片RAM空间模拟出mtd设备,然后对UBIFS文件系统进行挂载。具体步骤如下:

(1)加载UBIFS驱动和mtd驱动 依次输入如下命令:
[mw_shl_code=bash,true]$ sudo modprobe nandsim first_id _byte=0xec second_id_byte=0xda third_id_byte=0x10 fourth_id_byte=0x95
[/mw_shl_code]
加载nandsim时需要传入的几个参数:first_id_byte、second_id_byte、third_id_byte fourth_id_byte 是需要模拟的目标NANDFLASH的ID,MYD-SAM9x5 使用的 NANDFLASH 为三星的 K9F2G08U0B,从 datasheet 中可查到四个ID bytes依次为: 0xec,0xda,0x10,0x95 若执行成功将可以在 /dev/  目录下找到 mtd0 和 mtd0r0 两个设备:
[mw_shl_code=bash,true]
$ ls /dev/mtd*
/dev/mtd0 /dev/mtd0ro
[/mw_shl_code]

(2)擦除mtd0分区,操作如下:
[mw_shl_code=bash,true]
$ sudo flash_eraseall /dev/mtd0
flash_eraseall has been replaced by `flash_erase <mtddev> 0 0`; please use it
Erasing 128 Kibyte @ ffe0000 -- 100 % complete
[/mw_shl_code]
(3)将 ubi 装入新建的mtd0分区,这里用到dd命令进行装入,如下:
[mw_shl_code=bash,true]
$ sudo dd if=Angstrom-x11-at91samg-image-eglibc-ipk-v20110624-at91sam9x5ek.rootfs.ubi of=/dev/mtd0
100864+0 records in
100864+0 records out
51642368 bytes (52 MB) copied, 0.323121 s, 160 MB/s
[/mw_shl_code]

(4)挂载UBIFS文件系统
完成以上步骤之后,加载 ubi 模块并 attach 到 mtd0 中,便可以像挂载普通的 mtd 设备一样挂载UBIFS文件系统。
加载 ubi 模块并 attach 到 mtd0 设备:
[mw_shl_code=bash,true]$ sudo modprobe ubi mtd=0,2048[/mw_shl_code]
新建一个挂载点:
[mw_shl_code=bash,true]$ mkdir fsmount[/mw_shl_code]
通过以下命令进行挂载:
[mw_shl_code=bash,true]
$ sudo mount -t ubifs ubi0_0 fsmount/
$ ls fsmount/
bin  boot  dev  etc  home  lib  media  mnt  proc  sbin  sys  tmp  usr  var
[/mw_shl_code]
至此我们已经在PC机上成功挂载目标板中使用的UBIFS文件系统。

3、修改UBIFS文件系统
成功挂载UBIFS文件系统之后便可以按需要对里面的内容进行修改,如添加和删除文件,修改文件等,这里需要往文件系统的根目录中添加之前编译好的 demo 程序 helloworld 。操作如下:
[mw_shl_code=bash,true]
$ sudo cp helloworld fsmount/
$ sync
$ ls fsmount
bin boot dev etc helloworld home lib media  mnt  proc  sbin  sys  tmp  usr  var
[/mw_shl_code]

4、重新生成UBIFS文件系统
修改完成之后需要利用 mkfs.ubifs 工具重新生成文件系统,如果没有 mkfs.ubifs 工具可通过以下命令安装:
[mw_shl_code=bash,true]$ sudo apt-get install mtd-utils
[/mw_shl_code]
输入以下命令生成新的UBIFS文件系统:
[mw_shl_code=bash,true]
$ sudo mkfs.ubifs -r fsmount/ -m 2048 -e 126976 -c 2024 -o ubifs.img
[/mw_shl_code]
mkfs.ubifs参数说明:
  • -r        建立文件系统的目录
  • -m        最小的I/O传输单元大小
  • -e        逻辑擦除块大小
  • -c        最大的逻辑擦除块数
  • -o        指定输出文件
其中可以通过以下命令查看最小的I/O传输单元大小和逻辑擦除块大小:
[mw_shl_code=bash,true]
$ ubinfo /dev/ubi0         
ubi0
Volumes count:                           1
Logical eraseblock size:                 126976 bytes, 124.0 KiB
Total amount of logical eraseblocks:     2048 (260046848 bytes, 248.0 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  20
Current maximum erase counter value:     1
Minimum input/output unit size:          2048 bytes
Character device major/minor:            250:0
Present volumes:                         0
[/mw_shl_code]
通过以下命令查看最大的逻辑擦除块数:
[mw_shl_code=bash,true]$ ubinfo /dev/ubi0_0
Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2024 LEBs (256999424 bytes, 245.1 MiB)
State:       OK
Name:        rootfs
Character device major/minor: 250:1
[/mw_shl_code]

然后利用ubinize工具生成 fsimage.ubi 文件。首先需要建立 ubinize 的配置文件 ubinize.cfg:
[mw_shl_code=bash,true]
$ vi ubinize.cfg
[/mw_shl_code]
输入以下内容,并保存退出:
[mw_shl_code=bash,true]
[ubifs]
mode=ubi
image=ubifs.img
vol_id=0
vol_size=64MiB
vol_type=dynamic
vol_name=rootfs
vol_flags=autoresize
vol_alignment=1
[/mw_shl_code]
输入以下命令生成最终烧写到目标板的文件系统文件fsimage.ubi:
[mw_shl_code=bash,true]
$ sudo ubinize -m 2048 -p 128KiB -o fsimage.ubi ubinize.cfg
[/mw_shl_code]
ubinize参数说明:
  • -m        最小输入/输出字节闪存单元的大小
  • -p        FLASH的物理擦除块的大小
  • -o        输出的文件
这里和mkfs.ubifs的参数不同,-p的参数为物理擦除块大小,也就是ubi工作在MTD层之上,所以需要MTD的参数,即物理参数,而ubifs工作在ubi之上,所以需要ubi的参数,即逻辑参数。现在,ubi设备映像已经被保存在了ubi.img中,不仅包含ubifs信息,还包含ubi信息。
完成之后,所生成的fsimage.ubi文件便可以按手册的烧写方法进行烧写,即在烧写文件系统的步骤中将新生成的文件系统 fsimage.ubi 烧写到地址0x800000处即可。
成功烧写之后复位开发板,输入root登陆,可以在根目录下找到新添加进去的helloworld文件:

[mw_shl_code=bash,true]$ cd /
$ ls
bin etc        lib        proc       tmpboot       helloworld  media      sbin       usrdev        home       mnt        sys        var
[/mw_shl_code]

运行helloworld,如下所示:

[mw_shl_code=bash,true]
$ ./helloword
========== Hello World ==========
argc: 1
argv[0]: ./helloword
[/mw_shl_code]

回复

使用道具 举报

0

主题

10

回帖

45

积分

新手上路

积分
45
lifeforu 发表于 2014-9-25 16:20:48 | 显示全部楼层
请问按照这个教程到mount的时候提示:
mount: unknown filesystem type 'ubifs'
请问这是什么 原因?

root@ubuntu:~# modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x90 fourth_id_byte=0x95
root@ubuntu:~# ubinfo
ubinfo: error!: UBI is not present in the system
root@ubuntu:~# ls /dev/mtd*
/dev/mtd0  /dev/mtd0ro
root@ubuntu:~# flash_earseall /dev/mtd0
No command 'flash_earseall' found, did you mean:
Command 'flash_eraseall' from package 'mtd-utils' (universe)
flash_earseall: command not found
root@ubuntu:~# flash_eraseall /dev/mtd0
Erasing 128 Kibyte @ 10000000 -- 100 % complete.
root@ubuntu:~# ubiformat /dev/mtd0 -O 2048 -f rootfs.ubi
ubiformat: mtd0 (nand), size 268435456 bytes (256.0 MiB), 2048 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 2047 -- 100 % complete  
ubiformat: 2048 eraseblocks are supposedly empty
ubiformat: flashing eraseblock 236 -- 100 % complete  
ubiformat: formatting eraseblock 2047 -- 100 % complete  
root@ubuntu:~# modprobe ubi mtd=0,2048
root@ubuntu:~# ubinfo
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:53
Present UBI devices:            ubi0
root@ubuntu:~# mount -t ubifs ubi0_0 fsmount/
mount: unknown filesystem type 'ubifs'

回复 支持 反对

使用道具 举报

0

主题

10

回帖

45

积分

新手上路

积分
45
lifeforu 发表于 2014-9-25 16:21:29 | 显示全部楼层
请问按照这个教程到mount的时候提示:
mount: unknown filesystem type 'ubifs'
请问这是什么 原因?

root@ubuntu:~# modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x90 fourth_id_byte=0x95
root@ubuntu:~# ubinfo
ubinfo: error!: UBI is not present in the system
root@ubuntu:~# ls /dev/mtd*
/dev/mtd0  /dev/mtd0ro
root@ubuntu:~# flash_earseall /dev/mtd0
No command 'flash_earseall' found, did you mean:
Command 'flash_eraseall' from package 'mtd-utils' (universe)
flash_earseall: command not found
root@ubuntu:~# flash_eraseall /dev/mtd0
Erasing 128 Kibyte @ 10000000 -- 100 % complete.
root@ubuntu:~# ubiformat /dev/mtd0 -O 2048 -f rootfs.ubi
ubiformat: mtd0 (nand), size 268435456 bytes (256.0 MiB), 2048 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 2047 -- 100 % complete  
ubiformat: 2048 eraseblocks are supposedly empty
ubiformat: flashing eraseblock 236 -- 100 % complete  
ubiformat: formatting eraseblock 2047 -- 100 % complete  
root@ubuntu:~# modprobe ubi mtd=0,2048
root@ubuntu:~# ubinfo
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:53
Present UBI devices:            ubi0
root@ubuntu:~# mount -t ubifs ubi0_0 fsmount/
mount: unknown filesystem type 'ubifs'


root@ubuntu:~# strace mount -t ubifs rootfs.ubi fsmount/
execve("/bin/mount", ["mount", "-t", "ubifs", "rootfs.ubi", "fsmount/"], [/* 21 vars */]) = 0
brk(0)                                  = 0x8172000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7734000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=63058, ...}) = 0
mmap2(NULL, 63058, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7724000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libblkid.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`5\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=112768, ...}) = 0
mmap2(NULL, 115464, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x57a000
mmap2(0x594000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19) = 0x594000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libuuid.so.1", O_RDONLY)     = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\20\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=14000, ...}) = 0
mmap2(NULL, 16592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x9d0000
mmap2(0x9d3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0x9d3000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libselinux.so.1", O_RDONLY)  = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@G\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=104148, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7723000
mmap2(NULL, 109432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x5cf000
mmap2(0x5e8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18) = 0x5e8000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libsepol.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p6\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=219040, ...}) = 0
mmap2(NULL, 223360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x110000
mmap2(0x145000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x34) = 0x145000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0Pm\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1438276, ...}) = 0
mmap2(NULL, 1448360, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x1f2000
mmap2(0x34e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15b) = 0x34e000
mmap2(0x351000, 10664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x351000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9736, ...}) = 0
mmap2(NULL, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x387000
mmap2(0x389000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0x389000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7722000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7721000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7721750, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x389000, 4096, PROT_READ)     = 0
mprotect(0x34e000, 8192, PROT_READ)     = 0
mprotect(0x145000, 4096, PROT_READ)     = 0
mprotect(0x5e8000, 4096, PROT_READ)     = 0
mprotect(0x9d3000, 4096, PROT_READ)     = 0
mprotect(0x594000, 8192, PROT_READ)     = 0
mprotect(0x8059000, 4096, PROT_READ)    = 0
mprotect(0x1f0000, 4096, PROT_READ)     = 0
munmap(0xb7724000, 63058)               = 0
statfs64("/selinux", 84, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=4934317, f_bfree=2483441, f_bavail=2232792, f_files=1253376, f_ffree=845844, f_fsid={1567955571, 186192409}, f_namelen=255, f_frsize=4096}) = 0
brk(0)                                  = 0x8172000
brk(0x8193000)                          = 0x8193000
open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7733000
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 393
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xb7733000, 4096)                = 0
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7733000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2570
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7733000, 4096)                = 0
open("/usr/lib/locale/en_US.utf8/LC_IDENTIFICATION", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=373, ...}) = 0
mmap2(NULL, 373, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7733000
close(3)                                = 0
open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=26048, ...}) = 0
mmap2(NULL, 26048, PROT_READ, MAP_SHARED, 3, 0) = 0xb772c000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_MEASUREMENT", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=23, ...}) = 0
mmap2(NULL, 23, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb772b000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_TELEPHONE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=59, ...}) = 0
mmap2(NULL, 59, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb772a000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_ADDRESS", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=155, ...}) = 0
mmap2(NULL, 155, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7729000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_NAME", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=77, ...}) = 0
mmap2(NULL, 77, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7728000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_PAPER", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=34, ...}) = 0
mmap2(NULL, 34, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7727000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_MESSAGES", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=57, ...}) = 0
mmap2(NULL, 57, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7726000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_MONETARY", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=286, ...}) = 0
mmap2(NULL, 286, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7725000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY) = 3
回复 支持 反对

使用道具 举报

0

主题

10

回帖

45

积分

新手上路

积分
45
lifeforu 发表于 2014-9-25 16:21:53 | 显示全部楼层
fstat64(3, {st_mode=S_IFREG|0644, st_size=1170770, ...}) = 0
mmap2(NULL, 1170770, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7603000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_TIME", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=2454, ...}) = 0
mmap2(NULL, 2454, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7724000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_NUMERIC", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=54, ...}) = 0
mmap2(NULL, 54, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7602000
close(3)                                = 0
open("/usr/lib/locale/en_US.utf8/LC_CTYPE", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=256324, ...}) = 0
mmap2(NULL, 256324, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb75c3000
close(3)                                = 0
umask(022)                              = 022
open("/dev/null", O_RDWR|O_LARGEFILE)   = 3
close(3)                                = 0
getuid32()                              = 0
geteuid32()                             = 0
getcwd("/home/edwin", 4095)             = 12
readlink("/home/edwin/rootfs.ubi", 0xbfd5f81b, 4096) = -1 EINVAL (Invalid argument)
stat64("/sbin/mount.ubifs", 0xbfd60578) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0
stat64("/sbin/mount.ubifs", 0xbfd60548) = -1 ENOENT (No such file or directory)
mount("/home/edwin/rootfs.ubi", "fsmount/", "ubifs", MS_MGC_VAL, NULL) = -1 ENODEV (No such device)
rt_sigprocmask(SIG_UNBLOCK, ~[TRAP SEGV RTMIN RT_1], NULL, 8) = 0
open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75c2000
read(3, "nodev\tsysfs\nnodev\trootfs\nnodev\tb"..., 1024) = 393
read(3, "", 1024)                       = 0
close(3)                                = 0
munmap(0xb75c2000, 4096)                = 0
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/util-linux-ng.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "mount: unknown filesystem type '"..., 38mount: unknown filesystem type 'ubifs') = 38
write(2, "\n", 1
)                       = 1
exit_group(32)                          = ?
root@ubuntu:~#
回复 支持 反对

使用道具 举报

231

主题

64

回帖

2145

积分

管理员

积分
2145
 楼主| 玉米糊 发表于 2014-9-25 16:45:57 | 显示全部楼层
lifeforu 发表于 2014-9-25 16:21
fstat64(3, {st_mode=S_IFREG|0644, st_size=1170770, ...}) = 0
mmap2(NULL, 1170770, PROT_READ, MAP_PR ...

请参考这个帖子:http://bbs.myir-tech.com/thread-6148-1-1.html,安装mtd-utils
回复 支持 反对

使用道具 举报

0

主题

10

回帖

45

积分

新手上路

积分
45
lifeforu 发表于 2014-9-25 18:01:26 | 显示全部楼层
玉米糊 发表于 2014-9-25 16:45
请参考这个帖子:http://bbs.myir-tech.com/thread-6148-1-1.html,安装mtd-utils

已经安装过了

root@ubuntu:~# apt-get install mtd-utils
Reading package lists... Done
Building dependency tree      
Reading state information... Done
mtd-utils is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-38 linux-headers-2.6.32-38-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@ubuntu:~# sync
root@ubuntu:~# mount -t ubifs ubi0_0 fsmount/
mount: unknown filesystem type 'ubifs'
root@ubuntu:~#
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录

本版积分规则

Archiver|手机版|小黑屋|米尔科技论坛   

GMT+8, 2024-11-24 23:18 , Processed in 0.078211 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表