linux_latest-libre: 19812 -> 19835 (#418293)

Also, update the phases to run their hooks, and the hash to be SRI, and the update script to support that.

This fixes the build. I don't have great passion for Linux Libre; I just wanted to see fewer of these build failures being "expected". Though I did not attempt to boot the kernel on a real machine, I did run the nixosTests.kernel-generic.linux_libre test and the machine does in fact boot and do the needful.
This commit is contained in:
Philip Taron
2025-07-02 09:07:57 -07:00
committed by GitHub
2 changed files with 22 additions and 8 deletions
+18 -4
View File
@@ -5,8 +5,8 @@
linux,
scripts ? fetchsvn {
url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
rev = "19812";
sha256 = "1bhkc0r5p3d4mmmi26k5lsk56jgbc8hi46bfih313hxmrnsd07dy";
rev = "19835";
hash = "sha256-5usyLmlTr5nlM+/uWPQepzhhNSLi3Hol1BfnWb9CFws=";
},
...
}@args:
@@ -30,16 +30,30 @@ linux.override {
src = stdenv.mkDerivation {
name = "${linux.name}-libre-src";
src = linux.src;
buildPhase = ''
runHook preBuild
# --force flag to skip empty files after deblobbing
${scripts}/${majorMinor}/deblob-${majorMinor} --force \
${major} ${minor} ${patch}
${scripts}/${majorMinor}/deblob-${majorMinor} --force ${major} ${minor} ${patch}
runHook postBuild
'';
checkPhase = ''
runHook preCheck
${scripts}/deblob-check
runHook postCheck
'';
installPhase = ''
runHook preInstall
cp -r . "$out"
runHook postInstall
'';
};
@@ -6,7 +6,6 @@ nixpkgs="$(git rev-parse --show-toplevel)"
path="$nixpkgs/pkgs/os-specific/linux/kernel/linux-libre.nix"
old_rev="$(grep -o 'rev = ".*"' "$path" | awk -F'"' '{print $2}')"
old_sha256="$(grep -o 'sha256 = ".*"' "$path" | awk -F'"' '{print $2}')"
svn_url=https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/
rev="$(curl -s "$svn_url" | grep -Em 1 -o 'Revision [0-9]+' | awk '{print $2}')"
@@ -16,15 +15,16 @@ if [ "$old_rev" = "$rev" ]; then
exit 0
fi
old_hash="$(grep -o 'hash = ".*"' "$path" | awk -F'"' '{print $2}')"
sha256="$(QUIET=1 nix-prefetch-svn "$svn_url" "$rev" | tail -1)"
new_hash="$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$sha256")"
if [ "$old_sha256" = "$sha256" ]; then
if [ "$old_hash" = "$new_hash" ]; then
echo "No updates for linux-libre"
exit 0
fi
sed -i -e "s/rev = \".*\"/rev = \"$rev\"/" \
-e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" "$path"
sed -i -e "s,rev = \".*\",rev = \"$rev\",; s,hash = \".*\",hash = \"$new_hash\"," "$path"
if [ -n "${COMMIT-}" ]; then
git commit -qm "linux_latest-libre: $old_rev -> $rev" "$path" \