chore(sys-boot/grub): bump to get grub-2

grub-2 is needed for grub-mkimage

Change-Id: I13ed9af890494b43513ec9a0f863117bf186fa44
This commit is contained in:
Brandon Philips 2013-02-12 11:32:02 -08:00
parent a29e857ceb
commit 2b1049fb9e
36 changed files with 8258 additions and 9 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1 +1,73 @@
DIST grub-1.99.tar.xz 2639224 RMD160 d59a47fa40b2be0d5ea5b2b00ff5538cfa147747 SHA1 a5ae9558f30ce7757a76aa130088b053a87e2fb6 SHA256 f308148d4c83c6f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
AUX 1.99-call_proper_grub_probe.patch 536 SHA256 0e27b4ba6a0deedef2f65822e3b76aea4a817cb7219b01c29c8f682c450bd5e8 SHA512 db4188ed7e5ed3a736580cb17b3a41b984e81d65036254e699a3cba409cfdcbe342341a467c2e01d351800f70ec1b4c61c0fd23c2c4c5fbdf9949a16b43c4d4b WHIRLPOOL eda7dece32b1c3f74227b4f0e53e8846e30f0d56239c512ae17d852fa36825294b314d2c1af8d10807cf345201e31e37762fd556f2c2390ae9de9327129a8df0
AUX 1.99-do_not_stat_so_often.patch 1731 SHA256 a33fdbcab7fa4ad66b26598d9a6f1703f419229058c1e9c9c14edb6272783727 SHA512 66c0e7ea45228b1b58fd842316c35ce708a4fc3170f255165dc90073ea109a7e7f34a0673bca3f8228c392fbd9470cf36984e9e3d9de59c4cd6974ddf05da1b5 WHIRLPOOL bb8e382e4822a03028340092e67ccfc84f5608a4600b329b85c1b325b01d6c0476223e0e102b0948e4ea4cf7cbf310c56468f3c703a72edb5383b8eda30f7f8d
AUX 1.99-improve_devmapper.patch 7134 SHA256 b12624944d129820966146d55693b325d48d5d56901727142e386be082661778 SHA512 21d73e2d7f6e065f254a1cc55675e45fe5d1e345f44d8de648395bcd41750324641e84c807839aa06261095ec229a8928290f609d0558d7c897764881305de46 WHIRLPOOL 5e168f740d81e20122acbe1cbfb37cbcb09ba27d1ed2edc537825664107aa416aae5d87ffb96207768a186ba2309e64925a9b9d0f67163fcee7568408e4bac59
AUX 1.99-stat_root_device_properly-p1.patch 698 SHA256 1facf84e5195eb98b390e43e0a0d6f791e9500ef678b025e95f96d5a2769da5a SHA512 bb2b88d9c5ff6a37292c98ddc1e655076781ac485a5625d09f3cac596ba3aac4b06f9fb0fd250146dd3be1f9e0328085d3a6c52137a4ab5dd3961c53ba87e0ec WHIRLPOOL 92e0cd474b2277876037e602ed47b76b62fe2becc98a0704c9de7ca318f97d89c5a137473fbc558eeea7fed907e49293a61ae3c0a914ec365b2558db37cd4e04
AUX 1.99-stat_root_device_properly-p2.patch 621 SHA256 431876459562c0aae6e854a97eeaf0cacdad8ceb5477788a4d691e4e6fa613eb SHA512 6953a5a7c48cd38ab41f60d3c4ef8fbeb413408fc749feca7cfffa0413e370c298f3fe3b6a01e457ec376524c9d40536258f7c0fde1e76991774291571117f76 WHIRLPOOL b94e253e2169e8b3a958cb49db81a86aa7d35de29b3fdfc9c58121f18496dcf440b4abe7b07c6d952f3f2172155958100b60795d96485108f874fa163d8c1883
AUX grub-0.97-gpt.patch 10682 SHA256 5e38046cfb727420e5b4b19d71c7fb4ddff22cbcc356c9f888763b0c1963d389 SHA512 2fe10c839c4c575750f7eeb29953c00f232771a3143687aac21e3b90585ec59d6f7c0346db80c0aa3c18d27799d301711d6f995f6781ce8a148c7ce59004e1aa WHIRLPOOL 22b3d12124115ec78fff2b3699c44d3b2c0bb84bec673e36d66e73c9da89137d237b1c7681b671ce89b06b2f4d78f9999eca98f43aa284d2b610713fc4161226
AUX grub-2.00-compression.patch 2051 SHA256 003cc6b8762adbff14c1d0f7a0c2ddb145e80d73e899439fb8ab12e133a60feb SHA512 2b57ddb395cb5aa37bc3d721f3d4c527a1d5165c0b5e1c2efec7d169ae2438ad063ee67da68eff4069f0451983e599ec40ed92a0bc33348a21ad622738bbc213 WHIRLPOOL 2c61bfd65ed1d53e42a1ec881f3a7e42904924097460f692952a0fbfa46cfbb029374a2e6cfdcb1f2eb1216e994b56265e6e0e72912ecda7de90daddc03931c2
AUX grub-2.00-config-quoting.patch 3934 SHA256 4f1bc29429a864731edf4a5a5fa53004dc67bf1225bd8fa81cb58b197df12510 SHA512 bed0fb1a8589c1979cf7162599e041c8b8eaa66bff3e8fa4a8b9929c8e8191ec1f85c129bcf2f7c9dcc75d5ea50330067ffd519835308460f7a194aab40bfc13 WHIRLPOOL 979234f1d3e1282d1e6d3ac4aa1e01c86082a3883abd452f0f1886181a6d46ccccd8e6b59628acfa8dc375ad9db1b35037d9483f87df2893a7398402dc7cb51a
AUX grub-2.00-freebsd.patch 16465 SHA256 5464dda43bed28634e406a3b182db1d76e70059e0a3b3c276ee91ff27ca78cbd SHA512 d0fecaf83796971ef6f2cd43cab4c89faf1496d4241e249467d7839b366c616e15a8c6961d9224ed0e139d018d5d9f354cf59ddf2ef5e915a4b03e11dbdf568e WHIRLPOOL 963c61923503a57894634f0b3431e8e701a83f6514e5829f0ed91fc3c9011fa39870c319e1cbfee62341f1d37dfd0fdadcd4a028b725bb65d2f06fbedfd31166
AUX grub-2.00-hardcoded-awk.patch 599 SHA256 438c7357a632c7c9efe406b1d7cbb2524694e68c5783b401d3dd17ae0aba6816 SHA512 f47b742b9fa4c57e36e767ace6e14318678cc429ae88cd275e07d95abbc8d3d01d831058da2f6f91662bfdfc4396aed5417198245534488359a43023459d1a1f WHIRLPOOL 17be198f854466ff8a50c5b7d46eaf7883a4ce8cbe3a89cbc0e62d75ae71e94ce863341c0650b113bbee4415220da38896da73177ab59d2b53d3bde7ec9809ba
AUX grub-2.00-no-gets.patch 805 SHA256 054d85619905055a0ea0e5f9d27eb8c8596959598ac9a5bae7e82543c19adeaf SHA512 8b89fa40efe232474e7bb03d12542030d40fea1fe0839a9493f6704fbe6de77516b5976841bf652c7236104513f427750efc668248c71ba0ea7f676557e8c9e3 WHIRLPOOL 796a7bc4583829abd1a552f7d16d6cc4f2999707af1ae0b5231fa53e87ce22a265a35a3d0f486fcac2e74dbed5fd54e3a572186cc2ba1a849433adc021a0a65b
AUX grub-2.00-parallel-make.patch 1907 SHA256 7d8eda92eeeeb87001bc44dd1390b96c927c45542af2984c5d80f9ca3a552362 SHA512 cc2c47858ca2fa76b081ca78b6090fe61f0b41d6aad21f07e269dd9f98355b7c148f62659418257c24aa370634060ead2c3a612aae07c6f53e9ba13a25a1d7fc WHIRLPOOL 9b5aad7db3ec5c60151984861690b64e90d6adbeb1dec4257d33873156ae6ce6ded432377520cfb9cbbbbf2f30e69e134d6dbc0007355cfa74521042500d844e
AUX grub-2.00-tftp-endian.patch 728 SHA256 4806fb14471fe6547cb69e6fab97e66c8245654acbc4738071cf2717368de458 SHA512 8fee95b06b50f8721d7013ecf8fb954e9b1ba83f99790e165ec334dfcd41fe7655f37868069a315acd4af97d3c4466aa36e0ab5a8b767faf862f1d71f88b3252 WHIRLPOOL 53779e4952049f069824eefcaaaa0e46fc9a7036ed0f9b67008e523f618105d760300ffcd315f861de786c63de02b2753d3ed14637b39fd7af47aadd02355695
AUX grub-2.00-zfs-feature-flag-support.patch 31186 SHA256 596d509a22d1f3c2bf27864ff285d7ae8e39b3912347163a14afb36812de8605 SHA512 e262f33de0e3ef97c9bcfc294ba40638dd66b369a4a72bcee42c2d5aafa223eec96b1ed841b97c09b40db798dec38504397ad6000eb3b98eb8b29457e0dfefa3 WHIRLPOOL 70314defe1fc0704a2e3ff2579916a8a206b9437517096b3b1129991dd3364a994991f6bed0d5ace51b78c9ba469afeb4de88d445600783c91456a1278c9ac23
AUX grub.conf.gentoo 627 SHA256 914b15af252210a32776196437cd8013e10e57d5780e66877ef3fe9a2b4b9776 SHA512 5ee586c151b025a153867d2854b73e2e18a6af38e9d65069b7114a55af776803ba947b4901b0806e79fa8f36aeac90daad608b9ec2a4a8526301d1beb36e4ef3 WHIRLPOOL fcaef85cd7c2c446c882874cf4ec8a2241d1fc97720973a0a0cd1add259da599d4dae4d0b429ba2dff0307ed2d4598d5939cbc1b11127a0dedb3a54249ec9f81
AUX grub.default 1254 SHA256 181bdb7433ebcbde635e7058a1febaf0100e4e9c83ea4fd222d7010c375882d8 SHA512 1cdce5d9c606a2cba29ec859df96de9e8c292301ee3f26dff848816cda950088c0660dbd3401eec97b15841a2544116664eeda6cb0be753f6d160a7e62578dbc WHIRLPOOL 03514e95078f4f4d176e85ba3a739105a7cbf58a6c3e2ba4a2c660c48329dcc78b968391ecb2d9821084ba4ddddbe03e41d9d6c36685f1db1d4a1f00a1e5d393
AUX grub.default-2 1470 SHA256 fcef668c1316a38f6a1c784c489c2052b23b8e2b79dc1a940b5bda831947af74 SHA512 5c331323ef17683fdfc59b0057a6e89a451039febc4ff6242c17cd3aeda0ef60930a79dc52e180bf534f94867a8b4545655808ae5a7362643542fea42b6a0d91 WHIRLPOOL 5f8a1192763ee9089e48a7eff13ef75947e7f4db20ff873ae86fd99920b107de827588558bdc26d2bf5ee3da4f51a44d53470aa65bf73ab565cf23e84097de5c
DIST grub-0.92-gentoo-0.2.tar.bz2 21727 SHA256 f579b49b2d24702905c333ce2b6170a554ce26d0232c65478a21a1fd2eb8b8fe SHA512 ac90f58913203b970808e3a6e20ce367af1d6a262eba5f229d080c7f5eebd228bd9add9a423d642f8a53d915930921975af1d45116f18bc0be982320b898ef1d WHIRLPOOL 2bbfddab5da2e786047e25d95c0c8c6cb70f5174df5991db3b09657bc15802af81bcb124bf7723fca3c2016eb42d9f06ef2b8500920ae15de3624ae87c8d3d51
DIST grub-0.92.tar.gz 877112 SHA256 197e690faed45bcbf854ab5dc591053d6f6ed1a5b8e5596c4ba27d6f0d50eb37 SHA512 11750f4dc6606e354acc7f459416f0a2efaedcd6e60ab85c708de0d04eb7876a899292067c651cc857db30a7a533714f21719a9eb65c14aef9306c5187843bee WHIRLPOOL be47d1ff182dc8305d748b2e6bcf0c6796019eb1f59abfb042ad3bb4c0922c25b5420ce8c6bfe2c098ef120088866b9623e85e47902f8441e061a13c65b58ae1
DIST grub-0.94-gentoo-0.1.tar.bz2 40585 SHA256 6f5ac30e0495917cd062c48568bab582f68f288bb3fe4fb968869fdefcd012e3 SHA512 c24e5b394a12c557bb023ace27975415540c0a6386a57fcd966c3acc15284e76163bdac4a2878cdae217c4ee276860691dfe7e061b734adf2c493ac3be66fb37 WHIRLPOOL 78abf4a7211a246e99eb30bf74df7a016fdcc66e3bbd2e3abc847e000896723c144f9a0b96d707149ed0cc230d01effad9d4001ad9dc7d4d2ae44a53476b6afb
DIST grub-0.94.tar.gz 923518 SHA256 010d15c823cbccc7b5943735799bf8412ae18391307d4c2d5f8dbed158cc4a1b SHA512 71892db0cfcff3dd3a38ebcbb062419ca9757f0335a26f67a31cb2dd3782f68424753103ea2cb22edf41c2f03d6df28b94828704176ad4ac1c97d836a518798c WHIRLPOOL df4a0cbe1a563f508fae74ad3192348456459962c1fd7d5fa110b7c4f7b8d96033942f4a0f95ead439bc7976b92bd5926482ab35bc9428fdb1c6c1fffc97aee0
DIST grub-0.96-patches-1.0.tar.bz2 49828 SHA256 3d31cab8131d728673d1b866890a54f7652cab23dc2c4b9499e1f51f0ea6e956 SHA512 8749085473b2064bd051bf79a7026f172b8d87df31c0e9fa1a109410373d15a0c13ccffb92b396fa592a9c0fa1bf37abd1132aec94db30de253715ed668d561d WHIRLPOOL 3db4930c68d2f6f067ce09e990faa6763d148348cfaddd8add2a1988e9727bb69bddbb0a8a5711887df1e8eba69aa96af0b2f4487319cdc240818ebb939c7825
DIST grub-0.96-r1-gentoo-0.1.tar.bz2 47051 SHA256 3457a18707a0c733cc9e6caea5b41ce182b55add08bc69aa5b4e2fb92676431e SHA512 71a4245bb063cbb98e1735a0520d7d626a763dbf2683980e4695fe45972552de671ea563a1a4cb2acc260eb243825e5d58365f22014902de7d720306251763df WHIRLPOOL 81505f373fca5312a843e6a100a74827b55dd3a226c4a11b53f956e20012e09a1ae96891618f597b921c615d9a2846419f1959935e615969924ddeaf5e5b85a7
DIST grub-0.96-r2-gentoo-0.1.tar.bz2 47639 SHA256 78fabb16c53518a3e96b9984ee49258ed5cdf23b8c33591c38ddf84912ea7e6c SHA512 6e01f951e3321b0f0ecc6f935e2d9e1bd766f46ecbd46de4921bb6050b4d690f8ff8c9bab627ae48826cee40605a75b5fd9afc6bc56e4af74c6501e8a6057c62 WHIRLPOOL 69d1b4a84c0afbc2a717beb1407957104e1699262bef2e4ad4400e18dccb110f59aae55ea528a78c87dd7bb070be93768e0002c56c4810d1f943c1feefc16e2e
DIST grub-0.96.tar.gz 985761 SHA256 58ba90b7256b1d2a920a7d89eac73ccab01916745f698cbe4fe1c853637ab9ba SHA512 98be0be057fd67f0ced212576de98907d39863d45ffd53a8a8576de05f71e7b28d97be4e544bf7257f0c1b43839945f06fc2a57bac7b7c973cb5a868cc78e1f7 WHIRLPOOL 477ab4234967026e7db253b66b05b5b0ecb1f70090587a992cc5c977b37645f61e9610c9ac21c1fe4a9a4d72e532369b49824dc3c388ede334276ac63defe1b6
DIST grub-0.97-patches-1.0.tar.bz2 46259 SHA256 b3b9f1998e42684b452cf9793523a1654af8fdf82ab208a8731a32c8eeaacb8f SHA512 de545e96ea0d6e47cbf7e38001f625a43b2d032d4a4a5b4866af99b970f0c6100c8486b68dcddc8ee5768fc0d3999c668d765d4498233ef12c6c202ff4d0339c WHIRLPOOL ebe66e7a814a58185baff0dc862839e96520c5aa33aa38b7ef5b3d46a5a8505afc22580134baba64ba295b037cb7b72f93303ee235e04a166c64dd63fa4a14cb
DIST grub-0.97-patches-1.12.tar.bz2 55811 SHA256 80cedf74d29e334182d8fb906035d2c365b96b6e8a09bbe800f44f98c828ac97 SHA512 c823f01953da5067217c635cf919379d7e3b21929dc2b71463ece6d35b51905c03d361353066eb3ff56cb30460336b6a420889eb007c5a37be66bb7222981460 WHIRLPOOL afffebb1650c50b4bfe33146553c16223d71ba887ecaa9cd985b47f83b2023b691d79f86f5b52475b7799e1d7a11979503ff86d25e9108fd4fa3dcf6aeae7fcf
DIST grub-0.97-patches-1.13.tar.bz2 56412 SHA256 765a7f0bd3ba65d27413794e75deef2c0e76a788dacd0b5387bad21da4bab94f SHA512 9b5d0ab54a839a96c695871fb44605d49ae42be8c31545da6ddf4703ccc45efd2cbe7babb7d6f680ef24bef586ee8d9df83a942208784b9a0d77f79d0f0456f8 WHIRLPOOL e5e09e9ed6734c837453919a767cd5c5c431b4513b25b8454dbdaaa03fa6606de57d1627ae5216fcacc97693ebf6f604fddc3cc6a5afc8111da8fa51a220edf2
DIST grub-0.97-patches-1.14.tar.bz2 52916 SHA256 5c7ca31fd9b2123471daf2e46a1936c4044ad0c12e353d9d3d8c3f83a1c7a0e5 SHA512 d9a8d420fd5a36f181ca608f9b70be90f9d82cee66c8484636fda5085290586071b5d9379d917e8141b993ffc4777859cd02971c916d6167dca6f50d83282c26 WHIRLPOOL 60abd5087e85d9969784b9f5a100934606a76da03b665533d9d4d1d13f4e2d15de233a71e67a32d18a5fbfe128c2c8bf04c0d4451de24e6ca4fbd8dd862e23ea
DIST grub-0.97-patches-1.2.tar.bz2 20872 SHA256 0a41e076ce1c1dd92b4eaac2905ebd5624162b5258ed0cb234889fa8beb38049 SHA512 2f1402c5c2b32e9b3b492cf58bb2ea952b726fcfbb4104134e667dbfd076509b27228af1a4ce86f36eb3cff7c47b10887f56a25dde3313defa83bd815b90f072 WHIRLPOOL 99d5c5bc91d56c6376673b2d4c1f5bca70ea2a0b005ed7abcf46ecdf0475a2e4b875131b5b38c6330f1c662f389edf9ee57716bd1b7d3adca629782d12d7cabf
DIST grub-0.97-patches-1.4.tar.bz2 24693 SHA256 290dd96fdeb9471c516f061f4949ccda33f8d03ab81a6e2beb5005b3022e71da SHA512 349a3fcba0f56f4c54aed4d51c8ff91e66c410135e05743bb0762f2e4db62048621d0f722311336d8e29e550ab6c1192eeb6b2aaaed7413c174c5c07bcab7446 WHIRLPOOL 5f2ec0f44f8dc274652cdb00270785742740a24a1507854235804537b95d96f327c10b787f084369807bb4fb6393c29e72d55c4d4075f31feaa6cf6f5f83be87
DIST grub-0.97-patches-1.7.tar.bz2 31190 SHA256 6dfb17ff874ce8f737211a728c319a133b90e3633a80daf5ef370c15ee625389 SHA512 5e2cb9d28797b110014d1b15d1554963b1a7c5d98bf8218673de40ddfdd125789a1f9b635b29592f35616ec8b00ac32e84bc7a49801b02361a7e1f125274d1ce WHIRLPOOL b1333cd1af1a375d374404ba48dde76f1c8cf36a44692f44af45a3b483f765e466e4b4ba7f11c160f621331d7cae54db93aa255fad347af2ab5ee361b6874a89
DIST grub-0.97-patches-1.8.tar.bz2 48274 SHA256 fcd16e6def8ace7bb5928c2d16ddb032a57a5df24a69f9cfae5ce6292785318b SHA512 43c86ef66cb7cf72e48a198caaaf036df2a989c9f2f6d9e0ca7b25fee59bb1926ff1ac22cc56bc94d0927b468844fc96c4ebb70e02a1bec5648b31244498f166 WHIRLPOOL ce8835b7d41b1c84efd8b175f12d72efe36c22ba5deb8ea3d18a5c4255136d23e1cc036b888fe71759bf8e3e6a0f9e47481b4afb7255ccb5232b248995ff0b93
DIST grub-0.97-patches-1.9.tar.bz2 51809 SHA256 6b8445c9260803f059031cbe7475a45fee6499fc2dbd911288af6169455c4028 SHA512 b639bc7a42212a4d6ca106f3a6acf18aac88494bd5d29f872e530af0ac9552a9fadf34d9197c8335922dc19684cd2866a3648ce828862c540380e052e88c2c25 WHIRLPOOL 6ada276e2cd3aeb2792219d79ddebdaf6237b21b7bed86a42ec1c11374d42d2072a19959ff657ee865c9ee563ab3a157da983d320f002a1e8d8681d01d84b6de
DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5
DIST grub-1.99.tar.xz 2639224 SHA256 f308148d4c83c6f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b SHA512 604b931eef3781cdfbd9589ed76c96d6bc9fd9d6429a7a32c94ab1ea5dc2b2e1e26b60c93353763831bddbe071368779bab8564234139cb5eb6cbc3c88395ff4 WHIRLPOOL 68d9de328eb492b9dc1771db6a356de9af5d0bbceb1e187c0aea48f117c94b492c721e773e715664d3e431bda7f0ff5d63774184d2f2c413a08554a91c13dde4
DIST grub-2.00.tar.xz 5136412 SHA256 784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458 SHA512 f0dbfc90639491e5c671d2df206dec0139171bf096a99ee236f7ebf21cdafc6e6d39a9607e14ad2a6aee7c199ecc63f0a39573d969318e1a0cd32f989aa6b44a WHIRLPOOL b9690c023ab507926b8615ce28bf9de82b793ebd02126a5ecd52a130ab4bc52e2ae650b02ae2d784d4089e2981be944ba8b4800cde742aab793ff0d9029843c8
DIST grub-2.00~beta6.tar.xz 5122792 SHA256 e58f5ae62b3384ccb75ea9709c85f344b68823e422fd3dea127b1dc28c08abfc SHA512 e37e40f888c962c561a47c459b7d2a6e8b38d736169750199656fae72e227472695bf820267cbe9f73635cbd07d1ae2dfc967c3e18d17e4d595ba4ebcfac8e8a WHIRLPOOL c7074824bc369ef5179418acf222204ba35e87d7a582cd0e03abeca4fdff4b5a2ad89480069297da5ffd9d37cbc5941a5c38f7b7bd533860ce8a001432144862
DIST splash.xpm.gz 33856 SHA256 b95600f777331b0dd31d51c68f60f0e846e4c8b628857a41165f4e6b30e6acaf SHA512 5ae1f786f7d46a95a7061068d5b2b3ad64607c7b190d6f28379508c5dce67e26308325bfd637542a84855dfcf1ea3d143947326fdb189a6a8972208d3ead23da WHIRLPOOL d95b7b588ea8ac7c2c8c53eb8057aef21c825da6411afe3b7e864c606aeffaaebce8ae41ce3e979f277bd6b48a9e82a1f2ea8afc836213b56523d8a854227d7b
EBUILD grub-0.92-r1.ebuild 2605 SHA256 cd42e232b3d1e3ce99fa391907df1019f38a853f574cfb812346d9b1db0c7596 SHA512 8e1f79d34e3398be574d83a3b6a28ba1adad2ff80fdeadf6bb13cf3d77d73224372161a27f3f079e01aa4b564395473fa658eb52a38c3e3fba937557c0c1b41a WHIRLPOOL 090466918d908b36416a48f8b5109b8042bebae5fd5769a8b27ff3cb6f80dd769ee7960e4981da7ef82f9243a945ec6397e3aa70e958423adf530baedb6731c2
EBUILD grub-0.94-r1.ebuild 3340 SHA256 d9d07a2c87d1d6656e42559244e1c4f06e47aa7dfdbc644f2a3eeefabf3b784e SHA512 ee66f414607b9d2a14cf8b3e7af5b3614836f35417a45e1eebf3ba2e450818dc6704f80e6b62108697f99b84c3052c9b9dd0bd0a45b021de1b614106cf10641f WHIRLPOOL a538c069f51d9a12b24a083f8223907bd4c1a2ca10b1632db94dc795450739d069095f20c59c6d73528d23d22e288c36f0ca38783104b0eba5588fc9cb3aebf0
EBUILD grub-0.96-r1.ebuild 4459 SHA256 f7fa0fc99b2554897cb1ac437a49c64231cc0d1513b0a89d9fab78e61af08b4b SHA512 35c917af6d71b6f3f9428628b5673f1ee892c2f7c2d8fd6f8c7ba7605d8c674ff46bebaa7fe9c0815d4b6af92118669d01678e197e066c806690510171adab47 WHIRLPOOL a80d3ca9d42c412f5526cb1927d939c33b15230589eae9a79a10a2db87f41eb2921f848ffc9f1ba08ad7a989bf8419fd4af861024c9d6fc13991a0d9fdaa3184
EBUILD grub-0.96-r2.ebuild 4315 SHA256 47a243f251180b5e4a8695db5d81eceb90f4a3116c4abc088a1ed656ceadec9a SHA512 542b6a4f3f63e2c5b5072e4cd6b205b572d29b734f0a928330e77bcd5e0b26489eee8af26a6a29eb22f75dd69949f1a640e5a9c1a05b329ae9874f885f0bf291 WHIRLPOOL 5bd5b47084103148bd281f55866547ad337da2eea9112a27b3f6dde583733a9eff7680cb495376defdd6b02afb394a7d515d313d84a2378c5c46ff8cda5323c9
EBUILD grub-0.96-r3.ebuild 4291 SHA256 ce7a2a810dc1df885b6df4ba6e4bdb9e2db68954bd49ba7259b8e7a7532a49b2 SHA512 21014ad6e31d1cf6186aaead0825b1932d3e7027a7e58520cb9a6f16ca146eae54b9bbb63f5543f93ec80395f8bf5a819159c9b690090b3459db8c8ad2b27aea WHIRLPOOL e78f6ef6fe7ee056ae2b4f6142e106ad3bace7f37a6b2ea32b094d286df5ae250c5506ab75fa7a1d5469e0871229a2b481aa995d65a8b9a721318b4a2817d687
EBUILD grub-0.97-r10.ebuild 9459 SHA256 86413acb2ff57ab54b2f53499ccef341fc734edda73506ac56063667e473fec6 SHA512 c5d6a183140e1637300db264068c08347145d2808df0206e775458a9ccdc7f2a76c48b76545d563a27f141c8bcace0f17ef71e99e3d8e1de0c5cd6d45ac8b18d WHIRLPOOL 16ef1de80a08205af1be71b3cfe4b0959591f8827bc26a138a8a92e173944f0589df7e466263c074c96ab1e25eb7dc7669f352526d3a6f433581218812aa004d
EBUILD grub-0.97-r11.ebuild 9460 SHA256 adab9a8ca3381cc500b81f48315a7ccdc01aff8bab661a498357b28df580c1e5 SHA512 c5314029baba3a32d805c5ab55d8f9d886cd6954610b7989df30bf0272412c9b1fca734c968e7462cee9d17e46c8a6a2e3144ed09ea8f41cbbf6b02217ad3dde WHIRLPOOL 64b82c6aee372085aefb530d248d192e61fe05e29ed1b577c9c7923caaba18ff309a904fca4ba813e9e5505eaf8b57b3b8ced3c0acd91a4f556e7a546407be46
EBUILD grub-0.97-r12.ebuild 9233 SHA256 d5486666e1f8339a8308489607c9108cd34e8ebc696a956e2ff8dafad1c71815 SHA512 332a89395331ef04654345f960f2939340ce9b47ae6ac755e54f4ecc85f6243060890e7553b515468aaffd8346bbb5a0b7fbd26d23911b847f12c557854e96f1 WHIRLPOOL 1a20c9df999954ce431ca50eaaa5651721c939229b3a55d820445620218ffa64d43ba6251e88b1df6f54163f6914265596698db513a47d3c415ccaa01b51e61d
EBUILD grub-0.97-r13.ebuild 9384 SHA256 c694ab37f477548da2b98c9beb2c5432ddd799e40fcbf82273cd2da3fdb072e1 SHA512 615e4d11ba91c7bc2fcb926bfc791d1aa3151a06dd336f9597ccc5b22a4b6a1bbffde5f7622ec6cc4c04216c63d99becfc9cf38bcf8fed476773bd3b7930fad2 WHIRLPOOL 91d94e1f90393bb5137b791bfa2d73b418938091d81ec44b783d749ea08ee3a615a5ca4d07a841c66429f6ff7d480ae2ad4f0626576ddaab459f111106160761
EBUILD grub-0.97-r2.ebuild 4820 SHA256 e76d0df0f865851a7ed5aba91b4f275ad099d9dd61f897c8a27ac0df31880a2d SHA512 c021917b2b54ed54205dd9d0c74be86882367e04f94e69460cb5c44cc15d05a2762140d286823b8abe8650ae72c0f85c646225d8c463ecadca9742b0ea391a23 WHIRLPOOL 4c741c97cec4820bfd7db26da9fd2d07722c2dc68ecee0388a34cf284c401dfe47700e517c427a55a76644f3cfdf52cb5bf47f7ff3e2a229cd6a07e4dab21f23
EBUILD grub-0.97-r3.ebuild 4697 SHA256 fc6caf4957afda2029324f73403248c2916e5736a0e779fe1492d0c69fb8d358 SHA512 255f3628d98d4e0f9ecb17bb7e1f09c256abd5da2388034374a80700d7c8d0fb016e69b5fedc109e1bd2bef0e49e090612e77ae5531552252dc35f7110b026b8 WHIRLPOOL 7ef1de92ab6ecfdfdf3b1e64f50924de3702e37c0c142120b3898ba58eebaf15ca42d65aa63c5972acc8124d2e0196503e4cdde00545ab64a7185ffdd6e066d7
EBUILD grub-0.97-r4.ebuild 4942 SHA256 28e7599759c86df56eedb0390553c85cd5b59ca4188cac2af7d9024b2d8743d4 SHA512 939469c8504dc60a56846d8a5a329673b363feef3e41b54c43b178bb254a3d24f1667b0bde738dbd04a3e5499060def55d758a49110bd89caeb9d388526448ac WHIRLPOOL 9187ee32dc340a66ebdcb9775fda2be3bb6990ae9352b34b0c5c6381c425a3b26140ed2e39fb9832e7fbc9643364392f116a0d1030dbcf6f616b87fabefeeb07
EBUILD grub-0.97-r5.ebuild 6855 SHA256 3ac1983105be92f0fa20b22ea422391860dcec6975e2278878329532be3596ef SHA512 e770c35e5b91ce9d93c8957394f8a579e333bfd9b209358f0fb05c892eded8cf42acb040c92d4a24f991714ba8658f87a7d62e7dd41c0f7ff524d2915b14392b WHIRLPOOL 10886d92a05480b957f8f565d2b852ccc3da386eb7d0d78fc98238526b3dadfd692dc84036b88341374f1b92e913acfb48592e27d45ce595c7c33d1533982c45
EBUILD grub-0.97-r6.ebuild 8808 SHA256 2a425bfcd935f7e3d16ba4949067445f851a46bf837a903a2822f7a319bcb407 SHA512 409a7f3f4dca29d76b9a8d6193614c0a801abe196fc096b7dab8db2b8fbe2dbd89ce3f91db576e2c988be36cf06253fad17f93a9807d0a90a4bedb5e6a0228b9 WHIRLPOOL 5d86053fa3be9450004c7637d2677b92eeee7059de2020d0fb509f0034f9b0c1ea56e400bc29489c503f6b7a5bfd59e13f92197f1d37d5c7aaf600be2583aea5
EBUILD grub-0.97-r8.ebuild 8948 SHA256 3eb9b11beeae64c986c9d27233f79525f271d0362fba66c8eccf6b2a62fc7463 SHA512 0d1ecf0fa67d282d01932683aa722028cf42c0197695a19d2e11d793604b2a275a6bbcd968b1f6d3281a1d258bfd674fab6cbbd704e7e4f73721948b68e34c1b WHIRLPOOL d7bf10cc21047f2d05e6a49d8de0923f4cc5e009f27ccea9f574165afec01e3b6a4e4d55f69b5ccf0652ce4a34918992f1533f0facc18660864313af3dbe47c8
EBUILD grub-0.97-r9.ebuild 9053 SHA256 b6411eb5c379cc6b9120f1f727733d9724c4257405c3a7a1935b2aa573085726 SHA512 ddcf78c3d72f1bd854ed44753f4870fc9efd0cf69a28efb24423863c6ad740657affa74eff403484b4f30046e338d4a506a71e5d6b1818022377a1a77880b004 WHIRLPOOL 13d3adafd3814259081dd783067c077fbaebfa2974214d5b0249c818aa3cc004cb2bd526b18f1c1a46dfc0641325a92b87c8f73608972061c52c7ded99e95fe0
EBUILD grub-0.97.ebuild 4238 SHA256 d93dd5dca80c822e0659007b827966fb69c7f702b13ba672b4c3f486af54cee1 SHA512 46d72cfaa5735d0b3d2d89a8e6ce83745e4645370cdbbfcffc37d1413ffeb2b1caafac8c7cc712925ffc09411870b06467eb50bc475997508e7beea8fa5172d7 WHIRLPOOL 4b6fe9a7300baf6364555858a49ae2775ea0da27291d5d48fa634097531ae3b6da445ee2f959ef584bf4c913aad5e689b77e7326af257549ef107704dc0d202e
EBUILD grub-1.99-r2.ebuild 8413 SHA256 13a1281843b801804a5f2dc491cd21d6ac4d068c59e739015dc949a51011f585 SHA512 520bd623cfaf70451b4331f2dc464982f4de1b0c070ee8c0b336c9d16589aaa96924ea923f4c47ccb07d3c8f6da987a89ed285f1f4fa8f922465ab912e8940bd WHIRLPOOL 5abb91bf54a5024b225e7c3891b884827b31e6e8e380db9aa37fd520c55cd2e94ce1e7545271d52a58baab63446906cb69440177a4678000ac519088b9ae6966
EBUILD grub-2.00-r1.ebuild 8862 SHA256 c88e12c0de910726920616a0fb9fecd1dab504532287d9742015faab713268ab SHA512 2589fb92dee5d6a25af6a9584ccb45c6b019d219fde0c3dbde1e35abc8a82e7ce8793375e694c30372ea98da9e7383db98b6639c8ee93d23dfb0b9cb6f0cc838 WHIRLPOOL 06f3d43667856a0d6c2fe6ebf3b89930171f047e66ed9df5d766b8851b9bb5ae0db7f72a6d319d16db18a1968b6a4d6c4bcf1b8532df168141bb9c9f0733d24a
EBUILD grub-2.00-r2.ebuild 8674 SHA256 371eef0156015ab5216baaafbc5faef833c83048e8dc8fc0434f4358dd3a13a0 SHA512 4b461bfb162a43d98bdccdd8927949f7b2073684e9a6af7becf8dd328c0abc939946117ad5044db4baa233000d9db525e71246708f345774ddd81c1c7aba5242 WHIRLPOOL 2f6f4eebfda762159e6bd136ef0838dc1c3aff631af750708f74a91fe3ba3f2045710ad6b48294d10f5fbdc7ef125cbe0641ec3364f373ef143042d3b6084cb8
EBUILD grub-2.00_beta6.ebuild 7140 SHA256 8026d9d32d21863e5427cac5b641fbc5f799662437bd9a40daa3f9a377a0de68 SHA512 35b5a7aa5224ba1f0d3dabaeb03d915b86a3c16419f6ef012c8092b198e8bbc054f22e4658930f704402066622b98c67c869f0c9cf5d74637c34ae786b0861fa WHIRLPOOL 54839cae4be956d12f8c62524923e9087f76c5e2c3c7db7cca074084deba71cd870238e514227a73a1131748fac501566afe29866231b68e4bbddbf2b465a71b
EBUILD grub-9999.ebuild 8605 SHA256 506e79cb8de178641162809a15b2656d771af197cb8bc4dbe83754ac99234cdb SHA512 3dcda4d909ab6f37e9e9db5951d4bad076b42e6a38a5e28431b7e5cd801c2c3e569966a5a16ce6031acec03a05005ac8dee1c5a12305fac88e38c3554afa68b8 WHIRLPOOL da73ca55e91e5e303e5f0254197722a0ff05ef223d5fc70305d6d215ef36879232350734b7c92851608989ae97d4e3c71bedb6e64557f2b93b98ac47655483f2
MISC ChangeLog 48389 SHA256 40e61650279307893f5b1d3b67088a5e75beafe4178a90dfc782ba73a6611d51 SHA512 6abbd2a4df86f9931a6d698bcf22ad6550d4e34d6f5cff96b815c9d91eb5e3f8e3c17c274a699dd53b0a227454509f8611ed3c19cb51bfce60a7603143d5b71c WHIRLPOOL bbb9140139bdc778fe0413598328afc00cd877abbe3945d3b873ed93dd9e5e5bd5565b1afd78f3b6162599f79be5b9c750370fc5dcaee23d47db84b31f454d44
MISC metadata.xml 673 SHA256 e14e5e46b726a3645b85217a2afbd5b04adb54990c7db837e01a50a8322d81b9 SHA512 9df3d519f0aa3e53304c956638acb927224f3ca83ba1959f089852ee7c822ca3cae99d3da0efcbfeedd99dbe630aa0b39d6f9b61d0cad8e72c155f7253c7d8cc WHIRLPOOL ed7bc1f5c8f84ef6fb18143163f239d9f47e8fd88c3fd521f625b2191349d7520bf4c6a7e6c7e3eef73a0af43faa6814e591c983cc29298bf88e7c42df3c69d2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
iF4EAREIAAYFAlEO5zYACgkQC77qH+pIQ6S5lwEApR9Z4NKa3N1pra7I83ciCi72
6wbYIx273E9gt/J38jUA/ippKNu3lNUJwIdcD6LEpuVHKwvOueV5KQ5r+nJDApUT
=201N
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,315 @@
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 <shared.h>
#include <filesys.h>
+#include <gpt.h>
#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,
&current_partition, &current_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);

