#!/bin/ash kexec=$(which kexec 2>/dev/null) if [ -z "$kexec" ]; then echo "Failed to find kexec binary in PATH. Exiting." exit 1 fi . /opt/openslx/bin/slx-tools kexec_load() { . /opt/openslx/config local DIR="$(mktemp -d)" for FILE in kernel initramfs-stage31; do if ! download_retry "http://${SLX_KCL_SERVERS}/${SLX_BASE_PATH}/${FILE}" > "${DIR}/${FILE}" ; then echo "Failed to download ${FILE}." exit 1 fi done if download_retry "http://${SLX_KCL_SERVERS}/tftp/bwlp.cpio" > "${DIR}/bwlp.cpio"; then cat "${DIR}/initramfs-stage31" "${DIR}/bwlp.cpio" > "${DIR}/initramfs-tmp" mv -f -- "${DIR}/initramfs-tmp" "${DIR}/initramfs-stage31" fi if ! kexec -l "${DIR}/kernel" --initrd "${DIR}/initramfs-stage31" --reuse-cmdline; then echo "Failed to load kernel/initrd from ${DIR}" exit 1 fi } kexec_load