diff --git a/elements/deploy-kexec/README.md b/elements/deploy-kexec/README.md new file mode 100644 index 00000000..af3f9423 --- /dev/null +++ b/elements/deploy-kexec/README.md @@ -0,0 +1,3 @@ +Boots into the new image once baremetal-deploy-helper signals +it is finished by downloading the kernel and ramdisk via tftp, +and using the kexec utilities. \ No newline at end of file diff --git a/elements/deploy-kexec/binary-deps.d/deploy-kexec b/elements/deploy-kexec/binary-deps.d/deploy-kexec new file mode 100644 index 00000000..0526f546 --- /dev/null +++ b/elements/deploy-kexec/binary-deps.d/deploy-kexec @@ -0,0 +1 @@ +kexec diff --git a/elements/deploy-kexec/element-deps b/elements/deploy-kexec/element-deps new file mode 100644 index 00000000..8541464a --- /dev/null +++ b/elements/deploy-kexec/element-deps @@ -0,0 +1 @@ +deploy diff --git a/elements/deploy-kexec/init.d/zdeploy-kexec b/elements/deploy-kexec/init.d/zdeploy-kexec new file mode 100644 index 00000000..e456f7d7 --- /dev/null +++ b/elements/deploy-kexec/init.d/zdeploy-kexec @@ -0,0 +1,10 @@ +TFTP_MAC_ADDRESS="01-"`echo $BOOT_MAC_ADDRESS | sed 's/:/-/g' | tr "A-Z" "a-z"` +tftp -r /tftpboot/pxelinux.cfg/${TFTP_MAC_ADDRESS} -g ${BOOT_SERVER} +APPEND=$(tail -n1 ${TFTP_MAC_ADDRESS} | cut -f3- -d" ") + +KERNEL=$(get_kernel_parameter BOOT_IMAGE | sed 's/deploy_//g') +RAMDISK=$(echo $KERNEL | sed 's/kernel/ramdisk/') + +tftp -r ${KERNEL} -g ${BOOT_SERVER} +tftp -r ${RAMDISK} -g ${BOOT_SERVER} +kexec -l kernel --append="${APPEND}" --initrd=ramdisk && kexec -e diff --git a/elements/deploy-kexec/install.d/53-install-kexec b/elements/deploy-kexec/install.d/53-install-kexec new file mode 100755 index 00000000..19e430e5 --- /dev/null +++ b/elements/deploy-kexec/install.d/53-install-kexec @@ -0,0 +1,2 @@ +#!/bin/sh +install-packages kexec-tools