summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2014-11-12 14:35:04 +0100
committerTom Rini <trini@ti.com>2014-11-23 06:49:01 -0500
commit59e890ef7bf5b80d96802e115255f969491ef645 (patch)
tree570d6ef6e5a64a25e3a71eaf67273f8e0b8aa013 /include
parent1b51d32c0f0ac7cdcab0ae04d531129a020cc903 (diff)
downloadu-boot-imx-59e890ef7bf5b80d96802e115255f969491ef645.zip
u-boot-imx-59e890ef7bf5b80d96802e115255f969491ef645.tar.gz
u-boot-imx-59e890ef7bf5b80d96802e115255f969491ef645.tar.bz2
fs: make it possible to read the filesystem UUID
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 codes changes 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 works changes v2 -> v3: - change ext4fs_uuid(..) to make use of #if .. #else .. #endif construct to get rid of unreachable code Hit any key to stop autoboot: 0 => fsuuid fsuuid - Look up a filesystem UUID Usage: fsuuid <interface> <dev>:<part> - print filesystem UUID fsuuid <interface> <dev>:<part> <varname> - 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 <christian.gmeiner@gmail.com> Acked-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r--include/ext4fs.h1
-rw-r--r--include/fs.h7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/ext4fs.h b/include/ext4fs.h
index 6c419f3..38970e4 100644
--- a/include/ext4fs.h
+++ b/include/ext4fs.h
@@ -145,4 +145,5 @@ int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
disk_partition_t *fs_partition);
int ext4_read_file(const char *filename, void *buf, int offset, int len);
int ext4_read_superblock(char *buffer);
+int ext4fs_uuid(char *uuid_str);
#endif
diff --git a/include/fs.h b/include/fs.h
index 06a45f2..491c60a 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -93,4 +93,11 @@ int file_exists(const char *dev_type, const char *dev_part, const char *file,
int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int fstype);
+/*
+ * Determine the UUID of the specified filesystem and print it. Optionally it is
+ * possible to store the UUID directly in env.
+ */
+int do_fs_uuid(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype);
+
#endif /* _FS_H */