Use diferent base images for livecd grub artifacts (#376)

This commit is contained in:
Itxaka
2023-08-16 13:53:37 +02:00
committed by GitHub
parent 4f7cca39db
commit 283d3141f2
3 changed files with 88 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
{{if eq .Values.name "grub2"}}
image: "opensuse/leap:15.4"
prelude:
- zypper in -y git
{{if .Values.arch }}
{{if eq .Values.arch "amd64"}}
- zypper in -y --no-recommends syslinux
@@ -11,10 +11,8 @@ prelude:
- zypper cc
- grub2-mkimage -O i386-pc -o /usr/share/grub2/i386-pc/core.img -p /boot/grub2 -d /usr/share/grub2/i386-pc ext2 iso9660 linux echo configfile search_label search_fs_file search search_fs_uuid ls normal gzio png fat gettext font minicmd gfxterm gfxmenu all_video xfs btrfs lvm luks gcry_rijndael gcry_sha256 gcry_sha512 crypto cryptodisk test true loadenv part_gpt part_msdos biosdisk vga vbe chain boot
- cat /usr/share/grub2/i386-pc/cdboot.img /usr/share/grub2/i386-pc/core.img > /usr/share/grub2/i386-pc/eltorito.img
- git clone https://github.com/kairos-io/kairos && cd kairos && git checkout -b v"{{.Values.kairos_tag}}"
steps:
{{if eq .Values.name "grub2"}}
- mkdir -p /boot/x86_64/loader
{{if .Values.arch }}
{{if eq .Values.arch "amd64"}}
@@ -29,19 +27,31 @@ steps:
- cp -p /usr/share/grub2/i386-pc/eltorito.img /usr/share/grub2/i386-pc/boot_hybrid.img /boot/x86_64/loader
{{end}}
{{end}}
- cp -p kairos/overlay/files-iso/boot/grub2/grub.cfg /boot/grub2/grub.cfg
- cp -p config/grub_live_bios.cfg /boot/grub2/grub.cfg
{{end}}
{{if eq .Values.name "grub2-efi-image"}}
image: "opensuse/tumbleweed"
prelude:
{{if .Values.arch }}
{{if eq .Values.arch "amd64"}}
- zypper in -y shim grub2-x86_64-efi
{{end}}
{{if eq .Values.arch "arm64"}}
- zypper in -y shim grub2-arm64-efi
{{end}}
{{end}}
- zypper cc
steps:
- mkdir -p /EFI/BOOT
{{if .Values.arch }}
{{if eq .Values.arch "amd64"}}
- mkdir -p /EFI/BOOT
# For removable drives the name of the efi needs to be bootx64.efi
- cp /usr/share/efi/x86_64/shim.efi /EFI/BOOT/bootx64.efi
- cp /usr/share/efi/x86_64/grub.efi /EFI/BOOT/grub.efi
- cp /usr/share/efi/x86_64/MokManager.efi /EFI/BOOT/MokManager.efi
{{end}}
{{if eq .Values.arch "arm64"}}
- mkdir -p /EFI/BOOT
# For removable drives the name of the efi needs to be bootaa64.efi
- cp /usr/share/efi/aarch64/shim.efi /EFI/BOOT/bootaa64.efi
- cp /usr/share/efi/aarch64/grub.efi /EFI/BOOT/grub.efi

View File

@@ -1,11 +1,9 @@
packages:
- name: "grub2"
category: "livecd"
version: "0.0.9"
version: "0.0.10"
description: "Grub2 booloader for live systems"
kairos_tag: "1.6.0"
- name: "grub2-efi-image"
category: "livecd"
version: "0.0.9"
kairos_tag: "1.6.0"
version: "0.0.10"
description: "Grub2 booloader EFI image for live systems"

View File

@@ -0,0 +1,70 @@
search --file --set=root /boot/kernel
set default=0
set timeout=10
set timeout_style=menu
set linux=linux
set initrd=initrd
if [ "${grub_cpu}" = "x86_64" -o "${grub_cpu}" = "i386" -o "${grub_cpu}" = "arm64" ];then
if [ "${grub_platform}" = "efi" ]; then
if [ "${grub_cpu}" != "arm64" ]; then
set linux=linuxefi
set initrd=initrdefi
fi
fi
fi
if [ "${grub_platform}" = "efi" ]; then
echo "Please press 't' to show the boot menu on this console"
fi
set font=($root)/boot/${grub_cpu}/loader/grub2/fonts/unicode.pf2
if [ -f ${font} ];then
loadfont ${font}
fi
menuentry "Kairos" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty1 console=ttyS0 rd.cos.disable vga=795 nomodeset nodepair.enable selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
menuentry "Kairos (manual)" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty1 console=ttyS0 rd.cos.disable vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
menuentry "kairos (interactive install)" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty1 console=ttyS0 rd.cos.disable vga=795 nomodeset interactive-install selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
menuentry "Kairos (remote recovery mode)" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty1 console=ttyS0 rd.cos.disable vga=795 nomodeset kairos.remote_recovery_mode selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
menuentry "Kairos (boot local node from livecd)" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty1 console=ttyS0 kairos.boot_live_mode vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
menuentry "Kairos (debug)" --class os --unrestricted {
echo Loading kernel...
$linux ($root)/boot/kernel cdroot root=live:CDLABEL=COS_LIVE rd.live.dir=/ rd.live.squashimg=rootfs.squashfs net.ifnames=1 console=tty0 rd.debug rd.shell rd.cos.disable rd.immucore.debug vga=795 nomodeset selinux=0 rd.live.overlay.overlayfs
echo Loading initrd...
$initrd ($root)/boot/initrd
}
if [ "${grub_platform}" = "efi" ]; then
hiddenentry "Text mode" --hotkey "t" {
set textmode=true
terminal_output console
}
fi