diff --git a/backport-Fix-logging-information-about-ignoring-hidden-device.patch b/backport-Fix-logging-information-about-ignoring-hidden-device.patch new file mode 100644 index 0000000000000000000000000000000000000000..3163b13d42b7f301652eb7ab6115706b5fe77ea7 --- /dev/null +++ b/backport-Fix-logging-information-about-ignoring-hidden-device.patch @@ -0,0 +1,25 @@ +From d4d8224637d6967418c62de61f8673d520e16243 Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Mon, 7 Dec 2020 18:48:36 +0100 +Subject: [PATCH] Fix logging information about ignoring hidden devices + +--- + blivet/populator/populator.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py +index 40623714..75bb1741 100644 +--- a/blivet/populator/populator.py ++++ b/blivet/populator/populator.py +@@ -250,7 +250,7 @@ class PopulatorMixin(object): + + log.info("scanning %s (%s)...", name, sysfs_path) + if udev.device_is_hidden(info): +- log.info("device %s is marked as hidden in sysfs, ignoring") ++ log.info("device %s is marked as hidden in sysfs, ignoring", name) + return + + # make sure we note the name of every device we see +-- +2.27.0 + diff --git a/backport-Fix-reading-hidden-sysfs-attribute.patch b/backport-Fix-reading-hidden-sysfs-attribute.patch new file mode 100644 index 0000000000000000000000000000000000000000..9ce9a080b154970beb1732e462269fff067a46bb --- /dev/null +++ b/backport-Fix-reading-hidden-sysfs-attribute.patch @@ -0,0 +1,30 @@ +From ceeb75df8362f848cd2c11caaba04c5efdc4629d Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 30 Jul 2020 12:36:35 +0200 +Subject: [PATCH] Fix reading hidden sysfs attribute + +util.get_sysfs_attr returns a string so bool(hidden) is always +True and we hide all devices. + +Reference:https://github.com/storaged-project/blivet/commit/191a6961f13bd868052346047d0c1dc24b19f09e +Conflict:NA +--- + blivet/udev.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/blivet/udev.py b/blivet/udev.py +index 8b3fc58..5788a5e 100644 +--- a/blivet/udev.py ++++ b/blivet/udev.py +@@ -1004,4 +1004,7 @@ def device_is_nvdimm_namespace(info): + def device_is_hidden(info): + sysfs_path = device_get_sysfs_path(info) + hidden = util.get_sysfs_attr(sysfs_path, "hidden") +- return bool(hidden) ++ if not hidden or not hidden.isnumeric(): ++ return False ++ ++ return bool(int(hidden)) +-- +2.27.0 + diff --git a/backport-Ignore-devices-marked-as-hidden-in-sysfs-1856974.patch b/backport-Ignore-devices-marked-as-hidden-in-sysfs-1856974.patch new file mode 100644 index 0000000000000000000000000000000000000000..f5bed6576826509f620d4b410140814e1060a6a4 --- /dev/null +++ b/backport-Ignore-devices-marked-as-hidden-in-sysfs-1856974.patch @@ -0,0 +1,47 @@ +From 7297046bdeb98449f4b224d13548ea97aa411aad Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Tue, 21 Jul 2020 13:26:40 +0200 +Subject: [PATCH] Ignore devices marked as hidden in sysfs(#1856974) + +NVMe multipath devices have a special internal hidden devices that +are visible in /sys/block but not directly usable so we should +ignore these as well as all devices with the hidden attribute. + +Reference:https://github.com/storaged-project/blivet/commit/8957eb1f82a37542ea1ae3990b6068b3cf90a3be +Conflict:NA +--- + blivet/populator/populator.py | 3 +++ + blivet/udev.py | 6 ++++++ + 2 files changed, 9 insertions(+) + +diff --git a/blivet/populator/populator.py b/blivet/populator/populator.py +index 465c272..1d6daa6 100644 +--- a/blivet/populator/populator.py ++++ b/blivet/populator/populator.py +@@ -247,6 +247,9 @@ class PopulatorMixin(object): + return + + log.info("scanning %s (%s)...", name, sysfs_path) ++ if udev.device_is_hidden(info): ++ log.info("device %s is marked as hidden in sysfs, ignoring") ++ return + + # make sure we note the name of every device we see + self._add_name(name) +diff --git a/blivet/udev.py b/blivet/udev.py +index c85eb3d..8b3fc58 100644 +--- a/blivet/udev.py ++++ b/blivet/udev.py +@@ -999,3 +999,9 @@ def device_is_nvdimm_namespace(info): + devname = info.get("DEVNAME", "") + ninfo = blockdev.nvdimm_namespace_get_devname(devname) + return ninfo is not None ++ ++ ++def device_is_hidden(info): ++ sysfs_path = device_get_sysfs_path(info) ++ hidden = util.get_sysfs_attr(sysfs_path, "hidden") ++ return bool(hidden) +-- +2.27.0 + diff --git a/python-blivet.spec b/python-blivet.spec index ad5fc4e014ba6e2578ce431ba3b09c19b9c9d8e3..5662af24dd5561da57453849f359ccb34c5407ec 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.2.2 -Release: 8 +Release: 11 Epoch: 1 Summary: A python module for system storage configuration License: LGPLv2+ @@ -28,6 +28,11 @@ Patch9001: huawei-fix-allocate-partitions-threw-exception-when-raid.patch Patch6003: backport-Convert-LVM-filter-lists-to-sets.patch Patch6004: backport-Remove-action-device-from-LVM-reject-list.patch +Patch6005: backport-Ignore-devices-marked-as-hidden-in-sysfs-1856974.patch +Patch6006: backport-Fix-reading-hidden-sysfs-attribute.patch +Patch6007: backport-Fix-logging-information-about-ignoring-hidden-device.patch +patch10000: xfusion-Incomplete-Chineseization-of-disk-mount.patch + %description The python-blivet package is a python module for examining and modifying storage configuration. @@ -127,6 +132,25 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README %changelog +* Thu Dec 08 2022 wanglimin - 3.2.2-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: Incomplete Chineseization of disk mount + + +* Thu Sep 1 2022 yueyuankun - 3.2.2-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix logging information about ignoring hidden devices + +* Thu Aug 4 2022 wanglu - 1:3.2.2-9 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:ignore devices marked as hidden in sysfs and fix reading hidden sysfs attribute + * Fri Dec 10 2021 yanan - 3.2.2-8 - Type:bugfix - ID:NA diff --git a/xfusion-Incomplete-Chineseization-of-disk-mount.patch b/xfusion-Incomplete-Chineseization-of-disk-mount.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa35cd53d60f6157be4ea647ef9acb4cdf1cd7da --- /dev/null +++ b/xfusion-Incomplete-Chineseization-of-disk-mount.patch @@ -0,0 +1,74 @@ +From 5cac6005312fd6f0cb47b73571254acaff70078c Mon Sep 17 00:00:00 2001 +From: wangzhiyi +Date: Tue, 22 Nov 2022 18:13:27 +0800 +Subject: Sinicization"not enough free space for new device" + +--- + blivet/devicefactory.py | 5 +++-- + po/blivet.pot | 4 ++++ + po/zh_CN.po | 4 ++++ + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py +index 9214ad5..3d3029e 100644 +--- a/blivet/devicefactory.py ++++ b/blivet/devicefactory.py +@@ -39,6 +39,7 @@ from .partitioning import TotalSizeSet + from .partitioning import do_partitioning + from .size import Size + from .static_data import luks_data ++from .i18n import _ + + import gi + gi.require_version("BlockDev", "2.0") +@@ -704,7 +705,7 @@ class DeviceFactory(object): + # the container + size = self._get_device_size() + if size <= Size(0): +- raise DeviceFactoryError("not enough free space for new device") ++ raise DeviceFactoryError(_("not enough free space for new device")) + + parents = self._get_parent_devices() + +@@ -1302,7 +1303,7 @@ class LVMFactory(DeviceFactory): + self.size += self.device.size + + if self.size == Size(0): +- raise DeviceFactoryError("not enough free space for new device") ++ raise DeviceFactoryError(_("not enough free space for new device")) + else: + super(LVMFactory, self)._handle_no_size() + +diff --git a/po/blivet.pot b/po/blivet.pot +index 29f34b9..c8526de 100644 +--- a/po/blivet.pot ++++ b/po/blivet.pot +@@ -50,6 +50,10 @@ msgstr "" + msgid "FCoE not available" + msgstr "" + ++#: ../blivet/devicefactory.py:708 ../blivet/devicefactory.py:1306 ++msgid "not enough free space for new device" ++msgstr "" ++ + #: ../blivet/zfcp.py:62 + msgid "You have not specified a device number or the number is invalid" + msgstr "" +diff --git a/po/zh_CN.po b/po/zh_CN.po +index 480801d..05c635e 100644 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -71,6 +71,10 @@ msgstr "" + msgid "FCoE not available" + msgstr "FCoE 不可用" + ++#: ../blivet/devicefactory.py:708 ../blivet/devicefactory.py:1306 ++msgid "not enough free space for new device" ++msgstr "新设备没有足够的剩余空间" ++ + #: ../blivet/zfcp.py:62 + msgid "You have not specified a device number or the number is invalid" + msgstr "您没有指定设备号码或号码无效" +-- +2.27.0 +