Compare commits

...

3 Commits

Author SHA1 Message Date
Marian Csontos 5bfbcda19c tests: Remove obsolete boom-boot-grub2 subpackage 2023-11-29 01:20:47 +00:00
Marian Csontos 2fedabc7fa Update boom-boot to upstream release 1.6.0
Resolves: RHEL-16813
2023-11-23 10:25:50 +01:00
Marian Csontos a9b051e5a3 Update boom-boot to upstream release 1.5.1
Resolves: #2189518
2023-05-16 18:29:11 +02:00
10 changed files with 19 additions and 222 deletions

1
.boom-boot.metadata Normal file
View File

@ -0,0 +1 @@
37c2ab76ae0fb2db05f3358f795b32208472aa44 boom-1.6.0.tar.gz

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
/boom-1.2.tar.gz
/boom-1.3.tar.gz
/boom-1.4.tar.gz
/boom-1.5.1.tar.gz
/boom-1.6.0.tar.gz

View File

@ -1,31 +0,0 @@
From 841e7d3d0dc7ad194e0b82d8cd0930cef1a95301 Mon Sep 17 00:00:00 2001
From: Marian Csontos <mcsontos@redhat.com>
Date: Fri, 29 Nov 2019 10:23:44 +0100
Subject: [PATCH 1/5] man: Fix line starting with '
Lines starting with ' result in macro not defined warnings:
1117: warning: macro `boom' not defined
1118: warning: macro `+'' not defined
---
man/man8/boom.8 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man/man8/boom.8 b/man/man8/boom.8
index 7b862e7..9eee048 100644
--- a/man/man8/boom.8
+++ b/man/man8/boom.8
@@ -1168,8 +1168,8 @@ describing the properties of the configured host profiles.
The list of fields to display is given with \fB--options\fP as a comma
separated list of field names. To obtain a list of available fields run
-'\fBboom host list -o help\fP'. If the list of fields begins with the
-'\fB+\fP' character the specified fields are appended to the default
+\&'\fBboom host list -o help\fP'. If the list of fields begins with the
+\&'\fB+\fP' character the specified fields are appended to the default
field list. Otherwise the given list of fields replaces the default set
of report fields.
--
2.34.3

View File

