From 56805c0994230a9fdab5014c9200a13cfc35dca7 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Thu, 30 May 2013 18:46:17 +0200 Subject: sys-boot/grub: Refresh with upstream release Package-Manager: portage-2.1.12.2 --- sys-boot/grub/ChangeLog | 12 +- sys-boot/grub/Manifest | 14 +- .../grub/files/1.99-call_proper_grub_probe.patch | 12 - .../grub/files/1.99-do_not_stat_so_often.patch | 65 ----- sys-boot/grub/files/1.99-improve_devmapper.patch | 279 ------------------ .../files/1.99-stat_root_device_properly-p1.patch | 21 -- .../files/1.99-stat_root_device_properly-p2.patch | 21 -- sys-boot/grub/files/grub-0.97-gpt.patch | 315 --------------------- sys-boot/grub/files/grub-1.95-build.patch | 15 - sys-boot/grub/files/grub-1.96-genkernel.patch | 11 - sys-boot/grub/files/grub.default | 6 +- sys-boot/grub/grub-0.97-r12.ebuild | 288 ------------------- sys-boot/grub/grub-0.97-r13.ebuild | 294 +++++++++++++++++++ 13 files changed, 312 insertions(+), 1041 deletions(-) delete mode 100644 sys-boot/grub/files/1.99-call_proper_grub_probe.patch delete mode 100644 sys-boot/grub/files/1.99-do_not_stat_so_often.patch delete mode 100644 sys-boot/grub/files/1.99-improve_devmapper.patch delete mode 100644 sys-boot/grub/files/1.99-stat_root_device_properly-p1.patch delete mode 100644 sys-boot/grub/files/1.99-stat_root_device_properly-p2.patch delete mode 100644 sys-boot/grub/files/grub-0.97-gpt.patch delete mode 100644 sys-boot/grub/files/grub-1.95-build.patch delete mode 100644 sys-boot/grub/files/grub-1.96-genkernel.patch delete mode 100644 sys-boot/grub/grub-0.97-r12.ebuild create mode 100644 sys-boot/grub/grub-0.97-r13.ebuild (limited to 'sys-boot/grub') diff --git a/sys-boot/grub/ChangeLog b/sys-boot/grub/ChangeLog index 49be14ad..1f0c4bd0 100644 --- a/sys-boot/grub/ChangeLog +++ b/sys-boot/grub/ChangeLog @@ -2,6 +2,17 @@ # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*grub-0.97-r13 (30 May 2013) + + 30 May 2013; Bertrand Jacquin +grub-0.97-r13.ebuild, + -files/1.99-call_proper_grub_probe.patch, + -files/1.99-do_not_stat_so_often.patch, -files/1.99-improve_devmapper.patch, + -files/1.99-stat_root_device_properly-p1.patch, + -files/1.99-stat_root_device_properly-p2.patch, -files/grub-0.97-gpt.patch, + -files/grub-1.95-build.patch, -files/grub-1.96-genkernel.patch, + -grub-0.97-r12.ebuild, files/grub.default: + sys-boot/grub: Refresh with upstream release + 28 May 2013; Bertrand Jacquin grub-0.97-r12.ebuild: remove prepalldocs @@ -49,4 +60,3 @@ grub: fix netboot build Gentoo #139277 - diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index 1060746c..b796ee58 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -1,8 +1,3 @@ -AUX 1.99-call_proper_grub_probe.patch 536 SHA256 0e27b4ba6a0deedef2f65822e3b76aea4a817cb7219b01c29c8f682c450bd5e8 WHIRLPOOL eda7dece32b1c3f74227b4f0e53e8846e30f0d56239c512ae17d852fa36825294b314d2c1af8d10807cf345201e31e37762fd556f2c2390ae9de9327129a8df0 -AUX 1.99-do_not_stat_so_often.patch 1731 SHA256 a33fdbcab7fa4ad66b26598d9a6f1703f419229058c1e9c9c14edb6272783727 WHIRLPOOL bb8e382e4822a03028340092e67ccfc84f5608a4600b329b85c1b325b01d6c0476223e0e102b0948e4ea4cf7cbf310c56468f3c703a72edb5383b8eda30f7f8d -AUX 1.99-improve_devmapper.patch 7134 SHA256 b12624944d129820966146d55693b325d48d5d56901727142e386be082661778 WHIRLPOOL 5e168f740d81e20122acbe1cbfb37cbcb09ba27d1ed2edc537825664107aa416aae5d87ffb96207768a186ba2309e64925a9b9d0f67163fcee7568408e4bac59 -AUX 1.99-stat_root_device_properly-p1.patch 698 SHA256 1facf84e5195eb98b390e43e0a0d6f791e9500ef678b025e95f96d5a2769da5a WHIRLPOOL 92e0cd474b2277876037e602ed47b76b62fe2becc98a0704c9de7ca318f97d89c5a137473fbc558eeea7fed907e49293a61ae3c0a914ec365b2558db37cd4e04 -AUX 1.99-stat_root_device_properly-p2.patch 621 SHA256 431876459562c0aae6e854a97eeaf0cacdad8ceb5477788a4d691e4e6fa613eb WHIRLPOOL b94e253e2169e8b3a958cb49db81a86aa7d35de29b3fdfc9c58121f18496dcf440b4abe7b07c6d952f3f2172155958100b60795d96485108f874fa163d8c1883 AUX formilux/0002_all_save-default-entry-on-mbr.patch 2915 SHA256 7177b8f2c75886cf5f97cf623ab4b86bb7818effc4472f2f8f208b4269663d7a WHIRLPOOL 3a038809cae93b412bf712b2f76070b35d58ffb48e09c8d3729a6466e8dca03a7c08afdbf2c72520aa3551cfd48af27ac8bb0ad0cbf88e35bdb11717cfb23a6c AUX formilux/0003_all_add-grub-mbr-default3.patch 6097 SHA256 3bc1c5488bd8e9b9038374b62bf88d0c4eedd2a32a2e8bf63c8a52039a4f8164 WHIRLPOOL b49e110f6b418f1660cbf430ad9517ffcac88aa468c4da2cce2d757c4cafd743f69a5b64a146ea479fa633f6a6f5de1de774cbb792feead705b8423eb37280b1 AUX formilux/0004_all_add-support-for-the-savemap-keyword.patch 2751 SHA256 9bed3175a97b1b35d4e4c08901d3b3c73ddb3b255736dd3165da1e9c0defc885 WHIRLPOOL 13cd9c09ae9daa4610231a358eb3756e7ecc582a419ae9990052a055513fd7c67398e9ae2cbc072d70f6e364b1288c1cbc87003ed1fe7d8967d9ed5cc864f81a @@ -13,14 +8,11 @@ AUX formilux/0008_all_documentation-savemap.patch 10770 SHA256 da81461e3128fed1c AUX formilux/0009_all_sample-config-files-using-savemap.patch 2750 SHA256 226287798b8669d069638d2df6918a028e5c7462794ae0febba70813e2efac9f WHIRLPOOL 0d4eb2ad32a1e09a376419425e5a5a2007f5397fdd0eecec5f1cea22ee1feb559b698e6d41105958aea7c7d74cf4856060d84e4d9b8e5bd2306b6a9097805c28 AUX formilux/0010_all_print-a-dot-for-each-disk-I-O-in-debug-mode.patch 1386 SHA256 93bea20c2b4676b893d1de6ac25d10bb83df7c8ac2f1f0e67fc2e5ece1193a7e WHIRLPOOL 731cff1039cf136c25e4b3eccf276f6a36817850c65d5a59f2783770332e540c7153409fa09b17105a73f525652737bc824b60b70e0e9948e3a342c0b3ef47c3 AUX formilux/0011_all_add-a-debug-message-booting-image-now-just-before.patch 483 SHA256 02ed78b94fb1e24b8c4c7df7f9182fad099bf1c420237cda39a490ea96dfa57e WHIRLPOOL 2e1e4d107586fdf02555dfbe80e62b372ef20125a389a9f005050dffb8bb4767c77e2d5312d64edb8b576e24b878ffd2913214604487532c294c63b246e20bc2 -AUX grub-0.97-gpt.patch 10682 SHA256 5e38046cfb727420e5b4b19d71c7fb4ddff22cbcc356c9f888763b0c1963d389 WHIRLPOOL 22b3d12124115ec78fff2b3699c44d3b2c0bb84bec673e36d66e73c9da89137d237b1c7681b671ce89b06b2f4d78f9999eca98f43aa284d2b610713fc4161226 -AUX grub-1.95-build.patch 522 SHA256 26d45247376f1e42b4197088161146173ea5bee3800282a707b331c49aed6ccf WHIRLPOOL df1b2482d0af05b3e6a681a567f3d77eca0b997b20fd4b84a5fbb50c6bf440e363d7a2dd4a8d98108261a3cacb2b548fec337823ae95ad43e44fd05b52af419e -AUX grub-1.96-genkernel.patch 298 SHA256 8cbbaf1db68c39dfcc30b59779d820e9e9dca7ef957431791cdc0fc24e258eaf WHIRLPOOL 4f4a6e3f4451df9574abcc42ccbf6dafd603bbc7d90d46f72830b217e10db6007075af4db040c834ef7200173063f630c7160f13d5ea8545fce6fbef10b60cd1 AUX grub.conf.gentoo 627 SHA256 914b15af252210a32776196437cd8013e10e57d5780e66877ef3fe9a2b4b9776 WHIRLPOOL fcaef85cd7c2c446c882874cf4ec8a2241d1fc97720973a0a0cd1add259da599d4dae4d0b429ba2dff0307ed2d4598d5939cbc1b11127a0dedb3a54249ec9f81 -AUX grub.default 1229 SHA256 1ca3065f28c72043036fdc19565e66b1315928c725765463b2c6037e04deb1c5 WHIRLPOOL ec83659ffca38b08f97ac3b272fa64794a13c11c5b153f901a5f38c28d616751c5876e445e21367e58e60ae28cb241499229df697f8deeff8e6f9487d35ab4d5 +AUX grub.default 1254 SHA256 97f10c0421641b03cdb1f63496a1b10fbdeeb4b97e74c6804929f908729fb440 WHIRLPOOL 9aa39029fdbe1b2f1498785ae84f76c571e4ae2e80cecfcdcc7dd2c9bd11cfa88f4ab4b69c00994e028a1f921edecd37613c3b5e1523e979f8f38f09608992f3 DIST grub-0.97-patches-1.14.tar.bz2 52916 SHA256 5c7ca31fd9b2123471daf2e46a1936c4044ad0c12e353d9d3d8c3f83a1c7a0e5 WHIRLPOOL 60abd5087e85d9969784b9f5a100934606a76da03b665533d9d4d1d13f4e2d15de233a71e67a32d18a5fbfe128c2c8bf04c0d4451de24e6ca4fbd8dd862e23ea DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5 DIST splash.xpm.gz 33856 SHA256 b95600f777331b0dd31d51c68f60f0e846e4c8b628857a41165f4e6b30e6acaf WHIRLPOOL d95b7b588ea8ac7c2c8c53eb8057aef21c825da6411afe3b7e864c606aeffaaebce8ae41ce3e979f277bd6b48a9e82a1f2ea8afc836213b56523d8a854227d7b -EBUILD grub-0.97-r12.ebuild 9274 SHA256 a1b9c18335dd50b435afae83fdf62b34ae3cdb410ef6b27fee8521f3f39fbb57 WHIRLPOOL a42bde4c7b4b3deeaf0f7a99c3c938a5f2bbcb67892a83be0c55b05dc09eaac32184767e792781a92be7a35582842e4517970425f5dc23f711c642fc2efb4367 -MISC ChangeLog 2155 SHA256 4019a9d1ae292d023430fa71d3dfcb8dbc5cf0a7bcfde65b376f37a5f2c5703b WHIRLPOOL 0f16f05a99f2d42443fb0ecf13d8419eadbe93d8fbc9cbd8aa8dd97a86f14a126590717d385f6c839d7c4ce19e014c51d549d9557fc76aca08f54accd05437a7 +EBUILD grub-0.97-r13.ebuild 9437 SHA256 2355a22199627ce512b8d2365cedaa9599c7d7c8051babcc6a1e32a2d42bf1c0 WHIRLPOOL 2224867d5b5b8c9334be78995c7aa6b7b5b75b7a0a444669e49c31008b85100397aa9e4b054f72ca84c379b7510cbd934db73cf4c4edd14c816f67ffe663bb3e +MISC ChangeLog 2670 SHA256 4ebbf0287d71df334287816ae0e8b554b79db94ca7bc68c25594bd1471a81986 WHIRLPOOL 4b2cf8a6b5157fee6b4cd1965b4716a1021838ff74d0c6fa2c87e545ca2c0287c01ef67b66ec7dd97cc4e3d4a511e2fad1ace57230ef6d4e83c67856f81bfc1e MISC metadata.xml 139 SHA256 5cdc1888ebc8807b9a37b1d33429c61cabe7415a4f240e21a4c2ff8eca7a34ed WHIRLPOOL 620431014dd4fb752c3d46d11904ecb2c6d4525f5b4e30f4f778a3b74d3f7187ae4ccd856ebd7eabb48ce261b21849c732928fe647edce024a3fdc082d8f8630 diff --git a/sys-boot/grub/files/1.99-call_proper_grub_probe.patch b/sys-boot/grub/files/1.99-call_proper_grub_probe.patch deleted file mode 100644 index 6d65b5f8..00000000 --- a/sys-boot/grub/files/1.99-call_proper_grub_probe.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urN grub-1.99/util/grub.d/30_os-prober.in grub-1.99.new/util/grub.d/30_os-prober.in ---- grub-1.99/util/grub.d/30_os-prober.in 2010-12-25 18:13:57.000000000 +0100 -+++ grub-1.99.new/util/grub.d/30_os-prober.in 2011-08-28 12:35:40.965038455 +0200 -@@ -168,7 +168,7 @@ - done - ;; - macosx) -- OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`" -+ OSXUUID="`${grub_probe} --target=fs_uuid --device ${DEVICE} 2> /dev/null`" - osx_entry xnu_kernel 32 - osx_entry xnu_kernel64 64 - ;; diff --git a/sys-boot/grub/files/1.99-do_not_stat_so_often.patch b/sys-boot/grub/files/1.99-do_not_stat_so_often.patch deleted file mode 100644 index ca8a0239..00000000 --- a/sys-boot/grub/files/1.99-do_not_stat_so_often.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- grub-core/kern/emu/getroot.c 2011-05-18 07:35:47 +0000 -+++ grub-core/kern/emu/getroot.c 2011-05-21 05:03:55 +0000 -@@ -358,7 +358,7 @@ - - if (S_ISLNK (st.st_mode)) { - #ifdef __linux__ -- if (strcmp (dir, "mapper") == 0) { -+ if (strcmp (dir, "mapper") == 0 || strcmp (dir, "/dev/mapper") == 0) { - /* Follow symbolic links under /dev/mapper/; the canonical name - may be something like /dev/dm-0, but the names under - /dev/mapper/ are more human-readable and so we prefer them if -@@ -609,20 +609,27 @@ - - if (os_dev) - { -- if (stat (os_dev, &st) >= 0) -- dev = st.st_rdev; -- else -+ char *tmp = os_dev; -+ os_dev = canonicalize_file_name (os_dev); -+ free (tmp); -+ } -+ -+ if (os_dev) -+ { -+ if (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) != 0) -+ return os_dev; -+ if (stat (os_dev, &st) < 0) - grub_util_error ("cannot stat `%s'", os_dev); - free (os_dev); -- } -- else -- { -- if (stat (dir, &st) >= 0) -- dev = st.st_dev; -- else -- grub_util_error ("cannot stat `%s'", dir); -- } -- -+ dev = st.st_rdev; -+ return grub_find_device ("/dev/mapper", dev); -+ } -+ -+ if (stat (dir, &st) < 0) -+ grub_util_error ("cannot stat `%s'", dir); -+ -+ dev = st.st_dev; -+ - #ifdef __CYGWIN__ - /* Cygwin specific function. */ - os_dev = grub_find_device (dir, dev); - ---- grub-core/kern/emu/hostdisk.c 2011-05-18 07:35:47 +0000 -+++ grub-core/kern/emu/hostdisk.c 2011-05-21 05:03:55 +0000 -@@ -1408,7 +1408,8 @@ - if (tree) - dm_tree_free (tree); - free (path); -- char *ret = grub_find_device (NULL, (major << 8) | minor); -+ char *ret = grub_find_device ("/dev/mapper", -+ (major << 8) | minor); - return ret; - } - - diff --git a/sys-boot/grub/files/1.99-improve_devmapper.patch b/sys-boot/grub/files/1.99-improve_devmapper.patch deleted file mode 100644 index 5f0a930e..00000000 --- a/sys-boot/grub/files/1.99-improve_devmapper.patch +++ /dev/null @@ -1,279 +0,0 @@ ---- grub-core/kern/emu/getroot.c 2011-04-21 09:26:29 +0000 -+++ grub-core/kern/emu/getroot.c 2011-05-18 07:35:47 +0000 -@@ -34,6 +34,10 @@ - #include - #include - -+#ifdef HAVE_DEVICE_MAPPER -+# include -+#endif -+ - #ifdef __GNU__ - #include - #include -@@ -634,32 +638,65 @@ - } - - static int --grub_util_is_dmraid (const char *os_dev) -+grub_util_is_lvm (const char *os_dev) - { -- if (! strncmp (os_dev, "/dev/mapper/nvidia_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/isw_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt37x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/hpt45x_", 19)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/via_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/lsi_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/pdc_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/jmicron_", 20)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/asr_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/sil_", 16)) -- return 1; -- else if (! strncmp (os_dev, "/dev/mapper/ddf1_", 17)) -- return 1; -- -- return 0; -+ if ((strncmp ("/dev/mapper/", os_dev, 12) != 0)) -+ return 0; -+ -+#ifdef HAVE_DEVICE_MAPPER -+ { -+ struct dm_tree *tree; -+ uint32_t maj, min; -+ struct dm_tree_node *node = NULL; -+ const char *node_uuid; -+ struct stat st; -+ -+ if (stat (os_dev, &st) < 0) -+ return 0; -+ -+ tree = dm_tree_create (); -+ if (! tree) -+ { -+ grub_printf ("Failed to create tree\n"); -+ grub_dprintf ("hostdisk", "dm_tree_create failed\n"); -+ return 0; -+ } -+ -+ maj = major (st.st_rdev); -+ min = minor (st.st_rdev); -+ -+ if (! dm_tree_add_dev (tree, maj, min)) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_add_dev failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ -+ node = dm_tree_find_node (tree, maj, min); -+ if (! node) -+ { -+ grub_dprintf ("hostdisk", "dm_tree_find_node failed\n"); -+ dm_tree_free (tree); -+ return 0; -+ } -+ node_uuid = dm_tree_node_get_uuid (node); -+ if (! node_uuid) -+ { -+ grub_dprintf ("hostdisk", "%s has no DM uuid\n", os_dev); -+ dm_tree_free (tree); -+ return 0; -+ } -+ if (strncmp (node_uuid, "LVM-", 4) != 0) -+ { -+ dm_tree_free (tree); -+ return 0; -+ } -+ dm_tree_free (tree); -+ return 1; -+ } -+#else -+ return 1; -+#endif /* HAVE_DEVICE_MAPPER */ - } - - int -@@ -671,13 +708,11 @@ - return GRUB_DEV_ABSTRACTION_NONE; - - /* Check for LVM. */ -- if (!strncmp (os_dev, "/dev/mapper/", 12) -- && ! grub_util_is_dmraid (os_dev) -- && strncmp (os_dev, "/dev/mapper/mpath", 17) != 0) -+ if (grub_util_is_lvm (os_dev)) - return GRUB_DEV_ABSTRACTION_LVM; - - /* Check for RAID. */ -- if (!strncmp (os_dev, "/dev/md", 7)) -+ if (!strncmp (os_dev, "/dev/md", 7) && ! grub_util_device_is_mapped (os_dev)) - return GRUB_DEV_ABSTRACTION_RAID; - #endif - - -=== modified file 'grub-core/kern/emu/hostdisk.c' ---- grub-core/kern/emu/hostdisk.c 2011-05-09 16:59:35 +0000 -+++ grub-core/kern/emu/hostdisk.c 2011-05-18 07:35:47 +0000 -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -331,18 +332,23 @@ - return GRUB_ERR_NONE; - } - -+int -+grub_util_device_is_mapped (const char *dev) -+{ - #ifdef HAVE_DEVICE_MAPPER --static int --device_is_mapped (const char *dev) --{ - struct stat st; - -+ if (!grub_device_mapper_supported ()) -+ return 0; -+ - if (stat (dev, &st) < 0) - return 0; - - return dm_is_dm_major (major (st.st_rdev)); -+#else -+ return 0; -+#endif /* HAVE_DEVICE_MAPPER */ - } --#endif /* HAVE_DEVICE_MAPPER */ - - #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) - /* FIXME: geom actually gives us the whole container hierarchy. -@@ -418,7 +424,7 @@ - # endif /* !defined(HAVE_DIOCGDINFO) */ - - # ifdef HAVE_DEVICE_MAPPER -- if (grub_device_mapper_supported () && device_is_mapped (dev)) { -+ if (grub_util_device_is_mapped (dev)) { - struct dm_task *task = NULL; - grub_uint64_t start, length; - char *target_type, *params, *space; -@@ -1149,6 +1155,54 @@ - return ret; - } - -+#ifdef HAVE_DEVICE_MAPPER -+static int -+grub_util_get_dm_node_linear_info (const char *dev, -+ int *maj, int *min) -+{ -+ struct dm_task *dmt; -+ void *next = NULL; -+ uint64_t length, start; -+ char *target, *params; -+ char *ptr; -+ int major, minor; -+ -+ dmt = dm_task_create(DM_DEVICE_TABLE); -+ if (!dmt) -+ return 0; -+ -+ if (!dm_task_set_name(dmt, dev)) -+ return 0; -+ dm_task_no_open_count(dmt); -+ if (!dm_task_run(dmt)) -+ return 0; -+ next = dm_get_next_target(dmt, next, &start, &length, -+ &target, ¶ms); -+ if (grub_strcmp (target, "linear") != 0) -+ return 0; -+ major = grub_strtoul (params, &ptr, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (*ptr != ':') -+ return 0; -+ ptr++; -+ minor = grub_strtoul (ptr, 0, 10); -+ if (grub_errno) -+ { -+ grub_errno = GRUB_ERR_NONE; -+ return 0; -+ } -+ if (maj) -+ *maj = major; -+ if (min) -+ *min = minor; -+ return 1; -+} -+#endif -+ - static char * - convert_system_partition_to_system_disk (const char *os_dev, struct stat *st) - { -@@ -1325,9 +1379,39 @@ - node = NULL; - goto devmapper_out; - } -- else if (strncmp (node_uuid, "DMRAID-", 7) != 0) -- { -+ if (strncmp (node_uuid, "LVM-", 4) == 0) -+ { -+ grub_dprintf ("hostdisk", "%s is an LVM\n", path); -+ node = NULL; -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "mpath-", 6) == 0) -+ { -+ /* Multipath partitions have partN-mpath-* UUIDs, and are -+ linear mappings so are handled by -+ grub_util_get_dm_node_linear_info. Multipath disks are not -+ linear mappings and must be handled specially. */ -+ grub_dprintf ("hostdisk", "%s is a multipath disk\n", path); -+ mapper_name = dm_tree_node_get_name (node); -+ goto devmapper_out; -+ } -+ if (strncmp (node_uuid, "DMRAID-", 7) != 0) -+ { -+ int major, minor; -+ const char *node_name; - grub_dprintf ("hostdisk", "%s is not DM-RAID\n", path); -+ -+ if ((node_name = dm_tree_node_get_name (node)) -+ && grub_util_get_dm_node_linear_info (node_name, -+ &major, &minor)) -+ { -+ if (tree) -+ dm_tree_free (tree); -+ free (path); -+ char *ret = grub_find_device (NULL, (major << 8) | minor); -+ return ret; -+ } -+ - node = NULL; - goto devmapper_out; - } - ---- include/grub/emu/misc.h 2010-12-02 13:26:46 +0000 -+++ include/grub/emu/misc.h 2011-05-18 07:35:47 +0000 -@@ -54,6 +54,8 @@ - - char *grub_make_system_path_relative_to_its_root (const char *path) - __attribute__ ((warn_unused_result)); -+int -+grub_util_device_is_mapped (const char *dev); - - void * EXPORT_FUNC(xmalloc) (grub_size_t size) __attribute__ ((warn_unused_result)); - void * EXPORT_FUNC(xrealloc) (void *ptr, grub_size_t size) __attribute__ ((warn_unused_result)); - diff --git a/sys-boot/grub/files/1.99-stat_root_device_properly-p1.patch b/sys-boot/grub/files/1.99-stat_root_device_properly-p1.patch deleted file mode 100644 index fc14c536..00000000 --- a/sys-boot/grub/files/1.99-stat_root_device_properly-p1.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- grub-core/kern/emu/getroot.c 2011-05-21 05:03:55 +0000 -+++ grub-core/kern/emu/getroot.c 2011-06-23 17:50:41 +0000 -@@ -616,13 +616,15 @@ - - if (os_dev) - { -- if (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) != 0) -+ int dm = (strncmp (os_dev, "/dev/dm-", sizeof ("/dev/dm-") - 1) == 0); -+ int root = (strcmp (os_dev, "/dev/root") == 0); -+ if (!dm && !root) - return os_dev; - if (stat (os_dev, &st) < 0) - grub_util_error ("cannot stat `%s'", os_dev); - free (os_dev); - dev = st.st_rdev; -- return grub_find_device ("/dev/mapper", dev); -+ return grub_find_device (dm ? "/dev/mapper" : "/dev", dev); - } - - if (stat (dir, &st) < 0) - diff --git a/sys-boot/grub/files/1.99-stat_root_device_properly-p2.patch b/sys-boot/grub/files/1.99-stat_root_device_properly-p2.patch deleted file mode 100644 index aa7fd186..00000000 --- a/sys-boot/grub/files/1.99-stat_root_device_properly-p2.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- grub-core/kern/emu/getroot.c 2011-06-23 17:50:41 +0000 -+++ grub-core/kern/emu/getroot.c 2011-06-24 02:32:54 +0000 -@@ -620,11 +620,13 @@ - int root = (strcmp (os_dev, "/dev/root") == 0); - if (!dm && !root) - return os_dev; -- if (stat (os_dev, &st) < 0) -- grub_util_error ("cannot stat `%s'", os_dev); -+ if (stat (os_dev, &st) >= 0) -+ { -+ free (os_dev); -+ dev = st.st_rdev; -+ return grub_find_device (dm ? "/dev/mapper" : "/dev", dev); -+ } - free (os_dev); -- dev = st.st_rdev; -- return grub_find_device (dm ? "/dev/mapper" : "/dev", dev); - } - - if (stat (dir, &st) < 0) - diff --git a/sys-boot/grub/files/grub-0.97-gpt.patch b/sys-boot/grub/files/grub-0.97-gpt.patch deleted file mode 100644 index 7b1a55cd..00000000 --- a/sys-boot/grub/files/grub-0.97-gpt.patch +++ /dev/null @@ -1,315 +0,0 @@ -diff -ruBbd --unidirectional-new-file grub-0.96/stage2/builtins.c grub-0.96-patched/stage2/builtins.c ---- grub-0.96/stage2/builtins.c 2004-06-20 09:33:04.000000000 -0400 -+++ grub-0.96-patched/stage2/builtins.c 2007-01-04 13:56:06.000000000 -0500 -@@ -1229,14 +1229,15 @@ - for (drive = 0x80; drive < 0x88; drive++) - { - unsigned long part = 0xFFFFFF; -- unsigned long start, len, offset, ext_offset; -- int type, entry; -+ unsigned long start, len, offset, ext_offset, gpt_offset; -+ int type, entry, gpt_count, gpt_size; - char buf[SECTOR_SIZE]; - - current_drive = drive; - while (next_partition (drive, 0xFFFFFF, &part, &type, - &start, &len, &offset, &entry, -- &ext_offset, buf)) -+ &ext_offset, &gpt_offset, -+ &gpt_count, &gpt_size, buf)) - { - if (type != PC_SLICE_TYPE_NONE - && ! IS_PC_SLICE_TYPE_BSD (type) -@@ -2806,8 +2807,8 @@ - { - int new_type; - unsigned long part = 0xFFFFFF; -- unsigned long start, len, offset, ext_offset; -- int entry, type; -+ unsigned long start, len, offset, ext_offset, gpt_offset; -+ int entry, type, gpt_count, gpt_size; - char mbr[512]; - - /* Get the drive and the partition. */ -@@ -2844,7 +2845,14 @@ - /* Look for the partition. */ - while (next_partition (current_drive, 0xFFFFFF, &part, &type, - &start, &len, &offset, &entry, -- &ext_offset, mbr)) -+ &ext_offset, &gpt_offset, &gpt_count, &gpt_size, mbr)) -+ /* The partition may not be a GPT partition. */ -+ if (gpt_offset != 0) -+ { -+ errnum = ERR_BAD_ARGUMENT; -+ return 1; -+ } -+ - { - if (part == current_partition) - { -diff -ruBbd --unidirectional-new-file grub-0.96/stage2/disk_io.c grub-0.96-patched/stage2/disk_io.c ---- grub-0.96/stage2/disk_io.c 2004-05-23 12:35:24.000000000 -0400 -+++ grub-0.96-patched/stage2/disk_io.c 2007-01-04 14:01:08.000000000 -0500 -@@ -21,6 +21,7 @@ - - #include - #include -+#include - - #ifdef SUPPORT_NETBOOT - # define GRUB 1 -@@ -502,8 +503,8 @@ - set_partition_hidden_flag (int hidden) - { - unsigned long part = 0xFFFFFF; -- unsigned long start, len, offset, ext_offset; -- int entry, type; -+ unsigned long start, len, offset, ext_offset, gpt_offset; -+ int entry, type, gpt_count, gpt_size; - char mbr[512]; - - /* The drive must be a hard disk. */ -@@ -524,7 +525,14 @@ - /* Look for the partition. */ - while (next_partition (current_drive, 0xFFFFFF, &part, &type, - &start, &len, &offset, &entry, -- &ext_offset, mbr)) -+ &ext_offset, &gpt_offset, &gpt_count, &gpt_size, mbr)) -+ /* The partition may not be a GPT partition. */ -+ if (gpt_offset != 0) -+ { -+ errnum = ERR_BAD_ARGUMENT; -+ return 1; -+ } -+ - { - if (part == current_partition) - { -@@ -577,11 +585,14 @@ - unsigned long *partition, int *type, - unsigned long *start, unsigned long *len, - unsigned long *offset, int *entry, -- unsigned long *ext_offset, char *buf) -+ unsigned long *ext_offset, -+ unsigned long *gpt_offset, int *gpt_count, -+ int *gpt_size, char *buf) - { - /* Forward declarations. */ - auto int next_bsd_partition (void); - auto int next_pc_slice (void); -+ auto int next_gpt_slice(void); - - /* Get next BSD partition in current PC slice. */ - int next_bsd_partition (void) -@@ -666,6 +677,40 @@ - return 0; - } - -+ /* If this is a GPT partition table, read it as such. */ -+ if (*entry == -1 && *offset == 0 && PC_SLICE_TYPE (buf, 0) == PC_SLICE_TYPE_GPT) -+ { -+ struct grub_gpt_header *hdr = (struct grub_gpt_header *) buf; -+ -+ /* Read in the GPT Partition table header. */ -+ if (! rawread (drive, 1, 0, SECTOR_SIZE, buf)) -+ return 0; -+ -+ if (hdr->magic == GPT_HEADER_MAGIC && hdr->version == 0x10000) -+ { -+ /* Let gpt_offset point to the first entry in the GPT -+ partition table. This can also be used by callers of -+ next_partition to determine if a entry comes from a -+ GPT partition table or not. */ -+ *gpt_offset = hdr->partitions; -+ *gpt_count = hdr->maxpart; -+ *gpt_size = hdr->partentry_size; -+ -+ return next_gpt_slice(); -+ } -+ else -+ { -+ /* This is not a valid header for a GPT partition table. -+ Re-read the MBR or the boot sector of the extended -+ partition. */ -+ if (! rawread (drive, *offset, 0, SECTOR_SIZE, buf)) -+ return 0; -+ } -+ } -+ -+ /* Not a GPT partition. */ -+ *gpt_offset = 0; -+ - /* Increase the entry number. */ - (*entry)++; - -@@ -710,6 +755,43 @@ - return 1; - } - -+ /* Get the next GPT slice. */ -+ int next_gpt_slice (void) -+ { -+ struct grub_gpt_partentry *gptentry = (struct grub_gpt_partentry *) buf; -+ /* Make GPT partitions show up as PC slices. */ -+ int pc_slice_no = (*partition & 0xFF0000) >> 16; -+ -+ /* If this is the first time... */ -+ if (pc_slice_no == 0xFF) -+ { -+ pc_slice_no = -1; -+ *entry = -1; -+ } -+ -+ do { -+ (*entry)++; -+ -+ if (*entry >= *gpt_count) -+ { -+ errnum = ERR_NO_PART; -+ return 0; -+ } -+ /* Read in the GPT Partition table entry. */ -+ if (! rawread (drive, (*gpt_offset) + GPT_ENTRY_SECTOR (*gpt_size, *entry), GPT_ENTRY_INDEX (*gpt_size, *entry), *gpt_size, buf)) -+ return 0; -+ } while (! (gptentry->type1 && gptentry->type2)); -+ -+ pc_slice_no++; -+ *start = gptentry->start; -+ *len = gptentry->end - gptentry->start + 1; -+ *type = PC_SLICE_TYPE_EXT2FS; -+ *entry = pc_slice_no; -+ *partition = (*entry << 16) | 0xFFFF; -+ -+ return 1; -+ } -+ - /* Start the body of this function. */ - - #ifndef STAGE1_5 -@@ -717,6 +799,9 @@ - return 0; - #endif - -+ if (*partition != 0xFFFFFF && *gpt_offset != 0) -+ return next_gpt_slice (); -+ - /* If previous partition is a BSD partition or a PC slice which - contains BSD partitions... */ - if ((*partition != 0xFFFFFF && IS_PC_SLICE_TYPE_BSD (*type & 0xff)) -@@ -755,6 +840,9 @@ - unsigned long dest_partition = current_partition; - unsigned long part_offset; - unsigned long ext_offset; -+ unsigned long gpt_offset; -+ int gpt_count; -+ int gpt_size; - int entry; - char buf[SECTOR_SIZE]; - int bsd_part, pc_slice; -@@ -766,7 +854,8 @@ - int ret = next_partition (current_drive, dest_partition, - ¤t_partition, ¤t_slice, - &part_start, &part_length, -- &part_offset, &entry, &ext_offset, buf); -+ &part_offset, &entry, &ext_offset, -+ &gpt_offset, &gpt_count, &gpt_size, buf); - bsd_part = (current_partition >> 8) & 0xFF; - pc_slice = current_partition >> 16; - return ret; -diff -ruBbd --unidirectional-new-file grub-0.96/stage2/gpt.h grub-0.96-patched/stage2/gpt.h ---- grub-0.96/stage2/gpt.h 1969-12-31 19:00:00.000000000 -0500 -+++ grub-0.96-patched/stage2/gpt.h 2007-01-04 13:52:14.000000000 -0500 -@@ -0,0 +1,68 @@ -+/* -+ * GRUB -- GRand Unified Bootloader -+ * Copyright (C) 2002,2005,2006 Free Software Foundation, Inc. -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#ifndef _GPT_H -+#define _GPT_H -+ -+typedef signed char grub_int8_t; -+typedef signed short grub_int16_t; -+typedef signed int grub_int32_t; -+typedef signed long long int grub_int64_t; -+typedef unsigned char grub_uint8_t; -+typedef unsigned short grub_uint16_t; -+typedef unsigned int grub_uint32_t; -+typedef unsigned long long int grub_uint64_t; -+ -+struct grub_gpt_header -+{ -+ grub_uint64_t magic; -+ grub_uint32_t version; -+ grub_uint32_t headersize; -+ grub_uint32_t crc32; -+ grub_uint32_t unused1; -+ grub_uint64_t primary; -+ grub_uint64_t backup; -+ grub_uint64_t start; -+ grub_uint64_t end; -+ grub_uint8_t guid[16]; -+ grub_uint64_t partitions; -+ grub_uint32_t maxpart; -+ grub_uint32_t partentry_size; -+ grub_uint32_t partentry_crc32; -+} __attribute__ ((packed)); -+ -+struct grub_gpt_partentry -+{ -+ grub_uint64_t type1; -+ grub_uint64_t type2; -+ grub_uint8_t guid[16]; -+ grub_uint64_t start; -+ grub_uint64_t end; -+ grub_uint8_t attrib; -+ char name[72]; -+} __attribute__ ((packed)); -+ -+#define GPT_HEADER_MAGIC 0x5452415020494645UL -+ -+#define GPT_ENTRY_SECTOR(size,entry) \ -+ ((((entry) * (size) + 1) & ~(SECTOR_SIZE - 1)) >> SECTOR_BITS) -+#define GPT_ENTRY_INDEX(size,entry) \ -+ ((((entry) * (size) + 1) & (SECTOR_SIZE - 1)) - 1) -+ -+#endif /* _GPT_H */ -diff -ruBbd --unidirectional-new-file grub-0.96/stage2/pc_slice.h grub-0.96-patched/stage2/pc_slice.h ---- grub-0.96/stage2/pc_slice.h 2003-07-09 07:45:53.000000000 -0400 -+++ grub-0.96-patched/stage2/pc_slice.h 2007-01-04 13:52:14.000000000 -0500 -@@ -115,6 +115,7 @@ - #define PC_SLICE_TYPE_LINUX_EXTENDED 0x85 - #define PC_SLICE_TYPE_VSTAFS 0x9e - #define PC_SLICE_TYPE_DELL_UTIL 0xde -+#define PC_SLICE_TYPE_GPT 0xee - #define PC_SLICE_TYPE_LINUX_RAID 0xfd - - -diff -ruBbd --unidirectional-new-file grub-0.96/stage2/shared.h grub-0.96-patched/stage2/shared.h ---- grub-0.96/stage2/shared.h 2004-06-19 12:40:09.000000000 -0400 -+++ grub-0.96-patched/stage2/shared.h 2007-01-04 13:52:15.000000000 -0500 -@@ -934,7 +934,9 @@ - unsigned long *partition, int *type, - unsigned long *start, unsigned long *len, - unsigned long *offset, int *entry, -- unsigned long *ext_offset, char *buf); -+ unsigned long *ext_offset, -+ unsigned long *gpt_offset, int *gpt_count, -+ int *gpt_size, char *buf); - - /* Sets device to the one represented by the SAVED_* parameters. */ - int make_saved_active (void); diff --git a/sys-boot/grub/files/grub-1.95-build.patch b/sys-boot/grub/files/grub-1.95-build.patch deleted file mode 100644 index fff11a5c..00000000 --- a/sys-boot/grub/files/grub-1.95-build.patch +++ /dev/null @@ -1,15 +0,0 @@ -http://bugs.gentoo.org/185361 - -fix building in parallel - ---- grub-1.95/conf/i386-pc.mk -+++ grub-1.95/conf/i386-pc.mk -@@ -739,7 +739,7 @@ - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< - -include grub_emu-util_console.d - --grub_emu-util_grub_emu.o: util/grub-emu.c -+grub_emu-util_grub_emu.o: util/grub-emu.c grub_modules_init.h - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< - -include grub_emu-util_grub_emu.d - diff --git a/sys-boot/grub/files/grub-1.96-genkernel.patch b/sys-boot/grub/files/grub-1.96-genkernel.patch deleted file mode 100644 index 471fc66a..00000000 --- a/sys-boot/grub/files/grub-1.96-genkernel.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- util/grub.d/10_linux.in -+++ util/grub.d/10_linux.in -@@ -93,7 +93,7 @@ - echo "$a" - } - --list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do -+list=`for i in /boot/kernel-* /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do - if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi - done` - diff --git a/sys-boot/grub/files/grub.default b/sys-boot/grub/files/grub.default index 580d2758..8c5167fa 100644 --- a/sys-boot/grub/files/grub.default +++ b/sys-boot/grub/files/grub.default @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default,v 1.2 2011/08/30 06:45:04 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default,v 1.3 2012/02/29 01:52:23 floppym Exp $ # # To populate all changes in this file you need to regenerate your # grub configuration file afterwards: @@ -9,6 +9,8 @@ # See the grub info page for documentation on possible variables and # their associated values. +GRUB_DISTRIBUTOR="Gentoo" + GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true diff --git a/sys-boot/grub/grub-0.97-r12.ebuild b/sys-boot/grub/grub-0.97-r12.ebuild deleted file mode 100644 index 75a48c49..00000000 --- a/sys-boot/grub/grub-0.97-r12.ebuild +++ /dev/null @@ -1,288 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r12.ebuild,v 1.5 2012/08/07 21:00:21 hwoarang Exp $ - -# XXX: we need to review menu.lst vs grub.conf handling. We've been converting -# all systems to grub.conf (and symlinking menu.lst to grub.conf), but -# we never updated any of the source code (it still all wants menu.lst), -# and there is no indication that upstream is making the transition. - -# If you need to roll a new grub-static distfile, here is how. -# - Robin H. Johnson - 29 Nov 2010 -# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \ -# USE='static -ncurses -netboot -custom-cflags' \ -# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \ -# grub-${PVR}.ebuild clean package && \ -# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \ -# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2 - -inherit mount-boot eutils flag-o-matic toolchain-funcs autotools linux-info pax-utils - -PATCHVER="1.14" # Should match the revision ideally -DESCRIPTION="GNU GRUB Legacy boot loader" -HOMEPAGE="http://www.gnu.org/software/grub/" -SRC_URI="mirror://gentoo/${P}.tar.gz - mirror://gnu-alpha/${PN}/${P}.tar.gz - mirror://gentoo/splash.xpm.gz - mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86 ~x86-fbsd" -IUSE="custom-cflags ncurses netboot static" - -RDEPEND="ncurses? ( - >=sys-libs/ncurses-5.2-r5 - amd64? ( app-emulation/emul-linux-x86-baselibs ) - )" -DEPEND="${RDEPEND}" - -pkg_setup() { - case $(tc-arch) in - amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;; - esac -} - -src_unpack() { - unpack ${A} - cd "${S}" - - # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as - # discovered in bug 160801. We can change this, however, using larger values - # for this variable means that Grub needs more memory to run and boot. For a - # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom - # value in make.conf, it is possible to make kernels ~16Mb in size, but it - # needs the kitchen sink built-in. - local t="custom" - if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then - case $(tc-arch) in - amd64) GRUB_MAX_KERNEL_SIZE=9 ;; - x86) GRUB_MAX_KERNEL_SIZE=5 ;; - esac - t="default" - fi - einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)" - - sed -i \ - -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \ - "${S}"/grub/asmstub.c \ - || die - - if [[ -n ${PATCHVER} ]] ; then - EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch - fi - - EPATCH_SUFFIX="patch" epatch "${FILESDIR}"/formilux - - eautoreconf -} - -src_compile() { - filter-flags -fPIE #168834 - - use amd64 && multilib_toolchain_setup x86 - - unset BLOCK_SIZE #73499 - - ### i686-specific code in the boot loader is a bad idea; disabling to ensure - ### at least some compatibility if the hard drive is moved to an older or - ### incompatible system. - - # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2, - # but the objcopy's (faulty) test fails if -fstack-protector is default. - # create a cache telling configure that objcopy is ok, and add -C to econf - # to make use of the cache. - # - # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails. - # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites - # -fno-stack-protector detected by configure, removed from netboot's emake. - use custom-cflags || unset CFLAGS - - export grub_cv_prog_objcopy_absolute=yes #79734 - use static && append-ldflags -static - - # Per bug 216625, the emul packages do not provide .a libs for performing - # suitable static linking - if use amd64 && use static ; then - if [ -z "${GRUB_STATIC_PACKAGE_BUILDING}" ]; then - die "You must use the grub-static package if you want a static Grub on amd64!" - else - eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This" - eerror "is specifically intended for building the tarballs for the" - eerror "grub-static package via USE='static -ncurses'." - eerror "All bets are now off." - ebeep 10 - fi - fi - - # build the net-bootable grub first, but only if "netboot" is set - if use netboot ; then - econf \ - --libdir=/lib \ - --datadir=/usr/lib/grub \ - --exec-prefix=/ \ - --disable-auto-linux-mem-opt \ - --enable-diskless \ - --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ - --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ - --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ - --enable-{tulip,via-rhine,w89c840} - - emake w89c840_o_CFLAGS="-O" || die - - mv -f stage2/{nbgrub,pxegrub} "${S}"/ - mv -f stage2/stage2 stage2/stage2.netboot - - emake -j1 clean || die - fi - - # Now build the regular grub - # Note that FFS and UFS2 support are broken for now - stage1_5 files too big - econf \ - --libdir=/lib \ - --datadir=/usr/lib/grub \ - --exec-prefix=/ \ - --disable-auto-linux-mem-opt \ - $(use_with ncurses curses) - - # sanity check due to common failure - use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found" - - emake || die "making regular stuff" -} - -src_test() { - # non-default block size also give false pass/fails. - unset BLOCK_SIZE - emake -j1 check || die -} - -src_install() { - emake DESTDIR="${D}" install || die - if use netboot ; then - exeinto /usr/lib/grub/${CHOST} - doexe nbgrub pxegrub stage2/stage2.netboot || die - fi - - # bug 330745 - pax-mark -m "${D}"/sbin/grub - - dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO - newdoc docs/menu.lst grub.conf.sample - dodoc "${FILESDIR}"/grub.conf.gentoo - - [ -n "${GRUB_STATIC_PACKAGE_BUILDING}" ] && \ - mv \ - "${D}"/usr/share/doc/${PF} \ - "${D}"/usr/share/doc/grub-static-${PF/grub-} - - insinto /usr/share/grub - doins "${DISTDIR}"/splash.xpm.gz -} - -setup_boot_dir() { - local boot_dir=$1 - local dir=${boot_dir} - - mkdir -p "${dir}" - [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" - dir="${dir}/grub" - if [[ ! -e ${dir} ]] ; then - mkdir "${dir}" || die - fi - - # change menu.lst to grub.conf - if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then - mv -f "${dir}"/menu.lst "${dir}"/grub.conf - ewarn - ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" - ewarn - fi - - if [[ ! -e ${dir}/menu.lst ]]; then - einfo "Linking from new grub.conf name to menu.lst" - ln -snf grub.conf "${dir}"/menu.lst - fi - - if [[ -e ${dir}/stage2 ]] ; then - mv "${dir}"/stage2{,.old} - ewarn "*** IMPORTANT NOTE: you must run grub and install" - ewarn "the new version's stage1 to your MBR. Until you do," - ewarn "stage1 and stage2 will still be the old version, but" - ewarn "later stages will be the new version, which could" - ewarn "cause problems such as an unbootable system." - ewarn "This means you must use either grub-install or perform" - ewarn "root/setup manually! For more help, see the handbook:" - ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto" - ebeep - fi - - einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}" - for x in \ - "${ROOT}"/lib*/grub/*/* \ - "${ROOT}"/usr/share/grub/* ; do - [[ -f ${x} ]] && cp -p "${x}" "${dir}"/ - done - - if [[ ! -e ${dir}/grub.conf ]] ; then - s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" - [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf - [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf - [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf - fi - - # Per bug 218599, we support grub.conf.install for users that want to run a - # specific set of Grub setup commands rather than the default ones. - grub_config=${dir}/grub.conf.install - [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf - if [[ -e ${grub_config} ]] ; then - egrep \ - -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ - "${grub_config}" | \ - /sbin/grub --batch \ - --device-map="${dir}"/device.map \ - > /dev/null - fi - - # the grub default commands silently piss themselves if - # the default file does not exist ahead of time - if [[ ! -e ${dir}/default ]] ; then - grub-set-default --root-directory="${boot_dir}" default - fi - einfo "Grub has been installed to ${boot_dir} successfully." -} - -pkg_postinst() { - mount-boot_mount_boot_partition - - if [[ -n ${DONT_MOUNT_BOOT} ]]; then - elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" - elog "the following instructions for your /boot!" - elog "Neglecting to do so may cause your system to fail to boot!" - elog - else - setup_boot_dir "${ROOT}"/boot - # Trailing output because if this is run from pkg_postinst, it gets mixed into - # the other output. - einfo "" - fi - elog "To interactively install grub files to another device such as a USB" - elog "stick, just run the following and specify the directory as prompted:" - elog " emerge --config =${PF}" - elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" - elog "grub where to install in a non-interactive way." - - # needs to be after we call setup_boot_dir - mount-boot_pkg_postinst -} - -pkg_config() { - local dir - if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then - einfo "Enter the directory where you want to setup grub:" - read dir - else - dir="${GRUB_ALT_INSTALLDIR}" - fi - setup_boot_dir "${dir}" -} diff --git a/sys-boot/grub/grub-0.97-r13.ebuild b/sys-boot/grub/grub-0.97-r13.ebuild new file mode 100644 index 00000000..103da07e --- /dev/null +++ b/sys-boot/grub/grub-0.97-r13.ebuild @@ -0,0 +1,294 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-0.97-r13.ebuild,v 1.3 2012/07/24 15:49:35 vapier Exp $ + +# XXX: we need to review menu.lst vs grub.conf handling. We've been converting +# all systems to grub.conf (and symlinking menu.lst to grub.conf), but +# we never updated any of the source code (it still all wants menu.lst), +# and there is no indication that upstream is making the transition. + +# If you need to roll a new grub-static distfile, here is how. +# - Robin H. Johnson - 29 Nov 2010 +# FEATURES='-noauto -noinfo -nodoc -noman -splitdebug nostrip' \ +# USE='static -ncurses -netboot -custom-cflags' \ +# PORTAGE_COMPRESS=true GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \ +# grub-${PVR}.ebuild clean package && \ +# qtbz2 -s -j ${PKGDIR}/${CAT}/${PF}.tbz2 && \ +# mv ${PF}.tar.bz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2 + +EAPI="4" + +inherit eutils mount-boot toolchain-funcs linux-info flag-o-matic autotools pax-utils multiprocessing + +PATCHVER="1.14" # Should match the revision ideally +DESCRIPTION="GNU GRUB Legacy boot loader" +HOMEPAGE="http://www.gnu.org/software/grub/" +SRC_URI="mirror://gentoo/${P}.tar.gz + mirror://gnu-alpha/${PN}/${P}.tar.gz + mirror://gentoo/splash.xpm.gz + mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-fbsd" +IUSE="custom-cflags ncurses netboot static" + +LIB_DEPEND="ncurses? ( + >=sys-libs/ncurses-5.2-r5[static-libs(+)] + amd64? ( app-emulation/emul-linux-x86-baselibs ) + )" +RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )" +DEPEND="${RDEPEND} + static? ( ${LIB_DEPEND} )" + +pkg_setup() { + case $(tc-arch) in + amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;; + esac +} + +src_prepare() { + # Grub will not handle a kernel larger than EXTENDED_MEMSIZE Mb as + # discovered in bug 160801. We can change this, however, using larger values + # for this variable means that Grub needs more memory to run and boot. For a + # kernel of size N, Grub needs (N+1)*2. Advanced users should set a custom + # value in make.conf, it is possible to make kernels ~16Mb in size, but it + # needs the kitchen sink built-in. + local t="custom" + if [[ -z ${GRUB_MAX_KERNEL_SIZE} ]] ; then + case $(tc-arch) in + amd64) GRUB_MAX_KERNEL_SIZE=9 ;; + x86) GRUB_MAX_KERNEL_SIZE=5 ;; + esac + t="default" + fi + einfo "Grub will support the ${t} maximum kernel size of ${GRUB_MAX_KERNEL_SIZE} Mb (GRUB_MAX_KERNEL_SIZE)" + + sed -i \ + -e "/^#define.*EXTENDED_MEMSIZE/s,3,${GRUB_MAX_KERNEL_SIZE},g" \ + "${S}"/grub/asmstub.c \ + || die + + if [[ -n ${PATCHVER} ]] ; then + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch + fi + + EPATCH_SUFFIX="patch" epatch "${FILESDIR}"/formilux + eautoreconf +} + +src_configure() { + filter-flags -fPIE #168834 + + use amd64 && multilib_toolchain_setup x86 + + unset BLOCK_SIZE #73499 + + ### i686-specific code in the boot loader is a bad idea; disabling to ensure + ### at least some compatibility if the hard drive is moved to an older or + ### incompatible system. + + # grub-0.95 added -fno-stack-protector detection, to disable ssp for stage2, + # but the objcopy's (faulty) test fails if -fstack-protector is default. + # create a cache telling configure that objcopy is ok, and add -C to econf + # to make use of the cache. + # + # CFLAGS has to be undefined running econf, else -fno-stack-protector detection fails. + # STAGE2_CFLAGS is not allowed to be used on emake command-line, it overwrites + # -fno-stack-protector detected by configure, removed from netboot's emake. + use custom-cflags || unset CFLAGS + + export grub_cv_prog_objcopy_absolute=yes #79734 + use static && append-ldflags -static + + # Per bug 216625, the emul packages do not provide .a libs for performing + # suitable static linking + if use amd64 && use static ; then + if [[ -z ${GRUB_STATIC_PACKAGE_BUILDING} ]] ; then + die "You must use the grub-static package if you want a static Grub on amd64!" + else + eerror "You have set GRUB_STATIC_PACKAGE_BUILDING. This" + eerror "is specifically intended for building the tarballs for the" + eerror "grub-static package via USE='static -ncurses'." + eerror "All bets are now off." + fi + fi + + multijob_init + + # build the net-bootable grub first, but only if "netboot" is set + if use netboot ; then + ( + multijob_child_init + mkdir -p "${WORKDIR}"/netboot + pushd "${WORKDIR}"/netboot >/dev/null + ECONF_SOURCE=${S} \ + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + --enable-diskless \ + --enable-{3c{5{03,07,09,29,95},90x},cs89x0,davicom,depca,eepro{,100}} \ + --enable-{epic100,exos205,ni5210,lance,ne2100,ni{50,65}10,natsemi} \ + --enable-{ne,ns8390,wd,otulip,rtl8139,sis900,sk-g16,smc9000,tiara} \ + --enable-{tulip,via-rhine,w89c840} + popd >/dev/null + ) & + multijob_post_fork + fi + + # Now build the regular grub + # Note that FFS and UFS2 support are broken for now - stage1_5 files too big + econf \ + --libdir=/lib \ + --datadir=/usr/lib/grub \ + --exec-prefix=/ \ + --disable-auto-linux-mem-opt \ + $(use_with ncurses curses) + + # sanity check due to common failure + use ncurses && ! grep -qs "HAVE_LIBCURSES.*1" config.h && die "USE=ncurses but curses not found" + + multijob_finish +} + +src_compile() { + use netboot && emake -C "${WORKDIR}"/netboot w89c840_o_CFLAGS="-O" + emake +} + +src_test() { + # non-default block size also give false pass/fails. + unset BLOCK_SIZE + emake -j1 check +} + +src_install() { + default + if use netboot ; then + exeinto /usr/lib/grub/${CHOST} + doexe "${WORKDIR}"/netboot/stage2/{nbgrub,pxegrub} + newexe "${WORKDIR}"/netboot/stage2/stage2 stage2.netboot + fi + + pax-mark -m "${D}"/sbin/grub #330745 + + newdoc docs/menu.lst grub.conf.sample + dodoc "${FILESDIR}"/grub.conf.gentoo + + [[ -n ${GRUB_STATIC_PACKAGE_BUILDING} ]] && \ + mv "${D}"/usr/share/doc/{${PF},grub-static-${PF/grub-}} + + insinto /usr/share/grub + doins "${DISTDIR}"/splash.xpm.gz +} + +setup_boot_dir() { + local boot_dir=$1 + local dir=${boot_dir} + + mkdir -p "${dir}" + [[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot" + dir="${dir}/grub" + if [[ ! -e ${dir} ]] ; then + mkdir "${dir}" || die + fi + + # change menu.lst to grub.conf + if [[ ! -e ${dir}/grub.conf ]] && [[ -e ${dir}/menu.lst ]] ; then + mv -f "${dir}"/menu.lst "${dir}"/grub.conf + ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf" + echo + fi + + if [[ ! -e ${dir}/menu.lst ]]; then + einfo "Linking from new grub.conf name to menu.lst" + ln -snf grub.conf "${dir}"/menu.lst + fi + + if [[ -e ${dir}/stage2 ]] ; then + mv "${dir}"/stage2{,.old} + ewarn "*** IMPORTANT NOTE: you must run grub and install" + ewarn "the new version's stage1 to your MBR. Until you do," + ewarn "stage1 and stage2 will still be the old version, but" + ewarn "later stages will be the new version, which could" + ewarn "cause problems such as an unbootable system." + ewarn + ewarn "This means you must use either grub-install or perform" + ewarn "root/setup manually." + ewarn + ewarn "For more help, see the handbook:" + ewarn "http://www.gentoo.org/doc/en/handbook/handbook-${ARCH}.xml?part=1&chap=10#grub-install-auto" + echo + fi + + einfo "Copying files from /lib/grub and /usr/share/grub to ${dir}" + for x in \ + "${ROOT}"/lib*/grub/*/* \ + "${ROOT}"/usr/share/grub/* ; do + [[ -f ${x} ]] && cp -p "${x}" "${dir}"/ + done + + if [[ ! -e ${dir}/grub.conf ]] ; then + s="${ROOT}/usr/share/doc/${PF}/grub.conf.gentoo" + [[ -e "${s}" ]] && cat "${s}" >${dir}/grub.conf + [[ -e "${s}.gz" ]] && zcat "${s}.gz" >${dir}/grub.conf + [[ -e "${s}.bz2" ]] && bzcat "${s}.bz2" >${dir}/grub.conf + fi + + # Per bug 218599, we support grub.conf.install for users that want to run a + # specific set of Grub setup commands rather than the default ones. + grub_config=${dir}/grub.conf.install + [[ -e ${grub_config} ]] || grub_config=${dir}/grub.conf + if [[ -e ${grub_config} ]] ; then + egrep \ + -v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \ + "${grub_config}" | \ + /sbin/grub --batch \ + --device-map="${dir}"/device.map \ + > /dev/null + fi + + # the grub default commands silently piss themselves if + # the default file does not exist ahead of time + if [[ ! -e ${dir}/default ]] ; then + grub-set-default --root-directory="${boot_dir}" default + fi + einfo "Grub has been installed to ${boot_dir} successfully." +} + +pkg_postinst() { + mount-boot_mount_boot_partition + + if [[ -n ${DONT_MOUNT_BOOT} ]]; then + elog "WARNING: you have DONT_MOUNT_BOOT in effect, so you must apply" + elog "the following instructions for your /boot!" + elog "Neglecting to do so may cause your system to fail to boot!" + elog + else + setup_boot_dir "${ROOT}"/boot + # Trailing output because if this is run from pkg_postinst, it gets mixed into + # the other output. + einfo "" + fi + elog "To interactively install grub files to another device such as a USB" + elog "stick, just run the following and specify the directory as prompted:" + elog " emerge --config =${PF}" + elog "Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell" + elog "grub where to install in a non-interactive way." + + # needs to be after we call setup_boot_dir + mount-boot_pkg_postinst +} + +pkg_config() { + local dir + if [ ! -d "${GRUB_ALT_INSTALLDIR}" ]; then + einfo "Enter the directory where you want to setup grub:" + read dir + else + dir="${GRUB_ALT_INSTALLDIR}" + fi + setup_boot_dir "${dir}" +} -- cgit v1.2.3