# 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
# ${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 &
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
}
-grub_extn=4
###### begin command line parsing #####
reboot=true
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
;;
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
# 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:
#
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
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
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
}
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
}
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
}
# 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
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
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
# 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
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,
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