summaryrefslogtreecommitdiff
path: root/sys-boot/systemrescuecd-x86-grub/files/systemrescuecd.grub
blob: 269b1eb76adb16a01237c56c847fb63baf3be620 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/sh
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

. /usr/share/grub/grub-mkconfig_lib

if [ -r /etc/default/systemrescuecd ] ; then
  . /etc/default/systemrescuecd
fi

# srcd = path of newest link to iso of systemrescuecd, created by the ebuild
#        of systemrescuecd-x86
srcd="/usr/share/systemrescuecd/systemrescuecd-x86-newest.iso"

longname="SystemRescueCD"
bootops=")"

if [ ! -z "${SRCD_BOOTOPTIONS}" ]; then
	bootops=" with bootoptions)"
fi

if [ -f "${srcd}" ]; then

	device=$(${grub_probe} --target=device "${srcd}")
	path=$(make_system_path_relative_to_its_root "${srcd}")
	grub_string=$(prepare_grub_to_access_device "${device}" | grub_add_tab | grub_add_tab)

	gettext_printf "Found %s on %s\n" "${longname}" "${device}" >&2
	onstr=$(gettext_printf "(on %s)" "${device}")

	cat << EOF
submenu "${longname}" --class submenu {
	menuentry "${longname} (32bit standard${bootops}" --class rescue {
${grub_string}
		set isofile=${path}
		loopback loop \${isofile}
		linux (loop)/isolinux/rescue32 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
		initrd (loop)/isolinux/initram.igz
	}
	menuentry "${longname} (64bit standard${bootops}" --class rescue {
${grub_string}
		set isofile=${path}
		loopback loop \${isofile}
		linux (loop)/isolinux/rescue64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
		initrd (loop)/isolinux/initram.igz
	}
	menuentry "${longname} (32bit alternative${bootops}" --class rescue {
${grub_string}
		set isofile=${path}
		loopback loop \${isofile}
		linux (loop)/isolinux/altker32 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
		initrd (loop)/isolinux/initram.igz
	}
	menuentry "${longname} (64bit alternative${bootops}" --class rescue {
${grub_string}
		set isofile=${path}
		loopback loop \${isofile}
		linux (loop)/isolinux/altker64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile}
		initrd (loop)/isolinux/initram.igz
	}
}
EOF

fi