Skip to content

Instantly share code, notes, and snippets.

@kryogenic
Created February 11, 2020 03:05
Show Gist options
  • Save kryogenic/d0d20e6064b2ecfefc83aa97a61d9d1a to your computer and use it in GitHub Desktop.
Save kryogenic/d0d20e6064b2ecfefc83aa97a61d9d1a to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
## Generates a password for the kernel cmdline
password="rancher"
echo "## Installing kexec-tools, aria2" && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --show-progress kexec-tools aria2 && \
apt-get clean
echo "## Downloading RancherOS ISO" && \
aria2c https://github.com/rancher/os/releases/download/v1.5.5/rancheros.iso
echo "## Mounting RancherOS ISO" && \
mount -t iso9660 rancheros.iso /mnt || echo bad iso image
echo "## Entering Mounted RancherOS ISO" && \
[ -d /mnt/boot ] \
&& cd /mnt/ \
|| echo exit
echo "## Credentials: ${password} (rancher)" && echo "## Kernel-Executing RancherOS" && \
kexec --initrd ./boot/initrd-v1.5.5 \
--command-line="rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[/dev/nvme0n1] rancher.state.wait rancher.cloud_init.datasources=[url:https://pastebin.com/raw/xxxxxx] rancher.password=${password}" \
./boot/vmlinuz-4.14.138-rancher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment