various fixes and dns changes
authorIan Kelling <iank@fsf.org>
Thu, 4 Mar 2021 18:22:54 +0000 (13:22 -0500)
committerIan Kelling <iank@fsf.org>
Thu, 4 Mar 2021 18:22:54 +0000 (13:22 -0500)
fai-revm
fai/config/distro-install-common/libreboot_grub.cfg
fai/config/files/boot/chboot/DEFAULT
fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP
fai/config/hooks/partition.DEFAULT
fai/config/scripts/GRUB_PC/11-iank
grub.cfg.autodiscover
grub.cfg.netinst
grub.cfg.netinst-noreboot
myfai-chboot-local
wrt-setup-local

index acf0db27fc0ae019e02b49d71063eadc0b4eaba8..1b9897ebdb34a4831a31e8aca11ec1c28a94bae2 100755 (executable)
--- a/fai-revm
+++ b/fai-revm
@@ -71,9 +71,21 @@ done
 
 # change this to test different disk counts. 1 and > 1 should be the only
 # important things to test.
-disk_count=2
+disk_count=1
 
 
+if ! ip l show br0 &>/dev/null; then
+  cat <<'EOF'
+fai-rvm error: no bridge detected. add one to interfaces like this:
+iface eth0 inet manual
+iface br0 inet dhcp
+  bridge_ports eth0
+  bridge_stp off
+  bridge_maxwait 0
+EOF
+  exit 1
+fi
+
 if [[ $script_dir == /a/bin/* ]]; then
   # Copy our script elsewhere so we can develop it
   # and save it at the same time it's running
@@ -157,8 +169,13 @@ e sudo iptables -P FORWARD ACCEPT
   #   ${disk_arg[*]} -w bridge=br0,mac=52:54:00:9c:ef:ad $reboot_arg \
   #   --graphics spice,listen=0.0.0.0 $console_arg |& grep -v '^ *$' | uniq &
 
+cpus=1
+if (( $(nproc) > 2 )); then
+  cpus=2
+fi
+
 e sudo systemctl start libvirtd
-e sudo virt-install --rng /dev/urandom --os-variant $variant  -n $name $boot_arg -r 2048 --vcpus 1 \
+e sudo virt-install --rng /dev/urandom --os-variant $variant  -n $name $boot_arg -r 2048 --vcpus $cpus \
   ${disk_arg[*]} -w bridge=br0,mac=52:54:00:9c:ef:ad $reboot_arg \
   --graphics spice,listen=0.0.0.0 $console_arg |& grep -v '^ *$' | uniq &
 
index 84fa4e250105b15876ca67828b9359f5d0734267..16fec9cd90fd7da6775911da3ffc4389432b6559 100644 (file)
@@ -28,7 +28,7 @@ function save_chosen {
 set default=/debianbuster_bootstrap # could use 0 here.
 set timeout=1
 
-for part in (ahci*4) (ata*4); do
+for part in (ahci*5) (ata*5); do
     envfile=$part/grubenv
     if [ -s $envfile ]; then
         load_env --file $envfile
index 4abb48683a7f0794107198d18c2bd397df0c2fa2..6354ed95ecd06f71f118c39f37277b8453d188d9 100755 (executable)
@@ -64,7 +64,6 @@ EOF
 }
 
 
-grub_extn=4
 
 ###### begin command line parsing #####
 reboot=true
@@ -125,7 +124,14 @@ for boot_dev in $(btrfs fil show $mnt | sed -nr 's#.*path\s+(\S+)$#\1#p'); do
   e umount $mount_point
 done
 
-e mount $boot_disk$grub_extn $mount_point
+if [[ $(blockdev --getsize64 ${boot_disk}4) == 8388608 ]]; then
+  # old partition scheme
+  grub_dev=${boot_disk}4
+else
+  grub_dev=${boot_disk}5
+fi
+
+e mount $grub_dev $mount_point
 e grub-editenv $mount_point/grubenv set last_boot=/$distro
 e grub-editenv $mount_point/grubenv set did_fai_check=true
 e umount $mount_point
index 283bbf66610efff9f2fc3cf4e11875d4cf48a3a0..cff15ed664f9ff77fcbc1d08f3f870f903ca0103 100755 (executable)
@@ -47,10 +47,17 @@ case $1 in
     ;;
 esac
 
+
 first=true
 for dev in $(btrfs fi show / | sed -rn 's#^\s*devid\s.*\s([^0-9 ]+)\S+$#\1#p' \
                |sort); do
-  dev+=4
+
+  if [[ $(blockdev --getsize64 ${boot_disk}4) == 8388608 ]]; then
+    # old partition scheme
+    dev+=4
+  else
+    dev+=5
+  fi
   mount $dev /mnt
   if $first; then
     if [[ -e /mnt/grubenv ]]; then
index bb625fd1d35c1305ef22f1cdea477783739b5f4b..61da95a3f4162d003d6476fbc61a88ff35b32932 100755 (executable)
@@ -29,8 +29,10 @@ fi
 # s
 # source /b/fai/fai-wrapper
 # - set any appropriate classes with: fai-setclass OPT1... which sets CLASS_OPT1=true...
-#   or run eval-fai-classfile FILE
-# export luks_dir=/q/root/luks
+#   or run eval-fai-classfile FILE.
+# - Set a VOL_DISTROVER, eg:
+#   fai-setclass VOL_NABIA
+# - export luks_dir=/q/root/luks
 #
 # OPTIONS:
 #
@@ -650,3 +652,21 @@ ROOT_PARTITION=\${ROOT_PARTITION:-$first_root_crypt}
 SWAPLIST=\${SWAPLIST:-"${swaps[@]}"}
 EOF
 fi
+
+# initial setup of extra data fs, mounted,
+# btrfs subvol create nocow
+# chattr +C nocow
+# chown iank.iank nocow
+
+if [[ $HOSTNAME == kd ]]; then
+  cat >>/tmp/fai/crypttab <<EOF
+crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part6 /dev/disk/by-id/ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part6  none  keyscript=decrypt_keyctl,discard,luks,initramfs
+crypt_dev_ata-TOSHIBA_MD04ACA500_84R2K773FS9A-part1 /dev/disk/by-id/ata-TOSHIBA_MD04ACA500_84R2K773FS9A-part1  keyscript=decrypt_keyctl,discard,luks,initramfs
+EOF
+  cat >> /tmp/fai/fstab <<EOF
+/dev/mapper/crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part6  /d  btrfs  nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,compress=zstd,subvol=nocow  0 0
+# r6 = root partition6
+/dev/mapper/crypt_dev_ata-Samsung_SSD_870_QVO_8TB_S5VUNG0N900656V-part6  /mnt/r6  btrfs  nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,compress=zstd,subvolid=0  0 0
+/dev/mapper/crypt_dev_ata-TOSHIBA_MD04ACA500_84R2K773FS9A-part1  /mnt/rust  btrfs  nofail,x-systemd.device-timeout=30s,x-systemd.mount-timeout=30s,noatime,compress=zstd,subvolid=0  0 0
+EOF
+fi
index 29be58e2769532b0a803da8a1be9670d2d2fedd1..8a9eab792b8ebd230366dae0b40df959de60ff2c 100755 (executable)
@@ -105,8 +105,9 @@ if [[ $FAI_ACTION != dirinstall ]] && ! ifclass NOCRYPT; then
     cmdline="rd.luks.crypttab=no net.ifnames=0 console=ttyS0,${speed}n8 console=tty0"
     case $HOSTNAME in
       # https://wiki.archlinux.org/index.php/Solid_state_drive#Resolving_NCQ_errors
-      # evo-870 doesnt get along well with d16 with etiona
-      kd) cmdline+=" libata.force=5.00:noncq" ;;
+      # evo-870 doesnt get along well with d16 with etiona.
+      # the number is based on dmesg errors
+      kd) cmdline+=" libata.force=4.00:noncq" ;;
       # per rubens suggestion to make a d16 more stable
       kd|kw) cmdline+=" pci=realloc=off" ;;
     esac
index 9c7054fb43145b24a1e48504982cbe31a1d9a39e..83e90512801858f310d6fef26a0ad67e8f09522d 100644 (file)
@@ -23,13 +23,13 @@ set menu_color_highlight=black/yellow
 menuentry "FAI server via dns" {
     set gfxpayload=$resolution
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config root=/dev/nfs nfsroot=faiserver:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS=verbose,sshd,createvt,reboot FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config root=/dev/nfs nfsroot=faiserver:/srv/fai/nfsroot,vers=3,nolock rootovl ip=dhcp
     initrd  /boot/initrd.img
 }
 # ro,noatime,vers=3,rsize=1048576,wsize=same,namelen=255,hard,nolock,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.2.0.2,nountvers=3,mountport=49179,mountproto=udp,lock_lock=all,addr=10.2.0.2
 menuentry "Autodiscover the FAI server" {
     search --set=root --file /FAI-CD
-    linux   /boot/vmlinuz FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
+    linux   /boot/vmlinuz libata.force=noncq FAI_FLAGS="menu,verbose,createvt" fai.discover rootovl root=/dev/nfs ip=dhcp quiet
     initrd  /boot/initrd.img
 }
 
index 17d8e1f1ec13acd3c4843f7b6f856af21f931d0c..489af696829d64a5c50536742a62eb94d1ea72ef 100644 (file)
@@ -57,7 +57,7 @@ menuentry "" --unrestricted {
 
 menuentry "Netinstall" {
     set gfxpayload=$resolution
-    linux   /boot/vmlinuz console=ttyS0,19200n8 FAI_FLAGS="verbose,sshd,createvt,reboot" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet
+    linux   /boot/vmlinuz libata.force=noncq console=ttyS0,19200n8 FAI_FLAGS="verbose,sshd,createvt,reboot" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet
     initrd  /boot/initrd.img
 }
 
index 92f166700aaf33f67b3484477f949161e64d8dca..3db6a80f140df9f96f4ecd16c470cc7edd6d00bb 100644 (file)
@@ -57,7 +57,7 @@ menuentry "" --unrestricted {
 
 menuentry "Netinstall" {
     set gfxpayload=$resolution
-    linux   /boot/vmlinuz console=ttyS0,19200n8 FAI_FLAGS="verbose,sshd,createvt" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet
+    linux   /boot/vmlinuz libata.force=noncq console=ttyS0,19200n8 FAI_FLAGS="verbose,sshd,createvt" FAI_ACTION=install FAI_CONFIG_SRC=file:///var/lib/fai/config rd.live.image root=live:CDLABEL=FAI_CD rd.neednet ip=dhcp quiet
     initrd  /boot/initrd.img
 }
 
index b9b5537b613931a57a3227cb0f1ce4ac6f67ba5e..4fc6f06bd56183162800004ce3750ab867ab0cfc 100755 (executable)
@@ -110,7 +110,10 @@ default_k_args=$(fai-chboot -L '^default$' | \
 # example of default_k_args
 # initrd=initrd.img-3.16.0-4-amd64 ip=dhcp root=192.168.1.3:/srv/fai/nfsroot FAI_CONFIG_SRC=nfs://faiserver/srv/fai/config FAI_ACTION=install
 
-k_args=(FAI_ACTION=$fai_action)
+# https://wiki.archlinux.org/index.php/Solid_state_drive#Resolving_NCQ_errors
+# currently on needed on d16 samsung 870 qvo, but better to have this
+# and not wait for more conditions where its needed.
+k_args=(FAI_ACTION=$fai_action libata.force=noncq)
 if $kgped16; then
   k_args+=(console=tty0 console=ttyS0,115200)
 fi
index 00420030e328388d7ac79b000ee168cb420c7e18..4dbdc0456085a099a7f2cbcce38520c356811a05 100755 (executable)
@@ -720,6 +720,15 @@ case $hostname in
   cmc)
     v cedit host /etc/hosts <<EOF || dnsmasq_restart=true
 $l.1 $hostname
+# 127.0.0.1 www.youtube.com
+# 127.0.0.1 googlevideo.com
+# 127.0.0.1 youtu.be
+# 127.0.0.1 youtube-nocookie.com
+# 127.0.0.1 youtube.com
+# 127.0.0.1 youtube.googleapis.com
+# 127.0.0.1 youtubei.googleapis.com
+# 127.0.0.1 ytimg.com
+# 127.0.0.1 ytimg.l.google.com
 EOF
     ;;
 esac
@@ -769,11 +778,12 @@ ptr-record=4.0.2.10.in-addr.arpa.,wrt2.b8.nz
 ptr-record=5.0.2.10.in-addr.arpa.,x2.b8.nz
 ptr-record=6.0.2.10.in-addr.arpa.,xw2.b8.nz
 ptr-record=7.0.2.10.in-addr.arpa.,syw.b8.nz
-ptr-record=8.0.2.10.in-addr.arpa.,tp.b8.nz
+ptr-record=8.0.2.10.in-addr.arpa.,amy.b8.nz
 ptr-record=9.0.2.10.in-addr.arpa.,bb8.b8.nz
 ptr-record=12.0.2.10.in-addr.arpa.,demohost.b8.nz
 ptr-record=14.0.2.10.in-addr.arpa.,wrt3.b8.nz
 ptr-record=19.0.2.10.in-addr.arpa.,brother.b8.nz
+ptr-record=23.0.2.10.in-addr.arpa.,amyw.b8.nz
 ptr-record=25.0.2.10.in-addr.arpa.,hp.b8.nz
 ptr-record=.0.2.10.in-addr.arpa.,transmission.b8.nz
 
@@ -805,10 +815,15 @@ all-servers
 # download namebench and run it like this:
 # for x in all regional isp global preferred nearby; do ./namebench.py -s \$x -c US -i firefox -m weighted -J 10 -w; echo \$x; hr;  done
 # google
-server=8.8.4.4
-server=8.8.8.8
-server=2001:4860:4860::8888
-server=2001:4860:4860::8844
+server=1.1.1.3
+server=1.0.0.3
+server=2606:4700:4700::1113
+server=2606:4700:4700::1003
+
+# server=8.8.4.4
+# server=8.8.8.8
+# server=2001:4860:4860::8888
+# server=2001:4860:4860::8844
 
 
 # to fixup existin ips, on the client you can do
@@ -826,7 +841,7 @@ dhcp-host=94:05:bb:1e:2c:2e,set:sy,$l.3,sy
 dhcp-host=f0:de:f1:81:ec:88,set:x2,$l.5,x2
 dhcp-host=c4:8e:8f:44:f5:63,set:x2w,$l.6,x2w
 dhcp-host=34:7d:f6:ed:ec:07,set:syw,$l.7,syw
-dhcp-host=80:fa:5b:1c:6e:cf,set:tp,$l.8,tp
+dhcp-host=80:fa:5b:1c:6e:cf,set:amy,$l.8,amy
 # This is so fai can have an explicit name to use for testing,
 # or else any random machine which did a pxe boot would get
 # reformatted. The mac is from doing a virt-install, cancelling it,
@@ -836,9 +851,10 @@ dhcp-host=62:03:cb:a8:3e:a3,set:trp,$1.13,trp
 dhcp-host=00:1f:16:14:01:d8,set:x3,$l.18,x3
 # BRN001BA98CA823 in dhcp logs
 dhcp-host=00:1b:a9:8c:a8:23,set:brother,$l.19,brother
+
+dhcp-host=00:26:b6:f7:d4:d8,set:amyw,$l.23,amyw
 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=00:26:18:97:bb:16,set:frodo,$l.29,frodo
 
 
 # faiserver vm