From c59144a600fd661d9512d8a5005aa0f5bc29bf0d Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 15 Feb 2022 10:34:03 -0500 Subject: [PATCH] a few fixes, a few dns --- fai/config/distro-install-common/end | 2 +- fai/config/hooks/partition.DEFAULT | 34 +++++++++++++++++++--------- fai/config/scripts/GRUB_PC/11-iank | 2 +- faiserver-setup | 3 ++- wrt-setup-local | 8 ++++--- 5 files changed, 32 insertions(+), 17 deletions(-) diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index b248bd3..efb501a 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -81,7 +81,7 @@ echo "fs.inotify.max_user_watches = 50000" >> $f $ROOTCMD sysctl --system if getent group sudo >/dev/null; then - usermod -aG sudo iank + $ROOTCMD usermod -aG sudo iank fi cat >$target/etc/sudoers.d/ianksudoers <<'EOF' diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 19b8023..f3df865 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -35,7 +35,11 @@ fi # # OPTIONS: # -# mkroot2: for running outside of fai and setting up the root2/boot2 luks and btrfs +# mkroot2: for running outside of fai and setting up the root2/boot2 luks and btrfs and tab files +# +# mkroot2tab: for running outside of fai and setting up the root2/boot2 tab files, in case luks and btrfs +# happen to already be setup. +# # # environment variables: # @@ -64,12 +68,16 @@ fi # raid10. # RAID1: forces raid1 filesystem. +mkroot2tab=false mkroot2=false if [[ $1 ]]; then case $1 in mkroot2) mkroot2=true ;; + mkroot2tab) + mkroot2tab=true + ;; *) echo "$0: error: unsupported arg: $1" >&2 exit 1 @@ -91,7 +99,7 @@ skiptask partition || ! type skiptask if ! type -p devbyid; then for d in $FAI/distro-install-common \ - /a/bin/fai/fai/config/distro-install-common $FAI $PWD; do + /a/bin/fai/fai/config/distro-install-common $FAI $PWD; do [[ -d $d ]] || continue if [[ -e $d/devbyid ]]; then devbyid=$d/devbyid @@ -220,7 +228,7 @@ if (($(nproc) > 2)); then fi declare -A disk_excludes -if ! $mkroot2 && ! ifclass USE_MOUNTED; then +if ! $mkroot2 && ! $mkroot2tab ! ifclass USE_MOUNTED; then ## ignore disks that are mounted, eg when running from fai-cd while read -r l; do eval "$l" @@ -362,7 +370,7 @@ if (( boot_space > 60000 )); then boot_mib=10000 root2_mib=1000000 boot2_mib=5000 -elif (( boot_spa_ce > 30000 )); then +elif (( boot_space > 30000 )); then boot_mib=$(( 5000 + (boot_space - 30000) / 2 )) root2_mib=100 boot2_mib=100 @@ -411,7 +419,7 @@ if [[ ! $DISTRO ]]; then DISTRO=trisqueletiona elif ifclass VOL_NABIA; then DISTRO=trisquelnabia - elif $mkroot2; then + elif $mkroot2 || $mkroot2tab; then : else echo "PARTITIONER ERROR: no distro class/var set" >&2 @@ -481,21 +489,25 @@ shopt -s nullglob # because these are filesystems created after our current root, and so # this allows us to update other root filesystems too. rm -f /mnt/root/root2-{fs,crypt}tab -if $mkroot2; then +if $mkroot2 || $mkroot2tab; then if $partition; then echo $0: error: found partition=true but have mkroot2 arg exit 1 fi for dev in ${devs[@]}; do - luks_file=$luks_dir/host-amy - lukspw=$(cat $luks_dir/amy) - luks-setup $(root2dev) + if $mkroot2; then + luks_file=$luks_dir/host-amy + lukspw=$(cat $luks_dir/amy) + luks-setup $(root2dev) + fi cat >>/mnt/root/root2-crypttab <>/mnt/root/root2-fstab </dev/null && [[ $(iw dev) ]]; then +if [[ $HOSTNAME == bo ]] || type -p iw &>/dev/null && [[ $(iw dev) ]]; then chroot $FAI_ROOT bash </dev/null; then pkgs+=(nfs-kernel-server) else diff --git a/wrt-setup-local b/wrt-setup-local index cda21df..9205697 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -922,9 +922,9 @@ EOF if $zblock; then cat <<'EOF' -# amy, amyw, samsungtab -access-control-view: 10.2.0.8/32 "youtube" -access-control-view: 10.2.0.23/32 "youtube" +# syw, samsungtab +# no sy until that dongle is used by ziva +access-control-view: 10.2.0.7/32 "youtube" access-control-view: 10.2.0.32/32 "youtube" EOF fi @@ -1071,6 +1071,7 @@ server=10.2.0.1 # bottom port, iPXE (PCI 03:00.0) in seabios boot menu dhcp-host=c8:60:00:31:6b:75,set:kd,$l.2,kd dhcp-host=94:05:bb:1e:2c:2e,set:sy,$l.3,sy +#dhcp-host=94:05:bb:1e:2c:2e,set:bo,$l.38,bo # top port, iPXE (PCI 04:00.0) in seabios boot menu #dhcp-host=c8:60:00:2b:15:07,set:kd,$l.2,kd # 4 is reserved for a staticly configured host wrt2 @@ -1095,6 +1096,7 @@ dhcp-host=00:26:b6:f7:d4:d8,set:amyw,$l.23,amyw dhcp-host=9a:c6:52:6f:ce:7c,set:onep9,$l.24,onep9 dhcp-host=38:63:bb:07:5a:f9,set:hp,$l.25,hp dhcp-host=00:26:b6:f6:0f:e9,set:frodow,$l.28,frodow +dhcp-host=70:a6:cc:3a:bb:b4,set:bow,$l.29,bow dhcp-host=6c:56:97:88:7b:74,set:amazontab,$l.31,amazontab dhcp-host=0a:8a:9b:cf:b5:ec,set:samsungtab,$l.32,samsungtab -- 2.30.2