add udf-filesystem support

(cherry picked from commit 5f8b213a05ea179fe80a3d8b7e9be47f79241ec6)
This commit is contained in:
han_hui_hui 2023-02-13 12:02:23 +00:00 committed by openeuler-sync-bot
parent 7595083d3d
commit 6403d5253a
2 changed files with 91 additions and 5 deletions

View File

@ -0,0 +1,79 @@
From bc7366a03e86a3ea0402dc34ddedbc971b82e2c1 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Mon, 21 Nov 2022 11:04:40 +0100
Subject: [PATCH] Add a basic read-only support for UDF filesystem
Conflict:del doc and tests
Reference:https://github.com/storaged-project/blivet/commit/bc7366a03e86a3ea0402dc34ddedbc971b82e2c1
---
blivet/formats/fs.py | 12 ++++++++++++
blivet/populator/helpers/disklabel.py | 2 +-
blivet/populator/helpers/partition.py | 2 +-
blivet/tasks/fsmount.py | 4 ++++
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
index 8c346aa53..8df881b82 100644
--- a/blivet/formats/fs.py
+++ b/blivet/formats/fs.py
@@ -1338,6 +1338,18 @@ class Iso9660FS(FS):
register_device_format(Iso9660FS)
+class UDFFS(FS):
+
+ """ UDF filesystem. """
+ _type = "udf"
+ _modules = ["udf"]
+ _supported = True
+ _mount_class = fsmount.UDFFSMount
+
+
+register_device_format(UDFFS)
+
+
class NoDevFS(FS):
""" nodev filesystem base class """
diff --git a/blivet/populator/helpers/disklabel.py b/blivet/populator/helpers/disklabel.py
index db10638ef..842cd3081 100644
--- a/blivet/populator/helpers/disklabel.py
+++ b/blivet/populator/helpers/disklabel.py
@@ -42,7 +42,7 @@ def match(cls, data, device):
# XXX ignore disklabels on multipath or biosraid member disks
return (bool(udev.device_get_disklabel_type(data)) and
not udev.device_is_biosraid_member(data) and
- udev.device_get_format(data) != "iso9660" and
+ udev.device_get_format(data) not in ("iso9660", "udf") and
not (device.is_disk and udev.device_get_format(data) == "mpath_member"))
def _get_kwargs(self):
diff --git a/blivet/populator/helpers/partition.py b/blivet/populator/helpers/partition.py
index 8659bd483..9257407e6 100644
--- a/blivet/populator/helpers/partition.py
+++ b/blivet/populator/helpers/partition.py
@@ -77,7 +77,7 @@ class PartitionDevicePopulator(DevicePopulator):
# For partitions on disklabels parted cannot make sense of, go ahead
# and instantiate a PartitionDevice so our view of the layout is
# complete.
- if not disk.partitionable or disk.format.type == "iso9660" or disk.format.hidden:
+ if not disk.partitionable or disk.format.type in ("iso9660", "udf") or disk.format.hidden:
# there's no need to filter partitions on members of multipaths or
# fwraid members from lvm since multipath and dmraid are already
# active and lvm should therefore know to ignore them
diff --git a/blivet/tasks/fsmount.py b/blivet/tasks/fsmount.py
index 65b2470ac..a7f493dd4 100644
--- a/blivet/tasks/fsmount.py
+++ b/blivet/tasks/fsmount.py
@@ -163,6 +163,10 @@ class Iso9660FSMount(FSMount):
options = ["ro"]
+class UDFFSMount(FSMount):
+ options = ["ro"]
+
+
class NoDevFSMount(FSMount):
@property

View File

@ -3,7 +3,7 @@
Name: python-blivet
Version: 3.4.2
Release: 6
Release: 7
Epoch: 1
Summary: A python module for system storage configuration
License: LGPLv2+
@ -23,13 +23,14 @@ Patch9001: 0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch
%ifarch sw_64
Patch9002: blivet-3.4.2-sw.patch
%endif
patch9003: Incomplete-Chineseization-of-disk-mount.patch
patch9003: Incomplete-Chineseization-of-disk-mount.patch
patch6001: backport-Exclude-unusable-disks-from-PartitionFactory-1.patch
patch6002: backport-Exclude-unusable-disks-from-PartitionFactory-2.patch
patch6001: backport-Exclude-unusable-disks-from-PartitionFactory-1.patch
patch6002: backport-Exclude-unusable-disks-from-PartitionFactory-2.patch
%if 0%(test `uname -m` == "loongarch64" && echo 1)
Patch6003: 0001-add-loongarch64-support-for-blivet.patch
Patch6003: 0001-add-loongarch64-support-for-blivet.patch
%endif
patch6004: backport-Add-a-basic-read-only-support-for-UDF-filesystem.patch
%description
The python-blivet package is a python module for examining and modifying
@ -130,6 +131,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install
%doc README.md
%changelog
* Mon Feb 13 2023 hanhuihui<hanhuihui5@huawei.com> - 1:3.4.2-7
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add udf-filesystem support
* Sat Feb 11 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 1:3.4.2-6
- Type:bugfix
- ID:NA