Firefly开源社区

标题: 如何挂载已经编译好的kernel.img [打印本页]

作者: bacon36    时间: 2015-1-22 18:10
标题: 如何挂载已经编译好的kernel.img
本帖最后由 bacon36 于 2015-1-22 18:19 编辑

新手,编译好的kernel文件。想挂载到目录上查看内容。但是

sudo mount -t ext[234] [-o loop] kernel.img testmount/
  1. mount: wrong fs type, bad option, bad superblock on /dev/loop3,
  2.        missing codepage or helper program, or other error
  3.        In some cases useful info is found in syslog - try
  4.        dmesg | tail  or so
复制代码
dmesg|tail:
  1. [13035.226684] EXT4-fs (loop3): VFS: Can't find ext4 filesystem
复制代码

fdisk -l kernel.img

  1. Disk kernel.img: 6 MB, 6330880 bytes
  2. 255 heads, 63 sectors/track, 0 cylinders, total 12365 sectors
  3. Units = sectors of 1 * 512 = 512 bytes
  4. Sector size (logical/physical): 512 bytes / 512 bytes
  5. I/O size (minimum/optimal): 512 bytes / 512 bytes
  6. Disk identifier: 0x1a000003

  7. Disk kernel.img doesn't contain a valid partition table
复制代码


ubuntu14.4的发行版
按照网上资料,查了下没有没有 /etc/filesystems 和 /etc/vfs

完全不知道怎么办了。



作者: zhansb    时间: 2015-1-22 18:19
kernel.img只能刷哦,不能想system那样挂载
作者: bacon36    时间: 2015-1-22 18:46
zhansb 发表于 2015-1-22 18:19
kernel.img只能刷哦,不能想system那样挂载

那请问有没有什么方法查看编译好的目录结构呢?
作者: zhansb    时间: 2015-1-23 09:40
楼主可以看看这个文件arch/arm/Makefile:
  1. 332 kernel.img: zImage
  2. 333     $(Q)$(srctree)/mkkrnlimg $(objtree)/arch/arm/boot/zImage $(objtree)/kernel.img >/dev/null
  3. 334     @echo '  Image:  kernel.img is ready'
  4. 335
  5. 336 %_kernel.img: %.dtb zImage
  6. 337     $(Q)cat $(objtree)/arch/arm/boot/zImage $(objtree)/arch/arm/boot/dts/$*.dtb > $(objtree)/zImage-dtb && \
  7. 338     $(srctree)/mkkrnlimg $(objtree)/zImage-dtb $(objtree)/kernel.img >/dev/null && \
  8. 339     rm -f $(objtree)/zImage-dtb
  9. 340     @echo '  Image:  kernel.img (with $*.dtb) is ready'
  10. 341
  11. 342 LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
  12. 343 %.img: %.dtb kernel.img $(LOGO)
  13. 344     $(Q)$(srctree)/resource_tool $(objtree)/arch/arm/boot/dts/$*.dtb $(LOGO)
  14. 345     @echo '  Image:  resource.img (with $*.dtb $(LOGO)) is ready'  
复制代码


了解一下kernel.img和zImage的格式




欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/) Powered by Discuz! X3.1