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