#! /bin/sh -e ######################################################## # This script generates an Invaders entry on grub.cfg # # if grubinvaders is installed on the system. # ######################################################## prefix="/usr" exec_prefix="${prefix}" datarootdir="/usr/share" datadir="${datarootdir}" . "${datadir}/grub/grub-mkconfig_lib" INVADERS_IMAGE="/boot/grubinvaders/invaders.bin" CLASS="--class game" if [ -e ${INVADERS_IMAGE} ] && is_path_readable_by_grub ${INVADERS_IMAGE}; then # image exists, create menu entry echo "Found Invaders image: ${INVADERS_IMAGE}" >&2 echo "if [ \"\${grub_platform}\" == \"pc\" ]; then" echo -e "\tmenuentry \"Grub Invaders\" ${CLASS} {" prepare_grub_to_access_device $(${grub_probe} --target=device ${INVADERS_IMAGE}) | sed -e "s/^/\t\t/" echo -e "\t\tmultiboot $(make_system_path_relative_to_its_root ${INVADERS_IMAGE})" echo -e "\t}" echo "fi" fi