From: Ian Kelling <iank@fsf.org> Date: Thu, 4 Mar 2021 18:22:54 +0000 (-0500) Subject: various fixes and dns changes X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=61c3a58fcfadab7c333487f887b3f9f3a53bb93a;p=automated-distro-installer various fixes and dns changes --- diff --git a/fai-revm b/fai-revm index acf0db2..1b9897e 100755 --- 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 & diff --git a/fai/config/distro-install-common/libreboot_grub.cfg b/fai/config/distro-install-common/libreboot_grub.cfg index 84fa4e2..16fec9c 100644 --- a/fai/config/distro-install-common/libreboot_grub.cfg +++ b/fai/config/distro-install-common/libreboot_grub.cfg @@ -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 diff --git a/fai/config/files/boot/chboot/DEFAULT b/fai/config/files/boot/chboot/DEFAULT index 4abb486..6354ed9 100755 --- a/fai/config/files/boot/chboot/DEFAULT +++ b/fai/config/files/boot/chboot/DEFAULT @@ -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 diff --git a/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP b/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP index 283bbf6..cff15ed 100755 --- a/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP +++ b/fai/config/files/root/fai-check/VOL_BUSTER_BOOTSTRAP @@ -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 diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index bb625fd..61da95a 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -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 diff --git a/fai/config/scripts/GRUB_PC/11-iank b/fai/config/scripts/GRUB_PC/11-iank index 29be58e..8a9eab7 100755 --- a/fai/config/scripts/GRUB_PC/11-iank +++ b/fai/config/scripts/GRUB_PC/11-iank @@ -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 diff --git a/grub.cfg.autodiscover b/grub.cfg.autodiscover index 9c7054f..83e9051 100644 --- a/grub.cfg.autodiscover +++ b/grub.cfg.autodiscover @@ -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 } diff --git a/grub.cfg.netinst b/grub.cfg.netinst index 17d8e1f..489af69 100644 --- a/grub.cfg.netinst +++ b/grub.cfg.netinst @@ -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 } diff --git a/grub.cfg.netinst-noreboot b/grub.cfg.netinst-noreboot index 92f1667..3db6a80 100644 --- a/grub.cfg.netinst-noreboot +++ b/grub.cfg.netinst-noreboot @@ -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 } diff --git a/myfai-chboot-local b/myfai-chboot-local index b9b5537..4fc6f06 100755 --- a/myfai-chboot-local +++ b/myfai-chboot-local @@ -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 diff --git a/wrt-setup-local b/wrt-setup-local index 0042003..4dbdc04 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -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