diff --git a/0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch b/0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch new file mode 100644 index 0000000000000000000000000000000000000000..3ec539c47516371e0f3ae6e709010f93acee45c4 --- /dev/null +++ b/0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch @@ -0,0 +1,36 @@ +From 0b672ff4527ccbb7b7527f1ab2394fa36738b27f Mon Sep 17 00:00:00 2001 +From: Vojtech Trefny +Date: Thu, 27 Jan 2022 17:53:06 +0100 +Subject: [PATCH 1/1] Make sure we mount the top level subvolume when mounting + btrfs + +If we don't specify the subvolid=5 we end up mounting the default +subvolume and if it isn't the top volume one, we can't remove +other subvolumes "higher" in the hierarchy. + +This makes the installer crash when reinstalling over a preexisting +btrfs installation, for example the default openSUSE installation +where the default subvolume is a post installation snapshot. + +Resolves: rhbz#2026205 +--- + blivet/devices/btrfs.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/blivet/devices/btrfs.py b/blivet/devices/btrfs.py +index 3b9374fc..6629ba95 100644 +--- a/blivet/devices/btrfs.py ++++ b/blivet/devices/btrfs.py +@@ -123,7 +123,8 @@ class BTRFSDevice(StorageDevice): + else: + tmpdir = tempfile.mkdtemp(prefix=self._temp_dir_prefix) + try: +- util.mount(device=fmt.device, mountpoint=tmpdir, fstype=fmt.type) ++ util.mount(device=fmt.device, mountpoint=tmpdir, fstype=fmt.type, ++ options=fmt.mountopts) + except errors.FSError as e: + log.debug("btrfs temp mount failed: %s", e) + raise +-- +2.33.0 + diff --git a/python-blivet.spec b/python-blivet.spec index e2ce0c5c9607aea38a09b47de6f5a3578f44f2b7..81fd626a3ea6940ebaf6413e57d351c647ce4ee3 100644 --- a/python-blivet.spec +++ b/python-blivet.spec @@ -3,7 +3,7 @@ Name: python-blivet Version: 3.4.2 -Release: 1 +Release: 2 Epoch: 1 Summary: A python module for system storage configuration License: LGPLv2+ @@ -20,6 +20,7 @@ BuildRequires: python2-devel python2-setuptools Patch0: 0001-force-lvm-plugin.patch Patch1: fix-the-long-hostname.patch Patch9000: fix-allocate-partitions-threw-exception-when-raid.patch +Patch9001: 0001-Make-sure-we-mount-the-top-level-subvolume-when-moun.patch @@ -122,6 +123,9 @@ make PYTHON=%{__python2} DESTDIR=%{buildroot} install %doc README.md %changelog +* Thu Jul 28 2022 Chenxi Mao - 3.4.2-2 +- Fix remove subvolumes error on brtfs during installation. + * Wed Dec 15 2021 yangcheng - 3.4.2-1 - DESC:Upgrade to 3.4.2