From dfc30700e15703eebda47cba140241003e658b83 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 02 2025 20:40:17 +0000 Subject: [PATCH 1/6] Import liveinstall related files from fedora-kiwi-descriptions https://pagure.io/fedora-kiwi-descriptions --- diff --git a/components/common.xml b/components/common.xml new file mode 100644 index 0000000..dc1f34c --- /dev/null +++ b/components/common.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/components/liveinstall.xml b/components/liveinstall.xml new file mode 100644 index 0000000..f91283c --- /dev/null +++ b/components/liveinstall.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/grub-arm.cfg.iso-template b/grub-arm.cfg.iso-template new file mode 100644 index 0000000..037ae79 --- /dev/null +++ b/grub-arm.cfg.iso-template @@ -0,0 +1,41 @@ +# Inspired by the config used for lorax-built live media + +set default="1" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} +set basicgfx="nomodeset" + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +terminal_input console +terminal_output ${terminal_output} + +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} ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check + 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} ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} diff --git a/grub-ppc.cfg.iso-template b/grub-ppc.cfg.iso-template new file mode 100644 index 0000000..26cd610 --- /dev/null +++ b/grub-ppc.cfg.iso-template @@ -0,0 +1,30 @@ +# Inspired by the config used for lorax-built live media + +set default="1" + +insmod gzio +insmod part_gpt +insmod ext2 + +terminal_input console +terminal_output ${terminal_output} + +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} ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check + 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} ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} diff --git a/grub-riscv64.cfg.iso-template b/grub-riscv64.cfg.iso-template new file mode 100644 index 0000000..037ae79 --- /dev/null +++ b/grub-riscv64.cfg.iso-template @@ -0,0 +1,41 @@ +# Inspired by the config used for lorax-built live media + +set default="1" + +function load_video { + insmod efi_gop + insmod efi_uga + insmod video_bochs + insmod video_cirrus + insmod all_video +} +set basicgfx="nomodeset" + +load_video +set gfxpayload=keep +insmod gzio +insmod part_gpt +insmod ext2 + +terminal_input console +terminal_output ${terminal_output} + +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} ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check + 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} ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} diff --git a/grub-x86.cfg.iso-template b/grub-x86.cfg.iso-template new file mode 100644 index 0000000..9b779bd --- /dev/null +++ b/grub-x86.cfg.iso-template @@ -0,0 +1,48 @@ +# Inspired by the config used for lorax-built live media + +set default="1" + +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_output} + +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} ${boot_options} + initrd ($$root)${bootpath}/${initrd_file} +} +menuentry "Test this media & start ${title}" --class fedora --class gnu-linux --class gnu --class os { + linux ($$root)${bootpath}/${kernel_file} ${boot_options} rd.live.check + 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} ${boot_options} $${basicgfx} + initrd ($$root)${bootpath}/${initrd_file} + } +} diff --git a/iso-esp-excludes.yaml b/iso-esp-excludes.yaml new file mode 100644 index 0000000..c49d940 --- /dev/null +++ b/iso-esp-excludes.yaml @@ -0,0 +1,3 @@ +exclude: +- BOOT/fb*.efi +- fedora From f2aec705d0e7a825d3f68d54b0638874857c5884 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 02 2025 20:40:17 +0000 Subject: [PATCH 2/6] Base Common profile on Fedora's `BaseCommon` --- diff --git a/components/base.xml b/components/base.xml index 958aab9..9dca246 100644 --- a/components/base.xml +++ b/components/base.xml @@ -1,10 +1,11 @@ - + + + - @@ -13,8 +14,6 @@ - - diff --git a/config.xml b/config.xml index 29b735e..1bd68e1 100644 --- a/config.xml +++ b/config.xml @@ -19,6 +19,7 @@ + From 4e0d05001116cbec2fa5d375a06c5fde73c8e42f Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 05 2025 21:45:22 +0000 Subject: [PATCH 3/6] live: Fix anaconda's EFI boot loader dir to "fedora" This is used by the Fedora-Asahi-Remix disk images. TBD how this has to be handled for UEFI-only installs. --- diff --git a/config.sh b/config.sh index 3da2ed8..ba0d57b 100755 --- a/config.sh +++ b/config.sh @@ -112,4 +112,13 @@ mkdir -p /boot/efi/m1n1 update-m1n1 /boot/efi/m1n1/boot.bin rm /boot/.builder + +#====================================== +# Changing anaconda's EFI dir +#-------------------------------------- + +if [[ "$kiwi_profiles" == *"Live"* ]]; then + sed -i 's:\(efi_dir = \).*$:\1fedora:' /etc/anaconda/anaconda.conf +fi + exit 0 From e48cdfe6ced51a683ade5768f8154c10410c58cb Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 05 2025 21:45:22 +0000 Subject: [PATCH 4/6] Add "inst.noefi" to the liveinstall kernel command line This lets skips running efibootmgr during the installation. It fails due to non-writable EfiVars. Anaconda reports this and offers to ignore it. It prevents however writing the BLS config entry for the installed kernel. --- diff --git a/components/liveinstall.xml b/components/liveinstall.xml index f91283c..bd70de6 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -19,7 +19,7 @@ From f22a455f710398ca0b621b3eef567ca6ce7ba0a2 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 05 2025 22:02:58 +0000 Subject: [PATCH 5/6] KDE-Desktop: Slim image down as the Fedora image From Fedora's components/desktops/kde.xml --- diff --git a/components/desktop-environments.xml b/components/desktop-environments.xml index e99bc86..f0eed2e 100644 --- a/components/desktop-environments.xml +++ b/components/desktop-environments.xml @@ -47,7 +47,15 @@ - - + + + + + + + + + + From 5f8cabd5078aad67b375c1c8ca21d88b1e648cb4 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: May 05 2025 22:09:09 +0000 Subject: [PATCH 6/6] Add GNOME/KDE desktop live iso images Based on Fedora's live iso images. Unsolved issues using it for live-install: - Live system is behaving weirdly slow, slightly broken - USB storage might have to be replug to load system image - partition order is not maintained (Apple's tools are picky about this) - automatic partitioning not tested - ESP selection wrong on systems with more than one install / ESP --- diff --git a/components/boot.xml b/components/boot.xml index dc1362b..d0b7247 100644 --- a/components/boot.xml +++ b/components/boot.xml @@ -20,4 +20,9 @@ + + + + + diff --git a/components/desktop-environments.xml b/components/desktop-environments.xml index f0eed2e..fc399dd 100644 --- a/components/desktop-environments.xml +++ b/components/desktop-environments.xml @@ -6,9 +6,12 @@ - + + + + @@ -35,17 +38,15 @@ - + - + - - @@ -58,4 +59,8 @@ + + + + diff --git a/components/liveinstall.xml b/components/liveinstall.xml index bd70de6..81af99d 100644 --- a/components/liveinstall.xml +++ b/components/liveinstall.xml @@ -58,9 +58,9 @@ - - - + + + diff --git a/config.sh b/config.sh index ba0d57b..f330ccc 100755 --- a/config.sh +++ b/config.sh @@ -60,30 +60,42 @@ passwd -l root # Setup default services #-------------------------------------- -## Enable persistent journal -mkdir -p /var/log/journal +if [[ "$kiwi_profiles" == *"Live"* ]]; then + ## Configure livesys session + if [[ "$kiwi_profiles" == *"GNOME"* ]]; then + echo 'livesys_session="gnome"' > /etc/sysconfig/livesys + fi + if [[ "$kiwi_profiles" == *"KDE"* ]]; then + echo 'livesys_session="kde"' > /etc/sysconfig/livesys + fi +else + ## Enable persistent journal + mkdir -p /var/log/journal +fi #====================================== # Setup firstboot initial setup #-------------------------------------- -if [[ "$kiwi_profiles" == *"KDE"* ]]; then - ## Enable calamares - systemctl enable calamares-firstboot.service -elif [[ "$kiwi_profiles" != *"GNOME"* ]] && [[ "$kiwi_profiles" != *"KDE"* ]]; then - ## Enable initial-setup - systemctl enable initial-setup.service - ## Enable reconfig mode - touch /etc/reconfigSys +if [[ "$kiwi_profiles" != *"Live"* ]]; then + if [[ "$kiwi_profiles" == *"KDE"* ]]; then + ## Enable calamares + systemctl enable calamares-firstboot.service + elif [[ "$kiwi_profiles" != *"GNOME"* ]] && [[ "$kiwi_profiles" != *"KDE"* ]]; then + ## Enable initial-setup + systemctl enable initial-setup.service + ## Enable reconfig mode + touch /etc/reconfigSys + fi + + ## Enable swap setup on firstboot + systemctl enable asahi-setup-swap-firstboot.service + + ## Enable extras install on firstboot; this will only run if the extras are + ## actually present (and self disable afterwards) + systemctl enable asahi-extras-firstboot.service fi -## Enable swap setup on firstboot -systemctl enable asahi-setup-swap-firstboot.service - -## Enable extras install on firstboot; this will only run if the extras are -## actually present (and self disable afterwards) -systemctl enable asahi-extras-firstboot.service - #====================================== # Setup default target #-------------------------------------- diff --git a/config.xml b/config.xml index 1bd68e1..885d897 100644 --- a/config.xml +++ b/config.xml @@ -21,10 +21,12 @@ + + diff --git a/teams/asahi.xml b/teams/asahi.xml new file mode 100644 index 0000000..6002508 --- /dev/null +++ b/teams/asahi.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + +