Skip to content

Commit

Permalink
[udisks2] Fix parted disabling to allow formatting. Contributes to JB…
Browse files Browse the repository at this point in the history
…#39821
  • Loading branch information
rainemak committed Apr 3, 2018
1 parent 281f181 commit 7fe4961
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 22 deletions.
60 changes: 43 additions & 17 deletions rpm/0001-Disable-libblockdev-mdraid-and-part-support-from-sou.patch
@@ -1,4 +1,4 @@
From a6052f97297004be33c65573e0d334ae4e00950f Mon Sep 17 00:00:00 2001
From 3d783c006bb77d9564f59f14d513de9eab6a2a0f Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Tue, 5 Dec 2017 11:17:50 +0200
Subject: [PATCH 1/5] Disable libblockdev-mdraid and part support from source
Expand All @@ -9,12 +9,12 @@ Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com>
configure.ac | 4 ----
src/Makefile.am | 1 -
src/udisksdaemon.c | 23 +++++++++++++++++++++++
src/udiskslinuxblock.c | 8 ++++++++
src/udiskslinuxblock.c | 14 ++++++++++++++
src/udiskslinuxmanager.c | 24 ++++++++++++++++++++++++
src/udiskslinuxmdraidobject.c | 10 ++++++++++
src/udiskslinuxpartition.c | 28 ++++++++++++++++++++++++----
src/udiskslinuxpartitiontable.c | 10 ++++++++++
8 files changed, 99 insertions(+), 9 deletions(-)
8 files changed, 105 insertions(+), 9 deletions(-)

diff --git a/configure.ac b/configure.ac
index 488b27c..bc8f7af 100644
Expand Down Expand Up @@ -97,7 +97,7 @@ index 9a013ec..aafd79e 100644
error = NULL;

diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
index 3ac48da..9477499 100644
index 3ac48da..09fa90a 100644
--- a/src/udiskslinuxblock.c
+++ b/src/udiskslinuxblock.c
@@ -20,6 +20,10 @@
Expand All @@ -121,22 +121,48 @@ index 3ac48da..9477499 100644
#include <blockdev/fs.h>

#include "udiskslogging.h"
@@ -2686,6 +2692,7 @@ udisks_linux_block_handle_format (UDisksBlock *block,
void (*complete)(gpointer user_data),
gpointer complete_user_data)
{
@@ -2722,7 +2728,10 @@ udisks_linux_block_handle_format (UDisksBlock *block,
GVariant *config_items = NULL;
gboolean teardown_flag = FALSE;
gboolean no_discard_flag = FALSE;
+
+#if BLOCKDEV_PART_ENABLED
FormatWaitData *wait_data = NULL;
UDisksObject *object;
UDisksPartition *partition = NULL;
@@ -3225,6 +3232,7 @@ udisks_linux_block_handle_format (UDisksBlock *block,
g_clear_object (&partition_table);
g_clear_object (&partition);
g_clear_object (&object);
BDPartTableType part_table_type = BD_PART_TABLE_UNDEF;
+#endif

error = NULL;
object = udisks_daemon_util_dup_object (block, &error);
@@ -3083,11 +3092,13 @@ udisks_linux_block_handle_format (UDisksBlock *block,
}
}

+#if BLOCKDEV_PART_ENABLED
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);
@@ -3115,6 +3126,8 @@ udisks_linux_block_handle_format (UDisksBlock *block,
goto out;
}
}
+
+#if BLOCKDEV_PART_ENABLED
else
{
/* Create the partition table. */
@@ -3124,6 +3137,7 @@ udisks_linux_block_handle_format (UDisksBlock *block,
goto out;
}
}
+#endif
}

struct FormatCompleteData {
/* 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 157746f..3113301 100644
--- a/src/udiskslinuxmanager.c
Expand Down
2 changes: 1 addition & 1 deletion rpm/0002-Drop-smartata-dependencies.patch
@@ -1,4 +1,4 @@
From 9400a37acbe9672bf962b8edd5df18a93468c8bd Mon Sep 17 00:00:00 2001
From c7aed86fe13037ff763428d812e312eba154f273 Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Thu, 7 Dec 2017 13:15:34 +0200
Subject: [PATCH 2/5] Drop smartata dependencies
Expand Down
2 changes: 1 addition & 1 deletion rpm/0003-Loosen-up-mount-unmount-rights.patch
@@ -1,4 +1,4 @@
From 8610b30f5a8ba4062f7db9b6243e900e86b9dfd5 Mon Sep 17 00:00:00 2001
From 3357f5f291d0ae07bdcb6a4b039fb967f208296c Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Tue, 6 Feb 2018 14:01:16 +0200
Subject: [PATCH 3/5] Loosen up mount/unmount rights
Expand Down
@@ -1,4 +1,4 @@
From 860fa0325911456b880caa85db2d83b32efe0c3a Mon Sep 17 00:00:00 2001
From 6a85f8d3ccff83e679e2ada575c3d879bb0a5b2f Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Tue, 6 Feb 2018 14:08:59 +0200
Subject: [PATCH 4/5] Introduce mount-sd service that is executed as nemo
Expand Down
2 changes: 1 addition & 1 deletion rpm/0005-Add-udev-rule-for-the-sda-drives.patch
@@ -1,4 +1,4 @@
From 871dfeeee0a65cbf574757b04c7519a484a37f70 Mon Sep 17 00:00:00 2001
From 419f5f3299b68b663aad3b9de96f979610ddbe7e Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Mon, 12 Mar 2018 10:18:03 +0200
Subject: [PATCH 5/5] Add udev rule for the sda drives
Expand Down
2 changes: 1 addition & 1 deletion udisks2

0 comments on commit 7fe4961

Please sign in to comment.