URL:
<https://savannah.gnu.org/bugs/?58283>
Summary: save_env prepends \0 to grubenv, causing "error:
invalid environment block."
Project: GNU GRUB
Submitted by: clarity
Submitted on: Fri 01 May 2020 02:37:36 PM UTC
Category: None
Severity: Major
Priority: 5 - Normal
Item Group: Software Error
Status: None
Privacy: Public
Assigned to: None
Originator Name: Clara Short
Originator Email: [email protected]
Open/Closed: Open
Release:
Release: 2.02
Discussion Lock: Any
Reproducibility: Every Time
Planned Release: None
_______________________________________________________
Details:
= Configuration =
grub> echo $package_version $grub_cpu $grub_platform
2.02-2ubuntu8.15 i386 pc
= Steps to reproduce =
== 1. Initial conditions ==
# rm /boot/grub/grubenv
# grub-editenv - create
# grub-editenv - set foo=bar
# grub-editenv - list
foo=bar
# hexdump -C /boot/grub/grubenv
00000000 23 20 47 52 55 42 20 45 6e 76 69 72 6f 6e 6d 65 |# GRUB
Environme|
00000010 6e 74 20 42 6c 6f 63 6b 0a 66 6f 6f 3d 62 61 72 |nt
Block.foo=bar|
00000020 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
|.###############|
00000030 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
|################|
*
00000400
# reboot
== 2. Drop to GRUB shell ==
grub> list_env
foo=bar
grub> baz=quux
grub> save_env baz
grub> list_env
error: invalid environment block.
grub> reboot
== 3. Boot into Linux ==
$ grub-editenv - list
grub-editenv: error: invalid environment block.
$ hexdump -C /boot/grub/grubenv
00000000 00 23 20 47 52 55 42 20 45 6e 76 69 72 6f 6e 6d |.# GRUB
Environm|
00000010 65 6e 74 20 42 6c 6f 63 6b 0a 66 6f 6f 3d 62 61 |ent
Block.foo=ba|
00000020 72 0a 62 61 7a 3d 71 75 75 78 0a 23 23 23 23 23
|r.baz=quux.#####|
00000030 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23
|################|
*
00000400
$
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?58283>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/