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