summary refs log tree commit diff
path: root/pkgs/tools/misc/grub/grub1.patches.sh
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2018-09-16 22:47:56 -0400
committerSamuel Dionne-Riel <samuel@dionne-riel.com>2018-09-17 09:31:36 -0400
commit932c8f4c13d06ee7787e7099948eb5f926ce38dc (patch)
tree04179fc37476624c9966e542d7b4da7841ddea32 /pkgs/tools/misc/grub/grub1.patches.sh
parentba09b0570298dbbf583303d30491117375e04375 (diff)
downloadnixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar.gz
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar.bz2
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar.lz
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar.xz
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.tar.zst
nixpkgs-932c8f4c13d06ee7787e7099948eb5f926ce38dc.zip
grub: grub-0.97-patch-1.15 -> grub-0.97-73
Instead of using Gentoo's patchset, uses Debian's.

Gentoo's doesn't work anymore.
Diffstat (limited to 'pkgs/tools/misc/grub/grub1.patches.sh')
-rwxr-xr-xpkgs/tools/misc/grub/grub1.patches.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/tools/misc/grub/grub1.patches.sh b/pkgs/tools/misc/grub/grub1.patches.sh
new file mode 100755
index 00000000000..d3b138ad357
--- /dev/null
+++ b/pkgs/tools/misc/grub/grub1.patches.sh
@@ -0,0 +1,70 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -p nix -i bash --pure
+
+# Does like `maintainers/scripts/debian-patches.sh`, but specialized for
+# grub1 patches, and using the new salsa service.
+
+# Most common usage: `pkgs/tools/misc/grub/grub1.patches.sh pkgs/tools/misc/grub/grub1.patches.nix`
+# That is, after updating the script with the new list from the series file,
+# removing (by commenting) patches as required.
+
+set -e
+set -u
+
+# https://salsa.debian.org/grub-team/grub-legacy/tree/master/debian/patches
+SERIES=(
+	snapshot.patch
+	menu.lst_gnu-hurd.patch
+	graphics.patch
+	raid.patch
+	raid_cciss.patch
+	xfs_freeze.patch
+	2gb_limit.patch
+	grub-special_device_names.patch
+	grub-xvd_drives.patch
+	initrd_max_address.patch
+	splashimage_help.patch
+	grub-install_addsyncs.patch
+	grub-install_regexp.patch
+	grub-install_aoe_support.patch
+	grub-install_xvd.patch
+	geometry-26kernel.patch
+	print_func.patch
+	mprotect.patch
+	savedefault.patch
+	find-grub-dir.patch
+	intelmac.patch
+	crossreference_manpages.patch
+	ext3_256byte_inode.patch
+    # Breaks on NixOS.
+	#use_grub-probe_in_grub-install.patch
+	objcopy-absolute.patch
+	no-reorder-functions.patch
+
+	# We aren't building amd64 binaries, see #244498
+	#fix_amd64_compile.patch
+	modern-automake.patch
+	no-combine-stack-adjustments.patch
+	no-pie.patch
+)
+
+# Revision mapping to current tip of the 0.97-73 branch.
+rev="1dad5507d74ef97fdd3c6cf2a028084f6f2850c3"
+prefix="https://salsa.debian.org/grub-team/grub-legacy/raw/${rev}/debian/patches"
+FILE="$1"
+shift
+
+cat <<EOF > "$FILE"
+# Generated by grub1-patches.sh
+let
+  prefix = "${prefix}";
+in
+[
+EOF
+
+for PATCH in "${SERIES[@]}"; do
+	URL="$prefix/$PATCH"
+	HASH="$(nix-prefetch-url "$URL")"
+	echo "{ url = \"\${prefix}/$PATCH\"; sha256 = \"$HASH\"; }" >> "$FILE"
+done
+echo "]" >> "$FILE"