@ -1,43 +0,0 @@
From a3e33031fb4051eb9d76f950b536b513c58be861 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 Jun 2022 07:47:04 -0400
Subject: [PATCH 2/5] boom.bootloader: initialise _last_path before parsing
BootEntry
The path from which a boot entry was read can be useful context for
logging messages, particularly when a boot entry has been corrupted or
manually edited (so that the boot_id no longer matches the expected
value).
Move the initialisation of this member before parsing the boot entry, so
that the value is available for log messages.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
(cherry picked from commit fafa77556e442fe4f016c23eb9739f1015fa9eb8)
---
boom/bootloader.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boom/bootloader.py b/boom/bootloader.py
index aa9131f..185195d 100644
--- a/boom/bootloader.py
+++ b/boom/bootloader.py
@@ -1484,6 +1484,7 @@ class BootEntry(object):
entry_basename = basename(entry_file)
_log_debug("Loading BootEntry from '%s'" % entry_basename)
+ self._last_path = entry_file
with open(entry_file, "r") as ef:
for line in ef:
@@ -1536,7 +1537,6 @@ class BootEntry(object):
entry_basename)
self.read_only = True
- self._last_path = entry_file
self._unwritten = False
def __init__(self, title=None, machine_id=None, osprofile=None,
--
2.34.3

View File

@ -1,47 +0,0 @@
From faf43a2b923dd2e558da1e48978541389844f464 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 Jun 2022 07:50:11 -0400
Subject: [PATCH 3/5] boom.bootloader: improve warning for entries with no
root_device
A boot entry with no root_device= is invalid. Log the path to the file
rather than the boot_id since this may have changed if the entry is
corrupt/modified, and is not included in the file name for system
provided boot entries.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
(cherry picked from commit b70d2ad6a4b8f7ef7816426bcb18b6f247a52dca)
---
boom/bootloader.py | 3 +--
tests/bootloader_tests.py | 1 +
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/boom/bootloader.py b/boom/bootloader.py
index 185195d..bbf7fd5 100644
--- a/boom/bootloader.py
+++ b/boom/bootloader.py
@@ -720,8 +720,7 @@ class BootParams(object):
# The root_device key is handled specially since it is required
# for a valid BootEntry.
if name == 'root_device' and not value:
- _log_warn("Entry with boot_id=%s has no root_device"
- % be.boot_id)
+ _log_warn("No root_device for entry at %s" % be._last_path)
setattr(bp, name, "")
def is_add(opt):
diff --git a/tests/bootloader_tests.py b/tests/bootloader_tests.py
index 129000d..ace82bd 100644
--- a/tests/bootloader_tests.py
+++ b/tests/bootloader_tests.py
@@ -158,6 +158,7 @@ class MockBootEntry(object):
expand_options = "root=/dev/mapper/rhel-root ro rhgb quiet"
_osp = None
_entry_data = {}
+ _last_path = "/some/path/to/somewhere"
class BootEntryBasicTests(unittest.TestCase):
--
2.34.3

View File

@ -1,46 +0,0 @@
From 31f95734f0d6f90f256754377207f5373ff9015c Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 Jun 2022 07:54:29 -0400
Subject: [PATCH 4/5] boom.bootloader: do not allow deletion of read-only boot
entries
Currently when attempting to delete an entry that has been marked
read-only boom generates a misleading error message:
# boom delete 7fce1e5
Entry does not exist: /boot/loader/entries/619c4d9f1efa4cf7bd76f149f12138a0-7fce1e5-5.14.0-108.el9.x86_64.conf
Boom should not attempt to delete entries that are marked read-only;
these are either system provided entries, or entries that have been
modified outside of boom's control. Reject attempts to delete these
with an error that indicates the reason they cannot be removed:
# boom delete f6f8df5
Cannot delete read-only boot entry: /boot/loader/entries/68f613d8774e41e792fad28212cfedae-4.18.0-348.el8.x86_64.conf
Resolves: #10
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
(cherry picked from commit 42f66737e1d7dec432cd7fc330f87304a585c308)
---
boom/bootloader.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/boom/bootloader.py b/boom/bootloader.py
index bbf7fd5..a81ea84 100644
--- a/boom/bootloader.py
+++ b/boom/bootloader.py
@@ -2445,6 +2445,10 @@ class BootEntry(object):
:raises: ``OsError`` if an error occurs removing the file or
``ValueError`` if the entry does not exist.
"""
+ if self.read_only:
+ raise ValueError("Cannot delete read-only boot "
+ "entry: %s" % self._last_path)
+
if not path_exists(self._entry_path):
raise ValueError("Entry does not exist: %s" % self._entry_path)
try:
--
2.34.3

View File

@ -1,35 +0,0 @@
From cd0c4e28b0b2de9000edd5b4b56612d610337552 Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Tue, 14 Jun 2022 09:31:33 -0400
Subject: [PATCH 5/5] boom.command: add new os-release values to Red Hat
optional keys list
Add "Red Hat Enterprise Linux" (NAME for el8 onwards), and "Fedora
Linux" (NAME for fc35 onwards) to the table of names to automatically
enable grub optional keys for.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
(cherry picked from commit 0cb2d8da9de6fa01ebc5193e7ab6710a9c7b7125)
---
boom/command.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/boom/command.py b/boom/command.py
index 0ef66ee..07c0616 100644
--- a/boom/command.py
+++ b/boom/command.py
@@ -1094,9 +1094,11 @@ def _default_optional_keys(osp):
"""
all_optional_keys = "grub_users grub_arg grub_class id"
_default_optional_keys = [
+ "Red Hat Enterprise Linux",
"Red Hat Enterprise Linux Server",
"Red Hat Enterprise Linux Workstation",
"CentOS Linux",
+ "Fedora Linux",
"Fedora"
]
if osp.os_name in _default_optional_keys:
--
2.34.3

View File

@ -2,21 +2,13 @@
%global sphinx_docs 1
Name: boom-boot
Version: 1.4
Release: 4%{?dist}
Version: 1.6.0
Release: 1%{?dist}
Summary: %{summary}
License: GPLv2
License: GPL-2.0-only
URL: https://github.com/snapshotmanager/boom
Source0: https://github.com/snapshotmanager/boom/archive/%{version}/boom-%{version}.tar.gz
Patch1: 0001-man-Fix-line-starting-with.patch
# Minor improvements:
Patch2: 0002-boom.bootloader-initialise-_last_path-before-parsing.patch
Patch3: 0003-boom.bootloader-improve-warning-for-entries-with-no-.patch
# BZ 2096447:
Patch4: 0004-boom.bootloader-do-not-allow-deletion-of-read-only-b.patch
# BZ 2096368:
Patch5: 0005-boom.command-add-new-os-release-values-to-Red-Hat-op.patch
BuildArch: noarch
@ -28,6 +20,7 @@ BuildRequires: python3-dbus
BuildRequires: python3-sphinx
%endif
BuildRequires: make
BuildRequires: systemd-rpm-macros
Requires: python3-boom = %{version}-%{release}
Requires: %{name}-conf = %{version}-%{release}
@ -80,13 +73,7 @@ include this support in both Red Hat Enterprise Linux 7 and Fedora).
This package provides configuration files for boom.
%prep
%setup -n boom-%{version}
# NOTE: Do not use backup extension - MANIFEST.in is picking them
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%autosetup -p1 -n boom-%{version}
%build
%if 0%{?sphinx_docs}
@ -114,6 +101,9 @@ mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man5
install -m 644 man/man8/boom.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8
install -m 644 man/man5/boom.5 ${RPM_BUILD_ROOT}/%{_mandir}/man5
mkdir -p ${RPM_BUILD_ROOT}/%{_systemdgeneratordir}
install -m 755 systemd/snapshot-remount-fs ${RPM_BUILD_ROOT}/%{_systemdgeneratordir}
rm doc/Makefile
rm doc/conf.py
@ -125,6 +115,7 @@ rm doc/conf.py
%license COPYING
%doc README.md
%{_bindir}/boom
%{_systemdgeneratordir}/snapshot-remount-fs
%doc %{_mandir}/man*/boom.*
%files -n python3-boom
@ -147,6 +138,12 @@ rm doc/conf.py
%changelog
* Wed Nov 22 2023 Marian Csontos <mcsontos@redhat.com> - 1.6.0-1
- Update to release 1.6.0.
* Tue May 16 2023 Marian Csontos <mcsontos@redhat.com> - 1.5.1-1
- Update to release 1.5.1.
* Wed Jul 13 2022 Marian Csontos <mcsontos@redhat.com> 1.4-4
- Fix handling of read-only entries.
- Add OS names for recent versions.

View File

@ -1 +1 @@
SHA512 (boom-1.4.tar.gz) = f2f4ee658a8f1b670b0dd15c56a7f7c9eef047e2ca9aeaa7c54c619e68428c8225c3c115d2d12f0b055091752e8ee5c8be266ddb49ae4a036c6aa7cf32e03861
SHA512 (boom-1.6.0.tar.gz) = 533ddbfaaa532a2a5a4553f8fa4c94cbf872df05c09e47cbdbb76a8191468b8b4ea4b385c88f536ec0c76e83c8fe8695019f9f6ebd8c9985cd8c399a4d5a2c98

View File

@ -48,5 +48,4 @@
vgremove -ff boomvg; losetup -D; rm -f /dev/shm/boompv
required_packages:
- boom-boot
- boom-boot-grub2
- lvm2