From: Ian Kelling Date: Tue, 24 Oct 2017 03:40:37 +0000 (-0700) Subject: various fixes, improve flidas X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=commitdiff_plain;h=a2b8051e808621b9a33617d0c75d212bd2141ddc various fixes, improve flidas --- diff --git a/dsfull b/dsfull index 29946f3..df9c398 100755 --- a/dsfull +++ b/dsfull @@ -101,4 +101,6 @@ while [[ $(ser is-active btrbk.service) == active ]]; do done e btrbk-run -t $host ssh $host /a/bin/distro-setup/distro-begin +# this should be done instead of distro-begin, but +# keeping it to 2 steps for now #e dsremote $host diff --git a/fai-revm b/fai-revm index f7e45c9..2dbae8f 100755 --- a/fai-revm +++ b/fai-revm @@ -33,6 +33,7 @@ then start a virtual machine to test the config Note, sometimes shutting down the existing demohost vm fails. Just run again if that happens. +-d Don't do dhcp setup for when we aren't on Ian's home network. -r Do not boot after install is complete -n Create new qcow2(s) for vm. Good for testing partitioning script, to ensure a blank disk. @@ -45,10 +46,11 @@ EOF orig_args=("$@") new_disk=false -temp=$(getopt -l help hnr "$@") || usage 1 +temp=$(getopt -l help dnrh "$@") || usage 1 eval set -- "$temp" while true; do case $1 in + -d) dhcp_arg=-d; shift ;; -n) new_disk=true; shift ;; -r) reboot_arg=--noreboot; shift ;; -h|--help) usage ;; @@ -57,6 +59,7 @@ while true; do esac done + # change this to test different disk counts. 1 and > 1 should be the only # important things to test. disk_count=1 @@ -77,18 +80,19 @@ is_arch_revm() { } cleanup() { - ./pxe-server + echo "doing cleanup" + e ./pxe-server $dhcp_arg ./faiserver-disable } _errcatch_cleanup=cleanup if is_arch_revm; then - e ./pxe-server demohost arch + e ./pxe-server $dhcp_arg demohost arch sleep 2 # via osinfo-query os. guessing arch is closest to latest fedora. variant=fedora22 else - e ./pxe-server demohost fai + e ./pxe-server $dhcp_arg demohost fai sleep 2 # I don't think these variants actually make a diff for us, but I # use the appropriate one when trying a new distro just in case. diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index cb953a4..d10b949 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -96,4 +96,4 @@ while true; do if [[ $dir == /p ]]; then break; fi done -au -s /bin/false --home-dir /var/lib/bitcoind bitcoin +au --system -s /bin/false --home-dir /var/lib/bitcoind bitcoin diff --git a/fai/config/hooks/instsoft.DEBIAN b/fai/config/hooks/instsoft.DEBIAN index ebf7d8a..13c517a 100755 --- a/fai/config/hooks/instsoft.DEBIAN +++ b/fai/config/hooks/instsoft.DEBIAN @@ -1,5 +1,6 @@ #! /bin/bash +set -x # if package locales will be installed, then install it early, before # other packages if [ $FAI_ACTION != "install" -a $FAI_ACTION != "dirinstall" ]; then diff --git a/fai/config/scripts/GRUB_PC/10-setup b/fai/config/scripts/GRUB_PC/10-setup index 47b3ba4..00829e1 100755 --- a/fai/config/scripts/GRUB_PC/10-setup +++ b/fai/config/scripts/GRUB_PC/10-setup @@ -3,6 +3,7 @@ error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code +set -x set -a # do not set up grub during dirinstall @@ -39,11 +40,12 @@ if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then done elif [[ $GROOT =~ 'hostdisk' ]]; then - $ROOTCMD grub-install --no-floppy --modules=part_msdos $BOOT_DEVICE - if [ $? -eq 0 ]; then - echo "Grub installed on hostdisk $BOOT_DEVICE" - fi - + for dev in $BOOT_DEVICE; do + $ROOTCMD grub-install --no-floppy --modules=part_msdos $dev + if [ $? -eq 0 ]; then + echo "Grub installed on hostdisk $BOOT_DEVICE" + fi + done else for dev in $BOOT_DEVICE; do GROOT=$($ROOTCMD grub-probe -tdrive -d $dev) diff --git a/fai/config/scripts/GRUB_PC/11-ian b/fai/config/scripts/GRUB_PC/11-iank similarity index 100% rename from fai/config/scripts/GRUB_PC/11-ian rename to fai/config/scripts/GRUB_PC/11-iank diff --git a/fai/config/scripts/LAST/50-misc b/fai/config/scripts/LAST/50-misc index 459b4de..586c787 100755 --- a/fai/config/scripts/LAST/50-misc +++ b/fai/config/scripts/LAST/50-misc @@ -15,13 +15,15 @@ else fi fi - usedm=$(dmsetup ls 2>/dev/null | egrep -v '^live-rw|^live-base|^No devices found' | wc -l) - if [ $usedm -ne 0 ]; then - if [ ! -d $target/etc/lvm ]; then - echo ERROR: Found lvm devices, but the lvm2 package was not installed - error=1 - fi - fi + # i use dm for crypt, not lvm, so this gives false positive. todo, send patch to remove this + # upstream. + # usedm=$(dmsetup ls 2>/dev/null | egrep -v '^live-rw|^live-base|^No devices found' | wc -l) + # if [ $usedm -ne 0 ]; then + # if [ ! -d $target/etc/lvm ]; then + # echo ERROR: Found lvm devices, but the lvm2 package was not installed + # error=1 + # fi + # fi fi # remove backup files from cfengine, but only if cfengine is installed diff --git a/fai/config/scripts/UBUNTU/90-apt b/fai/config/scripts/UBUNTU/90-apt old mode 100644 new mode 100755 index 5e2d1e3..682d572 --- a/fai/config/scripts/UBUNTU/90-apt +++ b/fai/config/scripts/UBUNTU/90-apt @@ -1,9 +1,6 @@ #! /bin/bash -# note: the name of this scripts doesn't fit it's contents, but it's -# because we are taking just part of the corresponding fai example -# script, and it's easier to keep up with upstream changes if the file -# name is the same. +# ian: just taking part of the corresponding fai example script ainsl -v /etc/locale.gen '^en_US.UTF-8 UTF-8' $ROOTCMD locale-gen diff --git a/faiserver-disable b/faiserver-disable index 3cb6da2..0a9ad8d 100755 --- a/faiserver-disable +++ b/faiserver-disable @@ -16,8 +16,9 @@ if [[ $1 ]]; then fi ssh root@$(chost faiserver) bash <<'EOF' +set -eE -o pipefail if modprobe nfsd &>/dev/null; then - sed -ri --follow-symlinks '\%^/srv/fai/d' /etc/exports + sed -ri --follow-symlinks '\%^/srv/fai/%d' /etc/exports exportfs -ra else rm -f /etc/apache2/sites-enabled/faiserver.conf diff --git a/faiserver-setup b/faiserver-setup index 3e805df..78786c2 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -157,8 +157,10 @@ fi # tried out a stretch base, doesn't work yet. # $sed -f - /etc/fai/nfsroot.conf <