bugfix for partitioning when sda exists a ext4 filesystem

This commit is contained in:
t_feng 2020-10-26 21:50:08 +08:00
parent 698e6c6076
commit 020cfb235e
3 changed files with 96 additions and 1 deletions

View File

@ -1,7 +1,7 @@
%define _empty_manifest_terminate_build 0
Name: anaconda
Version: 33.19
Release: 11
Release: 12
Summary: Graphical system installer
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -38,6 +38,9 @@ Patch6006: bugfix-rename-function-for-a-simple-check-for-DNF-repository.patch
Patch9023: bugfix-add-dnf-transaction-timeout.patch
Patch6007: fix-0-storage-devices-selected.patch
Patch6008: fix-remove-unknow-partition-is-sda-failed.patch
%define dbusver 1.2.3
%define dnfver 3.6.0
%define dracutver 034-7
@ -250,6 +253,12 @@ update-desktop-database &> /dev/null || :
%{_datadir}/gtk-doc
%changelog
* Mon Oct 26 2020 fengtao <fengtao40@huawei.com> - 33.19-12
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:bugfix for partitioning when sda exists a ext4 filesystem
* Sat Sep 26 2020 fengtao <fengtao40@huawei.com> - 33.19-11
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,40 @@
From aa819ebee288aa307dc204337228c402189fd5e5 Mon Sep 17 00:00:00 2001
From: "Qr.Xia" <69908158+xqrustc2020@users.noreply.github.com>
Date: Mon, 12 Oct 2020 11:04:27 +0800
Subject: [PATCH] fix 0 storage devices selected
"0 storage devices selected" is printed because the format_type of sda
is "ext4" rather than "disklabel", and disk 'sda' is filtered by
filter_disks_by_names(partitioned_devices, selected_disks).
Resolves: rhbz#1878661
---
pyanaconda/ui/gui/spokes/custom_storage.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom_storage.py b/pyanaconda/ui/gui/spokes/custom_storage.py
index d72e315..b89866c 100644
--- a/pyanaconda/ui/gui/spokes/custom_storage.py
+++ b/pyanaconda/ui/gui/spokes/custom_storage.py
@@ -47,7 +47,7 @@ from pyanaconda.modules.common.structures.partitioning import PartitioningReques
from pyanaconda.modules.common.structures.device_factory import DeviceFactoryRequest, \
DeviceFactoryPermissions
from pyanaconda.product import productName, productVersion
-from pyanaconda.ui.lib.storage import reset_bootloader, create_partitioning, filter_disks_by_names
+from pyanaconda.ui.lib.storage import reset_bootloader, create_partitioning
from pyanaconda.core.storage import DEVICE_TYPE_UNSUPPORTED, DEVICE_TEXT_MAP, \
MOUNTPOINT_DESCRIPTIONS, NAMED_DEVICE_TYPES, CONTAINER_DEVICE_TYPES, device_type_from_autopart, \
PROTECTED_FORMAT_TYPES, DEVICE_TYPE_BTRFS, DEVICE_TYPE_MD, Size
@@ -303,9 +303,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageCheckHandler):
self._default_file_system = self._device_tree.GetDefaultFileSystem()
# Initialize the selected disks.
- selected_disks = self._disk_selection.SelectedDisks
- partitioned_devices = self._device_tree.GetPartitioned()
- self._selected_disks = filter_disks_by_names(partitioned_devices, selected_disks)
+ self._selected_disks = self._disk_selection.SelectedDisks
# Update the UI elements.
self._do_refresh(init_expanded_pages=True)
--
2.23.0

View File

@ -0,0 +1,46 @@
From ad48d3ab850c9dd40908a51eae3580fcc148e171 Mon Sep 17 00:00:00 2001
From: xqrustc2020 <69908158+xqrustc2020@users.noreply.github.com>
Date: Tue, 29 Sep 2020 13:16:43 +0800
Subject: [PATCH] fix remove unkown partition in sda failed
fix: cannot create partition when sda exists a ext4 filesystem.
When you clicked the "-" button, only the format on sda should be
destroyed without removing sda from the device tree, but sda
was also destroyed. As a result, sda cannot be found during disk
initialization and an error was reported.
Resolves: rhbz#1878661
---
.../modules/storage/partitioning/interactive/utils.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/modules/storage/partitioning/interactive/utils.py b/pyanaconda/modules/storage/partitioning/interactive/utils.py
index b52876a..fe7bd59 100644
--- a/pyanaconda/modules/storage/partitioning/interactive/utils.py
+++ b/pyanaconda/modules/storage/partitioning/interactive/utils.py
@@ -1046,8 +1046,10 @@ def _destroy_device(storage, device):
:param device: an instance of a device
"""
# Remove the device.
- if device.is_disk and device.partitioned and not device.format.supported:
- storage.recursive_remove(device)
+ if device.is_disk:
+ if device.partitioned and not device.format.supported:
+ storage.recursive_remove(device)
+ storage.initialize_disk(device)
elif device.direct and not device.isleaf:
# We shouldn't call this method for with non-leaf devices
# except for those which are also directly accessible like
@@ -1057,10 +1059,6 @@ def _destroy_device(storage, device):
else:
storage.destroy_device(device)
- # Initialize the disk.
- if device.is_disk:
- storage.initialize_disk(device)
-
# Remove empty extended partitions.
if getattr(device, "is_logical", False):
storage.remove_empty_extended_partitions()
--
2.23.0