10975a8f223790a4499a558ceacf58f869616ae6
[automated-distro-installer] / live-kexec
1 #!/bin/bash
2 #
3 # You can copy this to a http server, then wget -O- url|sudo bash
4 # or curl|bash, if curl is installed.
5 #
6 # This has been tested on trisquel belanos and ubuntu xenial.
7 #
8 # If the screen just sits in a weird color inverted, corrupted looking state,
9 # it's probably nothing wrong with the computer, but a problem
10 # with the fai server. If you can do this from a virtual terminal,
11 # it will print out more info (I know from running it on a vm).
12
13 set -ex
14 if grep -q ID=ubuntu /etc/os-release; then
15 sed -ri '/^\s*deb/{/universe/!s/$/ universe/}' /etc/apt/sources.list
16 fi
17 apt-get update
18 apt-get install -y debconf
19 debconf-set-selections <<EOF
20 kexec-tools kexec-tools/load_kexec boolean false
21 EOF
22 apt-get install -y pxe-kexec
23 # at least on belanos, apt-get goes into the background,
24 # and we need to wait for it to finish.
25 sleep 5
26 pxe-kexec -n --ignore-whitelist -l fai-generated faiserver