2009-05-04 Vladimir Serbinenko <phcoder@gmail.com>

HFS+ UUID

	* fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field 
	in the space previously used by unused3
	(grub_hfsplus_uuid): new function
	(grub_hfsplus_fs): added uuid field
This commit is contained in:
phcoder 2009-05-04 15:50:44 +00:00
parent 4c402e7301
commit 69f853f884
2 changed files with 42 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2009-05-04 Vladimir Serbinenko <phcoder@gmail.com>
HFS+ UUID
* fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field
in the space previously used by unused3
(grub_hfsplus_uuid): new function
(grub_hfsplus_fs): added uuid field
2009-05-03 Pavel Roskin <proski@gnu.org>
* disk/ata.c: Don't cast mod to void in GRUB_MOD_INIT to

View File

@ -61,7 +61,8 @@ struct grub_hfsplus_volheader
grub_uint32_t utime;
grub_uint8_t unused2[16];
grub_uint32_t blksize;
grub_uint8_t unused3[68];
grub_uint8_t unused3[60];
grub_uint64_t num_serial;
struct grub_hfsplus_forkdata allocations_file;
struct grub_hfsplus_forkdata extents_file;
struct grub_hfsplus_forkdata catalog_file;
@ -983,6 +984,36 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm)
}
static grub_err_t
grub_hfsplus_uuid (grub_device_t device, char **uuid)
{
struct grub_hfsplus_data *data;
grub_disk_t disk = device->disk;
#ifndef GRUB_UTIL
grub_dl_ref (my_mod);
#endif
data = grub_hfsplus_mount (disk);
if (data)
{
*uuid = grub_malloc (16 + sizeof ('\0'));
grub_sprintf (*uuid, "%016llx",
(unsigned long long)
grub_be_to_cpu64 (data->volheader.num_serial));
}
else
*uuid = NULL;
#ifndef GRUB_UTIL
grub_dl_unref (my_mod);
#endif
grub_free (data);
return grub_errno;
}
static struct grub_fs grub_hfsplus_fs =
@ -994,6 +1025,7 @@ static struct grub_fs grub_hfsplus_fs =
.close = grub_hfsplus_close,
.label = grub_hfsplus_label,
.mtime = grub_hfsplus_mtime,
.uuid = grub_hfsplus_uuid,
.next = 0
};