1 |
commit: 59b0932124c23e3088353d4992d5686b7d65ef82 |
2 |
Author: Ben Kohler <bkohler <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 1 17:43:35 2022 +0000 |
4 |
Commit: Ben Kohler <bkohler <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 1 17:43:35 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=59b09321 |
7 |
|
8 |
livecd-stage2: add memtest86+ detection for x86/amd64 |
9 |
|
10 |
When memtest86+ is detected, catalyst should now copy to the livecd and |
11 |
add it to grub menus. |
12 |
|
13 |
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org> |
14 |
|
15 |
targets/livecd-stage2/controller.sh | 4 ++++ |
16 |
targets/support/bootloader-setup.sh | 23 +++++++++++++++++++++++ |
17 |
2 files changed, 27 insertions(+) |
18 |
|
19 |
diff --git a/targets/livecd-stage2/controller.sh b/targets/livecd-stage2/controller.sh |
20 |
index 2b8858c0..9aba8167 100755 |
21 |
--- a/targets/livecd-stage2/controller.sh |
22 |
+++ b/targets/livecd-stage2/controller.sh |
23 |
@@ -93,6 +93,10 @@ case $1 in |
24 |
cp -f ${clst_sharedir}/livecd/files/README.txt $1 |
25 |
fi |
26 |
|
27 |
+ if [ -e ${clst_chroot_path}/boot/memtest86plus/ ]; then |
28 |
+ cp -rv ${clst_chroot_path}/boot/memtest86plus/* $1 |
29 |
+ fi |
30 |
+ |
31 |
case ${clst_livecd_type} in |
32 |
gentoo-release-livecd) |
33 |
mkdir -p $1/snapshots |
34 |
|
35 |
diff --git a/targets/support/bootloader-setup.sh b/targets/support/bootloader-setup.sh |
36 |
index 08d25b59..deff5609 100755 |
37 |
--- a/targets/support/bootloader-setup.sh |
38 |
+++ b/targets/support/bootloader-setup.sh |
39 |
@@ -30,6 +30,28 @@ case ${clst_fstype} in |
40 |
;; |
41 |
esac |
42 |
|
43 |
+# Optional memtest setups |
44 |
+memtest_grub() { |
45 |
+ if [[ -e $1/memtest64.bios ]]; then |
46 |
+ echo 'if [ "x$grub_platform" = xpc ]; then' |
47 |
+ echo ' menuentry "Memtest86+ 64bit BIOS" {' |
48 |
+ echo ' linux "/memtest64.bios"' |
49 |
+ echo ' }' |
50 |
+ echo 'fi' |
51 |
+ fi |
52 |
+ if [[ -e $1/memtest.efi64 ]]; then |
53 |
+ echo 'if [ "x$grub_platform" = xefi ]; then' |
54 |
+ echo ' menuentry "Memtest86+ 64bit UEFI" {' |
55 |
+ echo ' chainloader "/memtest.efi64"' |
56 |
+ echo ' }' |
57 |
+ echo 'fi' |
58 |
+ fi |
59 |
+ if [[ -e $1/memtest32.bios ]]; then |
60 |
+ echo 'menuentry "Memtest86+ 32bit BIOS" {' |
61 |
+ echo ' linux "/memtest32.bios"' |
62 |
+ echo '}' |
63 |
+ fi |
64 |
+} |
65 |
|
66 |
default_append_line=(root=/dev/ram0 init=/linuxrc ${cmdline_opts[@]} cdroot) |
67 |
|
68 |
@@ -118,6 +140,7 @@ case ${clst_hostarch} in |
69 |
fi |
70 |
echo "" >> ${iacfg} |
71 |
done |
72 |
+ memtest_grub $1 >> ${iacfg} |
73 |
;; |
74 |
mips) |
75 |
# NO SOFTLEVEL SUPPORT YET |