diff --git a/live/README.md b/live/README.md index f07b2d0515..a37116fa73 100644 --- a/live/README.md +++ b/live/README.md @@ -12,6 +12,7 @@ - [Image Definition](#image-definition) - [KIWI Files](#kiwi-files) - [Image Configuration](#image-configuration) + - [GRUB2 menu](#grub2-menu) - [SSH Server](#ssh-server) - [Autologin](#autologin) - [Firefox Profile](#firefox-profile) @@ -121,6 +122,15 @@ The main Kiwi source files are located in the [src](src) subdirectory: The Live ISO is configured to allow using some features and allow running Agama there. +## GRUB2 Menu + +grub.cfg, defining boot menu items of the Agama image, is generated by scripts stored in +[config-cdroot](https://github.com/openSUSE/agama/tree/master/live/config-cdroot). + +Both x86_64 and aarch64 grub.cfg are basically copies of KIWI autogenerated grub.cfg. +The x86_64 grub.cfg contains UEFI fix for Booting from disk (Issue #1609). + + ### SSH Server The SSH connection for the root user is enabled in the diff --git a/live/config-cdroot/fix_bootconfig.aarch64 b/live/config-cdroot/fix_bootconfig.aarch64 new file mode 100755 index 0000000000..4299976f0e --- /dev/null +++ b/live/config-cdroot/fix_bootconfig.aarch64 @@ -0,0 +1,102 @@ +#! /bin/bash + +# Custom menu to ensure that we boot correctly +# from local disk on UEFI +# https://github.com/openSUSE/agama/issues/1609 +# KIWI config + +dst="$1" + +if [ ! -d "$dst" ] ; then + echo "fix_bootconfig.aarch64: image dir \"$dst\" not found" + exit 1 +fi + +# KIWI config which should normally be inherited +# from a parent process in our case xorriso +# but that's not the case. +test -f $dst/.profile && . $dst/.profile + +# +# Create grub.cfg +# +cat >$dst/boot/grub2/grub.cfg <$dst/boot/grub2/grub.cfg <$dst/ppc/bootinfo.txt < -Agama Live +$kiwi_iname openSuSE Tumbleweed boot &device;:1,\boot\grub2\grub.elf diff --git a/live/config-cdroot/fix_bootconfig.x86_64 b/live/config-cdroot/fix_bootconfig.x86_64 new file mode 100755 index 0000000000..07e0656e6a --- /dev/null +++ b/live/config-cdroot/fix_bootconfig.x86_64 @@ -0,0 +1,110 @@ +#! /bin/bash + +# Custom menu to ensure that we boot correctly +# from local disk on UEFI +# https://github.com/openSUSE/agama/issues/1609 +# KIWI config + +dst="$1" + +if [ ! -d "$dst" ] ; then + echo "fix_bootconfig.x86_64: image dir \"$dst\" not found" + exit 1 +fi + +# KIWI config which should normally be inherited +# from a parent process in our case xorriso +# but that's not the case. +test -f $dst/.profile && . $dst/.profile + +# +# Create grub.cfg +# +cat >$dst/boot/grub2/grub.cfg < + +- Define boot menu for all arches by scripts in config-cdroot + newly added x86_64 and aarch64 write stock copies from kiwi + generated grub.cfg + +- intel uefi boot fix from "Boot from disk item" (gh#openSUSE/agama#1609) + +- Keep -x on purpose for future trubleshooting (advice from Marcus) + +- Use $kiwi_iname instead of static agama-live reference in all of + config-cdroom/* with exception of s390x, where for some reason + we use SUSE Linux... string instead + + ------------------------------------------------------------------- Mon Sep 9 15:55:16 UTC 2024 - Eugenio Paolantonio diff --git a/live/src/fix_bootconfig b/live/src/fix_bootconfig index 05f2087a4d..26357f7c25 100644 --- a/live/src/fix_bootconfig +++ b/live/src/fix_bootconfig @@ -13,12 +13,18 @@ # This script (a) adjusts the boot config, (b) runs xorriso, and (c) makes # it zIPL bootable on s390x. # +set -ex -# KIWI config -test -f .profile && . .profile dst=${1#iso:} +# KIWI config +# Copy it to $dst from where it can be later read by xorriso +if [ -f .profile ]; then + source .profile + cp .profile "$dst" +fi + arch=`uname -m` # removing live root setting from command line - it's in /etc/cmdline.d instead @@ -67,7 +73,7 @@ done volid=${kiwi_install_volid:-$kiwi_iname} [ -x $bootfix ] && $bootfix $dst -rm -f $dst/fix_bootconfig.* +rm -f $dst/fix_bootconfig.* $dst/.profile case $arch in s390x)