From 142be1096edffa988b527673e2a3a9a5087e2e75 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 27 2022 11:26:09 +0000 Subject: import boom-boot-1.4-4.el9 --- diff --git a/.boom-boot.metadata b/.boom-boot.metadata index a7b0260..4ea481f 100644 --- a/.boom-boot.metadata +++ b/.boom-boot.metadata @@ -1 +1 @@ -4c95e888f7aecd9dd809c6f0d44ce650a5ae07da SOURCES/boom-1.3.tar.gz +f7b6e12ebb69e4061b9ab0aa27b58d5e8b215970 SOURCES/boom-1.4.tar.gz diff --git a/.gitignore b/.gitignore index b3db033..16ff0ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/boom-1.3.tar.gz +SOURCES/boom-1.4.tar.gz diff --git a/SOURCES/0001-etc-Remove-executable-permission-from-etc-default-bo.patch b/SOURCES/0001-etc-Remove-executable-permission-from-etc-default-bo.patch deleted file mode 100644 index d454da1..0000000 --- a/SOURCES/0001-etc-Remove-executable-permission-from-etc-default-bo.patch +++ /dev/null @@ -1,22 +0,0 @@ - etc/default/boom | 0 - tests/bootloader_configs/boom_off/etc/default/boom | 0 - tests/bootloader_configs/boom_on/etc/default/boom | 0 - tests/bootloader_configs/no_grub_d/etc/default/boom | 0 - 4 files changed, 0 insertions(+), 0 deletions(-) - mode change 100755 => 100644 etc/default/boom - mode change 100755 => 100644 tests/bootloader_configs/boom_off/etc/default/boom - mode change 100755 => 100644 tests/bootloader_configs/boom_on/etc/default/boom - mode change 100755 => 100644 tests/bootloader_configs/no_grub_d/etc/default/boom - -diff --git a/etc/default/boom b/etc/default/boom -old mode 100755 -new mode 100644 -diff --git a/tests/bootloader_configs/boom_off/etc/default/boom b/tests/bootloader_configs/boom_off/etc/default/boom -old mode 100755 -new mode 100644 -diff --git a/tests/bootloader_configs/boom_on/etc/default/boom b/tests/bootloader_configs/boom_on/etc/default/boom -old mode 100755 -new mode 100644 -diff --git a/tests/bootloader_configs/no_grub_d/etc/default/boom b/tests/bootloader_configs/no_grub_d/etc/default/boom -old mode 100755 -new mode 100644 diff --git a/SOURCES/0001-man-Fix-line-starting-with.patch b/SOURCES/0001-man-Fix-line-starting-with.patch new file mode 100644 index 0000000..e1349e0 --- /dev/null +++ b/SOURCES/0001-man-Fix-line-starting-with.patch @@ -0,0 +1,31 @@ +From 841e7d3d0dc7ad194e0b82d8cd0930cef1a95301 Mon Sep 17 00:00:00 2001 +From: Marian Csontos +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 + diff --git a/SOURCES/0002-boom.bootloader-initialise-_last_path-before-parsing.patch b/SOURCES/0002-boom.bootloader-initialise-_last_path-before-parsing.patch new file mode 100644 index 0000000..1c303fa --- /dev/null +++ b/SOURCES/0002-boom.bootloader-initialise-_last_path-before-parsing.patch @@ -0,0 +1,43 @@ +From a3e33031fb4051eb9d76f950b536b513c58be861 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +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 +(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 + diff --git a/SOURCES/0002-man-Fix-line-starting-with.patch b/SOURCES/0002-man-Fix-line-starting-with.patch deleted file mode 100644 index f747576..0000000 --- a/SOURCES/0002-man-Fix-line-starting-with.patch +++ /dev/null @@ -1,18 +0,0 @@ - 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. - diff --git a/SOURCES/0003-boom.bootloader-improve-warning-for-entries-with-no-.patch b/SOURCES/0003-boom.bootloader-improve-warning-for-entries-with-no-.patch new file mode 100644 index 0000000..a593aa4 --- /dev/null +++ b/SOURCES/0003-boom.bootloader-improve-warning-for-entries-with-no-.patch @@ -0,0 +1,47 @@ +From faf43a2b923dd2e558da1e48978541389844f464 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +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 +(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 + diff --git a/SOURCES/0004-boom.bootloader-do-not-allow-deletion-of-read-only-b.patch b/SOURCES/0004-boom.bootloader-do-not-allow-deletion-of-read-only-b.patch new file mode 100644 index 0000000..b99b926 --- /dev/null +++ b/SOURCES/0004-boom.bootloader-do-not-allow-deletion-of-read-only-b.patch @@ -0,0 +1,46 @@ +From 31f95734f0d6f90f256754377207f5373ff9015c Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +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 +(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 + diff --git a/SOURCES/0005-boom.command-add-new-os-release-values-to-Red-Hat-op.patch b/SOURCES/0005-boom.command-add-new-os-release-values-to-Red-Hat-op.patch new file mode 100644 index 0000000..6f08094 --- /dev/null +++ b/SOURCES/0005-boom.command-add-new-os-release-values-to-Red-Hat-op.patch @@ -0,0 +1,35 @@ +From cd0c4e28b0b2de9000edd5b4b56612d610337552 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +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 +(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 + diff --git a/SPECS/boom-boot.spec b/SPECS/boom-boot.spec index a3e7694..596685b 100644 --- a/SPECS/boom-boot.spec +++ b/SPECS/boom-boot.spec @@ -2,21 +2,29 @@ %global sphinx_docs 1 Name: boom-boot -Version: 1.3 -Release: 3%{?dist} +Version: 1.4 +Release: 4%{?dist} Summary: %{summary} License: GPLv2 URL: https://github.com/snapshotmanager/boom Source0: https://github.com/snapshotmanager/boom/archive/%{version}/boom-%{version}.tar.gz -Patch1: 0001-etc-Remove-executable-permission-from-etc-default-bo.patch -Patch2: 0002-man-Fix-line-starting-with.patch +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 +BuildRequires: make BuildRequires: python3-setuptools BuildRequires: python3-devel %if 0%{?sphinx_docs} +BuildRequires: python3-dbus BuildRequires: python3-sphinx %endif BuildRequires: make @@ -24,6 +32,10 @@ BuildRequires: make Requires: python3-boom = %{version}-%{release} Requires: %{name}-conf = %{version}-%{release} +Obsoletes: boom-boot-grub2 <= 1.3 +# boom-grub2 was not an official name of subpackage in fedora, but was used upstream: +Obsoletes: boom-grub2 <= 1.3 + %package -n python3-boom Summary: %{summary} %{?python_provide:%python_provide python3-boom} @@ -39,10 +51,6 @@ Conflicts: boom %package conf Summary: %{summary} -%package grub2 -Summary: %{summary} -Supplements: (grub2 and boom-boot = %{version}-%{release}) - %description Boom is a boot manager for Linux systems using boot loaders that support the BootLoader Specification for boot entry configuration. @@ -71,21 +79,14 @@ include this support in both Red Hat Enterprise Linux 7 and Fedora). This package provides configuration files for boom. -%description grub2 -Boom is a boot manager for Linux systems using boot loaders that support -the BootLoader Specification for boot entry configuration. - -Boom requires a BLS compatible boot loader to function: either the -systemd-boot project, or Grub2 with the BLS patch (Red Hat Grub2 builds -include this support in both Red Hat Enterprise Linux 7 and Fedora). - -This package provides integration scripts for grub2 bootloader. - %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 %build %if 0%{?sphinx_docs} @@ -100,12 +101,6 @@ rm -r doc/_build %install %py3_install -# Install Grub2 integration scripts -mkdir -p ${RPM_BUILD_ROOT}/etc/grub.d -mkdir -p ${RPM_BUILD_ROOT}/etc/default -install -m 755 etc/grub.d/42_boom ${RPM_BUILD_ROOT}/etc/grub.d -install -m 644 etc/default/boom ${RPM_BUILD_ROOT}/etc/default - # Make configuration directories # mode 0700 - in line with /boot/grub2 directory: install -d -m 700 ${RPM_BUILD_ROOT}/boot/boom/profiles @@ -113,7 +108,6 @@ install -d -m 700 ${RPM_BUILD_ROOT}/boot/boom/hosts install -d -m 700 ${RPM_BUILD_ROOT}/boot/loader/entries install -d -m 700 ${RPM_BUILD_ROOT}/boot/boom/cache install -m 644 examples/boom.conf ${RPM_BUILD_ROOT}/boot/boom -install -m 644 examples/profiles/*.profile ${RPM_BUILD_ROOT}/boot/boom/profiles mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man8 mkdir -p ${RPM_BUILD_ROOT}/%{_mandir}/man5 @@ -147,25 +141,33 @@ rm doc/conf.py %dir /boot/boom %config(noreplace) /boot/boom/boom.conf %dir /boot/boom/profiles -%config(noreplace) /boot/boom/profiles/* %dir /boot/boom/hosts %dir /boot/boom/cache %dir /boot/loader/entries -%files grub2 -%license COPYING -%doc README.md -%{_sysconfdir}/grub.d/42_boom -%config(noreplace) %{_sysconfdir}/default/boom - %changelog -* Mon Aug 09 2021 Mohan Boddu - 1.3-3 -- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags - Related: rhbz#1991688 +* Wed Jul 13 2022 Marian Csontos 1.4-4 +- Fix handling of read-only entries. +- Add OS names for recent versions. + +* Tue May 24 2022 Marian Csontos 1.4-3 +- Fix missing /boot/boom/profiles directory. + +* Tue May 24 2022 Marian Csontos 1.4-2 +- Update gating.yaml. + +* Mon May 23 2022 Marian Csontos 1.4-1 +- Update to release 1.4. + +* Wed Jan 19 2022 Fedora Release Engineering - 1.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 1.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild -* Thu Apr 15 2021 Mohan Boddu - 1.3-2 -- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 +* Fri Jun 04 2021 Python Maint - 1.3-2 +- Rebuilt for Python 3.10 * Fri Jan 29 2021 Marian Csontos 1.3-1 - Update to release 1.3.