View File

@ -0,0 +1,84 @@
https://bugs.gentoo.org/show_bug.cgi?id=424527
https://savannah.gnu.org/bugs/index.php?36770
=== modified file 'grub-core/lib/xzembed/xz_dec_stream.c'
--- grub-core/lib/xzembed/xz_dec_stream.c 2012-02-29 13:56:51 +0000
+++ grub-core/lib/xzembed/xz_dec_stream.c 2012-07-22 14:27:03 +0000
@@ -403,18 +403,25 @@
}
#endif
- do {
+ if (b->in_pos == b->in_size)
+ return XZ_OK;
+
+ if (!crc32 && s->hash_size == 0)
+ s->pos += 8;
+
+ while (s->pos < (crc32 ? 32 : s->hash_size * 8)) {
if (b->in_pos == b->in_size)
return XZ_OK;
#ifndef GRUB_EMBED_DECOMPRESSOR
- if (hash && s->hash_value[s->pos / 8] != b->in[b->in_pos++])
+ if (hash && s->hash_value[s->pos / 8] != b->in[b->in_pos])
return XZ_DATA_ERROR;
#endif
+ b->in_pos++;
s->pos += 8;
- } while (s->pos < (crc32 ? 32 : s->hash_size * 8));
+ }
#ifndef GRUB_EMBED_DECOMPRESSOR
if (s->hash)
@@ -529,8 +536,6 @@
s->hash->init(s->index.hash.hash_context);
s->hash->init(s->block.hash.hash_context);
}
- if (!s->hash)
- return XZ_OPTIONS_ERROR;
#endif
}
else
=== modified file 'grub-core/normal/autofs.c'
--- grub-core/normal/autofs.c 2012-05-01 13:26:36 +0000
+++ grub-core/normal/autofs.c 2012-07-22 14:23:46 +0000
@@ -32,11 +32,21 @@
autoload_fs_module (void)
{
grub_named_list_t p;
+ int ret = 0;
+ grub_file_filter_t grub_file_filters_was[GRUB_FILE_FILTER_MAX];
+
+ grub_memcpy (grub_file_filters_was, grub_file_filters_enabled,
+ sizeof (grub_file_filters_enabled));
+ grub_memcpy (grub_file_filters_enabled, grub_file_filters_all,
+ sizeof (grub_file_filters_enabled));
while ((p = fs_module_list) != NULL)
{
if (! grub_dl_get (p->name) && grub_dl_load (p->name))
- return 1;
+ {
+ ret = 1;
+ break;
+ }
if (grub_errno)
grub_print_error ();
@@ -46,7 +56,10 @@
grub_free (p);
}
- return 0;
+ grub_memcpy (grub_file_filters_enabled, grub_file_filters_was,
+ sizeof (grub_file_filters_enabled));
+
+ return ret;
}
/* Read the file fs.lst for auto-loading. */

View File

@ -0,0 +1,113 @@
https://bugs.gentoo.org/show_bug.cgi?id=426364
https://savannah.gnu.org/bugs/index.php?36839
--- util/grub-mkconfig_lib.in
+++ util/grub-mkconfig_lib.in
@@ -255,19 +255,19 @@
echo "$version_find_latest_a"
}
-# One layer of quotation is eaten by "", the second by sed, and the third by
-# printf; so this turns ' into \'. Note that you must use the output of
+# One layer of quotation is eaten by "" and the second by
+# sed; so this turns ' into \'. Note that you must use the output of
# this function in a printf format string.
grub_quote () {
- sed "s/'/'\\\\\\\\''/g"
+ sed "s/'/'\\\\''/g"
}
gettext_quoted () {
- gettext "$@" | sed "s/'/'\\\\\\\\''/g"
+ gettext "$@" | grub_quote
}
-# Run the first argument through gettext_quoted, and then pass that and all
+# Run the first argument through gettext, and then pass that and all
# remaining arguments to printf. This is a useful abbreviation and tends to
# be easier to type.
gettext_printf () {
=== modified file 'util/grub.d/10_hurd.in'
--- util/grub.d/10_hurd.in
+++ util/grub.d/10_hurd.in
@@ -117,7 +117,7 @@
opts=
fi
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} $opts ${GRUB_CMDLINE_GNUMACH}
EOF
@@ -133,7 +133,7 @@
fi
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
module /hurd/${hurd_fs}.static ${hurd_fs} $opts \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--- util/grub.d/10_illumos.in
+++ util/grub.d/10_illumos.in
@@ -46,6 +46,7 @@
ISADIR=
fi
zfs-bootfs $($grub_mkrelpath /) ZFS_BOOTFS
+ echo '$(echo "$message" | grub_quote)'
multiboot $($grub_mkrelpath /platform/i86pc/kernel)/\$ISADIR/unix /platform/i86pc/kernel/\$ISADIR/unix -B \$ZFS_BOOTFS,console=text
module $($grub_mkrelpath /platform/i86pc)/\$ISADIR/boot_archive /platform/i86pc/\$ISADIR/boot_archive
}
--- util/grub.d/10_kfreebsd.in
+++ util/grub.d/10_kfreebsd.in
@@ -100,7 +100,7 @@
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
message="$(gettext_printf "Loading kernel of FreeBSD %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
kfreebsd ${rel_dirname}/${basename} ${args}
EOF
--- util/grub.d/10_linux.in
+++ util/grub.d/10_linux.in
@@ -134,14 +134,14 @@
fi
message="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
message="$(gettext_printf "Loading initial ramdisk ...")"
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
initrd ${rel_dirname}/${initrd}
EOF
fi
--- util/grub.d/20_linux_xen.in
+++ util/grub.d/20_linux_xen.in
@@ -120,16 +120,16 @@
xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
lmessage="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
- echo '$xmessage'
+ echo '$(echo "$xmessage" | grub_quote)'
multiboot ${rel_xen_dirname}/${xen_basename} placeholder ${xen_args}
- echo '$lmessage'
+ echo '$(echo "$lmessage" | grub_quote)'
module ${rel_dirname}/${basename} placeholder root=${linux_root_device_thisversion} ro ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
message="$(gettext_printf "Loading initial ramdisk ...")"
sed "s/^/$submenu_indentation/" << EOF
- echo '$message'
+ echo '$(echo "$message" | grub_quote)'
module ${rel_dirname}/${initrd}
EOF
fi

View File

@ -0,0 +1,382 @@
Taken from
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4556
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4584
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4624
http://bzr.savannah.gnu.org/lh/grub/trunk/grub/revision/4625
diff -Nur grub-2.00.orig/grub-core/loader/i386/bsd.c grub-2.00/grub-core/loader/i386/bsd.c
--- grub-2.00.orig/grub-core/loader/i386/bsd.c 2012-06-07 22:06:00.000000000 +0900
+++ grub-2.00/grub-core/loader/i386/bsd.c 2013-01-04 19:50:55.000000000 +0900
@@ -1309,7 +1309,7 @@
&& phdr->p_type != PT_DYNAMIC)
return 0;
- paddr = phdr->p_paddr & 0xFFFFFF;
+ paddr = phdr->p_paddr & 0xFFFFFFF;
if (paddr < kern_start)
kern_start = paddr;
@@ -1333,7 +1333,7 @@
}
*do_load = 1;
- phdr->p_paddr &= 0xFFFFFF;
+ phdr->p_paddr &= 0xFFFFFFF;
paddr = phdr->p_paddr;
*addr = (grub_addr_t) (paddr - kern_start + (grub_uint8_t *) kern_chunk_src);
@@ -1351,7 +1351,7 @@
&& phdr->p_type != PT_DYNAMIC)
return 0;
- paddr = phdr->p_paddr & 0xffffff;
+ paddr = phdr->p_paddr & 0xfffffff;
if (paddr < kern_start)
kern_start = paddr;
@@ -1375,7 +1375,7 @@
}
*do_load = 1;
- paddr = phdr->p_paddr & 0xffffff;
+ paddr = phdr->p_paddr & 0xfffffff;
*addr = (grub_addr_t) (paddr - kern_start + (grub_uint8_t *) kern_chunk_src);
@@ -1394,7 +1394,7 @@
{
grub_relocator_chunk_t ch;
- entry = elf->ehdr.ehdr32.e_entry & 0xFFFFFF;
+ entry = elf->ehdr.ehdr32.e_entry & 0xFFFFFFF;
err = grub_elf32_phdr_iterate (elf, filename,
grub_bsd_elf32_size_hook, NULL);
if (err)
diff -Nur grub-2.00.orig/util/grub-mkconfig_lib.in grub-2.00/util/grub-mkconfig_lib.in
--- grub-2.00.orig/util/grub-mkconfig_lib.in 2012-06-28 00:27:53.000000000 +0900
+++ grub-2.00/util/grub-mkconfig_lib.in 2013-01-04 19:50:55.000000000 +0900
@@ -349,3 +349,10 @@
cat
fi
}
+
+grub_tab=" "
+
+grub_add_tab () {
+ sed -e "s/^/$grub_tab/"
+}
+
diff -Nur grub-2.00.orig/util/grub.d/10_hurd.in grub-2.00/util/grub.d/10_hurd.in
--- grub-2.00.orig/util/grub.d/10_hurd.in 2012-03-05 05:10:04.000000000 +0900
+++ grub-2.00/util/grub.d/10_hurd.in 2013-01-04 19:50:55.000000000 +0900
@@ -108,7 +108,7 @@
EOF
fi
- prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | sed -e "s/^/\t/"|sed "s/^/$submenu_indentation/"
+ prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | grub_add_tab|sed "s/^/$submenu_indentation/"
message="$(gettext_printf "Loading GNU Mach ...")"
if [ x$type = xrecovery ] ; then
@@ -122,9 +122,9 @@
EOF
if [ x$type != xrecovery ] ; then
- save_default_entry | sed -e "s/^/\t/"| sed "s/^/$submenu_indentation/"
+ save_default_entry | grub_add_tab| sed "s/^/$submenu_indentation/"
fi
- prepare_grub_to_access_device "${GRUB_DEVICE}" | sed -e "s/^/\t/"| sed "s/^/$submenu_indentation/"
+ prepare_grub_to_access_device "${GRUB_DEVICE}" | grub_add_tab| sed "s/^/$submenu_indentation/"
message="$(gettext_printf "Loading the Hurd ...")"
if [ x$type = xrecovery ] ; then
opts=
@@ -158,7 +158,7 @@
if [ "x$is_first_entry" = xtrue ]; then
hurd_entry "$kernel" simple
- submenu_indentation="\t"
+ submenu_indentation="$grub_tab"
# TRANSLATORS: %s is replaced with an OS name
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnuhurd-advanced-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
diff -Nur grub-2.00.orig/util/grub.d/10_illumos.in grub-2.00/util/grub.d/10_illumos.in
--- grub-2.00.orig/util/grub.d/10_illumos.in 2012-03-05 04:03:38.000000000 +0900
+++ grub-2.00/util/grub.d/10_illumos.in 2013-01-04 19:50:55.000000000 +0900
@@ -35,8 +35,8 @@
esac
echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'illumos-$(grub_get_device_id "${GRUB_DEVICE_BOOT}")' {"
-save_default_entry | sed -e "s/^/\t/"
-prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | sed -e "s/^/\t/"
+save_default_entry | grub_add_tab
+prepare_grub_to_access_device "${GRUB_DEVICE_BOOT}" | grub_add_tab
message="$(gettext_printf "Loading kernel of Illumos ...")"
cat << EOF
insmod gzio
diff -Nur grub-2.00.orig/util/grub.d/10_kfreebsd.in grub-2.00/util/grub.d/10_kfreebsd.in
--- grub-2.00.orig/util/grub.d/10_kfreebsd.in 2012-03-05 06:02:30.000000000 +0900
+++ grub-2.00/util/grub.d/10_kfreebsd.in 2013-01-04 19:50:55.000000000 +0900
@@ -54,7 +54,7 @@
fi
if [ -z "${prepare_module_dir_cache}" ]; then
- prepare_module_dir_cache="$(prepare_grub_to_access_device $(grub-probe -t device "${module_dir}") | sed -e "s/^/\t/")"
+ prepare_module_dir_cache="$(prepare_grub_to_access_device $(${grub_probe} -t device "${module_dir}") | grub_add_tab)"
fi
printf '%s\n' "${prepare_module_dir_cache}"
@@ -91,10 +91,10 @@
echo "menuentry '$(echo "$OS" | grub_quote)' ${CLASS} \$menuentry_id_option 'kfreebsd-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xrecovery ] ; then
- save_default_entry | sed -e "s/^/\t/" | sed "s/^/$submenu_indentation/"
+ save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
fi
if [ -z "${prepare_boot_cache}" ]; then
- prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+ prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
@@ -112,7 +112,7 @@
load_kfreebsd_module acpi true
- for abstraction in dummy $(grub-probe -t abstraction --device ${GRUB_DEVICE}) ; do
+ for abstraction in dummy $(${grub_probe} -t abstraction --device ${GRUB_DEVICE}) ; do
case $abstraction in
lvm) load_kfreebsd_module geom_linux_lvm false ;;
esac
@@ -122,10 +122,10 @@
zfs)
load_kfreebsd_module opensolaris false
- ls "${dirname}/zfs/zpool.cache" > /dev/null
+ ls "/boot/zfs/zpool.cache" > /dev/null
printf '%s\n' "${prepare_boot_cache}"
sed "s/^/$submenu_indentation/" << EOF
- kfreebsd_module ${rel_dirname}/zfs/zpool.cache type=/boot/zfs/zpool.cache
+ kfreebsd_module $(make_system_path_relative_to_its_root /boot)/zfs/zpool.cache type=/boot/zfs/zpool.cache
EOF
;;
esac
@@ -179,7 +179,7 @@
case ${GRUB_FS} in
zfs)
# zpool name
- kfreebsd_device=$(grub-probe -t fs_label --device ${GRUB_DEVICE})
+ kfreebsd_device=$(${grub_probe} -t fs_label --device ${GRUB_DEVICE})
# filesystem name (empty string for the main filesystem)
kfreebsd_device="${kfreebsd_device}$(${grub_mkrelpath} / | sed -e "s,/*@$,,")"
;;
@@ -213,7 +213,7 @@
if [ "x$is_first_entry" = xtrue ]; then
kfreebsd_entry "${OS}" "${version}" simple
- submenu_indentation="\t"
+ submenu_indentation="$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
diff -Nur grub-2.00.orig/util/grub.d/10_linux.in grub-2.00/util/grub.d/10_linux.in
--- grub-2.00.orig/util/grub.d/10_linux.in 2012-04-19 06:24:38.000000000 +0900
+++ grub-2.00/util/grub.d/10_linux.in 2013-01-04 19:50:55.000000000 +0900
@@ -101,7 +101,7 @@
echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xrecovery ] ; then
- save_default_entry | sed -e "s/^/\t/"
+ save_default_entry | grub_add_tab
fi
# Use ELILO's generic "efifb" when it's known to be available.
@@ -123,12 +123,12 @@
if [ x$dirname = x/ ]; then
if [ -z "${prepare_root_cache}" ]; then
- prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/")"
+ prepare_root_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab)"
fi
printf '%s\n' "${prepare_root_cache}" | sed "s/^/$submenu_indentation/"
else
if [ -z "${prepare_boot_cache}" ]; then
- prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+ prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
fi
@@ -230,7 +230,7 @@
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
- submenu_indentation="\t"
+ submenu_indentation="$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
diff -Nur grub-2.00.orig/util/grub.d/10_netbsd.in grub-2.00/util/grub.d/10_netbsd.in
--- grub-2.00.orig/util/grub.d/10_netbsd.in 2012-03-05 04:47:35.000000000 +0900
+++ grub-2.00/util/grub.d/10_netbsd.in 2013-01-04 19:50:55.000000000 +0900
@@ -77,10 +77,10 @@
prepare_grub_to_access_device $(${grub_probe} -t device "${kmodule}") | sed -e 's,^, ,'
case "${loader}" in
knetbsd)
- printf "\tknetbsd_module_elf %s\n" "${kmodule_rel}"
+ printf "$grub_tabknetbsd_module_elf %s\n" "${kmodule_rel}"
;;
multiboot)
- printf "\tmodule %s\n" "${kmodule_rel}"
+ printf "$grub_tabmodule %s\n" "${kmodule_rel}"
;;
esac
}
@@ -121,11 +121,11 @@
printf "%s\n" "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
case "${loader}" in
knetbsd)
- printf "\tknetbsd %s -r %s %s\n" \
+ printf "$grub_tabknetbsd %s -r %s %s\n" \
"${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
;;
multiboot)
- printf "\tmultiboot %s %s root=%s %s\n" \
+ printf "$grub_tabmultiboot %s %s root=%s %s\n" \
"${kernel}" "${kernel}" "${kroot_device}" "${GRUB_CMDLINE_NETBSD} ${args}" | sed "s/^/$submenu_indentation/"
;;
esac
@@ -159,7 +159,7 @@
if [ "x$is_first_entry" = xtrue ]; then
netbsd_entry "knetbsd" "$k" simple "${GRUB_CMDLINE_NETBSD_DEFAULT}"
- submenu_indentation="\t"
+ submenu_indentation="$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
diff -Nur grub-2.00.orig/util/grub.d/10_windows.in grub-2.00/util/grub.d/10_windows.in
--- grub-2.00.orig/util/grub.d/10_windows.in 2012-03-05 06:11:43.000000000 +0900
+++ grub-2.00/util/grub.d/10_windows.in 2013-01-04 19:50:55.000000000 +0900
@@ -45,7 +45,7 @@
sort | uniq | wc -l`" = 1 || return 1
# Search 'default=PARTITION'
- get_os_name_from_boot_ini_part=`sed -n 's,^default=,,p' "$1" | sed 's,\\\\,/,g;s,[ \t\r]*$,,;1q'`
+ get_os_name_from_boot_ini_part=`sed -n 's,^default=,,p' "$1" | sed 's,\\\\,/,g;s,[ $grub_tab\r]*$,,;1q'`
test -n "$get_os_name_from_boot_ini_part" || return 1
# Search 'PARTITION="NAME" ...'
@@ -87,8 +87,8 @@
menuentry '$(echo "$OS" | grub_quote)' \$menuentry_id_option '$osid-$(grub_get_device_id "${dev}")' {
EOF
- save_default_entry | sed -e 's,^,\t,'
- prepare_grub_to_access_device "$dev" | sed 's,^,\t,'
+ save_default_entry | sed -e 's,^,$grub_tab,'
+ prepare_grub_to_access_device "$dev" | sed 's,^,$grub_tab,'
test -z "$needmap" || cat <<EOF
drivemap -s (hd0) \$root
EOF
diff -Nur grub-2.00.orig/util/grub.d/10_xnu.in grub-2.00/util/grub.d/10_xnu.in
--- grub-2.00.orig/util/grub.d/10_xnu.in 2012-05-29 19:31:03.000000000 +0900
+++ grub-2.00/util/grub.d/10_xnu.in 2013-01-04 19:50:55.000000000 +0900
@@ -39,8 +39,8 @@
cat << EOF
menuentry '$(echo "Darwin/Mac OS X $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${GRUB_DEVICE}")' {
EOF
- save_default_entry | sed -e "s/^/ /"
- prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/ /"
+ save_default_entry | grub_add_tab
+ prepare_grub_to_access_device ${GRUB_DEVICE} | grub_add_tab
cat << EOF
load_video
set do_resume=0
diff -Nur grub-2.00.orig/util/grub.d/20_linux_xen.in grub-2.00/util/grub.d/20_linux_xen.in
--- grub-2.00.orig/util/grub.d/20_linux_xen.in 2012-06-04 04:57:42.000000000 +0900
+++ grub-2.00/util/grub.d/20_linux_xen.in 2013-01-04 19:50:55.000000000 +0900
@@ -110,11 +110,11 @@
echo "menuentry '$(echo "$title" | grub_quote)' ${CLASS} \$menuentry_id_option 'xen-gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
if [ x$type != xrecovery ] ; then
- save_default_entry | sed -e "s/^/\t/" | sed "s/^/$submenu_indentation/"
+ save_default_entry | grub_add_tab | sed "s/^/$submenu_indentation/"
fi
if [ -z "${prepare_boot_cache}" ]; then
- prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")"
+ prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | grub_add_tab)"
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
xmessage="$(gettext_printf "Loading Xen %s ..." ${xen_version})"
@@ -236,7 +236,7 @@
linux_entry "${OS}" "${version}" "${xen_version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" "${GRUB_CMDLINE_XEN} ${GRUB_CMDLINE_XEN_DEFAULT}"
- submenu_indentation="\t\t"
+ submenu_indentation="$grub_tab$grub_tab"
if [ -z "$boot_device_id" ]; then
boot_device_id="$(grub_get_device_id "${GRUB_DEVICE}")"
diff -Nur grub-2.00.orig/util/grub.d/30_os-prober.in grub-2.00/util/grub.d/30_os-prober.in
--- grub-2.00.orig/util/grub.d/30_os-prober.in 2012-03-05 05:52:03.000000000 +0900
+++ grub-2.00/util/grub.d/30_os-prober.in 2013-01-04 19:50:55.000000000 +0900
@@ -54,8 +54,8 @@
cat << EOF
menuentry '$(echo "${LONGNAME} $bitstr $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")' {
EOF
- save_default_entry | sed -e "s/^/\t/"
- prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+ save_default_entry | grub_add_tab
+ prepare_grub_to_access_device ${DEVICE} | grub_add_tab
cat << EOF
load_video
set do_resume=0
@@ -126,8 +126,8 @@
cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class windows --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' {
EOF
- save_default_entry | sed -e "s/^/\t/"
- prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+ save_default_entry | grub_add_tab
+ prepare_grub_to_access_device ${DEVICE} | grub_add_tab
case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*)
@@ -181,14 +181,14 @@
used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'"
if [ -z "${prepare_boot_cache}" ]; then
- prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
+ prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)"
fi
if [ "x$is_first_entry" = xtrue ]; then
cat << EOF
menuentry '$(echo "$OS" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' {
EOF
- save_default_entry | sed -e "s/^/\t/"
+ save_default_entry | grub_add_tab
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
@@ -208,8 +208,8 @@
cat << EOF
menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' {
EOF
- save_default_entry | sed -e "s/^/\t\t/"
- printf '%s\n' "${prepare_boot_cache}" | sed -e "s/^/\t/"
+ save_default_entry | sed -e "s/^/$grub_tab$grub_tab/"
+ printf '%s\n' "${prepare_boot_cache}" | grub_add_tab
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
@@ -243,8 +243,8 @@
cat << EOF
menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' {
EOF
- save_default_entry | sed -e "s/^/\t/"
- prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
+ save_default_entry | grub_add_tab
+ prepare_grub_to_access_device ${DEVICE} | grub_add_tab
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"

View File

@ -0,0 +1,15 @@
https://bugs.gentoo.org/show_bug.cgi?id=424137
https://savannah.gnu.org/bugs/?37558
https://code.google.com/p/original-mawk/issues/detail?id=17
--- grub-core/Makefile.am 2012-07-07 12:29:01 +0000
+++ grub-core/Makefile.am 2012-10-12 13:04:02 +0000
@@ -349,7 +349,7 @@
# generate global module dependencies list
moddep.lst: syminfo.lst genmoddep.awk video.lst
- cat $< | sort | awk -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1)
+ cat $< | sort | $(AWK) -f $(srcdir)/genmoddep.awk > $@ || (rm -f $@; exit 1)
platform_DATA += moddep.lst
CLEANFILES += config.log syminfo.lst moddep.lst

View File

@ -0,0 +1,22 @@
hack until gzip pulls a newer gnulib version
From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Thu, 29 Mar 2012 13:30:41 -0600
Subject: [PATCH] stdio: don't assume gets any more
Gnulib intentionally does not have a gets module, and now that C11
and glibc have dropped it, we should be more proactive about warning
any user on a platform that still has a declaration of this dangerous
interface.
--- a/grub-core/gnulib/stdio.in.h
+++ b/grub-core/gnulib/stdio.in.h
@@ -125,7 +125,6 @@
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
#undef gets
-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@

View File

@ -0,0 +1,46 @@
Fix parallel make problems.
Upstream changesets 4547, 4552, 4578.
--- gentpl.py
+++ gentpl.py
@@ -484,10 +484,10 @@
def installdir(default="bin"):
return "[+ IF installdir +][+ installdir +][+ ELSE +]" + default + "[+ ENDIF +]"
-def manpage():
+def manpage(adddeps):
r = "if COND_MAN_PAGES\n"
r += gvar_add("man_MANS", "[+ name +].[+ mansection +]\n")
- r += rule("[+ name +].[+ mansection +]", "[+ name +]", """
+ r += rule("[+ name +].[+ mansection +]", "[+ name +] " + adddeps, """
chmod a+x [+ name +]
PATH=$(builddir):$$PATH pkgdatadir=$(builddir) $(HELP2MAN) --section=[+ mansection +] -i $(top_srcdir)/docs/man/[+ name +].h2m -o $@ [+ name +]
""")
@@ -503,7 +503,7 @@
r += gvar_add("TESTS", "[+ name +]")
r += "[+ ELSE +]"
r += var_add(installdir() + "_PROGRAMS", "[+ name +]")
- r += "[+ IF mansection +]" + manpage() + "[+ ENDIF +]"
+ r += "[+ IF mansection +]" + manpage("") + "[+ ENDIF +]"
r += "[+ ENDIF +]"
r += var_set(cname() + "_SOURCES", platform_sources(platform))
@@ -532,7 +532,7 @@
r += gvar_add ("TESTS", "[+ name +]")
r += "[+ ELSE +]"
r += var_add(installdir() + "_SCRIPTS", "[+ name +]")
- r += "[+ IF mansection +]" + manpage() + "[+ ENDIF +]"
+ r += "[+ IF mansection +]" + manpage("grub-mkconfig_lib") + "[+ ENDIF +]"
r += "[+ ENDIF +]"
r += rule("[+ name +]", platform_sources(platform) + " $(top_builddir)/config.status", """
--- grub-core/Makefile.am
+++ grub-core/Makefile.am
@@ -63,7 +63,7 @@
rs_decoder.S: $(srcdir)/lib/reed_solomon.c
$(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Os -I$(top_builddir) -S -DSTANDALONE -o $@ $< -g0 -mregparm=3 -ffreestanding
-kern/i386/pc/startup.S: $(builddir)/rs_decoder.S
+boot/i386/pc/startup_raw.S: $(builddir)/rs_decoder.S
boot/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
CLEANFILES += grub_script.yy.c grub_script.yy.h

View File

@ -0,0 +1,24 @@
https://bugs.gentoo.org/show_bug.cgi?id=438612
=== modified file 'grub-core/net/tftp.c'
--- grub-core/net/tftp.c 2012-06-22 20:04:16 +0000
+++ grub-core/net/tftp.c 2012-07-02 09:22:50 +0000
@@ -143,7 +143,7 @@
tftph_ack = (struct tftphdr *) nb_ack.data;
tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK);
- tftph_ack->u.ack.block = block;
+ tftph_ack->u.ack.block = grub_cpu_to_be16 (block);
err = grub_net_send_udp_packet (data->sock, &nb_ack);
if (err)
@@ -225,7 +225,7 @@
grub_priority_queue_pop (data->pq);
if (file->device->net->packs.count < 50)
- err = ack (data, tftph->u.data.block);
+ err = ack (data, data->block + 1);
else
{
file->device->net->stall = 1;

View File

@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Copyright 1999-2012 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

View File

@ -0,0 +1,43 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.2 2012/06/28 22:36:53 floppym Exp $
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
# 'grub2-mkconfig -o /boot/grub2/grub.cfg'
#
# 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
GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal.
# Note that you can use only modes which your graphic card supports via VBE.
# You can see them in real GRUB with the command `vbeinfo'.
#GRUB_GFXMODE=640x480
# Path to theme spec txt file.
# The starfield is by default provided with use truetype.
# NOTE: when enabling custom theme, ensure you have required font/etc.
#GRUB_THEME="/boot/grub2/themes/starfield/theme.txt"
# Background image used on graphical terminal.
# Can be in various bitmap formats.
#GRUB_BACKGROUND="/boot/grub2/mybackground.png"
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY=true

View File

@ -0,0 +1,95 @@
# 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.92-r1.ebuild,v 1.16 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=0.2
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gnu-alpha/grub/${P}.tar.gz
http://dev.gentoo.org/~seemant/distfiles/${P}-gentoo-${PATCHVER}.tar.bz2
http://dev.gentoo.org/~seemant/distfiles/splash.xpm.gz
mirror://gentoo/splash.xpm.gz
mirror://gentoo/${P}-gentoo-${PATCHVER}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* x86"
IUSE=""
DEPEND=">=sys-libs/ncurses-5.2-r5"
PATCHDIR="${WORKDIR}/gentoo"
src_unpack() {
unpack ${A} ; cd "${S}"
EPATCH_SUFFIX="patch"
epatch "${PATCHDIR}"
if [ "`gcc-version`" = "3.3" ]
then
epatch "${PATCHDIR}"/gcc-3.3
fi
}
src_compile() {
filter-flags "-fstack-protector"
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.
unset CFLAGS
./configure --prefix=/usr \
--sbindir=/sbin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-auto-linux-mem-opt \
|| die "Configuration of package failed."
#the vga16.patch changes configure.in but not configure so
#--enable-vga16 doesnt work. config.h gets overwritten by make.
echo "#define VGA16 1" >> config.h.in
emake || die "Building failed!"
}
src_install() {
make \
prefix="${D}"/usr \
sbindir="${D}"/sbin \
mandir="${D}"/usr/share/man \
infodir="${D}"/usr/share/info \
install || die "Installation failed."
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
}
pkg_postinst() {
[ "$ROOT" != "/" ] && return 0
if [ ! -e /boot/grub/stage1 ]
then
#if the boot loader files aren't in place, copy them over.
cd /usr/share/grub/i386-pc
cp stage1 stage2 *stage1_5 /boot/grub
else
einfo '*** A new GRUB has been installed. If you need to reinstall'
einfo '*** GRUB to a boot record on your drive, please remember to'
einfo '*** "cp /usr/share/grub/i386-pc/*stage* /boot/grub" first.'
einfo "*** If you're using XFS, unmount and remount /boot as well."
fi
# change menu.lst to grub.conf
if [ ! -e /boot/grub/grub.conf -a -e /boot/grub/menu.lst ]
then
mv /boot/grub/menu.lst /boot/grub/grub.conf
ln -s grub.conf /boot/grub/menu.lst
einfo "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
fi
}

View File

@ -0,0 +1,131 @@
# 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.94-r1.ebuild,v 1.28 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=0.1
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gnu-alpha/grub/${P}.tar.gz
http://dev.gentoo.org/~seemant/distfiles/${P}-gentoo-${PATCHVER}.tar.bz2
http://dev.gentoo.org/~seemant/distfiles/splash.xpm.gz
mirror://gentoo/splash.xpm.gz
mirror://gentoo/${P}-gentoo-${PATCHVER}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="-* x86 amd64"
IUSE="static"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.7
>=sys-devel/autoconf-2.5"
PATCHDIR="${WORKDIR}/gentoo"
pkg_setup() {
if use amd64; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A}; cd "${S}"
EPATCH_SUFFIX="patch"
epatch "${PATCHDIR}"
}
src_compile() {
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.
unset CFLAGS
filter-ldflags -pie
append-flags -DNDEBUG
[ `gcc-major-version` -eq 3 ] && append-flags -minline-all-stringops
use static && append-ldflags -static
autoconf || die
aclocal || die
WANT_AUTOMAKE=1.7 automake || die
# build the net-bootable grub first
CFLAGS="" \
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} || die
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv stage2/{nbgrub,pxegrub} "${S}"
mv stage2/stage2 stage2/stage2.netboot
make clean || die
# now build the regular grub
CFLAGS="${CFLAGS}" \
econf \
--libdir=/lib \
--datadir=/usr/lib/grub \
--exec-prefix=/ \
--disable-auto-linux-mem-opt || die
emake || die "making regular stuff"
}
src_install() {
make DESTDIR="${D}" install || die
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2 stage2/stage2.netboot
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
docinto gentoo
dodoc "${PATCHDIR}"/README*
}
pkg_postinst() {
[ "$ROOT" != "/" ] && return 0
# change menu.lst to grub.conf
if [ ! -e /boot/grub/grub.conf -a -e /boot/grub/menu.lst ]
then
mv /boot/grub/menu.lst /boot/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
einfo "Linking from new grub.conf name to menu.lst"
ln -s grub.conf /boot/grub/menu.lst
[ -e /boot/grub/stage2 ] && mv /boot/grub/stage2{,.old}
einfo "Copying files from /usr/lib/grub to /boot"
cp -p /usr/lib/grub/* /boot/grub
cp -p /usr/lib/grub/grub/*/* /boot/grub
[ -e /boot/grub/grub.conf ] \
&& /usr/sbin/grub \
--batch \
--device-map=/boot/grub/device.map \
< /boot/grub/grub.conf > /dev/null 2>&1
}

