Commit graph

95 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
63314aa43c * util/getroot.c (exec_pipe): Put proper #if's so that its users don't
compile when not needed.
2013-04-26 23:41:13 +02:00
Vladimir 'phcoder' Serbinenko
25fc51a879 Fix DMRAID partition handling. 2013-04-15 08:37:13 +02:00
Vladimir 'phcoder' Serbinenko
ba44ca6d1a Replace stpcpy with grub_stpcpy in tools. 2013-04-12 22:37:59 +02:00
Vladimir 'phcoder' Serbinenko
49818a594a Fix missing PVs if they don't contain "interesting" LV. Closes #38677.
Fix few warining messages and leaks while on it.
2013-04-11 00:08:27 +02:00
Colin Watson
25239370fd Remove nested functions from device iterators.
* include/grub/arc/arc.h (grub_arc_iterate_devs_hook_t): New type.
(grub_arc_iterate_devs): Add hook_data argument.
* include/grub/ata.h (grub_ata_dev_iterate_hook_t): New type.
(struct grub_ata_dev.iterate): Add hook_data argument.
* include/grub/device.h (grub_device_iterate_hook_t): New type.
(grub_device_iterate): Add hook_data argument.
* include/grub/disk.h (grub_disk_dev_iterate_hook_t): New type.
(struct grub_disk_dev.iterate): Add hook_data argument.
(grub_disk_dev_iterate): Likewise.
* include/grub/gpt_partition.h (grub_gpt_partition_map_iterate):
Likewise.
* include/grub/msdos_partition.h (grub_partition_msdos_iterate):
Likewise.
* include/grub/partition.h (grub_partition_iterate_hook_t): New
type.
(struct grub_partition_map.iterate): Add hook_data argument.
(grub_partition_iterate): Likewise.
* include/grub/scsi.h (grub_scsi_dev_iterate_hook_t): New type.
(struct grub_scsi_dev.iterate): Add hook_data argument.

Update all callers.
2013-01-20 15:52:15 +00:00
Vladimir 'phcoder' Serbinenko
22099030ad * grub-core/kern/emu/hostdisk.c (read_device_map): Explicitly
delimit path in strings using quotes.
	* util/getroot.c (grub_guess_root_devices): Likewise.
	(grub_make_system_path_relative_to_its_root): Likewise.
	* util/grub-probe.c (probe): Likewise.
	* util/ieee1275/ofpath.c (find_obppath): Likewise.
	(xrealpath): Likewise.
2013-01-13 22:45:16 +01:00
Vladimir 'phcoder' Serbinenko
258f43b7d7 * util/getroot.c (convert_system_partition_to_system_disk): Support
nbd disks.
2012-12-10 11:12:38 +01:00
Colin Watson
794c8c3375 Fix grub-emu build on FreeBSD.
* Makefile.util.def (grub-mount): Add LIBGEOM to ldadd.
* grub-core/net/drivers/emu/emunet.c: Only include Linux-specific
headers on Linux.
(GRUB_MOD_INIT): Return immediately on non-Linux platforms; this
implementation is currently Linux-specific.
* util/getroot.c (exec_pipe): Define only on Linux or when either
libzfs or libnvpair is unavailable.
(find_root_devices_from_poolname): Remove unused path variable.
2012-09-22 21:19:58 +01:00
Vladimir 'phcoder' Serbinenko
592fd0e4d6 * grub-core/disk/diskfilter.c (free_array) [GRUB_UTIL]: Fix memory leak.
* util/getroot.c (grub_find_device): Likewise.
	(get_mdadm_uuid): Likewise.
	(grub_util_is_imsm): Likewise.
	(grub_util_pull_device): Likewise.
	* util/grub-probe.c (probe): Likewise.
2012-09-11 07:53:26 +02:00
Vladimir 'phcoder' Serbinenko
d1718e7d2b * util/getroot.c (grub_find_root_devices_from_mountinfo): Handle btrfs
subvolumes.
2012-06-22 22:11:23 +02:00
Vladimir 'phcoder' Serbinenko
29a049c98a * util/getroot.c (convert_system_partition_to_system_disk) [__APPLE__]:
Set is_part appropriately.
	(grub_util_biosdisk_get_grub_dev): Use is_part rather than comparing
	names. Canonicalize partition without full disk.
2012-06-14 19:16:30 +02:00
Vladimir 'phcoder' Serbinenko
558d3a6023 * util/getroot.c (grub_util_get_dm_node_linear_info): Moved from here...
* grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info):
	to here. New return value start. All users updated.
	Recursively scan linear mappings.
	* include/grub/emu/hostdisk.h (grub_util_get_dm_node_linear_info): New
	proto.
	* grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start):
	Use grub_util_get_dm_node_linear_info.
	* util/getroot.c (convert_system_partition_to_system_disk): Use
	grub_util_info rather than grub_dprintf.
	(grub_util_biosdisk_get_grub_dev): Add a new grub_util_info.
2012-06-07 14:24:48 +02:00
Vladimir 'phcoder' Serbinenko
de89d33847 * util/getroot.c (grub_guess_root_devices): Don't canonicalise
/dev/root and /dev/dm-*.
2012-06-02 14:36:27 +02:00
Vladimir 'phcoder' Serbinenko
037f6d9060 * util/getroot.c (grub_util_biosdisk_get_grub_dev) [__APPLE__]:
Implement Apple flavour.
	(convert_system_partition_to_system_disk) [__APPLE__]: Likewise.
2012-05-28 17:43:12 +02:00
Samuel Thibault
1796965f6c * util/getroot.c (find_hurd_root_device): Try to make error message
and comments to translators clearer.
2012-05-04 02:26:39 +02:00
Samuel Thibault
e5e4ca486c Handle hurd userspace partitions.
* util/getroot.c (find_hurd_root_device): New function.
	(grub_guess_root_devices): Use find_hurd_root_device on Hurd.
2012-05-03 23:41:46 +02:00
Vladimir 'phcoder' Serbinenko
56bb5dd518 * util/getroot.c (convert_system_partition_to_system_disk); Add etherd
names.
	Reported by: Bastian Blank.
2012-05-03 22:59:16 +02:00
Vladimir 'phcoder' Serbinenko
bcb288ed17 * util/getroot.c (find_root_devices_from_poolname): Handle spaces in the
name.
2012-05-02 09:56:56 +02:00
root
fe4824e998 Fix hurd build.
* util/getroot.c [__GNU__] (strip_extra_slashes, xgetcwd, exec_pipe,
find_root_devices_from_poolname, find_root_devices_from_libzfs,
grub_find_device): Do not define.
2012-04-22 19:02:55 +00:00
Vladimir 'phcoder' Serbinenko
9a06490c07 Fix kfreebsd compile and behaviour.
* grub-core/kern/emu/hostdisk.c (grub_util_follow_gpart_up): Fix
	format-security.
	* util/getroot.c: Fix wait.h include.
	(grub_guess_root_devices): Error if grub_find_device fails.
	(grub_util_get_geom_abstraction): Fix shadowing and format-security.
	(grub_util_get_dev_abstraction): Likewise.
	(grub_util_pull_device): Likewise.
	(grub_util_get_grub_dev): Likewise.
	* util/lvm.c (grub_util_lvm_isvolume): Likewise.
2012-04-21 16:49:56 +02:00
Vladimir 'phcoder' Serbinenko
48143d96a6 Fix and unify wholedisk detection.
* util/getroot.c (convert_system_partition_to_system_disk): New argument
	is_part. All users updated.
	(device_is_wholedisk): Removed.
	(grub_util_biosdisk_get_grub_dev): Use is_part.
2012-04-21 16:42:28 +02:00
Vladimir 'phcoder' Serbinenko
4e75f21c33 * util/getroot.c (convert_system_partition_to_system_disk): Fix use
after free.
	Reported by: Peter Jones.
2012-03-31 12:27:10 +02:00
Vladimir 'phcoder' Serbinenko
b6cf74c901 * util/getroot.c (grub_make_system_path_relative_to_its_root): Fix
missing quotes which caused confusion among translators.
2012-03-19 16:30:16 +01:00
Vladimir 'phcoder' Serbinenko
ec31677170 Fix IMSM handling on Fedora.
* util/getroot.c (grub_util_is_imsm): New function.
	(grub_util_get_dev_abstraction): Treat IMSM as simple device, not RAID.
2012-03-10 18:01:01 +01:00
Vladimir 'phcoder' Serbinenko
6d790129fa * util/getroot.c (exec_pipe): Ensure that the child is not localised. 2012-03-10 13:05:21 +01:00
Vladimir 'phcoder' Serbinenko
e4b791fabe * util/getroot.c (grub_make_system_path_relative_to_its_root): Fix
absolutely unclear error message.
2012-03-02 14:58:53 +01:00
Vladimir 'phcoder' Serbinenko
937fd0cc0c * util/getroot.c (strip_extra_slashes) [CYGWIN]: #ifdef-out.
(exec_pipe) [CYGWIN || MINGW32]: Likewise.
	(find_root_devices_from_poolname) [CYGWIN || MINGW32]: Likewise.
	(find_root_devices_from_libzfs) [CYGWIN || MINGW32]: Likewise.
	Disable -Werror for -Wdeprecated-declarations.
	(grub_guess_root_devices) [CYGWIN || MINGW32]: #ifdef-out.
	(get_dm_uuid) [!HAVE_DEVICE_MAPPER]: Likewise.
	(grub_util_get_dm_abstraction) [! __linux__]: #ifdef-out.
	(grub_util_get_grub_dev): Make luks handling dependent on
	HAVE_DEVICE_MAPPER and not __linux__.
	(get_win32_path): Fix format security.
	(grub_find_zpool_from_dir) [CYGWIN || MINGW32]: #ifdef-out.
	(grub_make_system_path_relative_to_its_root) [CYGWIN || MINGW32]:
	Don't try grub_find_zpool_from_dir.
	(grub_make_system_path_relative_to_its_root) [!__linux__]:
	#ifdef-out paresdir.
2012-03-02 11:36:07 +01:00
Vladimir 'phcoder' Serbinenko
434814814b * util/getroot.c [__APPLE__]: Add missing includes.
(grub_util_biosdisk_is_floppy): Fix usage of undefined variable.
2012-02-29 14:14:08 +01:00
Vladimir 'phcoder' Serbinenko
7931dddfb8 * util/getroot.c (grub_find_root_devices_from_btrfs): Add
missing initialisation.
2012-02-28 04:25:13 +01:00
Richard Laager
f122e0d648 * util/getroot.c (grub_find_root_devices_from_mountinfo): Handle
"zfs" and "fuse.zfs" as synonyms.
2012-02-27 20:14:26 +01:00
Richard Laager
897b741978 * util/getroot.c (find_root_devices_from_poolname): Handle vdevs
with full paths.
2012-02-27 17:42:48 +01:00
Richard Laager
a414bd1565 * util/getroot.c (grub_find_root_devices_from_mountinfo): Add missing
unescape.
2012-02-27 17:40:38 +01:00
Vladimir 'phcoder' Serbinenko
30ac48c452 Don't use insecure popen in getroot.
* util/getroot.c (get_mdadm_uuid): Move pipe logic to ...
	(exec_pipe): ... here.
	(find_root_devices_from_poolname): Use exec_pipe.
