README.ext4 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. U-Boot supports access of both ext2 and ext4 filesystems, either in read-only
  2. mode or in read-write mode.
  3. First, to enable support for both ext4 (and, automatically, ext2 as well),
  4. but without selecting the corresponding commands, enable one of the following:
  5. CONFIG_FS_EXT4 (for read-only)
  6. CONFIG_EXT4_WRITE (for read-write)
  7. Next, to select the ext2-related commands:
  8. * ext2ls
  9. * ext2load
  10. or ext4-related commands:
  11. * ext4size
  12. * ext4ls
  13. * ext4load
  14. use one or both of:
  15. CONFIG_CMD_EXT2
  16. CONFIG_CMD_EXT4
  17. Selecting either of the above automatically selects CONFIG_FS_EXT4 if it
  18. wasn't enabled already.
  19. In addition, to get the write access command "ext4write", enable:
  20. CONFIG_CMD_EXT4_WRITE
  21. which automatically selects CONFIG_EXT4_WRITE if it wasn't defined
  22. already.
  23. Also relevant are the generic filesystem commands, selected by:
  24. CONFIG_CMD_FS_GENERIC
  25. This does not automatically enable EXT4 support for you, you still need
  26. to do that yourself.
  27. Some sample commands to test ext4 support:
  28. 1. Check that the commands can be seen in the output of U-Boot help:
  29. UBOOT #help
  30. ...
  31. ext4load- load binary file from a Ext4 file system
  32. ext4ls - list files in a directory (default /)
  33. ext4size - determine a file's size
  34. ext4write- create a file in ext4 formatted partition
  35. ...
  36. 2. To list the files in an ext4-formatted partition, run:
  37. ext4ls <interface> <dev[:part]> [directory]
  38. For example:
  39. UBOOT #ext4ls mmc 0:5 /usr/lib
  40. 3. To read and load a file from an ext4-formatted partition to RAM, run:
  41. ext4load <interface> <dev[:part]> [addr] [filename] [bytes]
  42. For example:
  43. UBOOT #ext4load mmc 2:2 0x30007fc0 uImage
  44. 4. To write a file to an ext4-formatted partition.
  45. a) First load a file to RAM at a particular address for example 0x30007fc0.
  46. Now execute ext4write command:
  47. ext4write <interface> <dev[:part]> [filename] [Address] [sizebytes]
  48. For example:
  49. UBOOT #ext4write mmc 2:2 /boot/uImage 0x30007fc0 6183120
  50. (here 6183120 is the size of the file to be written)
  51. Note: Absolute path is required for the file to be written
  52. References :
  53. -- ext4 implementation in Linux Kernel
  54. -- Uboot existing ext2 load and ls implementation
  55. -- Journaling block device JBD2 implementation in linux Kernel