From 487816f79b430885dbb4850b2b5517423accdc37 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 23 Sep 2024 19:34:47 -0400 Subject: [PATCH] minor fixes and improvements --- fai/config/class/50-host-classes | 4 ++-- fai/config/distro-install-common/devbyid | 9 +++++++-- fai/config/distro-install-common/end | 7 ++++--- .../distro-install-common/ethusb-static | 17 ++++++++--------- .../apt/sources.list.d/noble.list/ARAMO_EXTRA | 2 +- .../noble.list/{NOBLE => NOBLE_FREE} | 1 - .../sources.list.d/noble.list/NOBLE_NONFREE | 14 ++++++++++++++ fai/config/package_config/STANDARD | 2 ++ fai/config/scripts/IANK/11-iank | 15 +++++++++++---- faiserver-setup | 19 ++++++------------- wrt-setup-local | 6 ++++-- 11 files changed, 59 insertions(+), 37 deletions(-) rename fai/config/files/etc/apt/sources.list.d/noble.list/{NOBLE => NOBLE_FREE} (93%) create mode 100644 fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_NONFREE diff --git a/fai/config/class/50-host-classes b/fai/config/class/50-host-classes index 5116aa2..949c8c4 100755 --- a/fai/config/class/50-host-classes +++ b/fai/config/class/50-host-classes @@ -164,8 +164,8 @@ if [[ ! -e /a/bin/fai/fai-wrapper || $FAI_ACTION == dirinstall ]]; then _) echo UBUNTU FOCAL64 VOL_FOCAL FOCAL ;; # jammy _) echo UBUNTU JAMMY64 VOL_JAMMY JAMMY ;; - # NOBLE - _) echo UBUNTU NOBLE64 VOL_NOBLE NOBLE ;; + # NOBLE # there also exists NOBLE_NONFREE + _) echo UBUNTU NOBLE64 VOL_NOBLE NOBLE NOBLE_FREE;; esac fi ###### end Template for 51-multi-boot ###### diff --git a/fai/config/distro-install-common/devbyid b/fai/config/distro-install-common/devbyid index 733b840..445fd75 100755 --- a/fai/config/distro-install-common/devbyid +++ b/fai/config/distro-install-common/devbyid @@ -16,8 +16,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# input eg: /dev/sda1 or /dev/sda -# output: /dev/disk/by-id/model+serial, or if no link exists, the same as input +# input: /dev/DISK[PARTITION]... +# eg: /dev/sdb1 /dev/sda +# output example: +# /dev/disk/by-id/model+serial-part1 +# /dev/disk/by-id/model+serial +# +# If no symlink exists, output is the same as input. short_dev=$1 if [[ ! -e $short_dev ]]; then diff --git a/fai/config/distro-install-common/end b/fai/config/distro-install-common/end index 2455ece..a3c4bb4 100755 --- a/fai/config/distro-install-common/end +++ b/fai/config/distro-install-common/end @@ -52,9 +52,10 @@ if [[ -e $root_pw_f ]]; then fi au user2 -if ifclass frodo; then - sed 's/^/user2:/' /q/root/shadow/user2 | $ROOTCMD chpasswd -e -fi +# dont have any active user2 atm. +# if ifclass frodo; then +# sed 's/^/user2:/' /q/root/shadow/user2 | $ROOTCMD chpasswd -e +# fi # comparing iank's groups to user2, I see none she should join on arch $ROOTCMD usermod -a -G user2 iank diff --git a/fai/config/distro-install-common/ethusb-static b/fai/config/distro-install-common/ethusb-static index 5ca8b93..ce80424 100755 --- a/fai/config/distro-install-common/ethusb-static +++ b/fai/config/distro-install-common/ethusb-static @@ -186,6 +186,14 @@ shopt -s nullglob wiredx=1 declare -a args +if ! type -p ethtool &>/dev/null; then + apt-get -y install ethtool +fi + +if ! type -p dig &>/dev/null; then + apt-get -y install dig +fi + # device that has an eth0, but we aren't using it because it is # broken. We could just hardcode a mac comparison with `cat # /sys/class/net/eth0/address` but this is cooler. @@ -214,15 +222,6 @@ if ! nmcli con | grep -q "^$nm_con " &>/dev/null; then fi -if ! type -p dig &>/dev/null; then - apt-get -y install dig -fi - -if ! type -p ethtool &>/dev/null; then - apt-get -y install ethtool -fi - - get-cur ## end common setup / detection ## diff --git a/fai/config/files/etc/apt/sources.list.d/noble.list/ARAMO_EXTRA b/fai/config/files/etc/apt/sources.list.d/noble.list/ARAMO_EXTRA index fdba700..8c9d379 120000 --- a/fai/config/files/etc/apt/sources.list.d/noble.list/ARAMO_EXTRA +++ b/fai/config/files/etc/apt/sources.list.d/noble.list/ARAMO_EXTRA @@ -1 +1 @@ -NOBLE \ No newline at end of file +NOBLE_FREE \ No newline at end of file diff --git a/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE b/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_FREE similarity index 93% rename from fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE rename to fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_FREE index 140df90..cda7d9c 100644 --- a/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE +++ b/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_FREE @@ -12,4 +12,3 @@ deb http://archive.ubuntu.com/ubuntu/ noble-backports main universe deb-src http://archive.ubuntu.com/ubuntu/ noble-security main universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ noble-updates main universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ noble-backports main universe -deb http://packages.linuxmint.com wilma upstream diff --git a/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_NONFREE b/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_NONFREE new file mode 100644 index 0000000..9579b1a --- /dev/null +++ b/fai/config/files/etc/apt/sources.list.d/noble.list/NOBLE_NONFREE @@ -0,0 +1,14 @@ +# multiverse needed for libfdk-aac1, which is actually free +# https://www.gnu.org/licenses/license-list.html#fdk + +###### Ubuntu Main Repos +deb http://archive.ubuntu.com/ubuntu/ noble main universe multiverse restricted +deb-src http://archive.ubuntu.com/ubuntu/ noble main universe multiverse restricted + +###### Ubuntu Update Repos +deb http://archive.ubuntu.com/ubuntu/ noble-security main universe multiverse restricted +deb http://archive.ubuntu.com/ubuntu/ noble-updates main universe multiverse restricted +deb http://archive.ubuntu.com/ubuntu/ noble-backports main universe restricted +deb-src http://archive.ubuntu.com/ubuntu/ noble-security main universe multiverse restricted +deb-src http://archive.ubuntu.com/ubuntu/ noble-updates main universe multiverse restricted +deb-src http://archive.ubuntu.com/ubuntu/ noble-backports main universe restricted diff --git a/fai/config/package_config/STANDARD b/fai/config/package_config/STANDARD index afbefab..46d7eb8 100644 --- a/fai/config/package_config/STANDARD +++ b/fai/config/package_config/STANDARD @@ -69,6 +69,8 @@ zstd iw # for the fai partitioning script parted dosfstools +# for pee +moreutils # iank, copied from DEBIAN so it goes into ubuntu too PACKAGES install GRUB_PC diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index a10a5bb..a6cfe67 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -54,7 +54,7 @@ if [[ ! -e $dst && -e $src ]]; then mount -o bind $src $dst fi - +chmod 700 /mnt/root $FAI/distro-install-common/end @@ -158,7 +158,7 @@ esac # https://nouveau.freedesktop.org/InstallNouveau.html # And now in t11, things got worse with a newer card also not loading # nouveau when it did in t10. -if lspci|grep -q 'VGA compatible controller: NVIDIA'; then +if [[ $HOSTNAME != frodo ]] && lspci|grep -q 'VGA compatible controller: NVIDIA'; then mkdir -p $target/etc/X11/xorg.conf.d/ cat >$target/etc/X11/xorg.conf.d/10-nouveau.conf <<'EOF' Section "Device" @@ -390,7 +390,7 @@ esac # /usr/share/initramfs-tools/hooks/btrfs # /usr/share/initramfs-tools/scripts/local-premount/btrfs # everything else, seems better to take from upstream package. -for f in $(dpkg-query -L btrfs-progs | gr '/man/|^/s?bin/|^/usr/lib/udev') ; do +for f in $(dpkg-query -L btrfs-progs | grep '/man/|^/s?bin/|^/usr/lib/udev') ; do if [[ ! -f $f ]]; then continue fi @@ -411,6 +411,13 @@ if $static_ver; then bp_dirname=btrfs-progs-t11 fi else + # from packages listed in .github/workflows/devel.yml + # The dumb makefile makes us build docs even if they were already built. + if ! type -p sphinx-build &>/dev/null; then + $ROOTCMD apt-get -y install python3-sphinx-rtd-theme + fi + + python3-sphinx-rtd-theme bp_dirname=btrfs-progs-release # latest released version. pre=https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs @@ -440,7 +447,7 @@ if [[ $ver != "$cur_ver" ]]; then if [[ $FAI_ROOT == / ]]; then cd $bp_dir make install - mv /usr/bin/{fsck,mkfs}.btfs /usr/sbin/ + mv /usr/bin/{fsck,mkfs}.btrfs /usr/sbin/ else mkdir -p $target/tmp/bprogs mount -o bind $bp_dir $target/tmp/bprogs diff --git a/faiserver-setup b/faiserver-setup index b2d8bc7..4ecff54 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -178,21 +178,14 @@ cat >>/etc/fai/apt/sources.list <>/etc/fai/apt/sources.list <<'EOF' -# deb http://ftp.debian.org/debian buster-backports main -# EOF -# # note, fai doesn\'t look at /etc/fai/apt/preferences.d -# cat >/etc/fai/apt/preferences <<'EOF' -# Package: linux-* firmware-linux-free btrfs-progs -# Pin: release a=buster-backports -# Pin-Priority: 500 -# EOF -# fi - +cat >/etc/fai/apt/preferences <