Search
SailfishOS Open Build Service
>
Projects
>
nemo
:
testing:hw
:
motorola
:
moto_msm8960_jbbl
:
4.4.0.68
>
udisks2
> _service:tar_git:0001-Make-libblockdev-mdraid-and-part-support-optional.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:tar_git:0001-Make-libblockdev-mdraid-and-part-support-optional.patch of Package udisks2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com> Date: Mon, 8 Nov 2021 19:35:13 +0200 Subject: [PATCH] Make libblockdev-mdraid and part support optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com> --- configure.ac | 87 ++++++++++++++++++++------------- src/Makefile.am | 10 ++-- src/udisksdaemon.c | 15 ++++++ src/udiskslinuxblock.c | 19 ++++++- src/udiskslinuxmanager.c | 21 +++++++- src/udiskslinuxmdraidobject.c | 6 +++ src/udiskslinuxpartition.c | 20 ++++++++ src/udiskslinuxpartitiontable.c | 6 +++ src/udiskslinuxprovider.c | 19 ++++++- 9 files changed, 163 insertions(+), 40 deletions(-) diff --git a/configure.ac b/configure.ac index 61e74a3b..0e186fc9 100644 --- a/configure.ac +++ b/configure.ac @@ -573,23 +573,31 @@ AM_CONDITIONAL(HAVE_VDO, [test "x$have_vdo" = "xyes"]) if test "x$enable_daemon" = "xyes"; then # libblockdev part - SAVE_CFLAGS=$CFLAGS - SAVE_LDFLAGS=$LDFLAGS - - CFLAGS="$GLIB_CFLAGS" - LDFLAGS="$GLIB_LIBS" - AC_MSG_CHECKING([libblockdev-part presence]) - AC_TRY_COMPILE([#include <blockdev/part.h>], [], - [AC_MSG_RESULT([yes]) - have_part=yes], - [AC_MSG_RESULT([no]) - have_part=no]) - - CFLAGS=$SAVE_CFLAGS - LDFLAGS=$SAVE_LDFLAGS - - if test "x$have_part" = "xno"; then - AC_MSG_ERROR([BlockDev part support requested but header or library not found]) + AC_ARG_ENABLE(blockdev-part, [AS_HELP_STRING([--enable-blockdev-part], + [enable libblockdev-part support [default=yes]])], + enable_blockdev_part=yes,) + if test ! "x$enable_blockdev_part" = "xno"; then + SAVE_CFLAGS=$CFLAGS + SAVE_LDFLAGS=$LDFLAGS + + CFLAGS="$GLIB_CFLAGS" + LDFLAGS="$GLIB_LIBS" + AC_MSG_CHECKING([libblockdev-part presence]) + AC_TRY_COMPILE([#include <blockdev/part.h>], [], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_BLOCKDEV_PART], 1, [Define, if libblockdev-part is available]) + have_blockdev_part=yes], + [AC_MSG_RESULT([no]) + have_blockdev_part=no]) + + CFLAGS=$SAVE_CFLAGS + LDFLAGS=$SAVE_LDFLAGS + + if test "x$have_blockdev_part" = "xno" ; then + if test "x$enable_blockdev_part" = "xyes"; then + AC_MSG_ERROR([BlockDev part support requested but header or library not found]) + fi + fi fi # libblockdev loop @@ -633,23 +641,31 @@ if test "x$enable_daemon" = "xyes"; then fi # libblockdev mdraid - SAVE_CFLAGS=$CFLAGS - SAVE_LDFLAGS=$LDFLAGS - - CFLAGS="$GLIB_CFLAGS" - LDFLAGS="$GLIB_LIBS" - AC_MSG_CHECKING([libblockdev-mdraid presence]) - AC_TRY_COMPILE([#include <blockdev/mdraid.h>], [], - [AC_MSG_RESULT([yes]) - have_mdraid=yes], - [AC_MSG_RESULT([no]) - have_mdraid=no]) - - CFLAGS=$SAVE_CFLAGS - LDFLAGS=$SAVE_LDFLAGS - - if test "x$have_mdraid" = "xno"; then - AC_MSG_ERROR([BLOCKDEV MDRAID support requested but header or library not found]) + AC_ARG_ENABLE(blockdev-mraid, [AS_HELP_STRING([--enable-blockdev-mdraid], + [enable libblockdev-part support [default=yes]])], + enable_blockdev_mdraid=yes,) + if test ! "x$enable_blockdev_mdraid" = "xno"; then + SAVE_CFLAGS=$CFLAGS + SAVE_LDFLAGS=$LDFLAGS + + CFLAGS="$GLIB_CFLAGS" + LDFLAGS="$GLIB_LIBS" + AC_MSG_CHECKING([libblockdev-mdraid presence]) + AC_TRY_COMPILE([#include <blockdev/mdraid.h>], [], + [AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_BLOCKDEV_MDRAID], 1, [Define, if libblockdev-mdraid is available]) + have_blockdev_mdraid=yes], + [AC_MSG_RESULT([no]) + have_blockdev_mdraid=no]) + + CFLAGS=$SAVE_CFLAGS + LDFLAGS=$SAVE_LDFLAGS + + if test "x$have_blockdev_mdraid" = "xno"; then + if test "x$enable_blockdev_mdraid" = "xyes"; then + AC_MSG_ERROR([BLOCKDEV MDRAID support requested but header or library not found]) + fi + fi fi # libblockdev fs @@ -692,6 +708,7 @@ if test "x$enable_daemon" = "xyes"; then AC_MSG_ERROR([BLOCKDEV CRYPTO support requested but header or library not found]) fi fi +AM_CONDITIONAL(HAVE_BLOCKDEV_MDRAID, test "x$have_blockdev_mdraid" = "xyes") # Internationalization @@ -846,4 +863,6 @@ echo " LibStorageMgmt module: ${have_lsm} Bcache module: ${have_bcache} VDO module (deprecated): ${have_vdo} + LibBlockDev-part: ${have_blockdev_part:-no} + LibBlockDev-mdraid: ${have_blockdev_mdraid:-no} " diff --git a/src/Makefile.am b/src/Makefile.am index 4048854c..1aed534a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -79,9 +79,6 @@ libudisks_daemon_la_SOURCES = \ udiskslinuxdriveobject.h udiskslinuxdriveobject.c \ udiskslinuxdrive.h udiskslinuxdrive.c \ udiskslinuxdriveata.h udiskslinuxdriveata.c \ - udiskslinuxmdraidobject.h udiskslinuxmdraidobject.c \ - udiskslinuxmdraidhelpers.h udiskslinuxmdraidhelpers.c \ - udiskslinuxmdraid.h udiskslinuxmdraid.c \ udiskslinuxmanager.h udiskslinuxmanager.c \ udiskslinuxmountoptions.h udiskslinuxmountoptions.c \ udiskslinuxfsinfo.h udiskslinuxfsinfo.c \ @@ -113,6 +110,13 @@ libudisks_daemon_la_SOURCES += \ udisksutabmonitor.h udisksutabmonitor.c endif # HAVE_LIBMOUNT_UTAB +if HAVE_BLOCKDEV_MDRAID +libudisks_daemon_la_SOURCES += + udiskslinuxmdraidobject.h udiskslinuxmdraidobject.c \ + udiskslinuxmdraidhelpers.h udiskslinuxmdraidhelpers.c \ + udiskslinuxmdraid.h udiskslinuxmdraid.c +endif # HAVE_BLOCKDEV_MDRAID + libudisks_daemon_la_CFLAGS = \ -I$(top_srcdir) \ -DG_LOG_DOMAIN=\"udisks\" \ diff --git a/src/udisksdaemon.c b/src/udisksdaemon.c index 51e2bb5c..d6e311ad 100644 --- a/src/udisksdaemon.c +++ b/src/udisksdaemon.c @@ -328,18 +328,33 @@ udisks_daemon_constructed (GObject *object) uuid_t uuid; /* NULL means no specific so_name (implementation) */ +#ifdef HAVE_BLOCKDEV_PART BDPluginSpec part_plugin = {BD_PLUGIN_PART, NULL}; +#endif BDPluginSpec swap_plugin = {BD_PLUGIN_SWAP, NULL}; BDPluginSpec loop_plugin = {BD_PLUGIN_LOOP, NULL}; +#ifdef HAVE_BLOCKDEV_MDRAID BDPluginSpec mdraid_plugin = {BD_PLUGIN_MDRAID, NULL}; +#endif BDPluginSpec fs_plugin = {BD_PLUGIN_FS, NULL}; BDPluginSpec crypto_plugin = {BD_PLUGIN_CRYPTO, NULL}; /* The core daemon needs the part, swap, loop, mdraid, fs and crypto plugins. Additional plugins are required by various modules, but they make sure plugins are loaded themselves. */ +#if defined(HAVE_BLOCKDEV_PART) && defined(HAVE_BLOCKDEV_MDRAID) BDPluginSpec *plugins[] = {&part_plugin, &swap_plugin, &loop_plugin, &mdraid_plugin, &fs_plugin, &crypto_plugin, NULL}; +#elif defined(HAVE_BLOCKDEV_PART) + BDPluginSpec *plugins[] = {&part_plugin, &swap_plugin, &loop_plugin, + &fs_plugin, &crypto_plugin, NULL}; +#elif defined(HAVE_BLOCKDEV_MDRAID) + BDPluginSpec *plugins[] = {&swap_plugin, &loop_plugin, &mdraid_plugin, + &fs_plugin, &crypto_plugin, NULL}; +#else + BDPluginSpec *plugins[] = {&swap_plugin, &loop_plugin, &fs_plugin, &crypto_plugin, NULL}; +#endif + BDPluginSpec **plugin_p = NULL; error = NULL; diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c index 174301d8..a59793bf 100644 --- a/src/udiskslinuxblock.c +++ b/src/udiskslinuxblock.c @@ -39,7 +39,9 @@ #include <libmount/libmount.h> +#ifdef HAVE_BLOCKDEV_PART #include <blockdev/part.h> +#endif #include <blockdev/fs.h> #include <blockdev/crypto.h> @@ -61,7 +63,6 @@ #include "udisksbasejob.h" #include "udiskssimplejob.h" #include "udiskslinuxdriveata.h" -#include "udiskslinuxmdraidobject.h" #include "udiskslinuxdevice.h" #include "udiskslinuxpartition.h" #include "udiskslinuxencrypted.h" @@ -69,6 +70,10 @@ #include "udiskslinuxpartitiontable.h" #include "udiskslinuxfilesystemhelpers.h" +#ifdef HAVE_BLOCKDEV_MDRAID +#include "udiskslinuxmdraidobject.h" +#endif + #ifdef HAVE_LIBMOUNT_UTAB #include "udisksutabmonitor.h" #include "udisksutabentry.h" @@ -280,6 +285,8 @@ find_drive (GDBusObjectManagerServer *object_manager, /* ---------------------------------------------------------------------------------------------------- */ +#ifdef HAVE_BLOCKDEV_MDRAID + static UDisksLinuxMDRaidObject * find_mdraid (GDBusObjectManagerServer *object_manager, const gchar *md_uuid) @@ -352,6 +359,8 @@ update_mdraid (UDisksLinuxBlock *block, udisks_block_set_mdraid_member (iface, objpath_mdraid_member); } +#endif + /* ---------------------------------------------------------------------------------------------------- */ /** @@ -1244,7 +1253,9 @@ udisks_linux_block_update (UDisksLinuxBlock *block, #ifdef HAVE_LIBMOUNT_UTAB update_userspace_mount_options (block, daemon); #endif +#ifdef HAVE_BLOCKDEV_MDRAID update_mdraid (block, device, drive, object_manager); +#endif out: g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (block)); @@ -2966,7 +2977,9 @@ udisks_linux_block_handle_format (UDisksBlock *block, GVariant *config_items = NULL; gboolean teardown_flag = FALSE; gboolean no_discard_flag = FALSE; +#ifdef HAVE_BLOCKDEV_PART BDPartTableType part_table_type = BD_PART_TABLE_UNDEF; +#endif UDisksObject *filesystem_object; error = NULL; @@ -3357,12 +3370,14 @@ udisks_linux_block_handle_format (UDisksBlock *block, } } +#ifdef HAVE_BLOCKDEV_PART if (g_strcmp0 (type, "dos") == 0) part_table_type = BD_PART_TABLE_MSDOS; else if (g_strcmp0 (type, "gpt") == 0) part_table_type = BD_PART_TABLE_GPT; if (part_table_type == BD_PART_TABLE_UNDEF) +#endif { /* Build and run mkfs shell command */ const gchar *device = udisks_block_get_device (block_to_mkfs); @@ -3391,6 +3406,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, } g_free (error_message); } +#ifdef HAVE_BLOCKDEV_PART else { /* Create the partition table. */ @@ -3418,6 +3434,7 @@ udisks_linux_block_handle_format (UDisksBlock *block, } } } +#endif /* The mkfs program may not generate all the uevents we need - so explicitly * trigger an event here diff --git a/src/udiskslinuxmanager.c b/src/udiskslinuxmanager.c index 7a614f44..f852a79c 100644 --- a/src/udiskslinuxmanager.c +++ b/src/udiskslinuxmanager.c @@ -35,7 +35,9 @@ #include <blockdev/loop.h> #include <blockdev/fs.h> +#ifdef HAVE_BLOCKDEV_MDRAID #include <blockdev/mdraid.h> +#endif #include "udiskslogging.h" #include "udiskslinuxmanager.h" @@ -507,7 +509,9 @@ wait_for_array_object (UDisksDaemon *daemon, return ret; } +#ifdef HAVE_BLOCKDEV_MDRAID static const gchar *raid_level_whitelist[] = {"raid0", "raid1", "raid4", "raid5", "raid6", "raid10", NULL}; +#endif static gboolean handle_mdraid_create (UDisksManager *_object, @@ -518,6 +522,7 @@ handle_mdraid_create (UDisksManager *_object, guint64 arg_chunk, GVariant *arg_options) { +#ifdef HAVE_BLOCKDEV_MDRAID UDisksLinuxManager *manager = UDISKS_LINUX_MANAGER (_object); UDisksObject *array_object = NULL; uid_t caller_uid; @@ -872,6 +877,9 @@ handle_mdraid_create (UDisksManager *_object, g_clear_object (&array_object); return TRUE; /* returning TRUE means that we handled the method invocation */ +#else + return FALSE; +#endif } /* ---------------------------------------------------------------------------------------------------- */ @@ -1042,6 +1050,7 @@ handle_can_resize (UDisksManager *object, GDBusMethodInvocation *invocation, const gchar *type) { +#ifdef HAVE_BLOCKDEV_PART GError *error = NULL; gchar *required_utility = NULL; BDFsResizeFlags mode; @@ -1063,6 +1072,9 @@ handle_can_resize (UDisksManager *object, g_free (required_utility); return TRUE; +#else + return FALSE; +#endif } static gboolean @@ -1070,6 +1082,7 @@ handle_can_check (UDisksManager *object, GDBusMethodInvocation *invocation, const gchar *type) { +#ifdef HAVE_BLOCKDEV_MDRAID GError *error = NULL; gchar *required_utility = NULL; gboolean ret; @@ -1088,8 +1101,10 @@ handle_can_check (UDisksManager *object, ret ? "" : required_utility)); g_free (required_utility); - return TRUE; +#else + return FALSE; +#endif } static gboolean @@ -1097,6 +1112,7 @@ handle_can_repair (UDisksManager *object, GDBusMethodInvocation *invocation, const gchar *type) { +#ifdef HAVE_BLOCKDEV_MDRAID GError *error = NULL; gchar *required_utility = NULL; gboolean ret; @@ -1117,6 +1133,9 @@ handle_can_repair (UDisksManager *object, g_free (required_utility); return TRUE; +#else + return FALSE; +#endif } diff --git a/src/udiskslinuxmdraidobject.c b/src/udiskslinuxmdraidobject.c index 81bebe43..5ba685f1 100644 --- a/src/udiskslinuxmdraidobject.c +++ b/src/udiskslinuxmdraidobject.c @@ -431,7 +431,11 @@ mdraid_update (UDisksLinuxMDRaidObject *object, const gchar *uevent_action, GDBusInterface *_iface) { +#ifdef HAVE_BLOCKDEV_MDRAID return udisks_linux_mdraid_update (UDISKS_LINUX_MDRAID (object->iface_mdraid), object); +#else + return FALSE; +#endif } /* ---------------------------------------------------------------------------------------------------- */ @@ -619,6 +623,7 @@ udisks_linux_mdraid_object_uevent (UDisksLinuxMDRaidObject *object, UDisksLinuxDevice *device, gboolean is_member) { +#ifdef HAVE_BLOCKDEV_MDRAID g_return_if_fail (UDISKS_IS_LINUX_MDRAID_OBJECT (object)); g_return_if_fail (UDISKS_IS_LINUX_DEVICE (device)); @@ -732,6 +737,7 @@ udisks_linux_mdraid_object_uevent (UDisksLinuxMDRaidObject *object, } out: ; +#endif } /* ---------------------------------------------------------------------------------------------------- */ diff --git a/src/udiskslinuxpartition.c b/src/udiskslinuxpartition.c index 5461b390..5e06069f 100644 --- a/src/udiskslinuxpartition.c +++ b/src/udiskslinuxpartition.c @@ -33,7 +33,9 @@ #include <glib/gstdio.h> +#ifdef HAVE_BLOCKDEV_PART #include <blockdev/part.h> +#endif #include "udiskslogging.h" #include "udiskslinuxpartition.h" @@ -327,6 +329,7 @@ handle_set_flags (UDisksPartition *partition, guint64 flags, GVariant *options) { +#ifdef HAVE_BLOCKDEV_PART UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; @@ -464,6 +467,7 @@ handle_set_flags (UDisksPartition *partition, g_clear_object (&partition_table); g_clear_object (&partition_table_block); g_clear_object (&object); +#endif return TRUE; /* returning TRUE means that we handled the method invocation */ } @@ -477,6 +481,7 @@ handle_set_name (UDisksPartition *partition, const gchar *name, GVariant *options) { +#ifdef HAVE_BLOCKDEV_PART UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; @@ -592,6 +597,7 @@ handle_set_name (UDisksPartition *partition, g_clear_object (&partition_table_block); g_clear_object (&object); +#endif return TRUE; /* returning TRUE means that we handled the method invocation */ } @@ -648,6 +654,7 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, GCancellable *cancellable, GError **error) { +#ifdef HAVE_BLOCKDEV_PART gboolean ret = FALSE; UDisksBlock *block = NULL; UDisksObject *object = NULL; @@ -784,6 +791,9 @@ udisks_linux_partition_set_type_sync (UDisksLinuxPartition *partition, g_clear_error (&loc_error); return ret; +#else + return TRUE; +#endif } /* ---------------------------------------------------------------------------------------------------- */ @@ -821,6 +831,7 @@ typedef struct guint64 new_size; } WaitForPartitionResizeData; +#ifdef HAVE_BLOCKDEV_PART static UDisksObject * wait_for_partition_resize (UDisksDaemon *daemon, gpointer user_data) @@ -843,6 +854,7 @@ wait_for_partition_resize (UDisksDaemon *daemon, return object; } +#endif /* runs in thread dedicated to handling @invocation */ static gboolean @@ -851,6 +863,7 @@ handle_resize (UDisksPartition *partition, guint64 size, GVariant *options) { +#ifdef HAVE_BLOCKDEV_PART UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; @@ -961,6 +974,9 @@ handle_resize (UDisksPartition *partition, return TRUE; /* returning TRUE means that we handled the method invocation */ +#else + return FALSE; +#endif } /* ---------------------------------------------------------------------------------------------------- */ @@ -971,6 +987,7 @@ handle_delete (UDisksPartition *partition, GDBusMethodInvocation *invocation, GVariant *options) { +#ifdef HAVE_BLOCKDEV_PART UDisksBlock *block = NULL; UDisksObject *object = NULL; UDisksDaemon *daemon = NULL; @@ -1068,6 +1085,9 @@ handle_delete (UDisksPartition *partition, g_clear_object (&object); return TRUE; /* returning TRUE means that we handled the method invocation */ +#else + return FALSE; +#endif } /* ---------------------------------------------------------------------------------------------------- */ diff --git a/src/udiskslinuxpartitiontable.c b/src/udiskslinuxpartitiontable.c index e43a0708..4763e58d 100644 --- a/src/udiskslinuxpartitiontable.c +++ b/src/udiskslinuxpartitiontable.c @@ -31,7 +31,9 @@ #include <glib/gstdio.h> +#ifdef HAVE_BLOCKDEV_PART #include <blockdev/part.h> +#endif #include <blockdev/fs.h> #include "udiskslogging.h" @@ -256,6 +258,7 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta const gchar *name, GVariant *options) { +#ifdef HAVE_BLOCKDEV_PART const gchar *action_id = NULL; const gchar *message = NULL; UDisksBlock *block = NULL; @@ -562,6 +565,9 @@ udisks_linux_partition_table_handle_create_partition (UDisksPartitionTable *ta if (overlapping_part) bd_part_spec_free (overlapping_part); return partition_object; +#else + return NULL; +#endif } static int diff --git a/src/udiskslinuxprovider.c b/src/udiskslinuxprovider.c index c1447bc7..876977b2 100644 --- a/src/udiskslinuxprovider.c +++ b/src/udiskslinuxprovider.c @@ -30,7 +30,6 @@ #include "udiskslinuxprovider.h" #include "udiskslinuxblockobject.h" #include "udiskslinuxdriveobject.h" -#include "udiskslinuxmdraidobject.h" #include "udiskslinuxmanager.h" #include "udisksstate.h" #include "udiskslinuxdevice.h" @@ -40,6 +39,10 @@ #include "udisksdaemonutil.h" #include "udisksconfigmanager.h" +#ifdef HAVE_BLOCKDEV_MDRAID +#include "udiskslinuxmdraidobject.h" +#endif + /** * SECTION:udiskslinuxprovider * @title: UDisksLinuxProvider @@ -75,9 +78,11 @@ struct _UDisksLinuxProvider GHashTable *sysfs_path_to_drive; /* maps from array UUID and sysfs_path to UDisksLinuxMDRaidObject instances */ +#ifdef HAVE_BLOCKDEV_MDRAID GHashTable *uuid_to_mdraid; GHashTable *sysfs_path_to_mdraid; GHashTable *sysfs_path_to_mdraid_members; +#endif /* maps from UDisksModule to nested hashtables containing object skeleton instances */ GHashTable *module_objects; @@ -185,9 +190,11 @@ udisks_linux_provider_finalize (GObject *object) g_hash_table_unref (provider->sysfs_to_block); g_hash_table_unref (provider->vpd_to_drive); g_hash_table_unref (provider->sysfs_path_to_drive); +#ifdef HAVE_BLOCKDEV_MDRAID g_hash_table_unref (provider->uuid_to_mdraid); g_hash_table_unref (provider->sysfs_path_to_mdraid); g_hash_table_unref (provider->sysfs_path_to_mdraid_members); +#endif g_hash_table_unref (provider->module_objects); g_object_unref (provider->gudev_client); @@ -677,6 +684,7 @@ udisks_linux_provider_start (UDisksProvider *_provider) g_str_equal, g_free, NULL); +#ifdef HAVE_BLOCKDEV_MDRAID provider->uuid_to_mdraid = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, @@ -689,6 +697,7 @@ udisks_linux_provider_start (UDisksProvider *_provider) g_str_equal, g_free, NULL); +#endif provider->module_objects = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, @@ -876,6 +885,8 @@ perform_initial_housekeeping_for_drive (GTask *task, /* ---------------------------------------------------------------------------------------------------- */ +#ifdef HAVE_BLOCKDEV_MDRAID + /* called with lock held */ static void @@ -1019,6 +1030,8 @@ handle_block_uevent_for_mdraid (UDisksLinuxProvider *provider, handle_block_uevent_for_mdraid_with_uuid (provider, action, device, NULL, FALSE); } +#endif + /* ---------------------------------------------------------------------------------------------------- */ /* called with lock held */ @@ -1338,7 +1351,9 @@ handle_block_uevent (UDisksLinuxProvider *provider, { handle_block_uevent_for_block (provider, action, device); handle_block_uevent_for_drive (provider, action, device); +#ifdef HAVE_BLOCKDEV_MDRAID handle_block_uevent_for_mdraid (provider, action, device); +#endif handle_block_uevent_for_modules (provider, action, device); } else @@ -1357,7 +1372,9 @@ handle_block_uevent (UDisksLinuxProvider *provider, else { handle_block_uevent_for_modules (provider, action, device); +#ifdef HAVE_BLOCKDEV_MDRAID handle_block_uevent_for_mdraid (provider, action, device); +#endif handle_block_uevent_for_drive (provider, action, device); handle_block_uevent_for_block (provider, action, device); } -- 2.33.1