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