lol
1{stdenv, fetchurl, autoreconfHook, texinfo, buggyBiosCDSupport ? true}:
2
3stdenv.mkDerivation {
4 name = "grub-0.97-patch-1.12";
5
6 src = fetchurl {
7 url = ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz;
8 sha256 = "02r6b52r0nsp6ryqfiqchnl7r1d9smm80sqx24494gmx5p8ia7af";
9 };
10
11 # Lots of patches from Gentoo, in particular splash screen support
12 # (not the fancy SUSE gfxmenu stuff though). Also a fix for boot
13 # failures on systems with more than 2 GiB RAM, and for booting from
14 # ext3 filesystems with 256-byte inodes as well as ext4 filesystems.
15 gentooPatches = fetchurl {
16 url = mirror://gentoo/distfiles/grub-0.97-patches-1.12.tar.bz2;
17 sha256 = "15xc5349hkzl03lbn2cadrmvjrf3s8sn147vv2142cwys9sdzkl0";
18 };
19
20 patches = [
21 # Properly handle the case of symlinks such as
22 # /dev/disk/by-label/bla. The symlink resolution code in
23 # grub-install isn't smart enough.
24 ./symlink.patch
25
26 # Provide support for the "savedefault --once" command in the Grub
27 # shell. KDE uses this to allow rebooting into a non-default
28 # entry.
29 (fetchurl {
30 url = "https://raw.github.com/andatche/centos-grub/master/SOURCES/grub-0.97-once.patch";
31 sha256 = "1g5qfn8lvl32h4pggdf7dmjqjpi42jblknzakb5h909fi5i1qyw8";
32 })
33
34 ] ++ (stdenv.lib.optional buggyBiosCDSupport ./buggybios.patch);
35
36 # autoreconfHook required for the splashimage patch.
37 nativeBuildInputs = [ autoreconfHook ];
38 buildInputs = [ texinfo ];
39
40 hardeningDisable = [ "stackprotector" ];
41
42 prePatch = ''
43 unpackFile $gentooPatches
44 rm patch/400_all_grub-0.97-reiser4-20050808-gentoo.patch
45 for i in patch/*.patch; do
46 echo "applying patch $i"
47 patch -p1 < $i || patch -p0 < $i
48 done
49 '';
50
51 passthru.grubTarget = "";
52
53 meta = {
54 platforms = stdenv.lib.platforms.linux;
55 };
56}