cramfs.txt 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_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.