#!/bin/sh # Copyright 1999-2015 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=${srcd} 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=${srcd} 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=${srcd} 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=${srcd} loopback loop \${isofile} linux (loop)/isolinux/altker64 ${SRCD_BOOTOPTIONS} isoloop=\${isofile} initrd (loop)/isolinux/initram.igz } } EOF fi