]> git.proxmox.com Git - grub2.git/blob - include/grub/emu/getroot.h
Make / in btrfs refer to real root, not the default volume.
[grub2.git] / include / grub / emu / getroot.h
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003, 2007, 2008, 2009 Free Software Foundation, Inc.
4 *
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #ifndef GRUB_UTIL_GETROOT_HEADER
20 #define GRUB_UTIL_GETROOT_HEADER 1
21
22 #include <grub/types.h>
23
24 #include <sys/types.h>
25
26 enum grub_dev_abstraction_types {
27 GRUB_DEV_ABSTRACTION_NONE,
28 GRUB_DEV_ABSTRACTION_LVM,
29 GRUB_DEV_ABSTRACTION_RAID,
30 GRUB_DEV_ABSTRACTION_LUKS,
31 GRUB_DEV_ABSTRACTION_GELI,
32 };
33
34 char *grub_find_device (const char *dir, dev_t dev);
35 void grub_util_pull_device (const char *osname);
36 char **grub_guess_root_devices (const char *dir);
37 int grub_util_get_dev_abstraction (const char *os_dev);
38 char *grub_make_system_path_relative_to_its_root (const char *path);
39 char *
40 grub_make_system_path_relative_to_its_root_os (const char *path);
41 char *grub_util_get_grub_dev (const char *os_dev);
42 #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
43 void grub_util_follow_gpart_up (const char *name, grub_disk_addr_t *off_out,
44 char **name_out);
45 #endif
46
47 #include <sys/stat.h>
48
49 #ifdef __linux__
50 char **
51 grub_find_root_devices_from_mountinfo (const char *dir, char **relroot);
52 #endif
53
54 /* Devmapper functions provided by getroot_devmapper.c. */
55 void
56 grub_util_pull_devmapper (const char *os_dev);
57 int
58 grub_util_device_is_mapped_stat (struct stat *st);
59 void grub_util_devmapper_cleanup (void);
60 enum grub_dev_abstraction_types
61 grub_util_get_dm_abstraction (const char *os_dev);
62 char *
63 grub_util_get_vg_uuid (const char *os_dev);
64 char *
65 grub_util_devmapper_part_to_disk (struct stat *st,
66 int *is_part, const char *os_dev);
67 char *
68 grub_util_get_devmapper_grub_dev (const char *os_dev);
69
70 void
71 grub_util_pull_lvm_by_command (const char *os_dev);
72 char **
73 grub_util_find_root_devices_from_poolname (char *poolname);
74
75 grub_disk_addr_t
76 grub_util_find_partition_start (const char *dev);
77
78 /* OS-specific functions provided by getroot_*.c. */
79 enum grub_dev_abstraction_types
80 grub_util_get_dev_abstraction_os (const char *os_dev);
81 char *
82 grub_util_part_to_disk (const char *os_dev, struct stat *st,
83 int *is_part);
84 int
85 grub_util_pull_device_os (const char *osname,
86 enum grub_dev_abstraction_types ab);
87 char *
88 grub_util_get_grub_dev_os (const char *os_dev);
89 grub_disk_addr_t
90 grub_util_find_partition_start_os (const char *dev);
91
92 #endif /* ! GRUB_UTIL_GETROOT_HEADER */