UUID support for HFS.
* fs/hfs.c (grub_hfs_uuid): New function.
(grub_hfs_fs): New value .uuid.
* include/grub/hfs.h (grub_hfs_sblock): New field 'num_serial'.
+2009-12-16 Vladimir Serbinenko <phcoder@gmail.com>
+
+ UUID support for HFS.
+
+ * fs/hfs.c (grub_hfs_uuid): New function.
+ (grub_hfs_fs): New value .uuid.
+ * include/grub/hfs.h (grub_hfs_sblock): New field 'num_serial'.
+
2009-12-14 Felix Zielcke <fzielcke@z-51.de>
Fix a segfault with parsing unknown long options.
return grub_errno;
}
+static grub_err_t
+grub_hfs_uuid (grub_device_t device, char **uuid)
+{
+ struct grub_hfs_data *data;
+
+ grub_dl_ref (my_mod);
+
+ data = grub_hfs_mount (device->disk);
+ if (data && data->sblock.num_serial != 0)
+ {
+ *uuid = grub_malloc (16 + sizeof ('\0'));
+ grub_sprintf (*uuid, "%016llx",
+ (unsigned long long)
+ grub_be_to_cpu64 (data->sblock.num_serial));
+ }
+ else
+ *uuid = NULL;
+
+ grub_dl_unref (my_mod);
+
+ grub_free (data);
+
+ return grub_errno;
+}
+
\f
static struct grub_fs grub_hfs_fs =
.read = grub_hfs_read,
.close = grub_hfs_close,
.label = grub_hfs_label,
+ .uuid = grub_hfs_uuid,
.next = 0
};
/* A pascal style string that holds the volumename. */
grub_uint8_t volname[28];
- grub_uint8_t unused5[60];
+ grub_uint8_t unused5[52];
+ grub_uint64_t num_serial;
grub_uint16_t embed_sig;
struct grub_hfs_extent embed_extent;
grub_uint8_t unused6[4];