From 47b51938ae090a2717cb2ec3f9e547a76e7b2ae7 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 9 Feb 2017 14:21:11 -0800 Subject: [PATCH] minor fixes and documentation --- README | 40 +++++++++++++++++--------- devbyid | 2 +- dsfull | 12 ++++++-- fai-wrapper | 2 ++ fai/config/basefiles/mk-basefile | 1 + fai/config/files/boot/chboot/DEFAULT | 3 +- fai/config/scripts/DEBIAN/30-interface | 9 +++--- faiserver-setup | 28 +++++++++--------- live-kexec | 3 +- 9 files changed, 61 insertions(+), 39 deletions(-) diff --git a/README b/README index 5e09791..d579feb 100644 --- a/README +++ b/README @@ -44,26 +44,38 @@ Some of the scripts have dependencies for some simple obvious utility scripts from https://iankelling.org/git, and of course there are some hostnames that are specific to my network. -Main scripts meant to be called interactively: +All scripts meant to be used directly are listed here: + + +# Scripts to setup the environment for the install + +fai-redep # Deploy fai configuration to host "faiserver" +faiserver-revm # using pxe & preseed, create a vm which is a fai server +faiserver-uninstall # uninstall fai-server +faiserver-setup # install fai-server on the current machine +myfai-chboot # setup fai server for kexec, for use instead of "pxe-server" +pxe-server # disable/enable fai or arch pxe boot server +wrt-setup-remote # setup my router in general: dhcp, dns, etc. + + +# Scripts to do a distro install arch-init-remote # install arch (after it's been booted into it's setup env) +dsfull # install & post-install a new fai distro +fai-kexec # kexec to fai tftp server that pxe would normally point to +arch-revm # test arch install on a fresh vm +fai-revm # test fai install on a fresh vm +live-kexec # fai kexec from upstream live cds, e.g. curl live-kexec|bash + + +# Scripts to call after a distro install for various reasons + chboot # Set grub to boot into a different distro (installed earlier) -install-chboot # reinstall chboot to /boot subvols, for when it changes -dsfull # install & setup a new fai distro (if data partition already synced) +install-chboot # reinstall chboot to /boot subvols, for chboot updates. eboot # reboot without automatic disk decryption -fai-kexec # kexec to fai tftp server that pxe would normally point to -fai-redep # Deploy fai configuration to host "faiserver" -fai-revm # test fai on a fresh vm fai-wrapper # Evaluate and use fai classes outside of fai. -faiserver-revm # create a vm which is a fai server using pxe & preseed file -faiserver-uninstall # uninstall fai-server -faiserver-setup # install fai-server on the current machine fresize # resize swap or boot partitions in a host -myfai-chboot # Sets up tftp pxe config on fai server -pxe-server # temporarily enable (usually) fai or arch boot server -wrt-setup-remote # setup my router -ubuntu-xenial-live-fai-kexec # do fai install from xenial live cd using kexec -myfai-chboot # use instead of pxe-server for fai kexec based install + License stuff: The license for the project is GPLv2 or later, mostly because fai is diff --git a/devbyid b/devbyid index ecf4988..e344389 100755 --- a/devbyid +++ b/devbyid @@ -3,7 +3,7 @@ # input eg: /dev/sda1 or /dev/sda # output: /dev/disk/by-id/model+serial, or if no link exists, the same as input -short_dev=$1 # i.e. +short_dev=$1 # devices are identified by model+serial num, # and wwn. model+serial gives me more info, so use that. diff --git a/dsfull b/dsfull index 06af7f8..54ee366 100755 --- a/dsfull +++ b/dsfull @@ -26,7 +26,11 @@ fi usage() { cat < $target/etc/network/interfaces <<-EOF diff --git a/faiserver-setup b/faiserver-setup index 2ecf45b..3db7265 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -30,21 +30,24 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR e() { echo "$@"; "$@"; } -# tried with stretch at one point, but jessie works for everything, -# so no point in changing it. Leaving some code to deal with -# stretch hanging around as it will eventually become stable. +# When stretch becomes stable, change this to stretch. +# I've tested this with stretch, it works, but notably, +# the automatic basefile getting will be for stretch +# instead of jessie, so if you install jessie, you need +# to setup the basefile and it's corresponding class. base=jessie sed="sed -ri --follow-symlinks" - -if [[ $base == jessie ]]; then - wget -O - http://fai-project.org/download/074BCDE4.asc | apt-key add - - cat >/etc/apt/sources.list.d/fai.list <<'EOF' +if grep -xFq 'VERSION="9 (stretch)"' /etc/os-release; then + # if we use stretch, no need for fai-project repo. + # this will need to be updated when there is a codename + # for stretch+1 + rm -f /etc/apt/sources.list.d/fai.list +else + wget -O - http://fai-project.org/download/074BCDE4.asc | apt-key add - + cat >/etc/apt/sources.list.d/fai.list <<'EOF' deb http://fai-project.org/download jessie koeln EOF -else - # if we use stretch, no need for fai-project repo. - rm -f /etc/apt/sources.list.d/fai.list fi # for ubuntu: @@ -54,14 +57,11 @@ fi apt-get update -# all the dependencies except the dhcp server -deps="$(apt-cache show fai-quickstart | grep ^Depends: |head -n 1|\ - sed -r 's/^Depends:|,|\|[^,]+|isc-dhcp-server//g')" # Relevant packages from fai-quickstart depends and fai-server recommends. # I especially do not wait isc-dhcp-server or an inetd apt-get install -y fai-doc nfs-kernel-server tftpd-hpa tar reprepro squashfs-tools binutils -apt-get install -y --no-recommends fai-server +apt-get install --no-install-recommends -y fai-server r=http://http.us.debian.org/debian # like default, but scrap httpredir, and nonfree. diff --git a/live-kexec b/live-kexec index 01e8f72..651dad7 100644 --- a/live-kexec +++ b/live-kexec @@ -1,7 +1,8 @@ #!/bin/bash # +# fai kexec from upstream live cds, i.e. curl|bash # You can copy this to a http server, then wget -O- url|sudo bash -# or curl|bash, if curl is installed. +# curl is sometimes not preinstalled on a live cd. # # This has been tested on trisquel belanos and ubuntu xenial. # -- 2.30.2