update boom-boot to upstream version 1.5.1
This commit is contained in:
parent
a43b7b276e
commit
c9ec267c26
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
||||
/boom-1.2.tar.gz
|
||||
/boom-1.3.tar.gz
|
||||
/boom-1.4.tar.gz
|
||||
/boom-1.5.1.tar.gz
|
||||
|
210
0001-Fix-typos-across-tree.patch
Normal file
210
0001-Fix-typos-across-tree.patch
Normal file
@ -0,0 +1,210 @@
|
||||
From 82ba6ea6411d728f7d3b203caa0710641f74188d Mon Sep 17 00:00:00 2001
|
||||
From: "Bryn M. Reeves" <bmr@redhat.com>
|
||||
Date: Thu, 4 May 2023 15:11:59 +0100
|
||||
Subject: [PATCH 1/3] Fix typos across tree
|
||||
|
||||
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
||||
(cherry picked from commit 2ee6810bfbd9e356f2bee3eac4e3b3b87ed21814)
|
||||
---
|
||||
README.md | 6 +++---
|
||||
boom/bootloader.py | 12 ++++++------
|
||||
boom/cache.py | 2 +-
|
||||
boom/command.py | 2 +-
|
||||
boom/report.py | 4 ++--
|
||||
boom/stratis.py | 2 +-
|
||||
tests/bootloader_tests.py | 2 +-
|
||||
tests/command_tests.py | 2 +-
|
||||
tests/loader/entries/README | 2 +-
|
||||
9 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/README.md b/README.md
|
||||
index a1747c2..c6b4ef4 100644
|
||||
--- a/README.md
|
||||
+++ b/README.md
|
||||
@@ -325,7 +325,7 @@ BootEntry.
|
||||
#### boom cache command
|
||||
|
||||
The `boom cache` command gives information about the paths and
|
||||
-images stored in the boom boot iamge cache. The `boom cache list`
|
||||
+images stored in the boom boot image cache. The `boom cache list`
|
||||
command gives information on cache entries in a tabular report
|
||||
format similar to other `list` commands.
|
||||
|
||||
@@ -484,7 +484,7 @@ Created profile with os_id d4439b7:
|
||||
Options: "root=%{root_device} ro %{root_opts}"
|
||||
```
|
||||
|
||||
-The `--uname-pattern` `OsProfile` property is an otional but recommended
|
||||
+The `--uname-pattern` `OsProfile` property is an optional but recommended
|
||||
pattern (regular expression) that should match the UTS release (`uname`)
|
||||
strings reported by the operating system.
|
||||
|
||||
@@ -673,7 +673,7 @@ boot entries:
|
||||
```
|
||||
|
||||
## Python API
|
||||
-Boom also supports programatic use via a Python API. The API is flexible
|
||||
+Boom also supports programmatic use via a Python API. The API is flexible
|
||||
and allows greater customisation than is possible using the command line
|
||||
tool.
|
||||
|
||||
diff --git a/boom/bootloader.py b/boom/bootloader.py
|
||||
index fdd8c0c..89efd4a 100644
|
||||
--- a/boom/bootloader.py
|
||||
+++ b/boom/bootloader.py
|
||||
@@ -407,7 +407,7 @@ class BootParams(object):
|
||||
string. The string returned is in the form of a call to the
|
||||
``BootParams`` constructor.
|
||||
|
||||
- :returns: a machine readable string represenatation of this
|
||||
+ :returns: a machine readable string representation of this
|
||||
``BootParams`` object.
|
||||
"""
|
||||
return self.__str(quote=True, prefix="BootParams(", suffix=")")
|
||||
@@ -1198,7 +1198,7 @@ class BootEntry(object):
|
||||
|
||||
Return a copy of this ``BootEntry``'s values as a list.
|
||||
|
||||
- :returns: the current list of ``BotoEntry`` values.
|
||||
+ :returns: the current list of ``BootEntry`` values.
|
||||
:rtype: list
|
||||
"""
|
||||
values = list(self._entry_data.values())
|
||||
@@ -1259,7 +1259,7 @@ class BootEntry(object):
|
||||
self._unwritten = True
|
||||
|
||||
def __os_id_from_comment(self, comment):
|
||||
- """Retrive OsProfile from BootEntry comment.
|
||||
+ """Retrieve OsProfile from BootEntry comment.
|
||||
|
||||
Attempt to set this BootEntry's OsProfile using a comment
|
||||
string stored in the entry file. The comment must be of the
|
||||
@@ -1300,7 +1300,7 @@ class BootEntry(object):
|
||||
Attempt to guess the correct ``OsProfile`` to use with
|
||||
this ``BootEntry`` by probing each loaded ``OsProfile``
|
||||
in turn until a profile recognises the entry. If no match
|
||||
- is found the entrie's ``OsProfile`` is set to ``None``.
|
||||
+ is found the entry's ``OsProfile`` is set to ``None``.
|
||||
|
||||
Probing is only used in the case that a loaded entry has
|
||||
no embedded OsIdentifier string. All entries written by
|
||||
@@ -1527,7 +1527,7 @@ class BootEntry(object):
|
||||
|
||||
A ``BootParams`` object may be supplied using the
|
||||
``boot_params`` keyword argument. The object will be used to
|
||||
- provide values for subsitution using the patterns defined by
|
||||
+ provide values for substitution using the patterns defined by
|
||||
the configured ``OsProfile``.
|
||||
|
||||
If ``entry_file`` is specified the ``BootEntry`` will be
|
||||
@@ -1832,7 +1832,7 @@ class BootEntry(object):
|
||||
return True
|
||||
|
||||
def expanded(self):
|
||||
- """Return a string represenatation of this ``BootEntry``, with
|
||||
+ """Return a string representation of this ``BootEntry``, with
|
||||
any bootloader environment variables expanded to their
|
||||
current values.
|
||||
|
||||
diff --git a/boom/cache.py b/boom/cache.py
|
||||
index dfd8a32..6024f91 100644
|
||||
--- a/boom/cache.py
|
||||
+++ b/boom/cache.py
|
||||
@@ -174,7 +174,7 @@ def _image_id_from_path(img_path):
|
||||
def drop_cache():
|
||||
"""Discard the in-memory cache state. Calling this function has
|
||||
no effect on the persistent cache state but will free all
|
||||
- in-memory represenatations and clear the cache index.
|
||||
+ in-memory representations and clear the cache index.
|
||||
"""
|
||||
global _index, _paths, _images
|
||||
_index = {}
|
||||
diff --git a/boom/command.py b/boom/command.py
|
||||
index 696313d..ecd8153 100644
|
||||
--- a/boom/command.py
|
||||
+++ b/boom/command.py
|
||||
@@ -3233,7 +3233,7 @@ def main(args):
|
||||
parser.add_argument("-u", "--uname-pattern", "--unamepattern",
|
||||
help="A Boom OsProfile uname pattern",
|
||||
metavar="PATTERN", type=str)
|
||||
- parser.add_argument("-V", "--verbose", help="Enable verbose ouput",
|
||||
+ parser.add_argument("-V", "--verbose", help="Enable verbose output",
|
||||
action="count")
|
||||
parser.add_argument("-v", "--version", metavar="VERSION", type=str,
|
||||
help="The kernel version of a boom "
|
||||
diff --git a/boom/report.py b/boom/report.py
|
||||
index f7ff4a1..fdbd3ab 100644
|
||||
--- a/boom/report.py
|
||||
+++ b/boom/report.py
|
||||
@@ -446,7 +446,7 @@ class BoomReport(object):
|
||||
Display a list of valid fields for this ``BoomReport``.
|
||||
|
||||
:param fields: The list of fields to display
|
||||
- :param display_field_types: A boolean controling whether
|
||||
+ :param display_field_types: A boolean controlling whether
|
||||
field types (str, SHA, num)
|
||||
are included in help output
|
||||
"""
|
||||
@@ -837,7 +837,7 @@ class BoomReport(object):
|
||||
each sort key defines its own sort order.
|
||||
|
||||
:param row_a: The first row to compare
|
||||
- :param row_b: The seconf row to compare
|
||||
+ :param row_b: The second row to compare
|
||||
"""
|
||||
for cnt in range(0, row_a._report._keys_count):
|
||||
sfa = row_a._sort_fields[cnt]
|
||||
diff --git a/boom/stratis.py b/boom/stratis.py
|
||||
index 350bc18..ca79d7b 100644
|
||||
--- a/boom/stratis.py
|
||||
+++ b/boom/stratis.py
|
||||
@@ -49,7 +49,7 @@ _STRATISD_SERVICE = "org.storage.stratis3"
|
||||
_STRATISD_PATH = "/org/storage/stratis3"
|
||||
#: The DBus name of the pool interface
|
||||
_POOL_IFACE = "org.storage.stratis3.pool.r0"
|
||||
-#: The DBus timeout for stratisd in miliseconds
|
||||
+#: The DBus timeout for stratisd in milliseconds
|
||||
_STRATISD_TIMEOUT = 120000
|
||||
|
||||
#: The DBus ObjectManager interface implemented by stratisd
|
||||
diff --git a/tests/bootloader_tests.py b/tests/bootloader_tests.py
|
||||
index 8238d10..e56f2f9 100644
|
||||
--- a/tests/bootloader_tests.py
|
||||
+++ b/tests/bootloader_tests.py
|
||||
@@ -1081,7 +1081,7 @@ class BootLoaderTestsCheckRoot(unittest.TestCase):
|
||||
Device types in the del_devs list are currently ignored.
|
||||
|
||||
Tests using this base class require root privileges in order
|
||||
- to manipulate device nodes in the test sanbox. These tests
|
||||
+ to manipulate device nodes in the test sandbox. These tests
|
||||
are automatically skipped if the suite is run as a normal
|
||||
user.
|
||||
"""
|
||||
diff --git a/tests/command_tests.py b/tests/command_tests.py
|
||||
index 7af5ea2..5aa904f 100644
|
||||
--- a/tests/command_tests.py
|
||||
+++ b/tests/command_tests.py
|
||||
@@ -2071,7 +2071,7 @@ class CommandTests(unittest.TestCase):
|
||||
self.assertEqual(r, 0)
|
||||
|
||||
def test__edit_profile_cmd(self):
|
||||
- """Test the _edit_profile_cmd() hander with default args.
|
||||
+ """Test the _edit_profile_cmd() handler with default args.
|
||||
"""
|
||||
args = MockArgs()
|
||||
args.profile = "d4439b7"
|
||||
diff --git a/tests/loader/entries/README b/tests/loader/entries/README
|
||||
index 20ee65b..4407ef2 100644
|
||||
--- a/tests/loader/entries/README
|
||||
+++ b/tests/loader/entries/README
|
||||
@@ -1,6 +1,6 @@
|
||||
Boot loader entry directory for the boom unit test suite.
|
||||
|
||||
-The entries in this directory may contan synthetic test data:
|
||||
+The entries in this directory may contain synthetic test data:
|
||||
non-existent kernel versions, and mock OsProfile data.
|
||||
|
||||
For examples of actual boom boot entries please refer to the
|
||||
--
|
||||
2.40.1
|
||||
|
214
0002-Fix-system-vs.-project-import-ordering.patch
Normal file
214
0002-Fix-system-vs.-project-import-ordering.patch
Normal file
@ -0,0 +1,214 @@
|
||||
From f98bacd55fd4af5e1efee3fedd90c2c57d99cae7 Mon Sep 17 00:00:00 2001
|
||||
From: "Bryn M. Reeves" <bmr@redhat.com>
|
||||
Date: Thu, 4 May 2023 16:37:26 +0100
|
||||
Subject: [PATCH 2/3] Fix system vs. project import ordering
|
||||
|
||||
Resolves: #5
|
||||
|
||||
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
||||
(cherry picked from commit d8a7c9f2fbeecd4e291cda751c2dcbd4b1914d75)
|
||||
---
|
||||
boom/bootloader.py | 10 +++++-----
|
||||
boom/cache.py | 6 +++---
|
||||
boom/command.py | 16 ++++++++--------
|
||||
boom/config.py | 4 ++--
|
||||
boom/hostprofile.py | 6 +++---
|
||||
boom/legacy.py | 6 +++---
|
||||
boom/osprofile.py | 3 ++-
|
||||
boom/report.py | 3 ++-
|
||||
8 files changed, 28 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/boom/bootloader.py b/boom/bootloader.py
|
||||
index 89efd4a..cdee6d9 100644
|
||||
--- a/boom/bootloader.py
|
||||
+++ b/boom/bootloader.py
|
||||
@@ -39,11 +39,6 @@ is also provided in the ``MAP_KEY`` member).
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
-from boom.osprofile import *
|
||||
-from boom.hostprofile import find_host_profiles
|
||||
-from boom.stratis import *
|
||||
-
|
||||
from os.path import basename, exists as path_exists, join as path_join
|
||||
from subprocess import Popen, PIPE
|
||||
from tempfile import mkstemp
|
||||
@@ -51,6 +46,11 @@ from os import listdir, rename, fdopen, chmod, unlink, fdatasync, stat, dup
|
||||
from stat import S_ISBLK
|
||||
from hashlib import sha1
|
||||
import logging
|
||||
+
|
||||
+from boom import *
|
||||
+from boom.osprofile import *
|
||||
+from boom.hostprofile import find_host_profiles
|
||||
+from boom.stratis import *
|
||||
import re
|
||||
|
||||
#: The path to the BLS boot entries directory relative to /boot
|
||||
diff --git a/boom/cache.py b/boom/cache.py
|
||||
index 6024f91..b68caac 100644
|
||||
--- a/boom/cache.py
|
||||
+++ b/boom/cache.py
|
||||
@@ -17,9 +17,6 @@ images required to load boom-defined boot entries.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
-from boom.bootloader import *
|
||||
-
|
||||
from hashlib import sha1
|
||||
from os import chmod, chown, fdatasync, listdir, stat, unlink
|
||||
from stat import S_ISREG, ST_MODE, ST_UID, ST_GID, ST_MTIME, filemode
|
||||
@@ -32,6 +29,9 @@ from errno import ENOENT
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
+from boom import *
|
||||
+from boom.bootloader import *
|
||||
+
|
||||
# Module logging configuration
|
||||
_log = logging.getLogger(__name__)
|
||||
_log.set_debug_mask(BOOM_DEBUG_CACHE)
|
||||
diff --git a/boom/command.py b/boom/command.py
|
||||
index ecd8153..37172dc 100644
|
||||
--- a/boom/command.py
|
||||
+++ b/boom/command.py
|
||||
@@ -26,6 +26,14 @@ reports using the ``boom.report`` module.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
+from os import environ, uname, getcwd
|
||||
+from os.path import basename, exists as path_exists, isabs, join, sep
|
||||
+from argparse import ArgumentParser
|
||||
+from stat import filemode
|
||||
+import platform
|
||||
+import logging
|
||||
+import re
|
||||
+
|
||||
from boom import *
|
||||
from boom.osprofile import *
|
||||
from boom.report import *
|
||||
@@ -35,14 +43,6 @@ from boom.legacy import *
|
||||
from boom.config import *
|
||||
from boom.cache import *
|
||||
|
||||
-from os import environ, uname, getcwd
|
||||
-from os.path import basename, exists as path_exists, isabs, join, sep
|
||||
-from argparse import ArgumentParser
|
||||
-from stat import filemode
|
||||
-import platform
|
||||
-import logging
|
||||
-import re
|
||||
-
|
||||
#: The environment variable from which to take the location of the
|
||||
#: ``/boot`` file system.
|
||||
BOOM_BOOT_PATH_ENV = "BOOM_BOOT_PATH"
|
||||
diff --git a/boom/config.py b/boom/config.py
|
||||
index c58d3c3..9dae545 100644
|
||||
--- a/boom/config.py
|
||||
+++ b/boom/config.py
|
||||
@@ -20,14 +20,14 @@ the values of configuration keys defined in the boom configuration file.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
-
|
||||
from os.path import dirname
|
||||
|
||||
from os import fdopen, rename, chmod, fdatasync
|
||||
from tempfile import mkstemp
|
||||
import logging
|
||||
|
||||
+from boom import *
|
||||
+
|
||||
try:
|
||||
# Python2
|
||||
from ConfigParser import SafeConfigParser as ConfigParser, ParsingError
|
||||
diff --git a/boom/hostprofile.py b/boom/hostprofile.py
|
||||
index d63622f..fea9753 100644
|
||||
--- a/boom/hostprofile.py
|
||||
+++ b/boom/hostprofile.py
|
||||
@@ -31,14 +31,14 @@ property names) are identical to those used by the ``OsProfile`` class.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
-from boom.osprofile import *
|
||||
-
|
||||
from hashlib import sha1
|
||||
from os.path import join as path_join
|
||||
import logging
|
||||
import string
|
||||
|
||||
+from boom import *
|
||||
+from boom.osprofile import *
|
||||
+
|
||||
# Module logging configuration
|
||||
_log = logging.getLogger(__name__)
|
||||
_log.set_debug_mask(BOOM_DEBUG_PROFILE)
|
||||
diff --git a/boom/legacy.py b/boom/legacy.py
|
||||
index 389ed90..715358c 100644
|
||||
--- a/boom/legacy.py
|
||||
+++ b/boom/legacy.py
|
||||
@@ -20,9 +20,6 @@ all entries from the legacy configuration file.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
-from boom.bootloader import *
|
||||
-
|
||||
from subprocess import Popen, PIPE
|
||||
from os.path import dirname, exists, isabs, join as path_join
|
||||
from os import chmod, dup, fdatasync, fdopen, rename, unlink
|
||||
@@ -30,6 +27,9 @@ from tempfile import mkstemp
|
||||
import logging
|
||||
import re
|
||||
|
||||
+from boom import *
|
||||
+from boom.bootloader import *
|
||||
+
|
||||
#: Format strings use to construct begin/end markers
|
||||
BOOM_LEGACY_BEGIN_FMT = "#--- BOOM_%s_BEGIN ---"
|
||||
BOOM_LEGACY_END_FMT = "#--- BOOM_%s_END ---"
|
||||
diff --git a/boom/osprofile.py b/boom/osprofile.py
|
||||
index f05671f..e20d2fb 100644
|
||||
--- a/boom/osprofile.py
|
||||
+++ b/boom/osprofile.py
|
||||
@@ -34,7 +34,6 @@ are suitable for display use and are used by default by the
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import *
|
||||
from hashlib import sha1
|
||||
from tempfile import mkstemp
|
||||
from os.path import basename, join as path_join, exists as path_exists
|
||||
@@ -42,6 +41,8 @@ from os import fdopen, rename, chmod, unlink, fdatasync
|
||||
import logging
|
||||
import re
|
||||
|
||||
+from boom import *
|
||||
+
|
||||
#: Boom profiles directory name.
|
||||
BOOM_PROFILES = "profiles"
|
||||
|
||||
diff --git a/boom/report.py b/boom/report.py
|
||||
index fdbd3ab..d024013 100644
|
||||
--- a/boom/report.py
|
||||
+++ b/boom/report.py
|
||||
@@ -29,10 +29,11 @@ mapper reports.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
-from boom import find_minimum_sha_prefix, BOOM_DEBUG_REPORT
|
||||
import logging
|
||||
import sys
|
||||
|
||||
+from boom import find_minimum_sha_prefix, BOOM_DEBUG_REPORT
|
||||
+
|
||||
_log = logging.getLogger(__name__)
|
||||
_log.set_debug_mask(BOOM_DEBUG_REPORT)
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
@ -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
|
||||
|
28
0003-boom-fix-unclosed-file-warning-for-proc-cmdline.patch
Normal file
28
0003-boom-fix-unclosed-file-warning-for-proc-cmdline.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From f82215bded722e972a2b358ddd6a45bc36a4a3bb Mon Sep 17 00:00:00 2001
|
||||
From: "Bryn M. Reeves" <bmr@redhat.com>
|
||||
Date: Thu, 4 May 2023 18:23:31 +0100
|
||||
Subject: [PATCH 3/3] boom: fix unclosed file warning for /proc/cmdline
|
||||
|
||||
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
||||
(cherry picked from commit bd194eeb646198c28f3e79769175c0cf0843e523)
|
||||
---
|
||||
boom/command.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/boom/command.py b/boom/command.py
|
||||
index 37172dc..07d229a 100644
|
||||
--- a/boom/command.py
|
||||
+++ b/boom/command.py
|
||||
@@ -1923,7 +1923,8 @@ def os_options_from_cmdline():
|
||||
options = ""
|
||||
vg_lv_name = None
|
||||
have_root = False
|
||||
- cmdline = open("/proc/cmdline").read().strip()
|
||||
+ with open("/proc/cmdline") as proc_cmdline:
|
||||
+ cmdline = proc_cmdline.read().strip()
|
||||
for word in cmdline.split():
|
||||
if word.startswith("root="):
|
||||
have_root = True
|
||||
--
|
||||
2.40.1
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -2,18 +2,17 @@
|
||||
%global sphinx_docs 1
|
||||
|
||||
Name: boom-boot
|
||||
Version: 1.4
|
||||
Release: 3%{?dist}
|
||||
Version: 1.5.1
|
||||
Release: 1%{?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-man-Fix-line-starting-with.patch
|
||||
Patch2: 0002-boom.bootloader-initialise-_last_path-before-parsing.patch
|
||||
Patch3: 0003-boom.bootloader-improve-warning-for-entries-with-no-.patch
|
||||
Patch4: 0004-boom.bootloader-do-not-allow-deletion-of-read-only-b.patch
|
||||
Patch5: 0005-boom.command-add-new-os-release-values-to-Red-Hat-op.patch
|
||||
Patch2: 0001-Fix-typos-across-tree.patch
|
||||
Patch3: 0002-Fix-system-vs.-project-import-ordering.patch
|
||||
Patch4: 0003-boom-fix-unclosed-file-warning-for-proc-cmdline.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -77,13 +76,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}
|
||||
@ -145,6 +138,9 @@ rm doc/conf.py
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue May 16 2023 Marian Csontos <mcsontos@redhat.com> - 1.5.1-1
|
||||
- Update to release 1.5.1.
|
||||
|
||||
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (boom-1.4.tar.gz) = f2f4ee658a8f1b670b0dd15c56a7f7c9eef047e2ca9aeaa7c54c619e68428c8225c3c115d2d12f0b055091752e8ee5c8be266ddb49ae4a036c6aa7cf32e03861
|
||||
SHA512 (boom-1.5.1.tar.gz) = fa69d443bd553a35d0ba5fc825fba84b40382cd52d86f50b51d32e1f54c1698b1733044bfa048f580084a3ad3d10f1924113f82e24169ae40662d2961d6a8038
|
||||
|
Loading…
Reference in New Issue
Block a user