X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=faiserver-setup;h=bce13d272662e6bd11e410eaf32c519afcfd0325;hb=e11bc15a6dd70c363602bdfe90171c2b72aca703;hp=d8489eda2c0a1e31b8998ce6a9c41f25100ca7fd;hpb=ed3681256885d295f39d5df60784d3281a2f8719;p=automated-distro-installer diff --git a/faiserver-setup b/faiserver-setup index d8489ed..bce13d2 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -17,7 +17,9 @@ x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace" -[[ $EUID == 0 ]] || exec sudo -i "${BASH_SOURCE}" "$@" +[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" + +LC_USEBASHRC=t; . ~/.bashrc usage() { cat </etc/apt/sources.list.d/fai.list <<'EOF' deb https://fai-project.org/download jessie koeln EOF -elif grep -iE 'VERSION=.*(stretch|flidas|xenail)' /etc/os-release; then +elif grep -iE 'VERSION=.*(stretch|flidas|xenail|buster|bullseye|etiona|nabia)' /etc/os-release; then # fai on ubuntu only has official support using the universe repo, but newer # tends to have less bugs. - gpg --keyserver hkp://pool.sks-keyservers.net -a --recv-keys 2BF8D9FE074BCDE4; gpg -a --export 2BF8D9FE074BCDE4 | apt-key add - + wget -O - https://fai-project.org/download/2BF8D9FE074BCDE4.asc | apt-key add - case $base in - stretch) - cat >/etc/apt/sources.list.d/fai.list <<'EOF' -deb https://fai-project.org/download stretch koeln + stretch|buster|bullseye) + cat >/etc/apt/sources.list.d/fai.list </etc/apt/sources.list.d/fai.list <<'EOF' -deb https://fai-project.org/download buster koeln -EOF + *) + echo "$0: error: script needs updating for new base" >&2 + exit 1 ;; esac else @@ -114,27 +121,35 @@ fi e apt-get install -y ${pkgs[@]} # confnew since we edit /etc/fai/NFSROOT in an automated way # fai-client is already a fai-server dependency, but make sure it gets upgraded -e apt-get install --no-install-recommends -y -o Dpkg::Options::="--force-confnew" fai-server fai-client +e apt-get install --no-install-recommends -y -o Dpkg::Options::=--no-force-confdef -o Dpkg::Options::=--force-confnew fai-server fai-client r=http://http.us.debian.org/debian # like default, but scrap httpredir, and nonfree. # All my systems should be able to get along without nonfree # for a base working system afaik. + cat >/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <<'EOF' @@ -174,13 +189,19 @@ echo "LOGUSER=fai" >>/etc/fai/fai.conf # figured out after partitioning ignored my crypt partition -if ! grep cryptsetup /etc/fai/NFSROOT &>/dev/null; then - cat >>/etc/fai/NFSROOT <<'EOF' +cedit /etc/fai/NFSROOT <<'EOF' || [[ $? == 1 ]] # inserted by faserver-setup PACKAGES install cryptsetup +# default one is linux-image-server, doesnt exist anymore +linux-image-amd64 +# default is btrfs-tools which doesnt exist anymore +btrfs-progs +iw +# got an error in error.log about not having gpg. +# system seemed to still install ok, so i havent tested if this fixes it. +gpg EOF -fi if armhf; then cd /srv/fai