1
0
mirror of https://github.com/rancher/os.git synced 2025-07-04 02:26:13 +00:00

add a fedora based cloud-initi RancherOS install cloud-init script

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-04-13 10:14:28 +10:00
parent 7b421d02b0
commit 096c281ded

View File

@ -0,0 +1,28 @@
#!/bin/bash
ROS_VERSION="v0.9.2-symbiote"
URL_BASE="https://github.com/SvenDowideit/os/releases/download/${ROS_VERSION}"
VMLINUX="vmlinuz-4.9.21-rancher"
INITRD="initrd
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/vda -p /dev/vda1 \
--statedir ros -t noformat \
--append "rancher.state.directory=ros rancher.debug=true printk.devkmsg=on notsc clocksource=kvm-clock rancher.network.interfaces.eth0.ipv4ll rancher.cloud_init.datasources=[digitalocean] rancher.autologin=tty1 rancher.autologin=ttyS0"
exit 0
fi
echo "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 notsc clocksource=kvm-clock rancher.network.interfaces.eth0.ipv4ll rancher.cloud_init.datasources=[digitalocean] rancher.autologin=tty1 rancher.autologin=ttyS0 rancher.environment.installer=true"