Re: [U-Boot] [PATCH v2] fs: make it possible to read the filesystem UUID

2014-11-12 Thread Simon Glass
On 12 November 2014 06:35, Christian Gmeiner
christian.gmei...@gmail.com wrote:
 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

 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.gmei...@gmail.com

Acked-by: Simon Glass s...@chromium.org

Tested on Pi with eMMC:
Tested-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] fs: make it possible to read the filesystem UUID

2014-11-11 Thread Stephen Warren

On 11/11/2014 05:55 AM, Christian Gmeiner wrote:

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.


Just one more nit below, otherwise,

Acked-by: Stephen Warren swar...@nvidia.com

(feel free to add that the patch description for any repost)


diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c



+int ext4fs_uuid(char *uuid_str)
+{
+   if (ext4fs_root == NULL)
+   return -1;
+
+#ifdef CONFIG_LIB_UUID
+   uuid_bin_to_str((unsigned char *)ext4fs_root-sblock.unique_id,
+   uuid_str, UUID_STR_FORMAT_STD);
+
+   return 0;
+#endif
+
+   return -ENOSYS;
+}


If CONFIG_LIB_UUID is defined, doesn't that generate an unreachable code 
warning for the second return statement? I think you want a #if ... 
#else ... #endif to avoid that.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot