python-blivet/backport-Add-a-basic-read-only-support-for-UDF-filesystem.patch

80 lines
2.9 KiB
Diff
Raw Normal View History

2023-02-16 01:20:11 +00:00
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