--- kexec.init-2.0.3 2012-03-18 07:46:02.000000000 +0000 +++ kexec.init-2.0.3 2012-12-17 03:39:56.962835815 +0000 @@ -14,7 +14,7 @@ image_path() { bzImage-${kver} vmlinuz-${kver} \ kernel-genkernel-${karch}-${kver} \ kernel-${kver} kernel-${karch}; do - if [[ -e "${BOOTPART}/${x}" ]] ; then + if [ -e "${BOOTPART}/${x}" ] ; then echo "${BOOTPART}/${x}" return 0 fi @@ -30,7 +30,7 @@ initrd_path() { initrd.img-${kver} initrd-${kver}.img \ initrd-${kver} initramfs-${kver}.img \ initramfs-genkernel-${karch}-${kver} ; do - if [[ -e "${BOOTPART}/${x}" ]] ; then + if [ -e "${BOOTPART}/${x}" ] ; then echo "${BOOTPART}/${x}" return 0 fi @@ -40,7 +40,7 @@ initrd_path() { } load_image() { - if [[ "${KNAME}" = "-" ]]; then + if [ "${KNAME}" = "-" ]; then ebegin "Disabling kexec" kexec -u eend $? @@ -50,7 +50,7 @@ load_image() { BOOTPART="${BOOTPART:-/boot}" local img="$(image_path)" initrd="$(initrd_path)" mounted=false initrdopt= - if [[ -z "${img}" ]] || [[ -z "${initrd}" ]]; then + if [ -z "${img}" ] || [ -z "${initrd}" ]; then # If we cannot find our image, try mounting ${BOOTPART} if ! grep -q " ${BOOTPART} " /proc/mounts; then ebegin "Mounting ${BOOTPART}" @@ -61,7 +61,7 @@ load_image() { fi fi - if [[ -z "${img}" ]]; then + if [ -z "${img}" ]; then eerror "No kernel image found in ${BOOTPART}!" ${mounted} && umount "${BOOTPART}" return 1 @@ -69,12 +69,12 @@ load_image() { ebegin "Loading kernel image ${img} for kexec" fi - [[ -n "${ROOTPART}" ]] || \ + [ -n "${ROOTPART}" ] || \ ROOTPART="$(readlink -f "$(sed -n '/^\/[^ ]* \/ / s,^\([^ ]*\).*,\1,p' /proc/mounts)")" - [[ -n "${KPARAM}" ]] || KEXEC_OPT_ARGS+=" --reuse-cmdline" + [ -n "${KPARAM}" ] || KEXEC_OPT_ARGS="${KEXEC_OPT_ARGS} --reuse-cmdline" - [[ -n "${initrd}" ]] && [[ -e "${initrd}" ]] && initrdopt="--initrd=${initrd}" + [ -n "${initrd}" ] && [ -e "${initrd}" ] && initrdopt="--initrd=${initrd}" einfo " Setting kexec with ${KEXEC_OPT_ARGS} -l ${img} root=${ROOTPART} ${KPARAM} ${initrdopt}" kexec ${KEXEC_OPT_ARGS} -l "${img}" --append="root=${ROOTPART} ${KPARAM}" ${initrdopt} @@ -86,7 +86,7 @@ load_image() { } start() { - if [[ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]]; then + if [ "${LOAD_DURING_SHUTDOWN:-yes}" = "yes" ]; then image_path > /dev/null || \ ewarn "Cannot find kernel image. Please make sure a valid kernel image is present before reboot." return 0 @@ -98,7 +98,7 @@ start() { } stop() { - [[ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ]] && return 0 + [ "${LOAD_DURING_SHUTDOWN:-yes}" != "yes" ] && return 0 if ! yesno $RC_REBOOT; then einfo "Not rebooting, so disabling" @@ -106,7 +106,7 @@ stop() { return 0 fi - if [[ -f /nokexec ]]; then + if [ -f /nokexec ]; then einfo "Not using kexec during reboot" rm -f /nokexec kexec -u