From 3a8a3c91f75761f83fa1090a328c53509afeed83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 13 Jul 2009 16:57:33 +0000 Subject: [PATCH] Adding a patch for grub, so livecds with grub can still boot with buggy bioses, as those of Acer 292LMi or Airis N990. This allows booting the NixOS ISO releases. I made it optional, not included by default. I don't think it would harm at all enabling it always - let it be decided on forum. svn path=/nixpkgs/trunk/; revision=16341 --- pkgs/tools/misc/grub/buggybios.patch | 11 +++++++++++ pkgs/tools/misc/grub/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pkgs/tools/misc/grub/buggybios.patch diff --git a/pkgs/tools/misc/grub/buggybios.patch b/pkgs/tools/misc/grub/buggybios.patch new file mode 100644 index 00000000000..1453a8adaa0 --- /dev/null +++ b/pkgs/tools/misc/grub/buggybios.patch @@ -0,0 +1,11 @@ +Taken from: http://savannah.gnu.org/bugs/?func=detailitem&item_id=10433 +--- grub-0.95.orig/stage2/bios.c 2004-03-27 17:34:04.000000000 +0100 ++++ grub-0.95/stage2/bios.c 2005-03-02 01:02:29.192582200 +0100 +@@ -147,6 +147,7 @@ + grub_memset (&cdrp, 0, sizeof (cdrp)); + cdrp.size = sizeof (cdrp) - sizeof (cdrp.dummy); + err = biosdisk_int13_extensions (0x4B01, drive, &cdrp); ++ err = 0; /* really ugly hack to circumvent faulty BIOS versions like Acer 292LMi */ + if (! err && cdrp.drive_no == drive) + { + if ((cdrp.media_type & 0x0F) == 0) diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index e0c35d63f72..f6f8f3ca251 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, autoconf, automake}: +{stdenv, fetchurl, autoconf, automake, buggyBiosCDSupport ? false}: stdenv.mkDerivation { name = "grub-0.97-patch-1.9"; @@ -22,7 +22,7 @@ stdenv.mkDerivation { # /dev/disk/by-label/bla. The symlink resolution code in # grub-install isn't smart enough. ./symlink.patch - ]; + ] ++ (stdenv.lib.optional buggyBiosCDSupport ./buggybios.patch); # Autoconf/automake required for the splashimage patch. buildInputs = [autoconf automake]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d31a7710898..ba64b5de619 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -795,6 +795,7 @@ let grub = import ../tools/misc/grub { inherit fetchurl autoconf automake; stdenv = stdenv_32bit; + buggyBiosCDSupport = (getConfig ["grub" "buggyBiosCDSupport"] false); }; gssdp = import ../development/libraries/gssdp {