summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2019-02-13 12:15:25 +0100
committerTom Rini <trini@konsulko.com>2019-04-09 20:03:30 -0400
commit5efc0686eebc0c0daabfbfc2c403f8251b468526 (patch)
tree2eaa0660c0f9f303086f03e9765244493c0b5431 /env
parentb000180b0f467851525aae3d0dfb8ab3a9dbcf8f (diff)
downloadu-boot-5efc0686eebc0c0daabfbfc2c403f8251b468526.tar.gz
fs: ext4: Add support for the creation of symbolic links
Re-use the functions used to write/create a file, to support creation of a symbolic link. The difference with a regular file are small: - The inode mode is flagged with S_IFLNK instead of S_IFREG - The ext2_dirent's filetype is FILETYPE_SYMLINK instead of FILETYPE_REG - Instead of storing the content of a file in allocated blocks, the path to the target is stored. And if the target's path is short enough, no block is allocated and the target's path is stored in ext2_inode.b.symlink As with regulars files, if a file/symlink with the same name exits, it is unlinked first and then re-created. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Fix ext4 env code] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'env')
-rw-r--r--env/ext4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/env/ext4.c b/env/ext4.c
index 09c5e4a491..388474a11c 100644
--- a/env/ext4.c
+++ b/env/ext4.c
@@ -60,7 +60,7 @@ static int env_ext4_save(void)
}
err = ext4fs_write(CONFIG_ENV_EXT4_FILE, (void *)&env_new,
- sizeof(env_t));
+ sizeof(env_t), FILETYPE_REG);
ext4fs_close();
if (err == -1) {