tools/image-info: dont fail if /boot/grub2/grubenv is missing
The file is missing on non-bootable images and we skip missing files in all other cases. Do it in this one as well.
This commit is contained in:
parent
4f502a286c
commit
bceb51b330
1 changed files with 5 additions and 2 deletions
|
|
@ -228,8 +228,11 @@ def append_filesystem(report, tree):
|
|||
|
||||
if os.path.exists(f"{tree}/boot") and len(os.listdir(f"{tree}/boot")) > 0:
|
||||
assert "bootmenu" not in report
|
||||
with open(f"{tree}/boot/grub2/grubenv") as f:
|
||||
report["boot-environment"] = parse_environment_vars(f.read())
|
||||
try:
|
||||
with open(f"{tree}/boot/grub2/grubenv") as f:
|
||||
report["boot-environment"] = parse_environment_vars(f.read())
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
report["bootmenu"] = read_boot_entries(f"{tree}/boot")
|
||||
|
||||
elif len(glob.glob(f"{tree}/vmlinuz-*")) > 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue