bacon36 发表于 2015-1-22 18:10:32

如何挂载已经编译好的kernel.img

本帖最后由 bacon36 于 2015-1-22 18:19 编辑

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

sudo mount -t ext [-o loop] kernel.img testmount/
mount: wrong fs type, bad option, bad superblock on /dev/loop3,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tailor sodmesg|tail:
EXT4-fs (loop3): VFS: Can't find ext4 filesystem
fdisk -l kernel.img
Disk kernel.img: 6 MB, 6330880 bytes
255 heads, 63 sectors/track, 0 cylinders, total 12365 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1a000003

Disk kernel.img doesn't contain a valid partition table

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

完全不知道怎么办了。


zhansb 发表于 2015-1-22 18:19:35

kernel.img只能刷哦,不能想system那样挂载

bacon36 发表于 2015-1-22 18:46:14

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

那请问有没有什么方法查看编译好的目录结构呢?

zhansb 发表于 2015-1-23 09:40:54

楼主可以看看这个文件arch/arm/Makefile:
332 kernel.img: zImage
333   $(Q)$(srctree)/mkkrnlimg $(objtree)/arch/arm/boot/zImage $(objtree)/kernel.img >/dev/null
334   @echo 'Image:kernel.img is ready'
335
336 %_kernel.img: %.dtb zImage
337   $(Q)cat $(objtree)/arch/arm/boot/zImage $(objtree)/arch/arm/boot/dts/$*.dtb > $(objtree)/zImage-dtb && \
338   $(srctree)/mkkrnlimg $(objtree)/zImage-dtb $(objtree)/kernel.img >/dev/null && \
339   rm -f $(objtree)/zImage-dtb
340   @echo 'Image:kernel.img (with $*.dtb) is ready'
341
342 LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
343 %.img: %.dtb kernel.img $(LOGO)
344   $(Q)$(srctree)/resource_tool $(objtree)/arch/arm/boot/dts/$*.dtb $(LOGO)
345   @echo 'Image:resource.img (with $*.dtb $(LOGO)) is ready'

了解一下kernel.img和zImage的格式
页: [1]
查看完整版本: 如何挂载已经编译好的kernel.img