2012-02-27 17:37:23 +01:00
Vladimir 'phcoder' Serbinenko
b913642798 Support btrfs multi-volume probe.
* util/getroot.c (btrfs_ioctl_dev_info_args) [__linux__]: New struct.
	(btrfs_ioctl_fs_info_args) [__linux__]: Likewise.
	(BTRFS_IOC_DEV_INFO) [__linux__]: New define.
	(BTRFS_IOC_FS_INFO) [__linux__]: Likewise.
	(grub_find_root_devices_from_btrfs) [__linux__]: New function.
	(grub_find_root_devices_from_mountinfo) [__linux__]: Use
	grub_find_root_devices_from_btrfs if on btrfs.
2012-02-27 14:56:28 +01:00
Vladimir 'phcoder' Serbinenko
67093bc0ed Another round of string clarification and adding TRANSLATORS comments. 2012-02-26 17:28:05 +01:00
Vladimir 'phcoder' Serbinenko
b055f8f676 * util/getroot.c (grub_find_root_devices_from_mountinfo): Fix types.
(grub_util_biosdisk_get_grub_dev): Fix format specification.
2012-02-11 11:41:22 +01:00
Vladimir 'phcoder' Serbinenko
45b0c8b797 * util/getroot.c (grub_find_device): Respect format security.
(get_mdadm_uuid): Remove unused variable.
	(grub_util_pull_device): Dont call gettext on already translated
	grub_errmsg.
	(find_system_device): Remove unused variable.
	(grub_util_get_grub_dev): Likewise.
	(grub_make_system_path_relative_to_its_root): Respect format security.
2012-02-10 13:17:12 +01:00
Vladimir 'phcoder' Serbinenko
9c4b5c13e6 Improve gettext support. Stylistic fixes and error handling fixes while
on it.
2012-02-08 19:26:01 +01:00
Vladimir 'phcoder' Serbinenko
0ae70393ba Improve and unify messages.
* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): Add argument
	name. All users updated.
	Print filename in error.
	(read_device_map): Print filename in error.
	* util/getroot.c (grub_guess_root_devices): Print filename in error.
	(grub_util_get_os_disk): Likewise.
	(grub_util_biosdisk_get_grub_dev): Likewise.
	(grub_util_check_block_device): Likewise.
	(grub_util_check_char_device): Likewise.
	(grub_make_system_path_relative_to_its_root): Likewise.
	* util/grub-editenv.c (create_envblk_file): Likewise.
	(open_envblk_file): Likewise.
	(write_envblk): Likewise.
	* util/grub-fstest.c (cmd_cp): Likewise.
	(cmd_cat): Likewise.
	(cmd_cmp): Likewise.
	* util/grub-menulst2cfg.c (main): Likewise.
	* util/grub-mkfont.c (write_font_ascii_bitmap): Likewise.
	(write_font_width_spec): Likewise.
	(write_font_pf2): Likewise.
	* util/grub-mkimage.c (generate_image): New argument outname.
	All users updated.
	Remove unreacheable message.
	(options): Unify messages.
	(help_filter): Likewise.
	* util/grub-mklayout.c (usage): Removed (unused).
	(main): Print filename in error.
	* util/grub-mkrescue.in: Fix wrong quoting.
	* util/grub-setup.c (setup): Print filename in error.
	* util/ieee1275/ofpath.c (vendor_is_ATA): Likewise.
	(check_sas): Likewise.
	* util/misc.c (grub_util_get_fp_size): Removed.
	(grub_util_get_image_size): Print filename in error.
	(grub_util_read_at): Removed.
	(grub_util_read_image): Print filename in error.
	(grub_util_load_image): Likewise.
	(grub_util_write_image_at): New argument filename. All users updated.
	Print filename in error.
	(grub_util_write_image): New argument filename. All users updated.
	Print filename in error.
	* util/raid.c (grub_util_raid_getmembers): Print filename in error.
	* util/resolve.c (grub_util_resolve_dependencies): Likewise.
2012-02-05 11:07:33 +01:00
Vladimir 'phcoder' Serbinenko
8be63f2ef6 * Makefile.util.def (grub-mkdevicemap): Removed.
* include/grub/emu/hostdisk.h (grub_util_get_os_disk): New proto.
	* include/grub/util/deviceiter.h: Removed.
	* util/deviceiter.c: Likewise.
	* util/getroot.c (grub_util_get_os_disk): New function.
	* util/grub-install.in: Remove grub-mkdevicemap. Use -t disk as
	replacement for EFI.
	* util/grub-mkdevicemap.c: Removed.
	* util/grub-probe.c (probe): Handle PRINT_DISK.
	(argp_parser): Handle -t disk.
2012-02-03 22:36:51 +01:00
Grégoire Sutre
dc87d45a7a NetBSD disk wedge support. 2012-02-03 12:32:21 +01:00
Vladimir 'phcoder' Serbinenko
4a9f8346c9 * grub-core/commands/ls.c: Gettextize.
* grub-core/commands/setpci.c: Likewise.
        * grub-core/commands/videotest.c: Likewise.
        * grub-core/disk/geli.c: Likewise.
        * grub-core/kern/mm.c: Likewise.
        * grub-core/lib/relocator.c: Likewise.
        * grub-core/loader/efi/appleloader.c: Likewise.
        * grub-core/loader/i386/xnu.c: Likewise.
        * grub-core/loader/ia64/efi/linux.c: Likewise.
        * grub-core/loader/xnu.c: Likewise.
        * grub-core/net/dns.c: Likewise.
        * grub-core/net/net.c: Likewise.
        * grub-core/script/lexer.c: Likewise.
        * grub-core/script/parser.y: Likewise.
        * grub-core/script/yylex.l: Likewise.
        * util/getroot.c: Likewise.
        * util/grub-setup.c: Likewise.
2012-02-03 11:56:49 +01:00
Richard Laager
65f08dbfe0 * util/grub-probe.c (probe): Don't crash on canonicalize_file_name
failure.
	Put back lost PRINT_DRIVE.
2012-02-03 11:02:06 +01:00
Richard Laager
e9084abefd * util/getroot.c (find_root_devices_from_libzfs): Fix compilation error.
(grub_guess_root_devices): Replace strlen with sizeof.
	Avoid crash.
	(find_root_devices_from_poolname): Remove unused variable.
	Handle raidzN.
2012-02-03 10:50:56 +01:00
Vladimir 'phcoder' Serbinenko
cf5f7ee788 Support install on multi-device filesystems.
* include/grub/emu/getroot.h (grub_guess_root_device): Renamed to ...
	(grub_guess_root_devices): ...this. Return char **. All users updated.
	* include/grub/emu/misc.h (grub_find_root_device_from_mountinfo):
	Removed.
	* util/getroot.c (find_root_device_from_libzfs): Moved pool logic to ...
	(find_root_devices_from_poolname): ... here.
	(grub_find_root_devices_from_mountinfo): Return char **. Make static.
	Support zfs-fuse.
	(grub_guess_root_device): Rename to ...
	(grub_guess_root_devices): ... this. Return char **. All users updated.
	* util/grub-install.in: Handle multi-device filesystems.
	* util/grub-probe.c (probe). Make device_names a char **. Add delim
	argument. All users updated.
	Handle multi-device filesystems.
	Use 'delim' as separator.
	Remove device check to allow filesystems on file.
	(main): Support -0 argument. Handle multi-device.
	* util/grub-setup.c (setup): Remove root argument. Handle multi-device.
	Fix a cross-device check while on it.
	(arguments): Remove root_dev.
	(argp_parser): Remove -r.
	(main): Remove root_dev.
2012-02-03 10:35:28 +01:00
Vladimir 'phcoder' Serbinenko
63fe43f3c3 * util/getroot.c (grub_util_get_dm_node_linear_info): Fix memory leak.
* grub-core/disk/cryptodisk.c (cryptodisk_cleanup): Disable for
	now to avoid double free.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_dev): Rename to
	hostdisk.
	* include/grub/disk.h (grub_disk_dev_id): New id HOSTDISK.
	* util/grub-probe.c (escape_of_path): Always return a new copy.
	(print_full_name): Escape path.
	(probe): Don't call grub_util_devname_to_ofpath on NULL.
	Fix hints on abstractions.
