]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-07-29 Robert Millan <rmh@gnu.org>
authorRobert Millan <rmh@aybabtu.com>
Thu, 29 Jul 2010 16:46:42 +0000 (18:46 +0200)
committerRobert Millan <rmh@aybabtu.com>
Thu, 29 Jul 2010 16:46:42 +0000 (18:46 +0200)
* util/grub-probe.c (PRINT_FS_LABEL): New enum value.
(probe): Handle `PRINT_FS_LABEL'.
(main): Handle `-t fs_label'.

ChangeLog
util/grub-probe.c

index af48d4039cc76bb2911e0fb86d61e589821dc1dc..94b6741d39ca2c12661dc46f4ab48926406b75a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-29  Robert Millan  <rmh@gnu.org>
+
+       * util/grub-probe.c (PRINT_FS_LABEL): New enum value.
+       (probe): Handle `PRINT_FS_LABEL'.
+       (main): Handle `-t fs_label'.
+
 2010-07-29  Robert Millan  <rmh@gnu.org>
 
        * configure.ac: Remove grub-mkisofs checks.
index dff87907a707528f5b54f91c299f0eb207093012..56cbc5592c7f040c2df0709c5c24da7e152a04f1 100644 (file)
@@ -50,6 +50,7 @@
 enum {
   PRINT_FS,
   PRINT_FS_UUID,
+  PRINT_FS_LABEL,
   PRINT_DRIVE,
   PRINT_DEVICE,
   PRINT_PARTMAP,
@@ -291,6 +292,16 @@ probe (const char *path, char *device_name)
 
       printf ("%s\n", uuid);
     }
+  else if (print == PRINT_FS_LABEL)
+    {
+      char *label;
+      if (! fs->label)
+       grub_util_error ("%s does not support labels", fs->name);
+
+      fs->label (dev, &label);
+
+      printf ("%s\n", label);
+    }
 
  end:
   if (dev)
@@ -326,7 +337,7 @@ Probe device information for a given path (or device, if the -d option is given)
 \n\
   -d, --device              given argument is a system device, not a path\n\
   -m, --device-map=FILE     use FILE as the device map [default=%s]\n\
-  -t, --target=(fs|fs_uuid|drive|device|partmap|abstraction)\n\
+  -t, --target=(fs|fs_uuid|fs_label|drive|device|partmap|abstraction)\n\
                             print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\
   -h, --help                display this message and exit\n\
   -V, --version             print version information and exit\n\
@@ -375,6 +386,8 @@ main (int argc, char *argv[])
              print = PRINT_FS;
            else if (!strcmp (optarg, "fs_uuid"))
              print = PRINT_FS_UUID;
+           else if (!strcmp (optarg, "fs_label"))
+             print = PRINT_FS_LABEL;
            else if (!strcmp (optarg, "drive"))
              print = PRINT_DRIVE;
            else if (!strcmp (optarg, "device"))