From: Ian Kelling Date: Wed, 17 Feb 2021 22:51:07 +0000 (-0500) Subject: mostly nabia and update bootstrap to buster X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=21353fd35096ba6786c1bae3046b763bfeac5890;p=automated-distro-installer mostly nabia and update bootstrap to buster --- diff --git a/fai/config/files/etc/apt/preferences.d/nabia-focal/NABIA b/fai/config/files/etc/apt/preferences.d/nabia-focal/NABIA index 1e6fc34..22eb565 100644 --- a/fai/config/files/etc/apt/preferences.d/nabia-focal/NABIA +++ b/fai/config/files/etc/apt/preferences.d/nabia-focal/NABIA @@ -1,3 +1,7 @@ Package: * Pin: release n=focal,o=Ubuntu Pin-Priority: -100 + +Package: linux-image-* linux-modules-* linux-firmware intel-microcode amd64-microcode +Pin: release n=focal,o=Ubuntu +Pin-Priority: 500 diff --git a/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA b/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA deleted file mode 100644 index 2f4fbcb..0000000 --- a/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA +++ /dev/null @@ -1,8 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ focal main universe -deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe -deb http://archive.ubuntu.com/ubuntu/ focal-security main universe -deb http://archive.ubuntu.com/ubuntu/ focal-backports main universe -deb-src http://archive.ubuntu.com/ubuntu/ focal main universe -deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main universe -deb-src http://archive.ubuntu.com/ubuntu/ focal-security main universe -deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main universe diff --git a/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA b/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA new file mode 120000 index 0000000..25af0ff --- /dev/null +++ b/fai/config/files/etc/apt/sources.list.d/focal.list/ETIONA @@ -0,0 +1 @@ +FOCAL \ No newline at end of file diff --git a/fai/config/files/etc/apt/sources.list.d/focal.list/NABIA b/fai/config/files/etc/apt/sources.list.d/focal.list/NABIA new file mode 120000 index 0000000..25af0ff --- /dev/null +++ b/fai/config/files/etc/apt/sources.list.d/focal.list/NABIA @@ -0,0 +1 @@ +FOCAL \ No newline at end of file diff --git a/fai/config/files/etc/systemd/system/fai_check.service/VOL_BUSTER_BOOTSTRAP b/fai/config/files/etc/systemd/system/fai_check.service/VOL_BUSTER_BOOTSTRAP index cbe4272..61f5a1f 100644 --- a/fai/config/files/etc/systemd/system/fai_check.service/VOL_BUSTER_BOOTSTRAP +++ b/fai/config/files/etc/systemd/system/fai_check.service/VOL_BUSTER_BOOTSTRAP @@ -1,9 +1,11 @@ [Unit] Description=check whether to kexec to fai, reboot, or do nothing +After=syslog.target network-online.target [Service] Type=oneshot ExecStart=/root/fai-check +TimeoutStartSec=60 [Install] -WantedBy=network.target +WantedBy=multi-user.target diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index ea8d237..e9cce50 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -74,7 +74,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 @@ -270,9 +270,13 @@ for dev in ${devs[@]}; do fi done +even_raid=false if ifclass RAID0 || (( ${#boot_devs[@]} == 1 )); then raid_level=0 elif ifclass RAID1 || (( ${#boot_devs[@]} <= 3 )); then + if (( ${#boot_devs[@]} == 2 )); then + even_raid=true + fi raid_level=1 else raid_level=10 @@ -406,6 +410,17 @@ if $partition; then fi ### end wipefs + + if $even_raid; then + for dev in ${devs[@]}; do + disk_mib=$(( $(parted -m $dev unit MiB print | \ + sed -nr "s#^/dev/[^:]+:([0-9]+).*#\1#p") - 1)) + if [[ ! min_disk_mib ]] || (( disk_mib < min_disk_mib )); then + min_disk_mib=$disk_mib + fi + done + fi + for dev in ${devs[@]}; do if [[ $SPECIAL_DISK ]]; then dev=$(devbyid $SPECIAL_DISK) @@ -417,8 +432,12 @@ if $partition; then # # Note: parted print error output is expected. example: # Error: /dev/vda: unrecognised disk label - disk_mib=$(( $(parted -m $dev unit MiB print | \ - sed -nr "s#^/dev/[^:]+:([0-9]+).*#\1#p") - 1)) + if $even_raid; then + disk_mib=$min_disk_mib + else + disk_mib=$(( $(parted -m $dev unit MiB print | \ + sed -nr "s#^/dev/[^:]+:([0-9]+).*#\1#p") - 1)) + fi root_end=$(( disk_mib - swap_mib - boot_mib / ${#boot_devs[@]} )) swap_end=$(( root_end + swap_mib)) diff --git a/fai/config/package_config/STANDARD b/fai/config/package_config/STANDARD index 02f27b3..7d97667 100644 --- a/fai/config/package_config/STANDARD +++ b/fai/config/package_config/STANDARD @@ -21,8 +21,11 @@ ncurses-term openssh-client pciutils perl +# newer distros dont have python, it gets naturally removed python python-minimal +python3 +python3-minimal reportbug telnet traceroute @@ -57,6 +60,10 @@ apt-transport-https ifupdown netplan.io- libnss-resolve +publicsuffix +iso-codes +# new package buster/nabia+ +cryptsetup-initramfs # iank, copied from DEBIAN so it goes into ubuntu too PACKAGES install GRUB_PC @@ -64,3 +71,5 @@ grub-pc PACKAGES install GRUB_EFI grub-efi + +PACKAGES install NABIA FOCAL diff --git a/fai/config/scripts/GRUB_PC/11-iank b/fai/config/scripts/GRUB_PC/11-iank index 525010e..29be58e 100755 --- a/fai/config/scripts/GRUB_PC/11-iank +++ b/fai/config/scripts/GRUB_PC/11-iank @@ -104,6 +104,9 @@ if [[ $FAI_ACTION != dirinstall ]] && ! ifclass NOCRYPT; then speed=115200 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" ;; # per rubens suggestion to make a d16 more stable kd|kw) cmdline+=" pci=realloc=off" ;; esac diff --git a/wrt-setup-local b/wrt-setup-local index 5e4b038..fcab6e5 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -319,6 +319,7 @@ if $client; then uset wireless.radio1.disabled true else # defaults, just reseting in case client config ran + uset wireless.default_radio0.network lan uset wireless.default_radio0.mode ap for x in 0 1; do uset wireless.default_radio$x.ssid "$ssid"