Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Katerina Koukiou
11c99a93a3 Add necessary backend for fixing rhbz#2351824
Relevant: rhbz#2351824
2025-09-05 14:06:37 +02:00
Packit
90982f7282 Update to 43.37 upstream release
Upstream tag: anaconda-43.37
Upstream commit: 33047d14

Commit authored by Packit automation (https://packit.dev/)
2025-08-25 12:53:23 +00:00
Packit
d404a7ffea Update to 43.36 upstream release
Upstream tag: anaconda-43.36
Upstream commit: 7da0ca11

Commit authored by Packit automation (https://packit.dev/)
2025-08-19 04:58:54 +00:00
6 changed files with 251 additions and 4 deletions

2
.gitignore vendored
View file

@ -468,3 +468,5 @@
/anaconda-43.32.tar.bz2
/anaconda-43.33.tar.bz2
/anaconda-43.34.tar.bz2
/anaconda-43.36.tar.bz2
/anaconda-43.37.tar.bz2

View file

@ -46,30 +46,38 @@ actions:
- 'bash -c "ls -1 anaconda-*.tar.bz2"'
jobs:
# Propose downstream (Fedora)
- job: propose_downstream
trigger: release
packages: [anaconda-fedora]
dist_git_branches:
- main
- f43
# Tests on PR (Fedora)
- job: tests
trigger: pull_request
packages: [anaconda-fedora]
targets:
- fedora-rawhide
- fedora-43
# COPR builds on PR (Fedora)
- job: copr_build
trigger: pull_request
packages: [anaconda-fedora]
targets:
- fedora-rawhide
- fedora-43
- fedora-eln
# COPR builds on commit (Fedora): single job with multiple targets (add ELN on main)
- job: copr_build
trigger: commit
packages: [anaconda-fedora]
targets:
- fedora-rawhide
- fedora-43
- fedora-eln
branch: main
owner: "@rhinstaller"

213
6597.patch Normal file
View file

@ -0,0 +1,213 @@
From db5bd04346372049f2b4f41484ca014e792e8939 Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Thu, 28 Aug 2025 12:21:26 +0200
Subject: [PATCH 1/2] Add GetFreeSpaceForSystem API
For Gtk the GetFileSystemFreeSpace API was used to get free space on
mount points that will be used for system installaion. The API is not
usable for cockpit storage scenario which creates and formats the
devices before using in MANUAL partitioning (partitions assignment with
reformat=False) so they are handled as having existing formats for which
DeviceFormat.free function is used. DeviceFormat.free blivet API is
targeted specifically for file system shrinking, and for unshrinkable
file systems (for example XFS) returns 0.
The GetFileSysetemFreeSpace API is used also for decisions about space
required for downloading and installation of DNF payload and devices
used for payload downloading so potentially handling some existing
partitions / formats.
The patch is adding new API specifically used for obtaining free space
available for system installation. It explicitly assumes the file
systems are empty (freshly formatted) and therefore suitable
DeviceFormat.free_space_estimate blivet API is used to calculate the
value. Which goes in line with installer requirement for partitions used
for system installation (typically '/') to be formatted (either by
Cockpit Storage or Anaconda).
Related: INSTALLER-4160
---
.../modules/storage/devicetree/model.py | 47 ++++++++++++++-----
.../modules/storage/devicetree/viewer.py | 10 ++++
.../storage/devicetree/viewer_interface.py | 10 ++++
.../storage/test_module_device_tree.py | 33 +++++++++++++
4 files changed, 89 insertions(+), 11 deletions(-)
diff --git a/pyanaconda/modules/storage/devicetree/model.py b/pyanaconda/modules/storage/devicetree/model.py
index ade8072f981..aebe6a2117b 100644
--- a/pyanaconda/modules/storage/devicetree/model.py
+++ b/pyanaconda/modules/storage/devicetree/model.py
@@ -150,14 +150,7 @@ def mountpoints(self):
def root_device(self):
return self.fsset.root_device
- def get_file_system_free_space(self, mount_points=("/", "/usr")):
- """Get total file system free space on the given mount points.
-
- Calculates total free space in / and /usr, by default.
-
- :param mount_points: a list of mount points
- :return: a total size
- """
+ def _get_mount_points_free_space(self, mount_points, calculate):
free = Size(0)
btrfs_volumes = []
@@ -174,12 +167,44 @@ def get_file_system_free_space(self, mount_points=("/", "/usr")):
else:
btrfs_volumes.append(device.volume)
+ mp_size = calculate(device)
+ log.debug("Free size of mount point %s: %s", mount_point, mp_size.get_bytes())
+ free += mp_size
+
+ return free
+
+ def get_file_system_free_space(self, mount_points):
+ """Get total file system free space on the given mount points.
+
+ WARNING: For existing mount points the size available for resizing is
+ obtained. It means that for non resizeable format types it returns the
+ value 0.
+
+ :param mount_points: a list of mount points
+ :return: a total size
+ """
+ def calculate(device):
if device.format.exists:
- free += device.format.free
+ return device.format.free
else:
- free += device.format.free_space_estimate(device.size)
+ return device.format.free_space_estimate(device.size)
- return free
+ return self._get_mount_points_free_space(mount_points, calculate)
+
+ def get_free_space_for_system(self, mount_points):
+ """Get total space available for system on the given mount points.
+
+ Counts the free space available on empty formatted devices.
+
+ :param mount_points: a list of mount points
+ :return: a total size
+ """
+ def calculate(device):
+ if device.format.exists:
+ log.debug("Free size calculation: %s considered as formatted", device)
+ return device.format.free_space_estimate(device.size)
+
+ return self._get_mount_points_free_space(mount_points, calculate)
def get_disk_free_space(self, disks=None):
"""Get total free space on the given disks.
diff --git a/pyanaconda/modules/storage/devicetree/viewer.py b/pyanaconda/modules/storage/devicetree/viewer.py
index 49e9bf23028..6a11e4428b3 100644
--- a/pyanaconda/modules/storage/devicetree/viewer.py
+++ b/pyanaconda/modules/storage/devicetree/viewer.py
@@ -458,6 +458,16 @@ def get_file_system_free_space(self, mount_points):
"""
return self.storage.get_file_system_free_space(mount_points).get_bytes()
+ def get_free_space_for_system(self, mount_points):
+ """Get total space available for system on the given mount points.
+
+ Counts the free space available on empty formatted devices.
+
+ :param mount_points: a list of mount points
+ :return: a total size
+ """
+ return self.storage.get_free_space_for_system(mount_points).get_bytes()
+
def get_disk_free_space(self, disk_ids):
"""Get total free space on the given disks.
diff --git a/pyanaconda/modules/storage/devicetree/viewer_interface.py b/pyanaconda/modules/storage/devicetree/viewer_interface.py
index 84b6f701f21..06b94452a67 100644
--- a/pyanaconda/modules/storage/devicetree/viewer_interface.py
+++ b/pyanaconda/modules/storage/devicetree/viewer_interface.py
@@ -155,6 +155,16 @@ def GetFileSystemFreeSpace(self, mount_points: List[Str]) -> UInt64:
"""
return self.implementation.get_file_system_free_space(mount_points)
+ def GetFreeSpaceForSystem(self, mount_points: List[Str]) -> UInt64:
+ """Get total space available for system on the given mount points.
+
+ Counts the free space available on empty formatted devices.
+
+ :param mount_points: a list of mount points
+ :return: a total size
+ """
+ return self.implementation.get_free_space_for_system(mount_points)
+
def GetDiskFreeSpace(self, disk_ids: List[Str]) -> UInt64:
"""Get total free space on the given disks.
diff --git a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py
index 6d4267e9ca6..8a612144884 100644
--- a/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py
+++ b/tests/unit_tests/pyanaconda_tests/modules/storage/test_module_device_tree.py
@@ -621,6 +621,39 @@ def test_get_file_system_free_space(self):
assert total_size < Size("10 GiB").get_bytes()
assert total_size > Size("8 GiB").get_bytes()
+ def test_get_free_space_for_system(self):
+ """Test GetFreeSpaceForSystem."""
+ self._add_device(StorageDevice(
+ "dev1",
+ fmt=get_format("ext4", mountpoint="/"),
+ size=Size("5 GiB"))
+ )
+
+ self._add_device(StorageDevice(
+ "dev2",
+ fmt=get_format("ext4", mountpoint="/usr"),
+ size=Size("5 GiB"))
+ )
+
+ # /home should not be counted in
+ self._add_device(StorageDevice(
+ "dev3",
+ fmt=get_format("ext4", mountpoint="/home"),
+ size=Size("5 GiB"))
+ )
+
+ total_size = self.interface.GetFreeSpaceForSystem([])
+ assert total_size == 0
+
+ total_size = self.interface.GetFreeSpaceForSystem(["/", "/usr"])
+ assert total_size < Size("10 GiB").get_bytes()
+ assert total_size > Size("8 GiB").get_bytes()
+
+ # /var does not exist
+ total_size = self.interface.GetFreeSpaceForSystem(["/", "/var"])
+ assert total_size < Size("6 GiB").get_bytes()
+ assert total_size > Size("4 GiB").get_bytes()
+
@patch("blivet.formats.disklabel.DiskLabel.free", new_callable=PropertyMock)
@patch("blivet.formats.disklabel.DiskLabel.get_platform_label_types")
def test_get_disk_free_space(self, label_types, free):
From a4480c8acbc3bd15cc8d9630751a400136ac55da Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Thu, 28 Aug 2025 12:42:42 +0200
Subject: [PATCH 2/2] Use new more suitable API for Gtk UI required space check
Related: INSTALLER-4160
---
pyanaconda/ui/lib/space.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/lib/space.py b/pyanaconda/ui/lib/space.py
index b81adcb0125..c3078908c75 100644
--- a/pyanaconda/ui/lib/space.py
+++ b/pyanaconda/ui/lib/space.py
@@ -52,7 +52,7 @@ def __init__(self, payload):
def _calculate_free_space(self):
"""Calculate the available space."""
- return Size(self.device_tree.GetFileSystemFreeSpace(("/", "/usr")))
+ return Size(self.device_tree.GetFreeSpaceForSystem(("/", "/usr")))
def _calculate_needed_space(self):
"""Calculate the needed space."""

View file

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 1.11.0.
The file was generated using packit 1.11.0.post1.dev3+g351a3979f.

View file

@ -1,7 +1,7 @@
Summary: Graphical system installer
Name: anaconda
Version: 43.34
Release: 1%{?dist}
Version: 43.37
Release: 2%{?dist}
ExcludeArch: %{ix86}
License: GPL-2.0-or-later
URL: http://fedoraproject.org/wiki/Anaconda
@ -16,6 +16,9 @@ Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{vers
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
# Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2351824
Patch: https://patch-diff.githubusercontent.com/raw/rhinstaller/anaconda/pull/6597.patch
%if ! 0%{?rhel}
%bcond_without glade
%bcond_without live
@ -513,6 +516,27 @@ rm -rf \
%{_prefix}/libexec/anaconda/dd_*
%changelog
* Mon Sep 05 2025 Katerina Koukiou <kkoukiou@redhat.com> - 43.37-2
- Add GetFreeSpaceForSystem API (kkoukiou)
* Mon Aug 25 2025 Packit <hello@packit.dev> - 43.37-1
- Log correct boot option for iSCSI boot without iBFT (jstodola)
- Get full nevra string from dnf instead of composing it (pkratoch)
- Add release notes for RDP kickstart support (adamkankovsky)
- test: Enable kickstart RDP command in Anaconda (adamkankovsky)
- Enable kickstart RDP command in Anaconda (adamkankovsky)
- storage: devicetree: read VERSION or VERSION_CODENAME for identifying OS from
os-release (k.koukiou)
* Tue Aug 19 2025 Packit <hello@packit.dev> - 43.36-1
- packit: drive jobs from supported_releases per branch; dedupe and group
targets (k.koukiou)
- Fix pylint warnings caused by dynamic kickstart command imports (k.koukiou)
- core: kickstart: implement OS-release based version detection (k.koukiou)
- build: decouple BASE_CONTAINER from branch configuration (k.koukiou)
- workflows: remove hardcoded CONTAINER_TAG="lorax" usage (k.koukiou)
- dracut module requires generic initramfs (jstodola)
* Tue Aug 05 2025 Packit <hello@packit.dev> - 43.34-1
- Document Lorax template patching (mkolman)

View file

@ -1 +1 @@
SHA512 (anaconda-43.34.tar.bz2) = 536ea598a71c7f6b5a7a233d2db14ca28206fe9fb4fc7fb906415d45f21843cbdde4c4bbd759c4713ff8fa26d8fb826a38eb062457c0bafedacc7d59ab92862b
SHA512 (anaconda-43.37.tar.bz2) = d97e1383f733cbf2fb52c003100e9fee7980420d68d37be3a1f1c97262f2033023e933c7f9016c1ae1364ff8ecfa0a588698e9d2aae221dfc540e1e22231dbf3