#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/kexec-tools/files/kexec.init,v 1.8 2006/08/13 11:22:06 uberlord Exp $ depend() { need localmount } image_path() { local x= kver=$(uname -r) for x in "${KNAME:-bzImage}" vmlinuz \ bzImage-"${kver}" vmlinuz-"${kver}" ; do if [[ -e ${BOOTPART}/${x} ]] ; then echo "${BOOTPART}/${x}" return 0 fi done return 1 } load_image() { if [[ ${KNAME} == "-" ]] ; then ebegin "Disabling kexec" kexec -u eend $? return $? fi BOOTPART="${BOOTPART:-/boot}" local img=$(image_path) mounted=false initrdopt= if [[ -z ${img} ]] ; then # If we cannot find our image, try mounting ${BOOTPART} if [[ ! $'\n'$(