From 2eebb95531424e04797094d622eebdd7ece5b38b Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 27 Sep 2016 18:15:38 -0700 Subject: [PATCH] misc small fixes --- fai-redep | 3 ++- fai/config/class/50-host-classes | 2 +- fai/config/hooks/partition.DEFAULT | 17 ++++++++--------- pxe-server | 21 +++++++++++++-------- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/fai-redep b/fai-redep index 43d34bb..97ccfae 100755 --- a/fai-redep +++ b/fai-redep @@ -44,9 +44,10 @@ s scp -r /q/root/luks /q/root/shadow \ scp /a/bin/devbyid root@$faiserver_host:/srv/fai/nfsroot/usr/local/bin ssh root@$faiserver_host bash <<'EOF' set -eE -o pipefail +set -x chmod 644 /srv/fai/config/files/home/ian/.ssh/authorized_keys/GRUB_PC chmod -R a+rX /srv/fai/config/distro-install-common cd /srv/fai/config/basefiles u=http://fai-project.org/download/basefiles/XENIAL64.tar.xz -wget -nv -O /srv/fai/config/basefiles/${u##*/} $u +wget -nv -N $u EOF diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index 6f3f8a8..b8226de 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -24,7 +24,7 @@ # We check the reverse condition in 51-multi-boot, # and set what os we are installing, but don't check it # into git since it changes regularly. Each host needs -# to have a class of either DEBIAN + STABLE or STRETCH64, +# to have a class of either DEBIAN + (STABLE or STRETCH64), # or UBUNTU + XENIAL64. # # It's shell looks like this: diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 8c3140b..79826c7 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -160,15 +160,19 @@ for dev in ${devs[@]}; do done if [[ ! $DISTRO ]]; then - if ifclass STABLE; then + if ifclass STRETCH64; then + DISTRO=debiantesting + elif ifclass STABLE; then DISTRO=debianstable + elif ifclass XENIAL64; then + DISTRO=ubuntuxenial else - DISTRO=debiantesting + echo "PARTITIONER ERROR: no distro class/var set" >&2 + exit 1 fi fi - case ${#boot_devs[@]} in # need double the space if we are raid 10, and then # might as well give some extra overhead. @@ -339,18 +343,13 @@ $first_boot_dev /boot btrfs noatime,subvol=boot_$DISTRO 0 0 EOF -# these 2 are alternative ways to identify a subvol, i think i prefer the 2nd. +# I will avoid using uuid in the future. if ifclass treetowl; then cat >> /tmp/fai/fstab <<'EOF' $first_root_crypt /i btrfs noatime,subvol=i 0 0 UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2 EOF fi -if ifclass frodo; then - cat >> /tmp/fai/fstab <<'EOF' -$first_root_crypt /i btrfs noatime,subvol=i 0 0 -EOF -fi swaps=() for dev in ${devs[@]}; do diff --git a/pxe-server b/pxe-server index 3223fb9..0bdd134 100755 --- a/pxe-server +++ b/pxe-server @@ -40,6 +40,7 @@ HOST makes the pxe server only for that specific host on debian, there is a 3rd one shortly after the 2nd. I can't remember exactly why this caused a problem, but I'm hoping the sleep will take care of it. +-w Initially setup pxe, then wait like -a. -h|--help Print help and exit @@ -54,13 +55,14 @@ args=() redep=true acks=2 wait=false -temp=$(getopt -l help hra "$@") || usage 1 +temp=$(getopt -l help harw "$@") || usage 1 eval set -- "$temp" while true; do case $1 in - -h|--help) usage ;; + -a) wait=true; set=false; shift ;; -r) redep=false; shift ;; - -a) wait=true; shift ;; + -w) wait=true; set=true; shift ;; + -h|--help) usage ;; --) shift; break ;; *) echo "$0: Internal error!" ; exit 1 ;; esac @@ -129,13 +131,16 @@ set-pxe() { if [[ $type == arch ]]; then arch-pxe-mount; fi" } -set-pxe -if [[ $type == fai ]]; then - if $redep; then - fai-redep +if $set; then + set-pxe + + if [[ $type == fai ]]; then + if $redep; then + fai-redep + fi + faiserver-enable fi - faiserver-enable fi if $wait; then -- 2.30.2