View File

@ -0,0 +1,150 @@
# 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.96-r1.ebuild,v 1.19 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=0.1
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${P}.tar.gz
mirror://gnu-alpha/${PN}/${P}.tar.gz
http://dev.gentoo.org/~seemant/distfiles/${PF}-gentoo-${PATCHVER}.tar.bz2
http://dev.gentoo.org/~seemant/distfiles/splash.xpm.gz
mirror://gentoo/splash.xpm.gz
mirror://gentoo/${PF}-gentoo-${PATCHVER}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="static netboot custom-cflags"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.7
>=sys-devel/autoconf-2.5"
PATCHDIR="${WORKDIR}/gentoo"
pkg_setup() {
if use amd64; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A} ; cd "${S}"
EPATCH_SUFFIX="patch"
epatch "${PATCHDIR}"
# a bunch of patches apply to raw autotool files
autoconf || die "autoconf failed"
aclocal || die "aclocal failed"
automake || die "automake failed"
}
src_compile() {
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
exeinto /usr/lib/grub/${CHOST}
use netboot && doexe nbgrub pxegrub stage2/stage2.netboot
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
docinto gentoo
dodoc "${PATCHDIR}"/README.Gentoo.patches
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
# change menu.lst to grub.conf
if [[ ! -e /boot/grub/grub.conf && -e /boot/grub/menu.lst ]] ; then
mv -f /boot/grub/menu.lst /boot/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
einfo "Linking from new grub.conf name to menu.lst"
[[ ! -e /boot/grub/menu.lst ]] && ln -snf grub.conf /boot/grub/menu.lst
[[ -e /boot/grub/stage2 ]] && mv /boot/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to /boot"
for x in /lib/grub/*/* /usr/lib/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" /boot/grub
done
# hardened voodoo
[[ -x /sbin/chpax ]] && /sbin/chpax -spme /sbin/grub
[[ -x /sbin/paxctl ]] && /sbin/paxctl -spme /sbin/grub
[[ -e /boot/grub/grub.conf ]] \
&& /sbin/grub \
--batch \
--device-map=/boot/grub/device.map \
< /boot/grub/grub.conf > /dev/null 2>&1
}

View File

@ -0,0 +1,146 @@
# 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.96-r2.ebuild,v 1.13 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=0.1
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${P}.tar.gz
mirror://gnu-alpha/${PN}/${P}.tar.gz
http://dev.gentoo.org/~seemant/distfiles/${PF}-gentoo-${PATCHVER}.tar.bz2
http://dev.gentoo.org/~seemant/distfiles/splash.xpm.gz
mirror://gentoo/splash.xpm.gz
mirror://gentoo/${PF}-gentoo-${PATCHVER}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="static netboot custom-cflags"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.7
>=sys-devel/autoconf-2.5"
PATCHDIR="${WORKDIR}/gentoo"
pkg_setup() {
if use amd64; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A} ; cd "${S}"
EPATCH_SUFFIX="patch"
epatch "${PATCHDIR}"
# a bunch of patches apply to raw autotool files
autoconf || die "autoconf failed"
aclocal || die "aclocal failed"
automake || die "automake failed"
}
src_compile() {
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
exeinto /usr/lib/grub/${CHOST}
use netboot && doexe nbgrub pxegrub stage2/stage2.netboot
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
docinto gentoo
dodoc "${PATCHDIR}"/README*
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
# change menu.lst to grub.conf
if [[ ! -e /boot/grub/grub.conf && -e /boot/grub/menu.lst ]] ; then
mv -f /boot/grub/menu.lst /boot/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
einfo "Linking from new grub.conf name to menu.lst"
[[ ! -e /boot/grub/menu.lst ]] && ln -snf grub.conf /boot/grub/menu.lst
[[ -e /boot/grub/stage2 ]] && mv /boot/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to /boot"
for x in /lib/grub/*/* /usr/lib/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" /boot/grub
done
[[ -e /boot/grub/grub.conf ]] \
&& /sbin/grub \
--batch \
--device-map=/boot/grub/device.map \
< /boot/grub/grub.conf > /dev/null 2>&1
}

View File

@ -0,0 +1,145 @@
# 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.96-r3.ebuild,v 1.7 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=1.0
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
SRC_URI="mirror://gentoo/${P}.tar.gz
mirror://gnu-alpha/${PN}/${P}.tar.gz
http://dev.gentoo.org/~seemant/distfiles/${P}-patches-${PATCHVER}.tar.bz2
http://dev.gentoo.org/~seemant/distfiles/splash.xpm.gz
mirror://gentoo/splash.xpm.gz
mirror://gentoo/${P}-patches-${PATCHVER}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="static netboot custom-cflags"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.7
>=sys-devel/autoconf-2.5"
pkg_setup() {
if use amd64 ; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A}
cd "${S}"
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
# a bunch of patches apply to raw autotool files
autoconf || die "autoconf failed"
aclocal || die "aclocal failed"
automake || die "automake failed"
}
src_compile() {
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
exeinto /usr/lib/grub/${CHOST}
use netboot && doexe nbgrub pxegrub stage2/stage2.netboot
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
docinto gentoo
dodoc "${PATCHDIR}"/README*
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
# change menu.lst to grub.conf
if [[ ! -e /boot/grub/grub.conf && -e /boot/grub/menu.lst ]] ; then
mv -f /boot/grub/menu.lst /boot/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
einfo "Linking from new grub.conf name to menu.lst"
[[ ! -e /boot/grub/menu.lst ]] && ln -snf grub.conf /boot/grub/menu.lst
[[ -e /boot/grub/stage2 ]] && mv /boot/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to /boot"
for x in /lib/grub/*/* /usr/lib/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" /boot/grub
done
[[ -e /boot/grub/grub.conf ]] \
&& /sbin/grub \
--batch \
--device-map=/boot/grub/device.map \
< /boot/grub/grub.conf > /dev/null 2>&1
}

View File

@ -0,0 +1,291 @@
# 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-r10.ebuild,v 1.14 2012/05/31 00:01:18 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 <robbat2@gentoo.org> - 29 Nov 2010
# USE='static -ncurses -netboot -custom-cflags' \
# GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \
# grub-${PVR}.ebuild package && \
# cp -f ${PKGDIR}/${CAT}/${PF}.tbz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools linux-info pax-utils multilib
PATCHVER="1.12" # 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() {
local arch="$(tc-arch)"
case ${arch} in
amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
esac
}
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*reiser4*
# 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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
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
prepalldocs
[ -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 "${dir} does not exist!"
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, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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}"
}

View File

@ -0,0 +1,291 @@
# 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-r11.ebuild,v 1.3 2012/05/31 00:01:18 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 <robbat2@gentoo.org> - 29 Nov 2010
# USE='static -ncurses -netboot -custom-cflags' \
# GRUB_STATIC_PACKAGE_BUILDING=1 ebuild \
# grub-${PVR}.ebuild package && \
# cp -f ${PKGDIR}/${CAT}/${PF}.tbz2 ${DISTDIR}/grub-static-${PVR}.tar.bz2
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools linux-info pax-utils multilib
PATCHVER="1.13" # 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() {
local arch="$(tc-arch)"
case ${arch} in
amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
esac
}
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*reiser4*
# 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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
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
prepalldocs
[ -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 "${dir} does not exist!"
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, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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}"
}

View File

@ -0,0 +1,286 @@
# 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 <robbat2@gentoo.org> - 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
eautoreconf
fi
}
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
prepalldocs
[ -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}"
}

View File

@ -0,0 +1,292 @@
# 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-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 <robbat2@gentoo.org> - 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
eautoreconf
fi
}
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}"
}

View File

@ -0,0 +1,168 @@
# 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-r2.ebuild,v 1.13 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER="1.2"
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"
IUSE="static netboot custom-cflags"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
=sys-devel/automake-1.9*
>=sys-devel/autoconf-2.5"
pkg_setup() {
if use amd64 ; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
# a bunch of patches apply to raw autotool files
autoconf || die "autoconf failed"
aclocal || die "aclocal failed"
automake || die "automake failed"
fi
}
src_compile() {
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
}
setup_boot_dir() {
local dir="${1}"
[[ ! -e "${dir}" ]] && die "${dir} does not exist!"
[[ ! -e "${dir}"/grub ]] && mkdir "${dir}/grub"
# change menu.lst to grub.conf
if [[ ! -e "${dir}"/grub/grub.conf ]] && [[ -e "${dir}"/grub/menu.lst ]] ; then
mv -f "${dir}"/grub/menu.lst "${dir}"/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
if [[ ! -e "${dir}"/grub/menu.lst ]]; then
einfo "Linking from new grub.conf name to menu.lst"
ln -snf grub.conf "${dir}/grub/menu.lst"
fi
[[ -e "${dir}"/grub/stage2 ]] && mv "${dir}"/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to "${dir}""
for x in /lib*/grub/*/* /usr/lib*/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" "${dir}"/grub/
done
if [[ -e "${dir}"/grub/grub.conf ]] ; then
egrep -v '^[[:space:]]*(#|$|default|fallback|splashimage|timeout|title)' "${dir}"/grub/grub.conf | \
/sbin/grub --batch \
--device-map="${dir}"/grub/device.map \
> /dev/null
fi
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
setup_boot_dir /boot
einfo "To install grub files to another device (like a usb stick), just run:"
einfo " emerge --config =${PF}"
}
pkg_config() {
local dir
einfo "Enter the directory where you want to setup grub:"
read dir
setup_boot_dir "${dir}"
}

View File

@ -0,0 +1,161 @@
# 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-r3.ebuild,v 1.14 2012/05/31 00:01:18 vapier Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools multilib
PATCHVER="1.4"
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="static netboot custom-cflags"
DEPEND=">=sys-libs/ncurses-5.2-r5"
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
}
setup_boot_dir() {
local dir="${1}"
[[ ! -e "${dir}" ]] && die "${dir} does not exist!"
[[ ! -e "${dir}"/grub ]] && mkdir "${dir}/grub"
# change menu.lst to grub.conf
if [[ ! -e "${dir}"/grub/grub.conf ]] && [[ -e "${dir}"/grub/menu.lst ]] ; then
mv -f "${dir}"/grub/menu.lst "${dir}"/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
if [[ ! -e "${dir}"/grub/menu.lst ]]; then
einfo "Linking from new grub.conf name to menu.lst"
ln -snf grub.conf "${dir}"/grub/menu.lst
fi
[[ -e "${dir}"/grub/stage2 ]] && mv "${dir}"/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
for x in /lib*/grub/*/* /usr/lib*/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" "${dir}"/grub/
done
if [[ -e "${dir}"/grub/grub.conf ]] ; then
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${dir}"/grub/grub.conf | \
/sbin/grub --batch \
--device-map="${dir}"/grub/device.map \
> /dev/null
fi
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
[[ -n ${DONT_MOUNT_BOOT} ]] && return 0
setup_boot_dir /boot
einfo "To install grub files to another device (like a usb stick), just run:"
einfo " emerge --config =${PF}"
}
pkg_config() {
local dir
einfo "Enter the directory where you want to setup grub:"
read dir
setup_boot_dir "${dir}"
}

View File

@ -0,0 +1,172 @@
# 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-r4.ebuild,v 1.8 2012/05/31 00:01:18 vapier Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools multilib
PATCHVER="1.4"
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="static netboot custom-cflags"
DEPEND=">=sys-libs/ncurses-5.2-r5"
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
epatch "${FILESDIR}"/grub-0.97-gpt.patch
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
}
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
[[ ! -e ${dir} ]] && die "${dir} does not exist!"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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
[[ -e ${dir}/stage2 ]] && mv "${dir}"/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
for x in "${ROOT}"/lib*/grub/*/* "${ROOT}"/usr/lib*/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" "${dir}"/
done
if [[ -e ${dir}/grub.conf ]] ; then
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${dir}"/grub.conf | \
/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
}
pkg_postinst() {
[[ -n ${DONT_MOUNT_BOOT} ]] && return 0
setup_boot_dir "${ROOT}"/boot
einfo "To install grub files to another device (like a usb stick), just run:"
einfo " emerge --config =${PF}"
}
pkg_config() {
local dir
einfo "Enter the directory where you want to setup grub: "
read dir
setup_boot_dir "${dir}"
}

View File

