!104 add udf-filesystem support

From: @han_hui_hui 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2023-02-16 01:30:13 +00:00 committed by Gitee
commit c945b283d8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 88 additions and 1 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
@@ -75,7 +75,7 @@ def run(self):
# 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:
log.debug("ignoring partition %s on %s", name, disk.format.type)
return
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.6.1
Release: 2
Release: 3
Epoch: 1
Summary: A python module for system storage configuration
License: LGPL-2.1-or-later
@ -19,6 +19,8 @@ BuildRequires: python2-devel python2-setuptools
Patch0: 0001-force-lvm-plugin.patch
Patch1: fix-the-long-hostname.patch
patch6001: backport-Add-a-basic-read-only-support-for-UDF-filesystem.patch
%ifarch sw_64
patch9001: blivet-3.4.2-sw.patch
%endif
@ -127,6 +129,12 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install
%doc README.md
%changelog
* Mon Feb 13 2023 hanhuihui<hanhuihui5@huawei.com> - 1:3.6.1-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add udf-filesystem support
* Sat Feb 11 2023 Wenlong Zhang<zhangwenlong@loongson.cn> - 1:3.6.1-2
- Type:bugfix
- ID:NA