2012-01-29 21:49:44 +01:00
Vladimir 'phcoder' Serbinenko
076e7c0fda Merge common RAID and LVM logic to an abstract diskfilter.
Add LDM support using the same framework.

	* Makefile.util.def (libgrubkern): Add grub-core/disk/ldm.c,
	grub-core/disk/diskfilter.c and grub-core/partmap/gpt.c.
	(libgrubmods): Remove grub-core/disk/raid.c and
	grub-core/partmap/gpt.c.
	* grub-core/Makefile.core.def (ldm): New module.
	(raid): Renamed to diskfilter. All users updated.
	* grub-core/disk/raid.c: Moved to ...
	* grub-core/disk/diskfilter.c: ... here.
	* grub-core/disk/diskfilter.c: Rename grub_raid_ to grub_diskfilter_.
	(lv_num): New var.
	(find_array): Renamed to ...
	(find_lv): ... this. Support multi-LV. Skip nameless LVs
	(grub_is_array_readable): Renamed to ...
	(grub_is_lv_readable): ... this. Support multinode hierarchy.
	(insert_array): New argument id.
	(is_node_readable): New function.
	(scan_device): Rename to ...
	(scan_disk): .. this. Restrict to one disk.
	(scan_devices): New function.
	(grub_diskfilter_iterate): Support multi-LV.
	Skip invisible and nameless LVs.
	(grub_diskfilter_memberlist): Support multi-LV.
	(grub_diskfilter_read_node): New function.
	(grub_raid_read): Most of logic moved to ...
	(read_segment): ... here
	(read_lv): New function.
	(grub_diskfilter_get_vg_by_uuid): New function.
	(grub_diskfilter_make_raid): Likewise.
	* grub-core/disk/ldm.c: New file.
	* grub-core/disk/lvm.c (vg_list): Removed.
	(lv_count): Likewise.
	(scan_depth): Likewise.
	(is_lv_readable): Likewise.
	(grub_lvm_getvalue): Advance pointer past the number.
	(find_lv): Removed.
	(do_lvm_scan): Refactored into ...
	(grub_lvm_detect): ... this. Support raid.
	(grub_lvm_iterate): Removed.
	(grub_lvm_memberlist): Likewise.
	(grub_lvm_open): Likewise.
	(grub_lvm_close): Likewise.
	(read_lv): Likewise.
	(read_node): Likewise.
	(is_node_readable): Likewise.
	(is_lv_readable): Likewise.
	(grub_lvm_read): Likewise.
	(grub_lvm_write): Likewise.
	(grub_lvm_dev): Use diskfilter
	(GRUB_MOD_INIT): Likewise.
	(GRUB_MOD_FINI): Likewise.
	* grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Use
	new interface.
	* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Likewise.
	* grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise.
	* grub-core/disk/raid5_recover.c (grub_raid5_recover): Use
	grub_diskfilter_read_node.
	Fix a bug with xor.
	* grub-core/disk/raid6_recover.c (grub_raid6_recover): Use
	grub_diskfilter_read_node.
	Support GRUB_RAID_LAYOUT_MUL_FROM_POS.
	* grub-core/kern/disk.c (grub_disk_dev_list): Make global.
	(grub_disk_dev_iterate): Move from here...
	* include/grub/disk.h (grub_disk_dev_iterate): ... to here. Inlined.
	* grub-core/kern/emu/hostdisk.c (grub_hostdisk_find_partition_start):
	Make global.
	(grub_hostdisk_find_partition_start): Likewise.
	(grub_hostdisk_os_dev_to_grub_drive): New function.
	(grub_util_biosdisk_get_osdev): Check that disk is biosdisk.
	* grub-core/kern/emu/hostdisk.c (make_device_name): Move to ...
	* util/getroot.c (make_device_name): ... here.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_dm_node_linear_info):
	Move to ...
	* util/getroot.c (grub_util_get_dm_node_linear_info): ...here.
	* grub-core/kern/emu/hostdisk.c
	(convert_system_partition_to_system_disk): Move to ...
	* util/getroot.c (convert_system_partition_to_system_disk): ...here.
	* grub-core/kern/emu/hostdisk.c (device_is_wholedisk): Move to ...
	* util/getroot.c (device_is_wholedisk): ... here.
	* grub-core/kern/emu/hostdisk.c (find_system_device): Move to ...
	* util/getroot.c (find_system_device): ... here.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_present):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_is_present): ...here.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_get_grub_dev):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_get_grub_dev): ... here.
	Handle LDM.
	* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_is_floppy):
	Move to ...
	* util/getroot.c (grub_util_biosdisk_is_floppy): ... here.
	* grub-core/partmap/gpt.c (grub_gpt_partition_map_iterate): Made global.
	* include/grub/disk.h (grub_disk_dev_id): Replaced RAID and LVM with
	DISKFILTER.
	* include/grub/raid.h: Renamed to ...
	* include/grub/diskfilter.h: ... this.
	* include/grub/diskfilter.h: Rename grub_raid_* to grub_diskfilter_*
	(GRUB_RAID_LAYOUT_*): Make into array.
	(GRUB_RAID_LAYOUT_MUL_FROM_POS): New value.
	(grub_diskfilter_vg): New struct.
	(grub_diskfilter_pv_id): Likewise.
	(grub_raid_member): Removed.
	(grub_raid_array): Likewise.
	(grub_diskfilter_pv): New struct.
	(grub_diskfilter_lv): Likewise.
	(grub_diskfilter_segment): Likewise.
	(grub_diskfilter_node): Likewise.
	(grub_diskfilter_get_vg_by_uuid): New proto.
	(grub_raid_register): Inline.
	(grub_diskfilter_unregister): Likewise.
	(grub_diskfilter_make_raid): New proto.
	(grub_diskfilter_vg_register): Likewise.
	(grub_diskfilter_read_node): Likewise.
	(grub_diskfilter_get_pv_from_disk) [GRUB_UTIL]: Likewise.
	* include/grub/emu/hostdisk.h (grub_util_get_ldm): New proto.
	(grub_util_is_ldm): Likewise.
	(grub_util_ldm_embed) [GRUB_UTIL]: Likewise.
	(grub_hostdisk_find_partition_start): Likewise.
	(grub_hostdisk_os_dev_to_grub_drive): Likewise.
	* include/grub/gpt_partition.h (GRUB_GPT_PARTITION_TYPE_LDM):
	New definition.
	(grub_gpt_partition_map_iterate): New proto.
	* include/grub/lvm.h (grub_lvm_vg): Removed.
	(grub_lvm_pv): Likewise.
	(grub_lvm_lv): Likewise.
	(grub_lvm_segment): Likewise.
	(grub_lvm_node): Likewise.
	* util/getroot.c [...]
	* util/grub-probe.c (probe_raid_level): Handle diskfilter.
	(probe_abstraction): Likewise.
	* util/grub-setup.c (setup): Remove must_embed. Support LDM.
	(main): Remove dead logic.
2012-01-29 14:28:01 +01:00
Vladimir 'phcoder' Serbinenko
2980502850 Fix few bugs and memory leaks 2011-12-23 19:25:24 +01:00
Vladimir 'phcoder' Serbinenko
b87f7ef26b * util/getroot.c (ESCAPED_PATH_MAX): New define.
(mountinfo_entry): Increase the field size to take escaping into
	account.
	(find_root_device_from_libzfs): Add one byte to size of strings for
	security.
2011-12-23 11:36:31 +01:00
Colin Watson
112b483765 * util/getroot.c (find_root_device_from_libzfs): Use xasprintf. 2011-11-28 01:10:00 +00:00