@ -0,0 +1,219 @@
# 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-r5.ebuild,v 1.15 2012/05/31 00:01:18 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.
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools multilib
PATCHVER="1.7"
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"
DEPEND="ncurses? (
>=sys-libs/ncurses-5.2-r5
amd64? ( app-emulation/emul-linux-x86-baselibs )
)"
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
# 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=7 ;;
x86) GRUB_MAX_KERNEL_SIZE=3 ;;
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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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
die "You must use the grub-static package if you want a static Grub on amd64!"
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
}
setup_boot_dir() {
local boot_dir=$1
local dir=${boot_dir}
[[ ! -e ${dir} ]] && die "${dir} does not exist!"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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."
ebeep
fi
einfo "Copying files from /lib/grub and /usr/lib/grub to ${dir}"
for x in "${ROOT}"/lib*/grub/*/* "${ROOT}"/usr/lib*/grub/*/* ; do
[[ -f ${x} ]] && cp -p "${x}" "${dir}"/
done
if [[ -e ${dir}/grub.conf ]] ; then
egrep \
-v '^[[:space:]]*(#|$|default|fallback|initrd|password|splashimage|timeout|title)' \
"${dir}"/grub.conf | \
/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
}
pkg_postinst() {
[[ -n ${DONT_MOUNT_BOOT} ]] && return 0
setup_boot_dir "${ROOT}"/boot
einfo "To install grub files to another device (like a usb stick), just run:"
einfo " emerge --config =${PF}"
}
pkg_config() {
local dir
einfo "Enter the directory where you want to setup grub:"
read dir
setup_boot_dir "${dir}"
}

View File

@ -0,0 +1,269 @@
# 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-r6.ebuild,v 1.12 2012/05/31 00:01:18 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.
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools multilib
PATCHVER="1.7"
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"
DEPEND="ncurses? (
>=sys-libs/ncurses-5.2-r5
amd64? ( app-emulation/emul-linux-x86-baselibs )
)"
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
# 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=7 ;;
x86) GRUB_MAX_KERNEL_SIZE=3 ;;
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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
dodoc "${FILESDIR}"/grub.conf.gentoo
prepalldocs
[ -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}
[[ ! -e ${dir} ]] && die "${dir} does not exist!"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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() {
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."
}
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}"
}

View File

@ -0,0 +1,273 @@
# 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-r8.ebuild,v 1.6 2012/05/31 00:01:18 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.
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools multilib
PATCHVER="1.8" # 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"
DEPEND="ncurses? (
>=sys-libs/ncurses-5.2-r5
amd64? ( app-emulation/emul-linux-x86-baselibs )
)"
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
# 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=7 ;;
x86) GRUB_MAX_KERNEL_SIZE=3 ;;
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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
dodoc "${FILESDIR}"/grub.conf.gentoo
prepalldocs
[ -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}
[[ ! -e ${dir} ]] && die "${dir} does not exist!"
[[ ! -L ${dir}/boot ]] && ln -s . "${dir}/boot"
dir="${dir}/grub"
if [[ ! -e ${dir} ]] ; then
mkdir "${dir}" || die "${dir} does not exist!"
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, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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}"
}

View File

@ -0,0 +1,280 @@
# 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-r9.ebuild,v 1.10 2012/05/31 00:01:18 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.
inherit mount-boot eutils flag-o-matic toolchain-funcs autotools linux-info multilib
PATCHVER="1.9" # 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"
DEPEND="ncurses? (
>=sys-libs/ncurses-5.2-r5
amd64? ( app-emulation/emul-linux-x86-baselibs )
)"
pkg_setup() {
local arch="$(tc-arch)"
case ${arch} in
amd64) CONFIG_CHECK='~IA32_EMULATION' check_extra_config ;;
esac
}
src_unpack() {
unpack ${A}
cd "${S}"
# patch breaks booting for some people #111885
rm "${WORKDIR}"/patch/400_*
# 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=7 ;;
x86) GRUB_MAX_KERNEL_SIZE=3 ;;
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 "Failed to hack memory size"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
eautoreconf
fi
}
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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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) \
|| die "econf failed"
# 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
make check || die "make check failed"
}
src_install() {
emake DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
dodoc "${FILESDIR}"/grub.conf.gentoo
prepalldocs
[ -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 "${dir} does not exist!"
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, /usr/lib/grub and /usr/share/grub to ${dir}"
for x in \
"${ROOT}"/lib*/grub/*/* \
"${ROOT}"/usr/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}"
}

View File

@ -0,0 +1,147 @@
# 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.ebuild,v 1.6 2012/02/29 23:09:30 floppym Exp $
inherit mount-boot eutils flag-o-matic toolchain-funcs
PATCHVER=1.0
DESCRIPTION="GNU GRUB 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"
IUSE="static netboot custom-cflags"
RDEPEND=">=sys-libs/ncurses-5.2-r5"
DEPEND="${RDEPEND}
>=sys-devel/automake-1.7
>=sys-devel/autoconf-2.5"
pkg_setup() {
if use amd64 ; then
ABI_ALLOW="x86"
ABI="x86"
fi
}
src_unpack() {
unpack ${A}
cd "${S}"
if [[ -n ${PATCHVER} ]] ; then
EPATCH_SUFFIX="patch"
epatch "${WORKDIR}"/patch
# a bunch of patches apply to raw autotool files
autoconf || die "autoconf failed"
aclocal || die "aclocal failed"
automake || die "automake failed"
fi
}
src_compile() {
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
# 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} || die "netboot econf failed"
emake w89c840_o_CFLAGS="-O" || die "making netboot stuff"
mv -f stage2/{nbgrub,pxegrub} "${S}"/
mv -f stage2/stage2 stage2/stage2.netboot
make clean || die "make clean failed"
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 || die "econf failed"
emake || die "making regular stuff"
}
src_test() {
# non-default block size also give false pass/fails.
unset BLOCK_SIZE
make check || die "make check failed"
}
src_install() {
make DESTDIR="${D}" install || die
if use netboot ; then
exeinto /usr/lib/grub/${CHOST}
doexe nbgrub pxegrub stage2/stage2.netboot || die "netboot install"
fi
insinto /boot/grub
doins "${DISTDIR}"/splash.xpm.gz
newins docs/menu.lst grub.conf.sample
dodoc AUTHORS BUGS ChangeLog NEWS README THANKS TODO
newdoc docs/menu.lst grub.conf.sample
docinto gentoo
dodoc "${PATCHDIR}"/README*
}
pkg_postinst() {
[[ "${ROOT}" != "/" ]] && return 0
# change menu.lst to grub.conf
if [[ ! -e /boot/grub/grub.conf && -e /boot/grub/menu.lst ]] ; then
mv -f /boot/grub/menu.lst /boot/grub/grub.conf
ewarn
ewarn "*** IMPORTANT NOTE: menu.lst has been renamed to grub.conf"
ewarn
fi
einfo "Linking from new grub.conf name to menu.lst"
[[ ! -e /boot/grub/menu.lst ]] && ln -snf grub.conf /boot/grub/menu.lst
[[ -e /boot/grub/stage2 ]] && mv /boot/grub/stage2{,.old}
einfo "Copying files from /lib/grub and /usr/lib/grub to /boot"
for x in /lib/grub/*/* /usr/lib/grub/*/* ; do
[[ -f "${x}" ]] && cp -p "${x}" /boot/grub
done
[[ -e /boot/grub/grub.conf ]] \
&& /sbin/grub \
--batch \
--device-map=/boot/grub/device.map \
< /boot/grub/grub.conf > /dev/null 2>&1
}

View File

@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# 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-1.99-r2.ebuild,v 1.8 2011/11/18 00:04:29 vapier Exp $
# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/grub-1.99-r2.ebuild,v 1.12 2012/05/31 00:01:18 vapier Exp $
EAPI=4
@ -19,7 +19,7 @@ else
S=${WORKDIR}/${MY_P}
fi
inherit mount-boot eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
inherit mount-boot eutils flag-o-matic pax-utils toolchain-funcs multilib ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
unset LIVE_ECLASS
DESCRIPTION="GNU GRUB boot loader"
@ -54,7 +54,9 @@ RDEPEND="
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
truetype? ( media-libs/freetype >=media-fonts/unifont-5 )"
truetype? ( media-libs/freetype >=media-fonts/unifont-5 )
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )"
DEPEND="${RDEPEND}
>=dev-lang/python-2.5.2
sys-devel/flex
@ -249,7 +251,7 @@ src_install() {
"bin/grub2-mkimage"
)
for e in ${PAX[@]}; do
pax-mark -mp "${ED}/${e}"
pax-mark -mpes "${ED}/${e}"
done
# can't be in docs array as we use default_src_install in different builddir
@ -271,7 +273,7 @@ EOF
show_doc_url() {
elog
elog "For informations how to configure grub-2 please refer to the guide:"
elog " http://dev.gentoo.org/~scarabeus/grub-2-guide.xml"
elog " http://wiki.gentoo.org/wiki/GRUB2"
}
setup_boot_dir() {

View File

@ -0,0 +1,355 @@
# 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-2.00-r1.ebuild,v 1.8 2013/01/19 03:05:28 mattst88 Exp $
EAPI=4
if [[ ${PV} == "9999" ]] ; then
EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
LIVE_ECLASS="bzr"
SRC_URI=""
DO_AUTORECONF="true"
else
MY_P=${P/_/\~}
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
else
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
mirror://gentoo/${MY_P}.tar.xz"
fi
KEYWORDS="~amd64 ~x86"
S=${WORKDIR}/${MY_P}
DO_AUTORECONF="true"
fi
inherit eutils flag-o-matic multiprocessing pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
unset LIVE_ECLASS
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-3"
SLOT="2"
IUSE="custom-cflags debug device-mapper doc efiemu mount nls static sdl truetype libzfs"
GRUB_PLATFORMS=(
# everywhere:
emu
# mips only:
qemu-mips yeeloong
# amd64, x86, ppc, ppc64:
ieee1275
# amd64, x86:
coreboot multiboot efi-32 pc qemu
# amd64, ia64:
efi-64
)
IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
REQUIRED_USE="grub_platforms_qemu? ( truetype )
grub_platforms_yeeloong? ( truetype )"
# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
app-arch/xz-utils
>=sys-libs/ncurses-5.2-r5
debug? (
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
libzfs? ( sys-fs/zfs )
mount? ( sys-fs/fuse )
truetype? (
media-libs/freetype
media-fonts/dejavu
>=media-fonts/unifont-5
)
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
"
DEPEND="${RDEPEND}
>=dev-lang/python-2.5.2
sys-devel/flex
sys-devel/bison
sys-apps/help2man
sys-apps/texinfo
static? (
truetype? (
app-arch/bzip2[static-libs(+)]
media-libs/freetype[static-libs(+)]
sys-libs/zlib[static-libs(+)]
)
)
"
RDEPEND+="
kernel_linux? (
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
)
"
if [[ -n ${DO_AUTORECONF} ]] ; then
DEPEND+=" >=sys-devel/autogen-5.10"
fi
if [[ ${PV} != 9999 ]]; then
DEPEND+=" app-arch/xz-utils"
fi
export STRIP_MASK="*/grub/*/*.{mod,img}"
QA_EXECSTACK="
usr/bin/grub*
usr/sbin/grub*
usr/lib*/grub/*/*.mod
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/setjmp.module
"
QA_WX_LOAD="
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/*.image
"
QA_PRESTRIPPED="
usr/lib.*/grub/.*/kernel.img
"
grub_run_phase() {
local phase=$1
local platform=$2
[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
[[ -d "${WORKDIR}/build-${platform}" ]] || \
{ mkdir "${WORKDIR}/build-${platform}" || die ; }
pushd "${WORKDIR}/build-${platform}" > /dev/null || die
echo ">>> Running ${phase} for platform \"${platform}\""
echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
grub_${phase} ${platform}
popd > /dev/null || die
}
grub_src_configure() {
local platform=$1
local with_platform=
local enable_efiemu="--disable-efiemu"
[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
# Used below for efi cross-building
tc-export CC NM OBJCOPY STRIP
estack_push CTARGET "${CTARGET}"
estack_push TARGET_CC "${TARGET_CC}"
estack_push TARGET_CFLAGS "${TARGET_CFLAGS}"
estack_push TARGET_CPPFLAGS "${TARGET_CPPFLAGS}"
case ${platform} in
efi-32)
if [[ ${CHOST} == x86_64* ]]; then
CTARGET="${CTARGET:-i386}"
TARGET_CC="${TARGET_CC:-${CC}}"
export TARGET_CC
fi
with_platform="--with-platform=efi"
;;
efi-64)
if [[ ${CHOST} == i?86* ]]; then
CTARGET="${CTARGET:-x86_64}"
TARGET_CC="${TARGET_CC:-${CC}}"
TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS
fi
with_platform="--with-platform=efi"
;;
guessed) ;;
*)
with_platform="--with-platform=${platform}"
case ${CTARGET:-${CHOST}} in
i?86*|x86_64*)
enable_efiemu=$(use_enable efiemu)
;;
esac
;;
esac
ECONF_SOURCE="${S}" \
econf \
--libdir=/usr/lib \
--htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
--disable-werror \
--program-prefix= \
--program-transform-name="s,grub,grub2," \
--with-grubdir=grub2 \
${with_platform} \
$(use_enable debug mm-debug) \
$(use_enable debug grub-emu-usb) \
$(use_enable device-mapper) \
${enable_efiemu} \
$(use_enable mount grub-mount) \
$(use_enable nls) \
$(use_enable truetype grub-mkfont) \
$(use_enable libzfs) \
$(use sdl && use_enable debug grub-emu-sdl)
estack_pop CTARGET CTARGET || die
estack_pop TARGET_CC TARGET_CC || die
estack_pop TARGET_CFLAGS TARGET_CFLAGS || die
estack_pop TARGET_CPPFLAGS TARGET_CPPFLAGS || die
}
grub_src_compile() {
default_src_compile
pax-mark -mpes "${grub_binaries[@]}"
}
grub_build_docs() {
emake -C docs html
}
grub_src_install() {
default_src_install
}
grub_install_docs() {
emake -C docs DESTDIR="${D}" install-html
}
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]]; then
# Bug 439082
if $(tc-getLD) --version | grep -q "GNU gold"; then
eerror "GRUB does not function correctly when built with the gold linker."
eerror "Please select the bfd linker with binutils-config."
die "GNU gold detected"
fi
fi
}
src_prepare() {
if [[ ${PV} != 9999 ]]; then
epatch "${FILESDIR}/${P}-parallel-make.patch" #424231
epatch "${FILESDIR}/${P}-no-gets.patch" #424703
epatch "${FILESDIR}/${P}-config-quoting.patch" #426364
epatch "${FILESDIR}/${P}-tftp-endian.patch" # 438612
epatch "${FILESDIR}/${P}-hardcoded-awk.patch" #424137
epatch "${FILESDIR}/${P}-freebsd.patch" #442050
epatch "${FILESDIR}/${P}-compression.patch" #424527
fi
# fix texinfo file name, bug 416035
sed -i \
-e 's/^\* GRUB:/* GRUB2:/' \
-e 's/(grub)/(grub2)/' -- \
"${S}"/docs/grub.texi
epatch_user
# autogen.sh does more than just run autotools
if [[ -n ${DO_AUTORECONF} ]] ; then
sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
(
autopoint() { :; }
. ./autogen.sh
) || die
fi
# install into the right dir for eselect #372735
sed -i \
-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
util/bash-completion.d/Makefile.in || die
# get enabled platforms
GRUB_ENABLED_PLATFORMS=""
local i
for i in ${GRUB_PLATFORMS[@]}; do
use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
done
[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
}
src_configure() {
local i
use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
use static && append-ldflags -static
use elibc_FreeBSD && append-cppflags "-isystem /usr/include"
# Sandbox bug 404013.
use libzfs && addpredict /etc/dfs:/dev/zfs
multijob_init
for i in ${GRUB_ENABLED_PLATFORMS}; do
multijob_child_init grub_run_phase ${FUNCNAME} ${i}
done
multijob_finish || die
}
src_compile() {
# Used for pax marking in grub_src_compile
local grub_binaries=(
grub-editenv
grub-fstest
grub-menulst2cfg
grub-mkimage
grub-mklayout
grub-mkpasswd-pbkdf2
grub-mkrelpath
grub-script-check
grub-bios-setup
grub-ofpathname
grub-probe
grub-sparc64-setup
)
use mount && grub_binaries+=( grub-mount )
use truetype && grub_binaries+=( grub-mkfont )
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
# Just build docs once
use doc && grub_run_phase build_docs ${i}
}
src_install() {
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
use doc && grub_run_phase install_docs ${i}
mv "${ED}"usr/share/info/grub{,2}.info || die
# can't be in docs array as we use default_src_install in different builddir
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
insinto /etc/default
newins "${FILESDIR}"/grub.default-2 grub
}
pkg_postinst() {
# display the link to guide
elog "For information on how to configure grub-2 please refer to the guide:"
elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
if ! has_version sys-boot/os-prober; then
elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
fi
if ! has_version dev-libs/libisoburn; then
elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
fi
if has_version sys-boot/grub:0; then
ewarn "If you want to keep GRUB Legacy (grub-0.97) installed, please run"
ewarn "the following to add sys-boot/grub:0 to your world file."
ewarn "emerge --noreplace sys-boot/grub:0"
fi
}

View File

@ -0,0 +1,349 @@
# 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-2.00-r2.ebuild,v 1.2 2013/02/03 22:39:46 floppym Exp $
EAPI=4
if [[ ${PV} == "9999" ]] ; then
EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
LIVE_ECLASS="bzr"
SRC_URI=""
DO_AUTORECONF="true"
else
MY_P=${P/_/\~}
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
else
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
mirror://gentoo/${MY_P}.tar.xz"
fi
KEYWORDS="~amd64 ~x86"
S=${WORKDIR}/${MY_P}
DO_AUTORECONF="true"
fi
inherit eutils flag-o-matic multiprocessing pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
unset LIVE_ECLASS
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-3"
SLOT="2"
IUSE="custom-cflags debug device-mapper doc efiemu mount nls static sdl truetype libzfs"
GRUB_PLATFORMS=(
# everywhere:
emu
# mips only:
qemu-mips yeeloong
# amd64, x86, ppc, ppc64:
ieee1275
# amd64, x86:
coreboot multiboot efi-32 pc qemu
# amd64, ia64:
efi-64
)
IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
REQUIRED_USE="grub_platforms_qemu? ( truetype )"
# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
app-arch/xz-utils
>=sys-libs/ncurses-5.2-r5
debug? (
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
libzfs? ( sys-fs/zfs )
mount? ( sys-fs/fuse )
truetype? (
media-libs/freetype
media-fonts/dejavu
>=media-fonts/unifont-5
)
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
"
DEPEND="${RDEPEND}
>=dev-lang/python-2.5.2
sys-devel/flex
sys-devel/bison
sys-apps/help2man
sys-apps/texinfo
static? (
truetype? (
app-arch/bzip2[static-libs(+)]
media-libs/freetype[static-libs(+)]
sys-libs/zlib[static-libs(+)]
)
)
"
RDEPEND+="
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
"
if [[ -n ${DO_AUTORECONF} ]] ; then
DEPEND+=" >=sys-devel/autogen-5.10"
else
DEPEND+=" app-arch/xz-utils"
fi
export STRIP_MASK="*/grub/*/*.{mod,img}"
QA_EXECSTACK="
usr/bin/grub*
usr/sbin/grub*
usr/lib*/grub/*/*.mod
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/setjmp.module
"
QA_WX_LOAD="
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/*.image
"
QA_PRESTRIPPED="
usr/lib.*/grub/.*/kernel.img
"
grub_run_phase() {
local phase=$1
local platform=$2
[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
[[ -d "${WORKDIR}/build-${platform}" ]] || \
{ mkdir "${WORKDIR}/build-${platform}" || die ; }
pushd "${WORKDIR}/build-${platform}" > /dev/null || die
echo ">>> Running ${phase} for platform \"${platform}\""
echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
grub_${phase} ${platform}
popd > /dev/null || die
}
grub_src_configure() {
local platform=$1
local with_platform=
local enable_efiemu="--disable-efiemu"
[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
# Used below for efi cross-building
tc-export CC NM OBJCOPY STRIP
estack_push CTARGET "${CTARGET}"
estack_push TARGET_CC "${TARGET_CC}"
estack_push TARGET_CFLAGS "${TARGET_CFLAGS}"
estack_push TARGET_CPPFLAGS "${TARGET_CPPFLAGS}"
case ${platform} in
efi-32)
if [[ ${CHOST} == x86_64* ]]; then
CTARGET="${CTARGET:-i386}"
TARGET_CC="${TARGET_CC:-${CC}}"
export TARGET_CC
fi
with_platform="--with-platform=efi"
;;
efi-64)
if [[ ${CHOST} == i?86* ]]; then
CTARGET="${CTARGET:-x86_64}"
TARGET_CC="${TARGET_CC:-${CC}}"
TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS
fi
with_platform="--with-platform=efi"
;;
guessed) ;;
*)
with_platform="--with-platform=${platform}"
case ${CTARGET:-${CHOST}} in
i?86*|x86_64*)
enable_efiemu=$(use_enable efiemu)
;;
esac
;;
esac
ECONF_SOURCE="${S}" \
econf \
--libdir=/usr/lib \
--htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
--disable-werror \
--program-prefix= \
--program-transform-name="s,grub,grub2," \
--with-grubdir=grub2 \
${with_platform} \
$(use_enable debug mm-debug) \
$(use_enable debug grub-emu-usb) \
$(use_enable device-mapper) \
${enable_efiemu} \
$(use_enable mount grub-mount) \
$(use_enable nls) \
$(use_enable truetype grub-mkfont) \
$(use_enable libzfs) \
$(use sdl && use_enable debug grub-emu-sdl)
estack_pop CTARGET CTARGET || die
estack_pop TARGET_CC TARGET_CC || die
estack_pop TARGET_CFLAGS TARGET_CFLAGS || die
estack_pop TARGET_CPPFLAGS TARGET_CPPFLAGS || die
}
grub_src_compile() {
default_src_compile
pax-mark -mpes "${grub_binaries[@]}"
}
grub_build_docs() {
emake -C docs html
}
grub_src_install() {
default_src_install
}
grub_install_docs() {
emake -C docs DESTDIR="${D}" install-html
}
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]]; then
# Bug 439082
if $(tc-getLD) --version | grep -q "GNU gold"; then
eerror "GRUB does not function correctly when built with the gold linker."
eerror "Please select the bfd linker with binutils-config."
die "GNU gold detected"
fi
fi
}
src_prepare() {
if [[ ${PV} != 9999 ]]; then
epatch "${FILESDIR}/${P}-parallel-make.patch" #424231
epatch "${FILESDIR}/${P}-no-gets.patch" #424703
epatch "${FILESDIR}/${P}-config-quoting.patch" #426364
epatch "${FILESDIR}/${P}-tftp-endian.patch" # 438612
epatch "${FILESDIR}/${P}-hardcoded-awk.patch" #424137
epatch "${FILESDIR}/${P}-zfs-feature-flag-support.patch" #455358
fi
# fix texinfo file name, bug 416035
sed -i \
-e 's/^\* GRUB:/* GRUB2:/' \
-e 's/(grub)/(grub2)/' -- \
"${S}"/docs/grub.texi
epatch_user
# autogen.sh does more than just run autotools
if [[ -n ${DO_AUTORECONF} ]] ; then
sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
(
autopoint() { :; }
. ./autogen.sh
) || die
fi
# install into the right dir for eselect #372735
sed -i \
-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
util/bash-completion.d/Makefile.in || die
# get enabled platforms
GRUB_ENABLED_PLATFORMS=""
local i
for i in ${GRUB_PLATFORMS[@]}; do
use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
done
[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
}
src_configure() {
local i
use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
use static && append-ldflags -static
# Sandbox bug 404013.
use libzfs && addpredict /etc/dfs:/dev/zfs
multijob_init
for i in ${GRUB_ENABLED_PLATFORMS}; do
multijob_child_init grub_run_phase ${FUNCNAME} ${i}
done
multijob_finish || die
}
src_compile() {
# Used for pax marking in grub_src_compile
local grub_binaries=(
grub-editenv
grub-fstest
grub-menulst2cfg
grub-mkimage
grub-mklayout
grub-mkpasswd-pbkdf2
grub-mkrelpath
grub-script-check
grub-bios-setup
grub-ofpathname
grub-probe
grub-sparc64-setup
)
use mount && grub_binaries+=( grub-mount )
use truetype && grub_binaries+=( grub-mkfont )
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
# Just build docs once
use doc && grub_run_phase build_docs ${i}
}
src_install() {
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
use doc && grub_run_phase install_docs ${i}
mv "${ED}"usr/share/info/grub{,2}.info || die
# can't be in docs array as we use default_src_install in different builddir
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
insinto /etc/default
newins "${FILESDIR}"/grub.default-2 grub
}
pkg_postinst() {
# display the link to guide
elog "For information on how to configure grub-2 please refer to the guide:"
elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
if ! has_version sys-boot/os-prober; then
elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
fi
if ! has_version dev-libs/libisoburn; then
elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
fi
if has_version sys-boot/grub:0; then
ewarn "If you want to keep GRUB Legacy (grub-0.97) installed, please run"
ewarn "the following to add sys-boot/grub:0 to your world file."
ewarn "emerge --noreplace sys-boot/grub:0"
fi
}

View File

@ -0,0 +1,292 @@
# 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-2.00_beta6.ebuild,v 1.1 2012/06/02 16:06:48 floppym Exp $
EAPI=4
if [[ ${PV} == "9999" ]] ; then
EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
LIVE_ECLASS="bzr"
SRC_URI=""
DO_AUTORECONF="true"
else
MY_P=${P/_/\~}
if [[ ${PV} == *_alpha* || ${PV} == *_beta* ]]; then
SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
else
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
mirror://gentoo/${MY_P}.tar.xz"
fi
# Masked until documentation guys consolidate the guide and approve
# it for usage.
#KEYWORDS="~amd64 ~mips ~x86"
S=${WORKDIR}/${MY_P}
fi
inherit eutils flag-o-matic pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
unset LIVE_ECLASS
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-3"
SLOT="2"
IUSE="custom-cflags debug device-mapper efiemu mount nls static sdl truetype libzfs"
GRUB_PLATFORMS=(
# everywhere:
emu
# mips only:
qemu-mips yeeloong
# amd64, x86, ppc, ppc64:
ieee1275
# amd64, x86:
coreboot multiboot efi-32 pc qemu
# amd64, ia64:
efi-64
)
IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
dev-libs/lzo
>=sys-libs/ncurses-5.2-r5
debug? (
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
libzfs? ( sys-fs/zfs )
mount? ( sys-fs/fuse )
truetype? (
media-libs/freetype
>=media-fonts/unifont-5
)
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
"
DEPEND="${RDEPEND}
>=dev-lang/python-2.5.2
sys-devel/flex
virtual/yacc
sys-apps/texinfo
static? (
truetype? (
app-arch/bzip2[static-libs(+)]
media-libs/freetype[static-libs(+)]
sys-libs/zlib[static-libs(+)]
)
)
"
RDEPEND+="
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
"
if [[ -n ${DO_AUTORECONF} ]] ; then
DEPEND+=" >=sys-devel/autogen-5.10 sys-apps/help2man"
else
DEPEND+=" app-arch/xz-utils"
fi
export STRIP_MASK="*/grub/*/*.{mod,img}"
QA_EXECSTACK="
usr/bin/grub*
usr/sbin/grub*
usr/lib*/grub/*/*.mod
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/setjmp.module
"
QA_WX_LOAD="
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/*.image
"
QA_PRESTRIPPED="
usr/lib.*/grub/.*/kernel.img
"
grub_run_phase() {
local phase=$1
local platform=$2
[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
[[ -d "${WORKDIR}/build-${platform}" ]] || \
{ mkdir "${WORKDIR}/build-${platform}" || die ; }
pushd "${WORKDIR}/build-${platform}" > /dev/null || die
echo ">>> Running ${phase} for platform \"${platform}\""
echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
grub_${phase} ${platform}
popd > /dev/null || die
}
grub_src_configure() {
local platform=$1
local with_platform=
[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
# Used below for efi cross-building
tc-export CC NM OBJCOPY STRIP
estack_push CTARGET "${CTARGET}"
estack_push TARGET_CC "${TARGET_CC}"
estack_push TARGET_CFLAGS "${TARGET_CFLAGS}"
estack_push TARGET_CPPFLAGS "${TARGET_CPPFLAGS}"
case ${platform} in
efi-32)
if [[ ${CHOST} == x86_64* ]]; then
CTARGET="${CTARGET:-i386}"
TARGET_CC="${TARGET_CC:-${CC}}"
export TARGET_CC
fi
with_platform="--with-platform=efi"
;;
efi-64)
if [[ ${CHOST} == i?86* ]]; then
CTARGET="${CTARGET:-x86_64}"
TARGET_CC="${TARGET_CC:-${CC}}"
TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS
fi
with_platform="--with-platform=efi"
;;
guessed) ;;
*) with_platform="--with-platform=${platform}" ;;
esac
ECONF_SOURCE="${S}" \
econf \
--disable-werror \
--program-prefix= \
--program-transform-name="s,grub,grub2," \
--with-grubdir=grub2 \
${with_platform} \
$(use_enable debug mm-debug) \
$(use_enable debug grub-emu-usb) \
$(use_enable device-mapper) \
$(use_enable efiemu) \
$(use_enable mount grub-mount) \
$(use_enable nls) \
$(use_enable truetype grub-mkfont) \
$(use_enable libzfs) \
$(use sdl && use_enable debug grub-emu-sdl)
estack_pop CTARGET CTARGET || die
estack_pop TARGET_CC TARGET_CC || die
estack_pop TARGET_CFLAGS TARGET_CFLAGS || die
estack_pop TARGET_CPPFLAGS TARGET_CPPFLAGS || die
}
grub_src_compile() {
default_src_compile
pax-mark -mpes "${grub_binaries[@]}"
}
grub_src_install() {
default_src_install
}
src_prepare() {
local i j
# fix texinfo file name, bug 416035
sed -i \
-e 's/^\* GRUB:/* GRUB2:/' \
-e 's/(grub)/(grub2)/' -- \
"${S}"/docs/grub.texi
epatch_user
# autogen.sh does more than just run autotools
if [[ -n ${DO_AUTORECONF} ]] ; then
sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
(. ./autogen.sh) || die
fi
# install into the right dir for eselect #372735
sed -i \
-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
util/bash-completion.d/Makefile.in || die
# get enabled platforms
GRUB_ENABLED_PLATFORMS=""
for i in ${GRUB_PLATFORMS[@]}; do
use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
done
[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
elog "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
}
src_configure() {
local i
use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS
use libzfs && addpredict /etc/dfs
use static && append-ldflags -static
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
}
src_compile() {
# Used for pax marking in grub_src_compile
local grub_binaries=(
grub-editenv
grub-fstest
grub-menulst2cfg
grub-mkimage
grub-mklayout
grub-mkpasswd-pbkdf2
grub-mkrelpath
grub-script-check
grub-bios-setup
grub-ofpathname
grub-probe
grub-sparc64-setup
)
use mount && grub_binaries+=( grub-mount )
use truetype && grub_binaries+=( grub-mkfont )
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
}
src_install() {
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
mv "${ED}"usr/share/info/grub{,2}.info || die
# can't be in docs array as we use default_src_install in different builddir
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
insinto /etc/default
newins "${FILESDIR}"/grub.default grub
}
pkg_postinst() {
# display the link to guide
elog "For information on how to configure grub-2 please refer to the guide:"
elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
if ! has_version sys-boot/os-prober; then
elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
fi
if ! has_version dev-libs/libisoburn; then
elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
fi
}

View File

@ -0,0 +1,348 @@
# 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-9999.ebuild,v 1.85 2012/10/20 21:46:34 floppym Exp $
EAPI=4
if [[ ${PV} == "9999" ]] ; then
EBZR_REPO_URI="http://bzr.savannah.gnu.org/r/grub/trunk/grub/"
LIVE_ECLASS="bzr"
SRC_URI=""
DO_AUTORECONF="true"
else
MY_P=${P/_/\~}
if [[ ${PV} == *_alpha* || ${PV} == *_beta* || ${PV} == *_rc* ]]; then
SRC_URI="mirror://gnu-alpha/${PN}/${MY_P}.tar.xz"
else
SRC_URI="mirror://gnu/${PN}/${MY_P}.tar.xz
mirror://gentoo/${MY_P}.tar.xz"
fi
KEYWORDS="~amd64 ~x86"
S=${WORKDIR}/${MY_P}
DO_AUTORECONF="true"
fi
inherit eutils flag-o-matic multiprocessing pax-utils toolchain-funcs ${DO_AUTORECONF:+autotools} ${LIVE_ECLASS}
unset LIVE_ECLASS
DESCRIPTION="GNU GRUB boot loader"
HOMEPAGE="http://www.gnu.org/software/grub/"
LICENSE="GPL-3"
SLOT="2"
IUSE="custom-cflags debug device-mapper doc efiemu mount nls static sdl truetype libzfs"
GRUB_PLATFORMS=(
# everywhere:
emu
# mips only:
qemu-mips yeeloong
# amd64, x86, ppc, ppc64:
ieee1275
# amd64, x86:
coreboot multiboot efi-32 pc qemu
# amd64, ia64:
efi-64
)
IUSE+=" ${GRUB_PLATFORMS[@]/#/grub_platforms_}"
REQUIRED_USE="grub_platforms_qemu? ( truetype )"
# os-prober: Used on runtime to detect other OSes
# xorriso (dev-libs/libisoburn): Used on runtime for mkrescue
RDEPEND="
app-arch/xz-utils
>=sys-libs/ncurses-5.2-r5
debug? (
sdl? ( media-libs/libsdl )
)
device-mapper? ( >=sys-fs/lvm2-2.02.45 )
libzfs? ( sys-fs/zfs )
mount? ( sys-fs/fuse )
truetype? (
media-libs/freetype
media-fonts/dejavu
>=media-fonts/unifont-5
)
ppc? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
ppc64? ( sys-apps/ibm-powerpc-utils sys-apps/powerpc-utils )
"
DEPEND="${RDEPEND}
>=dev-lang/python-2.5.2
sys-devel/flex
sys-devel/bison
sys-apps/help2man
sys-apps/texinfo
static? (
truetype? (
app-arch/bzip2[static-libs(+)]
media-libs/freetype[static-libs(+)]
sys-libs/zlib[static-libs(+)]
)
)
"
RDEPEND+="
grub_platforms_efi-32? ( sys-boot/efibootmgr )
grub_platforms_efi-64? ( sys-boot/efibootmgr )
"
if [[ -n ${DO_AUTORECONF} ]] ; then
DEPEND+=" >=sys-devel/autogen-5.10"
else
DEPEND+=" app-arch/xz-utils"
fi
export STRIP_MASK="*/grub/*/*.{mod,img}"
QA_EXECSTACK="
usr/bin/grub*
usr/sbin/grub*
usr/lib*/grub/*/*.mod
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/setjmp.module
"
QA_WX_LOAD="
usr/lib*/grub/*/kernel.exec
usr/lib*/grub/*/kernel.img
usr/lib*/grub/*/*.image
"
QA_PRESTRIPPED="
usr/lib.*/grub/.*/kernel.img
"
grub_run_phase() {
local phase=$1
local platform=$2
[[ -z ${phase} || -z ${platform} ]] && die "${FUNCNAME} [phase] [platform]"
[[ -d "${WORKDIR}/build-${platform}" ]] || \
{ mkdir "${WORKDIR}/build-${platform}" || die ; }
pushd "${WORKDIR}/build-${platform}" > /dev/null || die
echo ">>> Running ${phase} for platform \"${platform}\""
echo ">>> Working in: \"${WORKDIR}/build-${platform}\""
grub_${phase} ${platform}
popd > /dev/null || die
}
grub_src_configure() {
local platform=$1
local with_platform=
local enable_efiemu="--disable-efiemu"
[[ -z ${platform} ]] && die "${FUNCNAME} [platform]"
# Used below for efi cross-building
tc-export CC NM OBJCOPY STRIP
estack_push CTARGET "${CTARGET}"
estack_push TARGET_CC "${TARGET_CC}"
estack_push TARGET_CFLAGS "${TARGET_CFLAGS}"
estack_push TARGET_CPPFLAGS "${TARGET_CPPFLAGS}"
case ${platform} in
efi-32)
if [[ ${CHOST} == x86_64* ]]; then
CTARGET="${CTARGET:-i386}"
TARGET_CC="${TARGET_CC:-${CC}}"
export TARGET_CC
fi
with_platform="--with-platform=efi"
;;
efi-64)
if [[ ${CHOST} == i?86* ]]; then
CTARGET="${CTARGET:-x86_64}"
TARGET_CC="${TARGET_CC:-${CC}}"
TARGET_CFLAGS="-Os -march=x86-64 ${TARGET_CFLAGS}"
TARGET_CPPFLAGS="-march=x86-64 ${TARGET_CPPFLAGS}"
export TARGET_CC TARGET_CFLAGS TARGET_CPPFLAGS
fi
with_platform="--with-platform=efi"
;;
guessed) ;;
*)
with_platform="--with-platform=${platform}"
case ${CTARGET:-${CHOST}} in
i?86*|x86_64*)
enable_efiemu=$(use_enable efiemu)
;;
esac
;;
esac
ECONF_SOURCE="${S}" \
econf \
--libdir=/usr/lib \
--htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
--disable-werror \
--program-prefix= \
--program-transform-name="s,grub,grub2," \
--with-grubdir=grub2 \
${with_platform} \
$(use_enable debug mm-debug) \
$(use_enable debug grub-emu-usb) \
$(use_enable device-mapper) \
${enable_efiemu} \
$(use_enable mount grub-mount) \
$(use_enable nls) \
$(use_enable truetype grub-mkfont) \
$(use_enable libzfs) \
$(use sdl && use_enable debug grub-emu-sdl)
estack_pop CTARGET CTARGET || die
estack_pop TARGET_CC TARGET_CC || die
estack_pop TARGET_CFLAGS TARGET_CFLAGS || die
estack_pop TARGET_CPPFLAGS TARGET_CPPFLAGS || die
}
grub_src_compile() {
default_src_compile
pax-mark -mpes "${grub_binaries[@]}"
}
grub_build_docs() {
emake -C docs html
}
grub_src_install() {
default_src_install
}
grub_install_docs() {
emake -C docs DESTDIR="${D}" install-html
}
pkg_pretend() {
if [[ ${MERGE_TYPE} != binary ]]; then
# Bug 439082
if $(tc-getLD) --version | grep -q "GNU gold"; then
eerror "GRUB does not function correctly when built with the gold linker."
eerror "Please select the bfd linker with binutils-config."
die "GNU gold detected"
fi
fi
}
src_prepare() {
if [[ ${PV} != 9999 ]]; then
epatch "${FILESDIR}/${P}-parallel-make.patch" #424231
epatch "${FILESDIR}/${P}-no-gets.patch" #424703
epatch "${FILESDIR}/${P}-config-quoting.patch" #426364
epatch "${FILESDIR}/${P}-tftp-endian.patch" # 438612
epatch "${FILESDIR}/${P}-hardcoded-awk.patch" #424137
fi
# fix texinfo file name, bug 416035
sed -i \
-e 's/^\* GRUB:/* GRUB2:/' \
-e 's/(grub)/(grub2)/' -- \
"${S}"/docs/grub.texi
epatch_user
# autogen.sh does more than just run autotools
if [[ -n ${DO_AUTORECONF} ]] ; then
sed -i -e '/^autoreconf/s:^:set +e; e:' autogen.sh || die
(
autopoint() { :; }
. ./autogen.sh
) || die
fi
# install into the right dir for eselect #372735
sed -i \
-e '/^bashcompletiondir =/s:=.*:= $(datarootdir)/bash-completion:' \
util/bash-completion.d/Makefile.in || die
# get enabled platforms
GRUB_ENABLED_PLATFORMS=""
local i
for i in ${GRUB_PLATFORMS[@]}; do
use grub_platforms_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}"
done
[[ -z ${GRUB_ENABLED_PLATFORMS} ]] && GRUB_ENABLED_PLATFORMS="guessed"
einfo "Going to build following platforms: ${GRUB_ENABLED_PLATFORMS}"
}
src_configure() {
local i
use custom-cflags || unset CCASFLAGS CFLAGS CPPFLAGS LDFLAGS
use static && append-ldflags -static
# Sandbox bug 404013.
use libzfs && addpredict /etc/dfs:/dev/zfs
multijob_init
for i in ${GRUB_ENABLED_PLATFORMS}; do
multijob_child_init grub_run_phase ${FUNCNAME} ${i}
done
multijob_finish || die
}
src_compile() {
# Used for pax marking in grub_src_compile
local grub_binaries=(
grub-editenv
grub-fstest
grub-menulst2cfg
grub-mkimage
grub-mklayout
grub-mkpasswd-pbkdf2
grub-mkrelpath
grub-script-check
grub-bios-setup
grub-ofpathname
grub-probe
grub-sparc64-setup
)
use mount && grub_binaries+=( grub-mount )
use truetype && grub_binaries+=( grub-mkfont )
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
# Just build docs once
use doc && grub_run_phase build_docs ${i}
}
src_install() {
local i
for i in ${GRUB_ENABLED_PLATFORMS}; do
grub_run_phase ${FUNCNAME} ${i}
done
use doc && grub_run_phase install_docs ${i}
mv "${ED}"usr/share/info/grub{,2}.info || die
# can't be in docs array as we use default_src_install in different builddir
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
insinto /etc/default
newins "${FILESDIR}"/grub.default-2 grub
}
pkg_postinst() {
# display the link to guide
elog "For information on how to configure grub-2 please refer to the guide:"
elog " http://wiki.gentoo.org/wiki/GRUB2_Quick_Start"
if ! has_version sys-boot/os-prober; then
elog "Install sys-boot/os-prober to enable detection of other operating systems using grub2-mkconfig."
fi
if ! has_version dev-libs/libisoburn; then
elog "Install dev-libs/libisoburn to enable creation of rescue media using grub2-mkrescue."
fi
if has_version sys-boot/grub:0; then
ewarn "If you want to keep GRUB Legacy (grub-0.97) installed, please run"
ewarn "the following to add sys-boot/grub:0 to your world file."
ewarn "emerge --noreplace sys-boot/grub:0"
fi
}

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>base-system</herd>
<maintainer>
<email>base-system@gentoo.org</email>
</maintainer>
<maintainer restrict="&gt;=sys-boot/grub-2">
<email>floppym@gentoo.org</email>
<name>Mike Gilbert</name>
</maintainer>
<use>
<flag name='device-mapper'>
Enable support for <pkg>sys-fs/device-mapper</pkg>
</flag>
<flag name='efiemu'>
Build and install the efiemu runtimes
</flag>
<flag name='mount'>
Build and install the grub-mount utility
</flag>
<flag name='libzfs'>
Enable support for <pkg>sys-fs/zfs</pkg>
</flag>
</use>
</pkgmetadata>