Andrei Borzenkov schreef op 08-05-2016 10:47:
08.05.2016 09:05, Andrei Borzenkov пишет:
+#ifdef GRUB_UTIL
+int
+grub_util_is_lvm(grub_disk_t disk)
+{
+ struct grub_diskfilter_pv_id id;
+ struct grub_diskfilter_vg *vg;
+ grub_disk_addr_t start_sector;
+ vg = grub_lvm_detect(disk, &id, &start_sector);
+ if (! vg)
+ return 0;
+ /* don't free the vg, it's held by grub_diskfilter_vg_register */
+ grub_free(id.uuid);
+ return 1;
+}
+
This has side effect of adding duplicate VG definitions; this may
later
confuse grub. What about just checking array->driver for LVM? Go
through
registered arrays, find disk match and check array driver. See
scan_disk_partition_iter () for example.
Which is basically call grub_diskfilter_get_pv_from_disk() and check
vg_out->driver.
Roger.
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel