stages/grub2: make $boot just an alias for $root

Up until now the grub config theoretically supported having different
values for 'root' (via grubenv's $GRUB2_ROOT_FS_UUID) and 'boot' (via
grubenv's $GRUB2_BOOT_FS_UUID). 'boot' is a leftover from the initial
implementation when grub was looking for BLS snippets also in the ESP,
and will be removed in the future.
In our and also the canonical Fedora/RHEL grub configurations the BLS
are in the very same location for UEFI and legacy and thus 'boot' is
always 'root'.
Therefore we get rid of the extra grubenv variable refering to 'boot'
and just set 'boot' to 'root' after that was discovered.
This commit is contained in:
Christian Kellner 2020-01-17 15:33:24 +01:00 committed by Tom Gundersen
parent 92e2961090
commit b3ae34b07e

View file

@ -113,7 +113,7 @@ def write_grub_cfg(tree, path):
cfg.write("set timeout=0\n"
"load_env\n"
"search --no-floppy --fs-uuid --set=root ${GRUB2_ROOT_FS_UUID}\n"
"search --no-floppy --fs-uuid --set=boot ${GRUB2_BOOT_FS_UUID}\n"
"set boot=${root}\n"
"function load_video {\n"
" insmod all_video\n"
"}\n"
@ -158,7 +158,6 @@ def main(tree, options):
default.write("GRUB_TIMEOUT=0\n"
"GRUB_ENABLE_BLSCFG=true\n")
os.makedirs(f"{tree}/boot/grub2", exist_ok=True)
grubenv = f"{tree}/boot/grub2/grubenv"
@ -174,7 +173,6 @@ def main(tree, options):
with open(grubenv, "w") as env:
env.write("# GRUB Environment Block\n"
f"GRUB2_ROOT_FS_UUID={grub_fs_uuid}\n"
f"GRUB2_BOOT_FS_UUID={grub_fs_uuid}\n"
f"kernelopts=root=UUID={root_fs_uuid} {kernel_opts}\n")
if uefi is not None: