commit: eaba8da233aa1837ff180fb3c00b79038e1e7747
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 12 20:48:27 2024 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct 12 20:48:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=eaba8da2
Use grub-mkconfig instead of our self-made mess
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
targets/support/diskimage-installation.sh | 1 -
targets/support/qcow2-bootloader-setup.sh | 56 -------------------------------
targets/support/qcow2-grub-install.sh | 5 ++-
3 files changed, 4 insertions(+), 58 deletions(-)
diff --git a/targets/support/diskimage-installation.sh
b/targets/support/diskimage-installation.sh
index 7abe62fb..1d80a9be 100755
--- a/targets/support/diskimage-installation.sh
+++ b/targets/support/diskimage-installation.sh
@@ -16,7 +16,6 @@ if [[ $(readlink /etc/portage/make.profile) == *systemd* ]] ;
then
# generic - an image with no means of logging in... needs postprocessing
# no services are started
-# Set up basic services
echo "Running systemctl preset-all"
systemctl preset-all || die "Running systemctl preset-all failed"
diff --git a/targets/support/qcow2-bootloader-setup.sh
b/targets/support/qcow2-bootloader-setup.sh
index ff338126..eb59cc52 100755
--- a/targets/support/qcow2-bootloader-setup.sh
+++ b/targets/support/qcow2-bootloader-setup.sh
@@ -17,59 +17,3 @@ then
done
fi
-# Optional memtest setups
-memtest_grub() {
- if [[ -e ${my_bootdir}/memtest64.bios ]]; then
- echo 'if [ "x$grub_platform" = xpc ]; then'
- echo ' menuentry "Memtest86+ 64bit BIOS" {'
- echo ' linux "/memtest64.bios"'
- echo ' }'
- echo 'fi'
- fi
- if [[ -e ${my_bootdir}/memtest.efi64 ]]; then
- echo 'if [ "x$grub_platform" = xefi ]; then'
- echo ' menuentry "Memtest86+ 64bit UEFI" {'
- echo ' chainloader "/memtest.efi64"'
- echo ' }'
- echo 'fi'
- fi
- if [[ -e ${my_bootdir}/memtest32.bios ]]; then
- echo 'menuentry "Memtest86+ 32bit BIOS" {'
- echo ' linux "/memtest32.bios"'
- echo '}'
- fi
-}
-
-default_append_line=(${cmdline_opts[@]})
-default_dracut_append_line=(${clst_diskimage_bootargs}
'root="LABEL=gentooroot"')
-
-case ${clst_hostarch} in
- amd64|arm64|ppc*)
- iacfg=${my_bootdir}/grub/grub.cfg
- mkdir -p ${my_bootdir}/grub
- echo 'set default=0' > ${iacfg}
- echo 'set gfxpayload=keep' >> ${iacfg}
- echo 'set timeout=10' >> ${iacfg}
- echo 'insmod all_video' >> ${iacfg}
- echo '' >> ${iacfg}
- for x in ${clst_boot_kernel}
- do
- eval "kernel_console=\$clst_boot_kernel_${x}_console"
- eval "distkernel=\$clst_boot_kernel_${x}_distkernel"
-
- echo "menuentry 'Gentoo Linux (kernel: ${x})' --class
gnu-linux --class os {" >> ${iacfg}
- if [ ${distkernel} = "yes" ]
- then
- echo " search --no-floppy --set=root -l
gentooefi" >> ${iacfg}
- echo " linux /${x}
${default_dracut_append_line[@]}" >> ${iacfg}
- else
- echo " linux /${x} ${default_append_line[@]}"
>> ${iacfg}
- fi
- echo " initrd /${x}.igz" >> ${iacfg}
- echo "}" >> ${iacfg}
- echo "" >> ${iacfg}
- done
- memtest_grub $1 >> ${iacfg}
- ;;
-esac
-exit $?
diff --git a/targets/support/qcow2-grub-install.sh
b/targets/support/qcow2-grub-install.sh
index 31194262..850eb72a 100755
--- a/targets/support/qcow2-grub-install.sh
+++ b/targets/support/qcow2-grub-install.sh
@@ -2,5 +2,8 @@
source /tmp/chroot-functions.sh
-# install the boot loader
+echo "Installing grub with target x86_64-efi"
grub-install --no-floppy --efi-directory=/boot --removable --skip-fs-probe
--no-nvram --no-bootsector --target=x86_64-efi
+
+echo "Creating grub configuration"
+grub-mkconfig -o /boot/grub/grub.cfg