From b28e1886d95507ebf2bbb93123e0c75b0d0f142c Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Aug 09 2023 01:17:47 +0000 Subject: [PATCH 1/3] components/liveinstall: Add custom GRUB configuration template The standard template embedded in kiwi is seemingly problematic for correctly booting the live environment, so we'll use something closer to what official Fedora/CentOS images use instead. --- diff --git a/components/liveinstall.xml b/components/liveinstall.xml index 2a5d7a9..75dbe22 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -5,7 +5,9 @@ - + + + diff --git a/grub.cfg.iso-template b/grub.cfg.iso-template new file mode 100644 index 0000000..a6b71a0 --- /dev/null +++ b/grub.cfg.iso-template @@ -0,0 +1,44 @@ +# Inspired by the config used for official live media + +set default=${default_boot} + +if [ "$$grub_platform" == "efi" ]; then + function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video + } + set basicgfx="nomodeset" +else + function load_video { + insmod all_video + } + set basicgfx="nomodeset vga=791" +fi + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +terminal_input console +terminal_output ${terminal_setup} + +set timeout=${boot_timeout} +set timeout_style=${boot_timeout_style} + +search ${search_params} + +menuentry "Start ${title}" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} rd.live.image ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +submenu "Troubleshooting -->" { + menuentry "Start ${title} in basic graphics mode" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} rd.live.image ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} From ad685f8a47ef0e637847fb1b77357ee59ea3f22d Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Aug 09 2023 01:17:47 +0000 Subject: [PATCH 2/3] rootfs: Add fstab.script to fix ESP and correctly label the filesystem This is based on the fixes done for the Fedora Asahi images. --- diff --git a/root/etc/fstab.script b/root/etc/fstab.script new file mode 100755 index 0000000..94e99db --- /dev/null +++ b/root/etc/fstab.script @@ -0,0 +1,10 @@ +#!/bin/sh + +# Set ESP mount options to match what Fedora does +# https://github.com/OSInside/kiwi/issues/2201 +gawk -i inplace '$2 == "/boot/efi" { $4 = $4",umask=0077,shortname=winnt" } { print $0 }' /etc/fstab + +# Run selinux relabel at the right time +# https://github.com/OSInside/kiwi/issues/2192 +# https://github.com/OSInside/kiwi/pull/2282#issuecomment-1514399308 +setfiles -F -p -c /etc/selinux/targeted/policy/policy.* -e /proc -e /sys -e /dev /etc/selinux/targeted/contexts/files/file_contexts / From 50103bd771601ae1bfaa230fbe9b6168149eeebd Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Aug 09 2023 09:38:28 +0000 Subject: [PATCH 3/3] components: Add grub packages for ISO type and set liveinstall for ISOs only Without the grub packages for ISO type, we cannot boot via UEFI. Additionally, package installs for liveinstall do not make sense for anything else other than ISO type images, so declare them as such. --- diff --git a/components/boot.xml b/components/boot.xml index 508dd05..f2352a5 100644 --- a/components/boot.xml +++ b/components/boot.xml @@ -15,4 +15,8 @@ + + + + diff --git a/components/liveinstall.xml b/components/liveinstall.xml index 75dbe22..0b36fed 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -9,7 +9,7 @@ - +