* grub-core/kern/emu/getroot.c (grub_guess_root_device): Revert to

old method if mountinfo would return /dev/root and /dev/root doesn't
	exist.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-06-24 04:32:54 +02:00
parent 290766fb77
commit bc09e1a238
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/getroot.c (grub_guess_root_device): Revert to
old method if mountinfo would return /dev/root and /dev/root doesn't
exist.
2011-06-24 Vladimir Serbinenko <phcoder@gmail.com> 2011-06-24 Vladimir Serbinenko <phcoder@gmail.com>
ZFS zlib support ZFS zlib support

View file

@ -620,12 +620,14 @@ grub_guess_root_device (const char *dir)
int root = (strcmp (os_dev, "/dev/root") == 0); int root = (strcmp (os_dev, "/dev/root") == 0);
if (!dm && !root) if (!dm && !root)
return os_dev; return os_dev;
if (stat (os_dev, &st) < 0) if (stat (os_dev, &st) >= 0)
grub_util_error ("cannot stat `%s'", os_dev); {
free (os_dev); free (os_dev);
dev = st.st_rdev; dev = st.st_rdev;
return grub_find_device (dm ? "/dev/mapper" : "/dev", dev); return grub_find_device (dm ? "/dev/mapper" : "/dev", dev);
} }
free (os_dev);
}
if (stat (dir, &st) < 0) if (stat (dir, &st) < 0)
grub_util_error ("cannot stat `%s'", dir); grub_util_error ("cannot stat `%s'", dir);