public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas K. Hüttel" <dilfridge@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:dilfridge/qcow2 commit in: targets/support/
Date: Sat,  5 Oct 2024 19:15:07 +0000 (UTC)	[thread overview]
Message-ID: <1728155671.74a62e27beb0c7a7e1967a49d5c75b72c22db6cb.dilfridge@gentoo> (raw)

commit:     74a62e27beb0c7a7e1967a49d5c75b72c22db6cb
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  5 19:14:31 2024 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct  5 19:14:31 2024 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=74a62e27

Add simplified qcow2 bootloader setup (do we really want grub?)

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 targets/support/qcow2-bootloader-setup.sh | 69 +++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/targets/support/qcow2-bootloader-setup.sh b/targets/support/qcow2-bootloader-setup.sh
new file mode 100755
index 00000000..be577ada
--- /dev/null
+++ b/targets/support/qcow2-bootloader-setup.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+
+source ${clst_shdir}/support/functions.sh
+
+# $1 is the destination root
+
+if [[ -n ${clst_cdtar} ]]; then
+	extract_cdtar $1
+fi
+
+extract_kernels $1/boot
+
+cmdline_opts=()
+
+# Add any additional options
+if [ -n "${clst_qcow2_bootargs}" ]
+then
+	for x in ${clst_qcow2_bootargs}
+	do
+		cmdline_opts+=(${x})
+	done
+fi
+
+# Optional memtest setups
+memtest_grub() {
+  if [[ -e $1/memtest.efi64 ]]; then
+    echo 'if [ "x$grub_platform" = xefi ]; then'
+    echo '  menuentry "Memtest86+ 64bit UEFI" {'
+    echo '    chainloader "/memtest.efi64"'
+    echo '  }'
+    echo 'fi'
+  fi
+}
+
+default_append_line=(${cmdline_opts[@]})
+default_dracut_append_line=(${clst_qcow2_bootargs})
+
+case ${clst_hostarch} in
+	amd64|arm64|ppc64*)
+		kern_subdir=/boot
+		iacfg=$1/boot/grub/grub.cfg
+		mkdir -p $1/boot/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 'Boot Gentoo image (kernel: ${x})' --class gnu-linux --class os {"  >> ${iacfg}
+			if [ ${distkernel} = "yes" ]
+			then
+				# FIXME: what can we search for here?
+				echo "	search --no-floppy --set=root -l ${clst_iso_volume_id}" >> ${iacfg}
+				echo "	linux ${kern_subdir}/${x} ${default_dracut_append_line[@]}" >> ${iacfg}
+			else
+				echo "	linux ${kern_subdir}/${x} ${default_append_line[@]}" >> ${iacfg}
+			fi
+			echo "	initrd ${kern_subdir}/${x}.igz" >> ${iacfg}
+			echo "}" >> ${iacfg}
+			echo "" >> ${iacfg}
+		done
+		memtest_grub $1 >> ${iacfg}
+	;;
+esac
+exit $?


             reply	other threads:[~2024-10-05 19:15 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-05 19:15 Andreas K. Hüttel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-13 13:35 [gentoo-commits] proj/catalyst:dilfridge/qcow2 commit in: targets/support/ Andreas K. Hüttel
2024-10-13 13:35 Andreas K. Hüttel
2024-10-13 13:02 Andreas K. Hüttel
2024-10-13 12:43 Andreas K. Hüttel
2024-10-12 22:56 Andreas K. Hüttel
2024-10-12 22:18 Andreas K. Hüttel
2024-10-12 22:06 Andreas K. Hüttel
2024-10-12 22:06 Andreas K. Hüttel
2024-10-12 21:58 Andreas K. Hüttel
2024-10-12 21:39 Andreas K. Hüttel
2024-10-12 21:39 Andreas K. Hüttel
2024-10-12 21:15 Andreas K. Hüttel
2024-10-12 20:48 Andreas K. Hüttel
2024-10-12 19:01 Andreas K. Hüttel
2024-10-12 17:58 Andreas K. Hüttel
2024-10-12 17:52 Andreas K. Hüttel
2024-10-12 16:43 Andreas K. Hüttel
2024-10-12 16:29 Andreas K. Hüttel
2024-10-12 15:18 Andreas K. Hüttel
2024-10-12 14:54 Andreas K. Hüttel
2024-10-12 14:29 Andreas K. Hüttel
2024-10-11 23:09 Andreas K. Hüttel
2024-10-11 23:01 Andreas K. Hüttel
2024-10-11 22:51 Andreas K. Hüttel
2024-10-11 22:28 Andreas K. Hüttel
2024-10-11 22:28 Andreas K. Hüttel
2024-10-11 22:07 Andreas K. Hüttel
2024-10-11 22:07 Andreas K. Hüttel
2024-10-11 20:14 Andreas K. Hüttel
2024-10-06 21:57 Andreas K. Hüttel
2024-10-06 20:41 Andreas K. Hüttel
2024-10-06 19:33 Andreas K. Hüttel
2024-10-05 15:48 Andreas K. Hüttel
2024-10-02 21:47 Andreas K. Hüttel
2024-09-27 23:45 Andreas K. Hüttel
2024-09-27 23:04 Andreas K. Hüttel
2024-08-09 19:34 Andreas K. Hüttel
2024-08-09 19:34 Andreas K. Hüttel
2024-08-09 19:34 Andreas K. Hüttel
2024-08-09 19:34 Andreas K. Hüttel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1728155671.74a62e27beb0c7a7e1967a49d5c75b72c22db6cb.dilfridge@gentoo \
    --to=dilfridge@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox