mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
Make grub-probe work with symbolic links under /dev/mapper as well
as with real block devices. The Linux world seems to be (at best) in transition here, and GRUB shouldn't get caught in the middle. * kern/emu/getroot.c (find_root_device): Follow symbolic links under /dev/mapper.
This commit is contained in:
1 parent
d870813427
commit
15fb2ae896
2 files changed
+21
-2
No files matched your search
@@ -0,0 +1,8 @@
|
|||||||
|
2010-05-28 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
|
Make grub-probe work with symbolic links under /dev/mapper as well
|
||||||
|
as with real block devices. The Linux world seems to be (at best)
|
||||||
|
in transition here, and GRUB shouldn't get caught in the middle.
|
||||||
|
|
||||||
|
* kern/emu/getroot.c (find_root_device): Follow symbolic links under
|
||||||
|
/dev/mapper.
|
||||||
+13
-2
@@ -126,9 +126,20 @@ find_root_device (const char *dir, dev_t dev)
|
|||||||
/* Ignore any error. */
|
/* Ignore any error. */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (S_ISLNK (st.st_mode))
|
if (S_ISLNK (st.st_mode)) {
|
||||||
/* Don't follow symbolic links. */
|
#ifdef __linux__
|
||||||
|
if (strcmp (dir, "mapper") == 0) {
|
||||||
|
/* Follow symbolic links under /dev/mapper/; the canonical name
|
||||||
|
may be something like /dev/dm-0, but the names under
|
||||||
|
/dev/mapper/ are more human-readable and so we prefer them if
|
||||||
|
we can get them. */
|
||||||
|
if (stat (ent->d_name, &st) < 0)
|
||||||
|
continue;
|
||||||
|
} else
|
||||||
|
#endif /* __linux__ */
|
||||||
|
/* Don't follow other symbolic links. */
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (S_ISDIR (st.st_mode))
|
if (S_ISDIR (st.st_mode))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user