From 0961ec10be817ce4fc66a7388f4bbf07e8ebf720 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Thu, 8 May 2025 09:50:25 +0200 Subject: [PATCH] refs #1970 fix handling of spaces in ogNvramAddEntry --- CHANGELOG.md | 6 ++++++ ogclient/lib/python3/UEFILib.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fee194a..4a1418f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.3] - 2025-05-08 + +### Fixed + +- Have ogNvramAddEntry() handle EFI entries with spaces in them + ## [0.8.2] - 2025-05-07 ### Changed diff --git a/ogclient/lib/python3/UEFILib.py b/ogclient/lib/python3/UEFILib.py index 3e61486..f45d7d2 100644 --- a/ogclient/lib/python3/UEFILib.py +++ b/ogclient/lib/python3/UEFILib.py @@ -98,8 +98,10 @@ def ogNvramAddEntry (bootlbl, bootldr, nvram_set=False): if nvram_set: efibootmgr_out = subprocess.run (['efibootmgr'], capture_output=True, text=True).stdout for l in efibootmgr_out.splitlines(): - words = l.split (maxsplit=1) - if len(words) < 2: continue + if '\t' not in l: continue + (pre_tab, post_tab) = l.split ('\t', maxsplit=1) + words = pre_tab.split (maxsplit=1) + if len(words) < 2: continue ## shouldn't happen if words[1] == bootlabel: numentry = words[0][4:8] order = ogNvramGetOrder()