免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2022 | 回复: 1
打印 上一主题 下一主题

为什么mkcramfs 不等于 mkfs.cramfs [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-08-30 10:54 |只看该作者 |倒序浏览
用上述两个工具制作initrd.img,mkfs.cramfs做的可以引导, mkcramfs做的不能引导,他们有什么区别吗?系统里也没有cramfs相关的man,望指教。

OS:         RedHat 9.0
Kernel:   2.4.32

论坛徽章:
0
2 [报告]
发表于 2006-08-30 14:06 |只看该作者
cramfs的相关文档怎么就这么少?只是在内核文档里找到一篇关于它的说明

  1.         Cramfs - cram a filesystem onto a small ROM

  2. cramfs is designed to be simple and small, and to compress things well.

  3. It uses the zlib routines to compress a file one page at a time, and
  4. allows random page access.  The meta-data is not compressed, but is
  5. expressed in a very terse representation to make it use much less
  6. diskspace than traditional filesystems.

  7. You can't write to a cramfs filesystem (making it compressible and
  8. compact also makes it _very_ hard to update on-the-fly), so you have to
  9. create the disk image with the "mkcramfs" utility.


  10. Usage Notes
  11. -----------

  12. File sizes are limited to less than 16MB.

  13. Maximum filesystem size is a little over 256MB.  (The last file on the
  14. filesystem is allowed to extend past 256MB.)

  15. Only the low 8 bits of gid are stored.  The current version of
  16. mkcramfs simply truncates to 8 bits, which is a potential security
  17. issue.

  18. Hard links are supported, but hard linked files
  19. will still have a link count of 1 in the cramfs image.

  20. Cramfs directories have no `.' or `..' entries.  Directories (like
  21. every other file on cramfs) always have a link count of 1.  (There's
  22. no need to use -noleaf in `find', btw.)

  23. No timestamps are stored in a cramfs, so these default to the epoch
  24. (1970 GMT).  Recently-accessed files may have updated timestamps, but
  25. the update lasts only as long as the inode is cached in memory, after
  26. which the timestamp reverts to 1970, i.e. moves backwards in time.

  27. Currently, cramfs must be written and read with architectures of the
  28. same endianness, and can be read only by kernels with PAGE_CACHE_SIZE
  29. == 4096.  At least the latter of these is a bug, but it hasn't been
  30. decided what the best fix is.  For the moment if you have larger pages
  31. you can just change the #define in mkcramfs.c, so long as you don't
  32. mind the filesystem becoming unreadable to future kernels.


  33. For /usr/share/magic
  34. --------------------

  35. 0       ulelong 0x28cd3d45      Linux cramfs offset 0
  36. >4      ulelong x               size %d
  37. >8      ulelong x               flags 0x%x
  38. >12     ulelong x               future 0x%x
  39. >16     string  >\0             signature "%.16s"
  40. >32     ulelong x               fsid.crc 0x%x
  41. >36     ulelong x               fsid.edition %d
  42. >40     ulelong x               fsid.blocks %d
  43. >44     ulelong x               fsid.files %d
  44. >48     string  >\0             name "%.16s"
  45. 512     ulelong 0x28cd3d45      Linux cramfs offset 512
  46. >516    ulelong x               size %d
  47. >520    ulelong x               flags 0x%x
  48. >524    ulelong x               future 0x%x
  49. >528    string  >\0             signature "%.16s"
  50. >544    ulelong x               fsid.crc 0x%x
  51. >548    ulelong x               fsid.edition %d
  52. >552    ulelong x               fsid.blocks %d
  53. >556    ulelong x               fsid.files %d
  54. >560    string  >\0             name "%.16s"


  55. Hacker Notes
  56. ------------

  57. See fs/cramfs/README for filesystem layout and implementation notes.
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP