fedora-symbiote.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. #
  3. # This can be invoked either from the commandline of a fedora 25 vm, or as user-data
  4. # either way, the part inside the "if" needs to be run by hand from the console atmA
  5. #
  6. # The most experimental way, is to use the ./scripts/hosting/digitalocean/host.sh script to modify this one for the current build
  7. # push the rancher/os:sha image to hub, and then use
  8. # doctl.exe compute droplet create --enable-ipv6 --enable-private-networking --image fedora-25-x64 --region sfo1 --size 2gb --ssh-keys 6956055 --ssh-keys 7170404 --user-data-file digitalocean.yml sven
  9. # where:
  10. #$ cat digitalocean.yml
  11. ##include
  12. #http://<IPaddress>:2115/digitalocean.sh
  13. #
  14. #
  15. ROS_VERSION="v1.0.1-rc1"
  16. URL_BASE="https://github.com/rancher/os/releases/download/${ROS_VERSION}"
  17. VMLINUX="vmlinuz-4.9.22-rancher"
  18. INITRD="initrd
  19. cd /tmp
  20. echo "downloading ${URL_BASE}/${VMLINUX}" > /dev/kmsg
  21. curl -O -L "${URL_BASE}/${VMLINUX}"
  22. echo "downloading ${URL_BASE}/${INITRD}" > /dev/kmsg
  23. curl -O -L "${URL_BASE}/${INITRD}"
  24. if type ros 2>/dev/null; then
  25. if [ "$(ros config get rancher.environment.installer)" == "true" ] && ros --version &>/dev/null; then
  26. # This stuff isn't called automatically atm, need to ru manually
  27. #FIXME removing the grub dir stops `ros os upgrade` from re-installing syslinux, which seems to cause havoc
  28. system-docker run -dit --privileged --name stuff alpine top
  29. system-docker exec -it stuff mount /dev/vda1 /mnt
  30. system-docker exec -it stuff rm -rf /mnt/boot/grub /mnt/boot/*fc25* /mnt/var /mnt/usr /mnt/dev /mnt/proc /mnt/sys /mnt/tmp
  31. system-docker exec -it stuff umount /mnt
  32. system-docker rm -f stuff
  33. ros config set rancher.debug true
  34. ros install -f --no-reboot \
  35. -d /dev/vda -p /dev/vda1 \
  36. --statedir ros -t noformat \
  37. --append "rancher.state.dev=LABEL=DOROOT 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"
  38. exit 0
  39. fi
  40. fi
  41. echo "installing kexec" > /dev/kmsg
  42. #apt-get update && apt-get install -y kexec-tools ipcalc
  43. #dnf update
  44. dnf install -y kexec-tools ipcalc
  45. echo "running kexec" > /dev/kmsg
  46. 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"