Blame SOURCES/0003-boom.bootloader-improve-warning-for-entries-with-no-.patch

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