From 4c0b3d508093cd1561f6ae887f154f06383b67d3 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 4 May 2016 00:08:42 -0700 Subject: [PATCH] small fixes and config changes --- arch-pxe | 3 +-- fai/config/class/50-host-classes | 4 +++- fai/config/distro-install-common/end | 3 --- fai/config/hooks/partition.DEFAULT | 13 +++++++++++++ fai/config/scripts/DEBIAN/30-interface | 2 +- fai/config/scripts/GRUB_PC/11-ian | 8 +++++++- pxe-server | 2 +- wrt-setup | 2 +- 8 files changed, 27 insertions(+), 10 deletions(-) diff --git a/arch-pxe b/arch-pxe index 56e4790..7252f2d 100755 --- a/arch-pxe +++ b/arch-pxe @@ -7,8 +7,7 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR cd /a/opt -#iso="archlinux-2015.11.01-dual" -iso="archlinux-2016.01.01-dual" +iso="archlinux-2016.05.01-dual" sfs=$iso/arch/x86_64/airootfs.sfs rm -rf $iso ex $iso.iso diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index 9afbe91..03bac3e 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -8,13 +8,15 @@ # use a list of classes for our demo machine case $HOSTNAME in demohost) - echo "FAIBASE DEBIAN DESKTOP STABLE" ;; + echo "FAIBASE DEBIAN DESKTOP" ;; x2) echo "FAIBASE DEBIAN DESKTOP PARTITION_PROMPT" ;; tp) echo "FAIBASE DEBIAN DESKTOP PARTITION_PROMPT" ;; frodo) echo "FAIBASE DEBIAN DESKTOP STABLE PARTITION_PROMPT" ;; + treetowl) + echo "FAIBASE DEBIAN DESKTOP STABLE REPARTITION" ;; # faiserver) # echo "FAIBASE DEBIAN DEMO FAISERVER" ;; # xfcehost) diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index 7d83b20..9c194fa 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -38,6 +38,3 @@ while true; do [[ $dir != /q ]] || break done -# kvm is normally created by some package, -# but unison doesn't like unknown groups, so make it now so initial sync works. -$ROOTCMD groupadd -r kvm || [[ $? == 9 ]] diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index c2b73cb..fac3155 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -173,6 +173,12 @@ first_boot_dev=$(bootdev ${devs[0]}) # keyfiles generated like: # head -c 2048 /dev/urandom | od | s dd of=/q/root/luks/host-demohost luks_dir=${LUKS_DIR:-/var/lib/fai/config/distro-install-common/luks} + +if [[ ! -e $luks_dir/host-$HOSTNAME ]]; then + echo "$0: error: no key for hostname at $luks_dir/host-$HOSTNAME" >&2 + exit 1 +fi + if ifclass tp; then lukspw=$(cat $luks_dir/traci) else @@ -317,6 +323,13 @@ $first_root_crypt /home btrfs noatime,subvol=home_$DISTRO 0 0 $first_boot_dev /boot btrfs noatime,subvol=boot_$DISTRO 0 0 EOF + +if ifclass treetowl; then + cat >> /tmp/fai/fstab <<'EOF' +UUID=3f7b31cd-f299-40b4-a86b-7604282e2715 /i btrfs noatime 0 2 +EOF +fi + swaps=() for dev in ${devs[@]}; do swaps+=(`swap-cryptname`) diff --git a/fai/config/scripts/DEBIAN/30-interface b/fai/config/scripts/DEBIAN/30-interface index 3388dcf..12672f1 100755 --- a/fai/config/scripts/DEBIAN/30-interface +++ b/fai/config/scripts/DEBIAN/30-interface @@ -24,7 +24,7 @@ EOF # you add some delay. # http://wiki.libvirt.org/page/PXE_boot_%28or_dhcp%29_on_guest_failed iface br0 inet dhcp - bridge_ports eth0 + bridge_ports $NIC1 bridge_stp off bridge_maxwait 0 EOF diff --git a/fai/config/scripts/GRUB_PC/11-ian b/fai/config/scripts/GRUB_PC/11-ian index bdfa275..221b6d4 100755 --- a/fai/config/scripts/GRUB_PC/11-ian +++ b/fai/config/scripts/GRUB_PC/11-ian @@ -37,7 +37,8 @@ chroot /target bash <<'EOF' set -eE -o pipefail chown -R 1000:1000 /home/ian/.ssh chmod -R u=Xrw,og= /home/ian/.ssh -cp -ar /home/ian/.ssh /root +rm -rf /root/.ssh +cp -rL /home/ian/.ssh /root chown -R root:root /root/.ssh # default jessie groups + kvm & systemd-journal @@ -66,3 +67,8 @@ done if ifclass frodo; then $ROOTCMD usermod -p "$(cat /var/lib/fai/config/distro-install-common/shadow/traci-simple)" traci fi + + +# makes the journal be saved to disk. +$ROOTCMD mkdir -p /target/var/log/journal +$ROOTCMD chmod 755 /target/var/log/journal diff --git a/pxe-server b/pxe-server index 1664253..f53bdef 100755 --- a/pxe-server +++ b/pxe-server @@ -15,7 +15,7 @@ fi action=$1 arch() { - default + plain-tftp cat <<'EOF' dhcp-option-force=209,boot/syslinux/archiso.cfg dhcp-option-force=210,/arch/ diff --git a/wrt-setup b/wrt-setup index 2362a33..1531c4f 100755 --- a/wrt-setup +++ b/wrt-setup @@ -281,7 +281,7 @@ server=75.75.75.75 # sudo dhclient -r; sudo dhclient # default dhcp range is 100-150 -dhcp-host=f4:6d:04:02:ee:eb,192.168.1.2,treetowl +dhcp-host=00:15:17:d2:1a:1c,192.168.1.2,treetowl dhcp-host=00:26:18:97:bb:16,192.168.1.3,frodo dhcp-host=10:78:d2:da:29:22,192.168.1.4,htpc dhcp-host=00:1f:16:16:39:24,192.168.1.5,x2 -- 2.30.2