X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;fp=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;h=1aa974057798a449b7ae9c08c85fffeb0b645c70;hp=0b8d6c5576caba9763234f1de2bbca79f9a0e41a;hb=d8024901625ccaec69197c28a7c6db34cc7ce616;hpb=0947190df0781e70eb1c5b6d98529a4caa96f095 diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index 0b8d6c5..1aa9740 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -19,8 +19,11 @@ if [[ -e /a/bin/fai/fai-wrapper ]]; then } fi -if [[ $FAI_ROOT != / ]]; then - bprogs_pre=/srv +if [[ $FAI_ROOT == / ]]; then + source /a/bin/bash_unpublished/source-state + bprogs_dir=/a/opt/btrfs-progs-release +else + bprogs_dir=/srv/btrfs-progs-release chroot="chroot $FAI_ROOT" fi @@ -117,7 +120,7 @@ systemctl enable myncq.service /usr/bin/myncq no-upgrub EOFOUTER - ;; + ;;& # per rubens suggestion to make a d16 more stable kd|kw) cmdline+=" pci=realloc=off" ;; esac @@ -205,21 +208,33 @@ EOF fi -# for btrfs bug reporting, install latest kernel and btrfs progs, as of -# 2023-07-21 +# for new btrfs features, get latest stable kernel and btrfs progs, +# update ver= as needed. case $HOSTNAME in sy) mkdir -p $FAI_ROOT/tmp/kernel-debs + files=($FAI_ROOT/tmp/kernel-debs/*) + if (( ${#files[@]} >= 1 )); then + rm -rf "${files[@]}" + fi cd $FAI_ROOT/tmp/kernel-debs - va=6.4.3 - vb=$va-060403 - vc=${vb}.202307110536 - pre="https://kernel.ubuntu.com/~kernel-ppa/mainline/v$va/amd64/linux-" - if ! dpkg -s -- linux-headers-${vb} 2>&1 | grep -Fx "Status: install ok installed" &>/dev/null; then - urls=( - ${pre}headers-${vb}_${vc}_all.deb - ${pre}{headers,image-unsigned,modules}-${vb}-generic_${vc}_amd64.deb - ) + ver='6\.6' + va=$(curl -s https://kernel.ubuntu.com/mainline/ | \ + sed -rn 's,.*alt="\[DIR\]".*href="([^/]+).*,\1,p' | \ + grep -v -- -rc | sed 's/^v//' | grep "^$ver" | sort -V | tail -n1) + + # note the wiki page about these says to install linux-headers.*generic.*amd64, but + # as of 2024, they have a requirement of a very new glibc, and people report + # that installing it is not needed. + pkgs=$(curl -s https://kernel.ubuntu.com/mainline/v$va/amd64/CHECKSUMS | awk '$2 ~ /^linux-/ { print $2 }' | sort -u | grep -iv 'linux-headers.*generic.*amd64' ) + + urls=() + for p in $pkgs; do + if ! dpkg -s -- "${p%%_*}" 2>&1 | grep -Fx "Status: install ok installed" &>/dev/null; then + urls+=(https://kernel.ubuntu.com/mainline/v$va/amd64/$p) + fi + done + if (( ${#urls[@]} >= 1 )); then wget "${urls[@]}" $chroot bash </dev/null | awk '{print $2}') ||: +if [[ $ver != "$cur_ver" ]]; then + if [[ $HOST2 == $HOSTNAME && $ver != "$($bprogs_dir/btrfs --version 2>/dev/null | awk '{print $2}')" ]]; then + rm -rf $bprogs_dir + cd /tmp + wget $url + sudo -u iank tar xzf $tarball + mv ${tarball%.tar.gz} $bprogs_dir + cd $bprogs_dir + apt-get -y build-dep btrfs-progs + sudo -u iank ./configure --disable-documentation + sudo -u iank make + make install + else + $chroot bash -xe <