;;
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 <<EOF
+cd /tmp/bprogs
+make install
+EOF
+ fi
+ else
cd $target/tmp
wget $url
tar xzf $tarball
chown -R iank:iank $target/tmp/${tarball%.tar.gz}
mv $target/tmp/${tarball%.tar.gz} $bp_dir
fi
- else
- 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 /a/opt/btrfs-progs-release
- make install
- else
- mkdir -p $target/tmp/bprogs
- mount -o bind $bp_dir $target/tmp/bprogs
- $ROOTCMD bash -xe <<EOF
-cd /tmp/bprogs
-make install
-EOF
- fi
+
fi
fi
## end get new kernel and btrfs-progs ##