Skip to content

Instantly share code, notes, and snippets.

@aredridel
Last active January 4, 2016 18:12
Show Gist options
  • Save aredridel/9043504 to your computer and use it in GitHub Desktop.
Save aredridel/9043504 to your computer and use it in GitHub Desktop.
Set up and boot CoreOS on top of a stock DigitalOcean Fedora 19 install. Abuses the Fedora 19 root as the CoreOS STATE partition. Still todo: copy SSH keys from Fedora install.
#!/bin/sh
kexec --load /boot/coreos_production_pxe.vmlinuz --initrd=/boot/coreos_production_pxe_image.cpio.gz --append='state=/dev/vda root=squashfs: sshkey="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAEAQCZ3fvhC7StXFdFRuXApBuXyS2phoH7ZVKMUMOi3DrbnZWC01GUq74WdalRDHtfq2dl0CPctLb8RHSD+/dKgWEH0gmoEOCio09ZAY5Ui4Cy+0cCGefXkUnJR4lgNOYD076BXjJwsCVCD8sMlFFT08Qn4/voP0jpL1uvvoWiC1KSvSjZf7sP/hRgsO633OuclXyVVq7mC6q+2QVg6hfO49Gt7TVXb+8lc8aUHAYyrXEVag6oICWqxWlSglbEpXCXhK4RB1f8h2vCaEPe2Kf1LNPYJ3dN5H5v+tnst9oZbFjo/qNSm4RvPBb3nsNARdcemdGcwiTjAiIn9gMxBMOyiYOYSgVwGd2U76FR0/RUFUORprynn6uebBhtpGzIAuFsUygMAPAM2tocO+t+h8AQviF6IeA9rKwf5bFTXV9HLy+iUoCWsVBmGypfGbsD7UNg3DIpXv4FdoLDDiCq+OV16ludjLk5pjknshH0cII+Q5b1fcITKSMrZ0CnMytkHHYPTvJ/uc2W9p3howAbMCs+WpNsSnLoCfq5ZjWclauV9Sn7OULQSMuKzTBF+bN7FOyolPbFrW+B3ESUpbonbLbKOubvsBjnUQLNoNjH4pa5Sg3Pluh1EoYLq/oKYU/C+SSwnbRy9N1h2z5UZy/CyrGNG8UomkuFIZWOAGH+zqwU1iCYaWHPgUNXM+4gSe0cGmVesFRpco5nhqvHGdDtw3OCC1U0f9jj6Pk+4jFmulj45+Hu4ZEL8wyMlftbycT8KtuqSVOD/yuytPFlvBzFrjP9s3V8ZN46y5rLpR9dAD+DJHYVESGxQV9lLq2g0p8IJzxToqDvEtKI5/6opajZo7d9dJQaEAN/M3UmaDByPY6a6YrRKkEFonByXCjpyH7hBJGAhpHGNC7bHE5XFa7u9qtzCB0347ZvVpyL0OmGjrJUo6wM3sV+nbEShSBLIY7SnrQl2k6ilsC2OH+zMD+mymGOMUGsRKxq4Riau4g7XLjMdAQPtikq5KBUFWz1utLtayoNtbILxddqZzA7V5iK2w2iMKOPo9+6tLKRjD9chiG+CgB5sMlAytoZR07LiXUGXe18fYYWzISbo9IScpGypBMtw4VNImuUqQ/32xKLAxkck5WA5qAKRewyqkDtuUF7Cqo7Ez6nFBDc1EUdMpiufa+74WvfbM50GhXtKO1yZch3n4XvgZ0KN6+Pyzr6QOCwZVpLY0Z9oTD3M+BJcTVcCG4FcTzYvzjyklqUWQ6cl3fMgyxubx6Ouxk3OQ2+toKYXV63zh3WugCADp95AmY9T1cjSHlDHYsuRX8pi7gIPGD4wh5iwteRJJ55u/IRtJ2WkkOezc4wdR/2WdHCYgsLcJVjfLnP aredridel@nbtsc.org"'
sync # this is a horrible good-enough hack.
kexec -e
#!/bin/sh
cd /boot
wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_pxe.vmlinuz
wget http://storage.core-os.net/coreos/amd64-generic/dev-channel/coreos_production_pxe_image.cpio.gz
gzip -d coreos_production_pxe_image.cpio.gz
mkdir -p usr/share/oem
echo '#!/bin/sh' > usr/share/oem/run
echo ip -4 addr `ip -o -4 addr show eth0 | awk '{print $4}'` add dev eth0 >> usr/share/oem/run
echo ip -4 route add `ip -o -4 route show default dev eth0 proto boot` >> usr/share/oem/run
echo cp /usr/share/oem/resolv.conf /etc/resolv.conf
cp /etc/resolv.conf usr/share/oem/resolv.conf
chmod +x usr/share/oem/run
find usr | cpio -o -A -H newc -O coreos_production_pxe_image.cpio
gzip coreos_production_pxe_image.cpio
tune2fs -L STATE /dev/vda
@intellix
Copy link

maybe obvious for anyone but me, but if you're installing a base version of Federa 19 on DO, ifrst you need to do the following:

  • yum install kexec-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment