Skip to content

Commit cb210da

Browse files
committed
grml2usb: handle_grub_config: stop moving bootid, live-media-path options
1 parent 62b0225 commit cb210da

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

grml2usb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,15 +1326,14 @@ def handle_grub_config(
13261326
for line in fh.read().split("\n"):
13271327
line = line.rstrip("\r\n")
13281328
if option_re.search(line):
1329-
line = bootid_re.sub("", line)
1329+
line = bootid_re.sub(f"bootid={bootid}", line)
13301330
if shortname in filename:
1331-
line = live_media_path_re.sub("", line)
1332-
line = line.rstrip() + f" live-media-path=/live/{grml_flavour}/ "
1331+
line = live_media_path_re.sub(f"live-media-path=/live/{grml_flavour}/", line)
13331332
if bootoptions.strip():
13341333
line = line.replace(f" {bootoptions.strip()} ", " ")
13351334
if line.endswith(bootoptions):
13361335
line = line[: -len(bootoptions)]
1337-
line = line.rstrip() + f" bootid={bootid} {bootoptions} "
1336+
line = line.rstrip() + f" {bootoptions} "
13381337
for regex in remove_regexes:
13391338
line = regex.sub(" ", line)
13401339
new_lines.append(line)

test/grml2usb_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -357,26 +357,26 @@ def test_remove_default_entry(tmp_path):
357357
(
358358
[],
359359
"",
360-
'apm=power-off boot=live "${loopback}" ${kernelopts} nomce '
361-
"live-media-path=/live/grml-full-amd64/ bootid=BOOTID ",
360+
"apm=power-off boot=live live-media-path=/live/grml-full-amd64/ bootid=BOOTID "
361+
'"${loopback}" ${kernelopts} nomce ',
362362
),
363363
(
364364
["nomce"],
365365
"",
366-
'apm=power-off boot=live "${loopback}" ${kernelopts} '
367-
"live-media-path=/live/grml-full-amd64/ bootid=BOOTID ",
366+
"apm=power-off boot=live live-media-path=/live/grml-full-amd64/ bootid=BOOTID "
367+
'"${loopback}" ${kernelopts} ',
368368
),
369369
(
370370
[],
371371
"nomce",
372-
'apm=power-off boot=live "${loopback}" ${kernelopts} '
373-
"live-media-path=/live/grml-full-amd64/ bootid=BOOTID nomce ",
372+
"apm=power-off boot=live live-media-path=/live/grml-full-amd64/ bootid=BOOTID "
373+
'"${loopback}" ${kernelopts} nomce ',
374374
),
375375
(
376376
[],
377377
"nomce noacpi",
378-
'apm=power-off boot=live "${loopback}" ${kernelopts} nomce '
379-
"live-media-path=/live/grml-full-amd64/ bootid=BOOTID nomce noacpi ",
378+
"apm=power-off boot=live live-media-path=/live/grml-full-amd64/ bootid=BOOTID "
379+
'"${loopback}" ${kernelopts} nomce nomce noacpi ',
380380
),
381381
],
382382
)

0 commit comments

Comments
 (0)