diff --git a/ChangeLog b/ChangeLog index e12dbaefb..41722f4f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-24 Vladimir Serbinenko + + Make grub_util_device_is_mapped_stat available in grub-emu core. + 2013-12-24 Vladimir Serbinenko Add -Qn to TARGET_CFLAGS if it's supported. diff --git a/grub-core/osdep/devmapper/getroot.c b/grub-core/osdep/devmapper/getroot.c index f52b8617b..d02386b34 100644 --- a/grub-core/osdep/devmapper/getroot.c +++ b/grub-core/osdep/devmapper/getroot.c @@ -211,22 +211,6 @@ grub_util_devmapper_part_to_disk (struct stat *st, return xstrdup (path); } -int -grub_util_device_is_mapped_stat (struct stat *st) -{ -#if GRUB_DISK_DEVS_ARE_CHAR - if (! S_ISCHR (st->st_mode)) -#else - if (! S_ISBLK (st->st_mode)) -#endif - return 0; - - if (!grub_device_mapper_supported ()) - return 0; - - return dm_is_dm_major (major (st->st_rdev)); -} - char * grub_util_get_devmapper_grub_dev (const char *os_dev) { @@ -311,12 +295,6 @@ grub_util_pull_devmapper (const char *os_dev __attribute__ ((unused))) return; } -int -grub_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused))) -{ - return 0; -} - void grub_util_devmapper_cleanup (void) { diff --git a/grub-core/osdep/devmapper/hostdisk.c b/grub-core/osdep/devmapper/hostdisk.c index d588be54e..19c1101fd 100644 --- a/grub-core/osdep/devmapper/hostdisk.c +++ b/grub-core/osdep/devmapper/hostdisk.c @@ -82,6 +82,23 @@ grub_util_device_is_mapped (const char *dev) return dm_is_dm_major (major (st.st_rdev)); } +int +grub_util_device_is_mapped_stat (struct stat *st) +{ +#if GRUB_DISK_DEVS_ARE_CHAR + if (! S_ISCHR (st->st_mode)) +#else + if (! S_ISBLK (st->st_mode)) +#endif + return 0; + + if (!grub_device_mapper_supported ()) + return 0; + + return dm_is_dm_major (major (st->st_rdev)); +} + + int grub_util_get_dm_node_linear_info (dev_t dev, int *maj, int *min, @@ -199,4 +216,10 @@ grub_util_get_dm_node_linear_info (dev_t dev __attribute__ ((unused)), return 0; } +int +grub_util_device_is_mapped_stat (struct stat *st __attribute__ ((unused))) +{ + return 0; +} + #endif