18 Oct, 2019
3 commits
-
This function is a variant of fs_get_type_name() and returns a filesystem
type with which the current device is associated.
We don't want to export fs_type variable directly because we have to take
care of it consistently within fs.c.Signed-off-by: AKASHI Takahiro
Reviewed-by: Heinrich Schuchardt -
fs_ls(), fs_mkdir() and fs_unlink() sets fs_type to FS_TYPE_ANY
explicitly, but it is redundant as they call fs_close().
So just remove those lines.Signed-off-by: AKASHI Takahiro
Reviewed-by: Heinrich Schuchardt -
fs_close() closes the connection to a file system which opened with
either fs_set_blk_dev() or fs_set_dev_with_part(). Many file system
functions implicitly call fs_close(), e.g. fs_closedir(), fs_exist(),
fs_ln(), fs_ls(), fs_mkdir(), fs_read(), fs_size(), fs_write()
and fs_unlink().
So just export it.Signed-off-by: AKASHI Takahiro
Reviewed-by: Heinrich Schuchardt
12 Aug, 2019
1 commit
-
Move env_set_hex() over to the new header file along with env_set_addr()
which uses it.Signed-off-by: Simon Glass
Acked-by: Joe Hershberger
21 Jun, 2019
1 commit
-
fatload command can be used to load the EFI payload since EFI system
partition is always a FAT partition. Call into EFI code from do_load()
to set the device path from which the last binary was loaded. An EFI
application like grub2 can’t find its configuration file without the
device path set.Since device path is now set in do_load() there is no need to set it
in do_load_wrapper() for the load command.Signed-off-by: Mian Yousaf Kaukab
Reviewed-by: Heinrich Schuchardt
10 Apr, 2019
1 commit
-
The command line is:
ln target linknameCurrently symbolic links are supported only in ext4 and only if the option
CMD_EXT4_WRITE is enabled.Signed-off-by: Jean-Jacques Hiblot
Reviewed-by: Tom Rini
09 Feb, 2019
1 commit
-
Unlike other generic FS accessors, fs_get_info() does not call fs_close()
at the end of it's operation. Thus, using fs_get_info() in do_fs_type()
without calling fs_close() causes potential memory leak by creating new
filesystem structures on each call of do_fs_type().The test case to trigger this problem is as follows. It is required to
have ext4 filesystem on the first partition of the SDMMC device, since
ext4 requires stateful mount and causes memory allocation.
=> while true ; do mmc rescan ; fstype mmc 1 ; done
Eventually, the mounting of ext4 will fail due to malloc failures
and the filesystem will not be correctly detected.This patch fixes the problem by adding the missing fs_close().
Signed-off-by: Marek Vasut
Cc: Simon Glass
Cc: Tom Rini
02 Feb, 2019
1 commit
-
This fixes the automatic lmb initialization and reservation for boards
with more than one DRAM bank.This fixes the CVE-2018-18439 and -18440 fixes that only allowed to load
files into the firs DRAM bank from fs and via tftp.Found-by: Heinrich Schuchardt
Signed-off-by: Simon Goldschmidt
Tested-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
01 Feb, 2019
2 commits
-
CONFIG_SPL_FS_EXT4 can be used to include/exclude the FS EXT4 from
SPL build. Excluding the FS EXT4 from SPL build can help to save 20KiB
memory.Signed-off-by: Tien Fong Chee
Reviewed-by: Tom Rini -
Most of the time SPL only needs very simple FAT reading, so having
CONFIG_IS_ENABLED(FAT_WRITE) to exclude it from SPL build would help
to save 64KiB default max clustersize from memory.Signed-off-by: Tien Fong Chee
Reviewed-by: Simon Goldschmidt
Reviewed-by: Tom Rini
17 Jan, 2019
1 commit
-
This fixes CVE-2018-18440 ("insufficient boundary checks in filesystem
image load") by using lmb to check the load size of a file against
reserved memory addresses.Signed-off-by: Simon Goldschmidt
Reviewed-by: Simon Glass
03 Dec, 2018
1 commit
-
As in the case of fs_set_blk_dev(), fs_set_blk_dev_with_part() should
maintain and update fs_dev_part whenever called.Without this patch, a problem will come up when an efi binary associated
with efi's BOOTxxxx variable is invoked via "bootefi bootmgr".Signed-off-by: AKASHI Takahiro
Signed-off-by: Alexander Graf
24 Sep, 2018
4 commits
-
In this patch, unlink support is added to FAT file system.
A directory can be deleted only if it is empty.In this implementation, only a directory entry for a short file name
will be removed. So entries for a long file name can and should be
reclaimed with fsck.Signed-off-by: AKASHI Takahiro
Signed-off-by: Alexander Graf -
"unlink" interface is added to file operations.
This is a preparatory change as unlink support for FAT file system
will be added in next patch.Signed-off-by: AKASHI Takahiro
Signed-off-by: Alexander Graf -
In this patch, mkdir support is added to FAT file system.
A newly created directory contains only "." and ".." entries.Signed-off-by: AKASHI Takahiro
Signed-off-by: Alexander Graf -
"mkdir" interface is added to file operations.
This is a preparatory change as mkdir support for FAT file system
will be added in next patch.Signed-off-by: AKASHI Takahiro
Signed-off-by: Alexander Graf
14 Aug, 2018
1 commit
-
%s/dumm /dummy /
Signed-off-by: Heinrich Schuchardt
30 May, 2018
1 commit
-
Add fs_get_type_name so we can get the current filesystem type.
Signed-off-by: Alex Kiernan
Reviewed-by: Simon Glass
Reviewed-by: Joe Hershberger
07 May, 2018
1 commit
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini
20 Jan, 2018
1 commit
-
The message
"** %s shorter than offset + len **\n"
may be interesting when debugging but it does not indicate an
error.So we should not write it if we are not in debug mode.
Fixes: 7a3e70cfd88c fs/fs.c: read up to EOF when len would read past EOF
Signed-off-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
16 Oct, 2017
1 commit
-
Otherwise fs_opendir will fault.
Signed-off-by: Marek Behun
03 Oct, 2017
1 commit
-
Signed-off-by: Marek Behun
create mode 100644 fs/btrfs/Kconfig
create mode 100644 fs/btrfs/Makefile
create mode 100644 fs/btrfs/btrfs.c
create mode 100644 include/btrfs.h
15 Sep, 2017
2 commits
-
Add a generic implementation of 'ls' using opendir/readdir/closedir, and
replace fat's custom implementation. Other filesystems should move to
the generic implementation after they add opendir/readdir/closedir
support.Signed-off-by: Rob Clark
Reviewed-by: Łukasz Majewski
Reviewed-by: Simon Glass -
Needed to support efi file protocol. The fallback.efi loader wants
to be able to read the contents of the /EFI directory to find an OS
to boot.Modelled after POSIX opendir()/readdir()/closedir(). Unlike the other
fs APIs, this is stateful (ie. state is held in the FS_DIR "directory
stream"), to avoid re-traversing of the directory structure at each
step. The directory stream must be released with closedir() when it
is no longer needed.Signed-off-by: Rob Clark
Reviewed-by: Łukasz Majewski
Reviewed-by: Simon Glass
16 Aug, 2017
3 commits
-
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass -
We are now using an env_ prefix for environment functions. Rename these
commonly used functions, for consistency. Also add function comments in
common.h.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass -
We are now using an env_ prefix for environment functions. Rename setenv()
for consistency. Also add function comments in common.h.Suggested-by: Wolfgang Denk
Signed-off-by: Simon Glass
15 Mar, 2016
2 commits
-
Rename this function to blk_get_device_part_str(). This is a better name
because it makes it clear that the function returns a block device and
parses a string.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren -
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Stephen Warren
19 Jan, 2016
1 commit
-
In a number of places we had wordings of the GPL (or LGPL in a few
cases) license text that were split in such a way that it wasn't caught
previously. Convert all of these to the correct SPDX-License-Identifier
tag.Signed-off-by: Tom Rini
08 Jan, 2016
1 commit
-
Signed-off-by: David Müller
25 Oct, 2015
1 commit
-
Add generic fs support, so that commands like ls, load and test -e can be
used on ubifs.Signed-off-by: Hans de Goede
Reviewed-by: Heiko Schocher
13 Aug, 2015
1 commit
-
http://lists.denx.de/pipermail/u-boot/2012-September/134347.html
allows for reading files in chunks from the shell.When this feature is used to read past the end of a file an error
was returned instead of returning the bytes read up to the end of
file. Thus the following fails in the shell:offset = 0
len = chunksize
do
read file, offset, len
write data
until bytes_read < lenThe patch changes the behaviour to printing an informational
message and returning the actual read number of bytes aka read(2)
behaviour for convenient use in U-Boot scripts.Signed-off-by: Max Krummenacher
Signed-off-by: Marcel Ziswiler
Acked-by: Marek Vasut
Signed-off-by: Stefan Agner
Signed-off-by: Marcel Ziswiler
19 Apr, 2015
1 commit
-
In the case where the arch defines a custom map_sysmem(), make sure that
including just mapmem.h is sufficient to have these functions as they
are when the arch does not override it.Also split the non-arch specific functions out of common.h
Signed-off-by: Joe Hershberger
Reviewed-by: Simon Glass
30 Jan, 2015
1 commit
-
New command to determine the filesystem type of a given partition.
Optionally stores the filesystem type in a environment variable.Signed-off-by: Sjoerd Simons
Reviewed-by: Stephen Warren
02 Dec, 2014
1 commit
-
The changes to introduce loff_t into filesize means that we need to do
64bit math on 32bit platforms. Make sure we use the right wrappers for
these operations.Cc: Daniel Schwierzeck
Cc: Suriyan Ramasami
Reviewed-by: Simon Glass
Signed-off-by: Tom Rini
Tested-by: Pierre Aubert
23 Nov, 2014
2 commits
-
The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.Signed-off-by: Suriyan Ramasami
Acked-by: Simon Glass
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini -
Some filesystems have a UUID stored in its superblock. To
allow using root=UUID=... for the kernel command line we
need a way to read-out the filesystem UUID.changes rfc -> v1:
- make the environment variable an option parameter. If not
given, the UUID is printed out. If given, it is stored in the env
variable.
- corrected typos
- return error codeschanges v1 -> v2:
- fix return code of do_fs_uuid(..)
- document do_fs_uuid(..)
- implement fs_uuid_unsuported(..) be more consistent with the
way other optional functionality workschanges v2 -> v3:
- change ext4fs_uuid(..) to make use of #if .. #else .. #endif
construct to get rid of unreachable codeHit any key to stop autoboot: 0
=> fsuuid
fsuuid - Look up a filesystem UUIDUsage:
fsuuid :
- print filesystem UUID
fsuuid :
- set environment variable to filesystem UUID=> fsuuid mmc 0:1
d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> fsuuid mmc 0:2
eb3db83c-7b28-499f-95ce-9e0bb21cda81
=> fsuuid mmc 0:1 uuid1
=> fsuuid mmc 0:2 uuid2
=> printenv uuid1
uuid1=d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> printenv uuid2
uuid2=eb3db83c-7b28-499f-95ce-9e0bb21cda81
=>Signed-off-by: Christian Gmeiner
Acked-by: Stephen Warren
09 Aug, 2014
1 commit
-
These commands may be used to determine the size of a file without
actually reading the whole file content into memory. This may be used
to determine if the file will fit into the memory buffer that will
contain it. In particular, the DFU code will use it for this purpose
in the next commit.Signed-off-by: Stephen Warren
22 Jul, 2014
1 commit
-
If filename is passed instead of address to ext2load or fatload,
u-boot silently accepts that, and uses 0 for load address and default
filename from environment. That is confusing, display help instead.Signed-off-by: Pavel Machek