Skip to content

Instantly share code, notes, and snippets.

@SvenDowideit
Last active April 11, 2017 10:40
Show Gist options
  • Save SvenDowideit/4fb7519d0ee0849604a43121b675a499 to your computer and use it in GitHub Desktop.
Save SvenDowideit/4fb7519d0ee0849604a43121b675a499 to your computer and use it in GitHub Desktop.
#!/bin/bash
# get the kernel and initrd
ROS_VERSION="v0.9.2-statedir"
URL_BASE="https://github.com/rancher/os/releases/download/${ROS_VERSION}"
VMLINUX="vmlinuz-4.9.21-statedir"
INITRD="initrd-v0.9.2-statedir"
cd /tmp
echo "downloading ${URL_BASE}/${VMLINUX}" > /dev/kmsg
curl -O -L "${URL_BASE}/${VMLINUX}"
echo "downloading ${URL_BASE}/${INITRD}" > /dev/kmsg
curl -O -L "${URL_BASE}/${INITRD}"
if [ "$(ros config get rancher.environment.installer)" == "true" ] && ros --version &>/dev/null; then
ros install -f -c cloud-config.yml -d /dev/sda -p /dev/sda1 --statedir ros --append "rancher.debug=true printk.devkmsg=on rancher.network.interfaces.eth*.dhcp=true rancher.cloud_init.datasources=[packet] rancher.autologin=tty1 rancher.autologin=ttyS1 console=ttyS1,115200n8"
exit 0
fi
echo "apt-get installing kexec" > /dev/kmsg
#apt-get update && apt-get install -y kexec-tools ipcalc
#dnf update
dnf install -y kexec-tools ipcalc
echo "running kexec" > /dev/kmsg
kexec --initrd=${INITRD} -l ${VMLINUX} -f --command-line="rancher.debug=true printk.devkmsg=on rancher.network.interfaces.eth*.dhcp=true rancher.cloud_init.datasources=[packet] rancher.autologin=tty1 rancher.autologin=ttyS1 console=ttyS1,115200n8 rancher.environment.installer=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment