1925
grub_guess_root_device (const char *dir)
1928
+ char *os_dev = NULL;
1932
@@ -533,30 +526,42 @@
1933
mach_port_deallocate (mach_task_self (), file);
1934
#else /* !__GNU__ */
1924
1935
struct stat st;
1926
1938
#ifdef __linux__
1927
1939
- os_dev = find_root_device_from_mountinfo (dir);
1928
+ os_dev = grub_find_root_device_from_mountinfo (dir, NULL);
1943
+ os_dev = grub_find_root_device_from_mountinfo (dir, NULL);
1931
1944
#endif /* __linux__ */
1946
#if defined(HAVE_LIBZFS) && defined(HAVE_LIBNVPAIR)
1947
- os_dev = find_root_device_from_libzfs (dir);
1951
+ os_dev = find_root_device_from_libzfs (dir);
1954
- if (stat (dir, &st) < 0)
1955
- grub_util_error ("cannot stat `%s'", dir);
1958
+ if (stat (os_dev, &st) >= 0)
1961
+ grub_util_error ("cannot stat `%s'", os_dev);
1966
+ if (stat (dir, &st) >= 0)
1969
+ grub_util_error ("cannot stat `%s'", dir);
1973
/* Cygwin specific function. */
1974
- os_dev = grub_find_device (dir, st.st_dev);
1975
+ os_dev = grub_find_device (dir, dev);
1979
/* This might be truly slow, but is there any better way? */
1980
- os_dev = grub_find_device ("/dev", st.st_dev);
1981
+ os_dev = grub_find_device ("/dev", dev);
1983
#endif /* !__GNU__ */
1932
1985
Index: b/grub-core/kern/emu/misc.c
1933
1986
===================================================================
1934
1987
--- a/grub-core/kern/emu/misc.c