1 Star 0 Fork 22

hanhuihui / python-blivet

forked from src-openEuler / python-blivet 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Add-a-basic-read-only-support-for-UDF-filesystem.patch 2.91 KB
一键复制 编辑 原始数据 按行查看 历史
hanhuihui 提交于 2023-02-16 01:20 . add udf-filesystem support
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/han_hui_hui/python-blivet.git
git@gitee.com:han_hui_hui/python-blivet.git
han_hui_hui
python-blivet
python-blivet
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891