X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FIANK%2F11-iank;h=1aa974057798a449b7ae9c08c85fffeb0b645c70;hb=839b3cf02ad7e8900b3d685d54449f11e7b60b60;hp=43fc13bcf5ff83db61307ac733f38278f6019573;hpb=6ba7f4d1207a9421d5a0a7495fb813d5e84fad21;p=automated-distro-installer diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index 43fc13b..1aa9740 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -19,7 +19,13 @@ if [[ -e /a/bin/fai/fai-wrapper ]]; then } fi - +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 # -r = recursive # -i = ignore non-matching class warnings, always exit 0 @@ -53,13 +59,13 @@ $FAI/distro-install-common/end # I run this as a single post-fai script to update things that have changed. tmpfile1=$(mktemp) # this can fail if we need an apt update -chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile1 ||: +$chroot /usr/bin/apt-cache policy >$tmpfile1 ||: fcopy -riB /etc/apt tmpfile2=$(mktemp) -chroot $FAI_ROOT /usr/bin/apt-cache policy >$tmpfile2 +$chroot /usr/bin/apt-cache policy >$tmpfile2 if ! diff -q $tmpfile1 $tmpfile2; then - chroot $FAI_ROOT /usr/bin/apt update + $chroot /usr/bin/apt update fi # outside of fai, this seems to regularly lead to # E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) @@ -109,12 +115,12 @@ TimeoutStartSec=20 WantedBy=dev-disk-by\x2did-ata\x2dSamsung_SSD_870_QVO_8TB_S5VUNG0N900656V.device EOF - chroot $FAI_ROOT bash <<'EOFOUTER' + $chroot bash <<'EOFOUTER' 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 @@ -159,7 +165,7 @@ fi # use networkmanager if this host has wireless. if [[ $HOSTNAME == bo ]] || type -p iw &>/dev/null && [[ $(iw dev) ]]; then - chroot $FAI_ROOT bash <= 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-" - urls=( - ${pre}headers-${vb}_${vc}_all.deb - ${pre}{headers,image-unsigned,modules}-${vb}-generic_${vc}_amd64.deb - ) - wget "${urls[@]}" - chroot $FAI_ROOT make install - - chroot $FAI_ROOT bash <&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 <