From 1245ba6b164023c2164b7806c932c261ddd3d8ba Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 12 Aug 2024 23:30:38 -0400 Subject: [PATCH] use dev btrfs for a bugfix --- fai-redep | 2 +- fai/config/scripts/IANK/11-iank | 63 +++++++++++++++++++++------------ 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/fai-redep b/fai-redep index 5498667..768e137 100755 --- a/fai-redep +++ b/fai-redep @@ -129,7 +129,7 @@ else rsrv -rlpt /q/root/shadow /q/root/luks /fai/config/distro-install-common fi -rsrv -rlpt --delete /a/bin/ds/bash-lib-u /a/opt/btrfs-progs-release /fai/config/distro-install-common +rsrv -rlpt --delete /a/bin/ds/bash-lib-u /a/opt/btrfs-progs-release /a/opt/btrfs-progs /fai/config/distro-install-common dirs=(/p/c/machine_specific/${target:-*}/filesystem/etc/ssh) if [[ -e ${dirs[0]} ]]; then diff --git a/fai/config/scripts/IANK/11-iank b/fai/config/scripts/IANK/11-iank index 1bb328b..56a4404 100755 --- a/fai/config/scripts/IANK/11-iank +++ b/fai/config/scripts/IANK/11-iank @@ -383,21 +383,52 @@ case $HOSTNAME in ;; esac -pre=https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs -tarball=$(curl -s $pre/sha256sums.asc \ - | awk '$2 ~ /^btrfs-progs-v/ { print $2 }' | grep -v -- -rc | grep "^btrfs-progs-v.*gz\$" | sort -V | tail -n1) -url="$pre/$tarball" -dir=${tarball%.tar.gz} -ver=${dir#btrfs-progs-} -cur_ver=$($ROOTCMD btrfs --version 2>/dev/null | awk '{print $2}') ||: + +### using dev version temporarily. comment when done, and uncomment below +ver='v6.10' + +### release version. uncomment when not using dev version +# pre=https://mirrors.edge.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs +# tarball=$(curl -s $pre/sha256sums.asc \ +# | awk '$2 ~ /^btrfs-progs-v/ { print $2 }' | grep -v -- -rc | grep "^btrfs-progs-v.*gz\$" | sort -V | tail -n1) +# url="$pre/$tarball" +# dir=${tarball%.tar.gz} +# ver=${dir#btrfs-progs-} + + +cur_ver=$($ROOTCMD btrfs --version 2>/dev/null | head -n1 | awk '{print $2}') ||: if [[ $FAI_ROOT == / ]]; then bp_dir=/a/opt/btrfs-progs-release + # dev version. temporary until bug fix gets into release. comment then. + bp_dir=/a/opt/btrfs-progs else bp_dir=$FAI/distro-install-common/btrfs-progs-release + # dev version. temporary until bug fix gets into release. comment then. + # note, also requires change in fai-redep. + bp_dir=$FAI/distro-install-common/btrfs-progs fi + +last_built_ver=$($bp_dir/btrfs --version 2>/dev/null | head -n1 | awk '{print $2}') + if [[ $ver != "$cur_ver" ]]; then - if [[ $ver != "$($bp_dir/btrfs --version 2>/dev/null | awk '{print $2}')" ]]; then + if [[ $ver == "$last_built_ver" ]]; then + if ! $ROOTCMD dpkg -s -- build-essential 2>&1 | grep -Fx "Status: install ok installed" &>/dev/null; then + $ROOTCMD apt-get -y install build-essential + fi + + if [[ $FAI_ROOT == / ]]; then + cd $bp_dir + make install + else + mkdir -p $target/tmp/bprogs + mount -o bind $bp_dir $target/tmp/bprogs + $ROOTCMD bash -xe <&1 | grep -Fx "Status: install ok installed" &>/dev/null; then - $ROOTCMD apt-get -y install build-essential - fi - if [[ $FAI_ROOT == / ]]; then - cd /a/opt/btrfs-progs-release - make install - else - mkdir -p $target/tmp/bprogs - mount -o bind $bp_dir $target/tmp/bprogs - $ROOTCMD bash -xe <