mirror of
http://cgit.git.savannah.gnu.org/git/grub.git
synced 2026-04-28 14:33:34 +00:00
Compare commits
943 Commits
2.00
...
phcoder/fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e2fb1e3ce | ||
|
|
442b86de32 | ||
|
|
04dea7e6c2 | ||
|
|
a8f15bceea | ||
|
|
a60dae7e4e | ||
|
|
891b713be3 | ||
|
|
cf880639f6 | ||
|
|
03dcac7f76 | ||
|
|
c81acb7ff3 | ||
|
|
c1bee64676 | ||
|
|
f37bf9c778 | ||
|
|
4021132be2 | ||
|
|
67811a6fd4 | ||
|
|
3ace8d7584 | ||
|
|
1e6ad6a668 | ||
|
|
188929ebee | ||
|
|
7994a09a9b | ||
|
|
2a8a75855c | ||
|
|
6d1fc99ab5 | ||
|
|
3d695d7b93 | ||
|
|
10bafa1c38 | ||
|
|
b1c6d03760 | ||
|
|
5f4028d4a5 | ||
|
|
a28567364a | ||
|
|
0a7e52b2ed | ||
|
|
428295739e | ||
|
|
3523b8d8a7 | ||
|
|
d43c64899d | ||
|
|
f690f8b030 | ||
|
|
74ff2c0501 | ||
|
|
fb56391ee3 | ||
|
|
40f290606d | ||
|
|
c64577a554 | ||
|
|
edd0179abb | ||
|
|
6673d8e7b6 | ||
|
|
a105d3755b | ||
|
|
c16535a845 | ||
|
|
af81ed880d | ||
|
|
ea899a5760 | ||
|
|
c6dc6fa175 | ||
|
|
ad2dc00309 | ||
|
|
b46684ae53 | ||
|
|
f70d5c0701 | ||
|
|
bca274b455 | ||
|
|
238f048987 | ||
|
|
863c590b1e | ||
|
|
f2e144ad3e | ||
|
|
84a0e9699f | ||
|
|
06a8358ea0 | ||
|
|
0d711431c7 | ||
|
|
f8401f760c | ||
|
|
ac1feb61d2 | ||
|
|
00f72e890b | ||
|
|
067e6ae74d | ||
|
|
64a6c791e1 | ||
|
|
979d9f521d | ||
|
|
1437da5440 | ||
|
|
47601ffe73 | ||
|
|
d9ee2269c8 | ||
|
|
63efa602ff | ||
|
|
2cc679adae | ||
|
|
2e4659b810 | ||
|
|
2a40badf82 | ||
|
|
1ba6b9b96f | ||
|
|
f3e393411b | ||
|
|
7152393503 | ||
|
|
28153eb87a | ||
|
|
88ce4cd7f6 | ||
|
|
66123940c7 | ||
|
|
0927e5bdc8 | ||
|
|
9c12ac9773 | ||
|
|
97ec2d71d0 | ||
|
|
156e4ea071 | ||
|
|
3b502c29a1 | ||
|
|
c7037f1d0f | ||
|
|
a07e6ad010 | ||
|
|
2359bf887c | ||
|
|
d28e1163c3 | ||
|
|
e89c2d48a9 | ||
|
|
7abdac8e13 | ||
|
|
518864c05b | ||
|
|
bbd2b5396b | ||
|
|
99519c154c | ||
|
|
2028576504 | ||
|
|
887c0bb61a | ||
|
|
cd78a56fb2 | ||
|
|
a4012f0764 | ||
|
|
31de274d29 | ||
|
|
40346de6d3 | ||
|
|
d3923ab956 | ||
|
|
663f6eb195 | ||
|
|
6f65237374 | ||
|
|
44d1c20a13 | ||
|
|
d0a116ee5a | ||
|
|
b47fcae6cb | ||
|
|
0f7c00c1c6 | ||
|
|
29013cba15 | ||
|
|
e8559d2434 | ||
|
|
8104063ce4 | ||
|
|
fc3182c799 | ||
|
|
f90a3cc0a8 | ||
|
|
1e3e741940 | ||
|
|
92c88fc896 | ||
|
|
3cd910a212 | ||
|
|
7b3aca00fa | ||
|
|
97dfe7e46b | ||
|
|
bf919aa977 | ||
|
|
f4ccf29dd5 | ||
|
|
0d3a6f8540 | ||
|
|
757e3eb7c3 | ||
|
|
fb320faf88 | ||
|
|
ea73acd2ce | ||
|
|
71237a6f0f | ||
|
|
3d46c22f5b | ||
|
|
47e0a61f6f | ||
|
|
946fd07357 | ||
|
|
9c13c57623 | ||
|
|
ad543f123b | ||
|
|
6176a0cdfa | ||
|
|
9688cae2eb | ||
|
|
8154884dd4 | ||
|
|
f7b69a3f2c | ||
|
|
ceca6ddf26 | ||
|
|
ac48d334ab | ||
|
|
b2b71bff36 | ||
|
|
669fc44923 | ||
|
|
593816780e | ||
|
|
bacfefbb0e | ||
|
|
f7c4957068 | ||
|
|
7b83ca449b | ||
|
|
df1e64c98e | ||
|
|
ec16e02639 | ||
|
|
4b4eeb3cc1 | ||
|
|
f4e0adc0f9 | ||
|
|
e012736478 | ||
|
|
20d535419f | ||
|
|
5a869940de | ||
|
|
c06c75201c | ||
|
|
8f53bb3fd2 | ||
|
|
148f100768 | ||
|
|
af3b06be14 | ||
|
|
27f9d02eb9 | ||
|
|
f6a81f0aaf | ||
|
|
d7750b324f | ||
|
|
2859196e5f | ||
|
|
11f3c324e6 | ||
|
|
c018c968cd | ||
|
|
7e45abcef4 | ||
|
|
23934da26e | ||
|
|
c11ebcc84f | ||
|
|
70671037c8 | ||
|
|
25ac643a54 | ||
|
|
69ca587652 | ||
|
|
d9d68ef020 | ||
|
|
58e211ccf2 | ||
|
|
588744d0dc | ||
|
|
44016e527a | ||
|
|
6de9ee86bf | ||
|
|
f8f3f15559 | ||
|
|
b73249d260 | ||
|
|
dac86b182c | ||
|
|
17614b8426 | ||
|
|
6de292cb9b | ||
|
|
84379b61d2 | ||
|
|
21d85db12f | ||
|
|
66a1b3eeb7 | ||
|
|
e19bec1715 | ||
|
|
ee8c1b295a | ||
|
|
bb338aaf24 | ||
|
|
ae5540d3d4 | ||
|
|
4cd3c4fec7 | ||
|
|
78170f3e85 | ||
|
|
3414b6c0e2 | ||
|
|
6d0740e8ca | ||
|
|
ff2d4dc41c | ||
|
|
eac6ae822c | ||
|
|
ba9baabecd | ||
|
|
60d4f0bb45 | ||
|
|
145e2369a7 | ||
|
|
3530bc9d90 | ||
|
|
fb9f59c3ce | ||
|
|
9be1c25578 | ||
|
|
2b1d3e72ab | ||
|
|
ed8c0887f4 | ||
|
|
f72ab14e4a | ||
|
|
2fe53a22b8 | ||
|
|
71c1d67a34 | ||
|
|
ad297ec734 | ||
|
|
6e9e5dc98b | ||
|
|
761c718b52 | ||
|
|
37149a2f20 | ||
|
|
3837a151e0 | ||
|
|
caca1c70cf | ||
|
|
f7676b7016 | ||
|
|
22f98db270 | ||
|
|
b102ce6909 | ||
|
|
acbbe5cbad | ||
|
|
2112fb3fef | ||
|
|
79f78fbf06 | ||
|
|
c2e6f70589 | ||
|
|
620b52bf47 | ||
|
|
aabe433afe | ||
|
|
9a2c903f28 | ||
|
|
4a445f580b | ||
|
|
c1ca424476 | ||
|
|
672fa55e81 | ||
|
|
a5b0365ab2 | ||
|
|
29072e994e | ||
|
|
f8772ea7f5 | ||
|
|
a1a315e780 | ||
|
|
cef86fefda | ||
|
|
c4cf25eef7 | ||
|
|
53a5f5c2f0 | ||
|
|
de300af2ac | ||
|
|
c582736463 | ||
|
|
dd2ed8b092 | ||
|
|
ffdfc1f3e9 | ||
|
|
7286c38450 | ||
|
|
ea547e1413 | ||
|
|
b726be7653 | ||
|
|
a5f6ade676 | ||
|
|
3b0f3aa2a7 | ||
|
|
1db3830418 | ||
|
|
fb295fc070 | ||
|
|
47345010a4 | ||
|
|
bf25f87931 | ||
|
|
24ca45125e | ||
|
|
c7c177f07f | ||
|
|
d71b45ae8e | ||
|
|
e44b9a8349 | ||
|
|
4fa60739f2 | ||
|
|
17c8bc378f | ||
|
|
9d4d797785 | ||
|
|
0caa407cd4 | ||
|
|
9ae393da5b | ||
|
|
498d503316 | ||
|
|
7d93298ff6 | ||
|
|
b2cae20c11 | ||
|
|
3896d6b421 | ||
|
|
ebc1da55cd | ||
|
|
c573914389 | ||
|
|
be74aeb39e | ||
|
|
d999ac72e2 | ||
|
|
2b131610d0 | ||
|
|
de6e5ff89b | ||
|
|
fa31ee9c2c | ||
|
|
e84f818865 | ||
|
|
2237daf246 | ||
|
|
d72bff0997 | ||
|
|
29648c5d84 | ||
|
|
4a87649207 | ||
|
|
3ccf16dff9 | ||
|
|
e9c492a02e | ||
|
|
0340bdbc22 | ||
|
|
30b7f58f4e | ||
|
|
bab7b1ebeb | ||
|
|
43b1c99d53 | ||
|
|
e8fd80bc3d | ||
|
|
bf645fda03 | ||
|
|
5177ba1400 | ||
|
|
9db826e149 | ||
|
|
4912008551 | ||
|
|
b3328b68ed | ||
|
|
3fff48ab45 | ||
|
|
39cfdaa9a2 | ||
|
|
7c680e1f17 | ||
|
|
890bdabe96 | ||
|
|
9c262ff966 | ||
|
|
d755342abe | ||
|
|
68b777070a | ||
|
|
efa68bfabf | ||
|
|
d9104204ac | ||
|
|
5830df88da | ||
|
|
c248781a83 | ||
|
|
621bed6990 | ||
|
|
71764dc8ca | ||
|
|
1bd7302506 | ||
|
|
affce7d417 | ||
|
|
0e8daad0bd | ||
|
|
3f7d9c8280 | ||
|
|
bca8873a0c | ||
|
|
5dd8205424 | ||
|
|
a47a78be88 | ||
|
|
e85a5d5ca6 | ||
|
|
dad9fa6bcf | ||
|
|
7e518ca84f | ||
|
|
d68d01573b | ||
|
|
775b284dd6 | ||
|
|
3ff4063dd3 | ||
|
|
287faafe8d | ||
|
|
d1983764f4 | ||
|
|
15ce95c40c | ||
|
|
207862dda4 | ||
|
|
306950e137 | ||
|
|
63653cfdae | ||
|
|
53c6b7d658 | ||
|
|
e70d6736ff | ||
|
|
90379808b6 | ||
|
|
386701a8fe | ||
|
|
5307078763 | ||
|
|
1bc783bd39 | ||
|
|
436ad5c3f4 | ||
|
|
607319c9ab | ||
|
|
f5d3e7ef49 | ||
|
|
d404d15450 | ||
|
|
28851ef640 | ||
|
|
897c3bc634 | ||
|
|
f163045985 | ||
|
|
64463dfde4 | ||
|
|
489724952c | ||
|
|
5dd5e64b71 | ||
|
|
1c1f31e5de | ||
|
|
c546a25901 | ||
|
|
8169047804 | ||
|
|
6b87c10a0b | ||
|
|
8f0baaac38 | ||
|
|
b224c26627 | ||
|
|
506b336b82 | ||
|
|
8c8c87b7d4 | ||
|
|
7dc5ca13c5 | ||
|
|
c3302aa582 | ||
|
|
7b780018f5 | ||
|
|
984cfd8a79 | ||
|
|
f82d79c984 | ||
|
|
fd7dd66dbd | ||
|
|
43ffba7c65 | ||
|
|
3c7eac445b | ||
|
|
bdb5ba47d8 | ||
|
|
ed7fbf43c2 | ||
|
|
fc46e9fca8 | ||
|
|
7f68269ad3 | ||
|
|
8ed358e0ee | ||
|
|
fc97214f7e | ||
|
|
ca1fb56345 | ||
|
|
0031b22993 | ||
|
|
54ea2f4401 | ||
|
|
3c601f8c81 | ||
|
|
1d679ddaa2 | ||
|
|
00c28dd9bc | ||
|
|
32af299a10 | ||
|
|
e733cf52f4 | ||
|
|
c6b066f2e9 | ||
|
|
66345b5071 | ||
|
|
ad1fe3f91f | ||
|
|
92a52dd4d6 | ||
|
|
b2e9d2761e | ||
|
|
7b966834c5 | ||
|
|
d5c1eef106 | ||
|
|
03dafa17df | ||
|
|
224a55bb07 | ||
|
|
58ec39c6a7 | ||
|
|
369508b3cb | ||
|
|
412ce9165c | ||
|
|
6f27a3f659 | ||
|
|
c6ed362a3f | ||
|
|
5e7d94641b | ||
|
|
dea55e2a95 | ||
|
|
f0b94ded6d | ||
|
|
b828fb5d9c | ||
|
|
7c9d0c39af | ||
|
|
816719c8d4 | ||
|
|
2af2353b0a | ||
|
|
797abd0a23 | ||
|
|
36e87d25e1 | ||
|
|
273349fe42 | ||
|
|
418f86c659 | ||
|
|
c137aea04b | ||
|
|
272dc8dfe2 | ||
|
|
b47434612c | ||
|
|
748a4533f5 | ||
|
|
fca5f9443c | ||
|
|
4f47d809c7 | ||
|
|
a62ae90c2b | ||
|
|
4ed4139290 | ||
|
|
3719fbc57f | ||
|
|
459b1d9171 | ||
|
|
f4e1ab9da7 | ||
|
|
fa471bfaaf | ||
|
|
d65be02b89 | ||
|
|
ba8bc620d1 | ||
|
|
4f0ad02936 | ||
|
|
43d53b72c9 | ||
|
|
bd744218c0 | ||
|
|
ae27e4d323 | ||
|
|
88f8d1463f | ||
|
|
3f42504c15 | ||
|
|
d110499b22 | ||
|
|
a8674ad37b | ||
|
|
286fe4b379 | ||
|
|
1bd57aa343 | ||
|
|
b2182299a7 | ||
|
|
7a87d69fcf | ||
|
|
795b3dc094 | ||
|
|
68714c4392 | ||
|
|
af211babd8 | ||
|
|
0036f02d7b | ||
|
|
6d0ddff3d9 | ||
|
|
038016f48a | ||
|
|
776bdce291 | ||
|
|
c71dbd40a9 | ||
|
|
53618046da | ||
|
|
8e67b50fdf | ||
|
|
f5ae3717e4 | ||
|
|
9c28da2a89 | ||
|
|
139072b83a | ||
|
|
c6a61bda9b | ||
|
|
5136961498 | ||
|
|
efa8640adb | ||
|
|
6f80a7b231 | ||
|
|
a2371e19b3 | ||
|
|
64fce2d829 | ||
|
|
eb272d84a4 | ||
|
|
a9e5abee0f | ||
|
|
e639c204e0 | ||
|
|
a4c89b1731 | ||
|
|
5b06b53cbd | ||
|
|
702da5c9bf | ||
|
|
aa62a5b7f1 | ||
|
|
4aa237c8a4 | ||
|
|
93d8479b70 | ||
|
|
837222cc30 | ||
|
|
99c971afd3 | ||
|
|
e6930a454d | ||
|
|
5027af38cf | ||
|
|
a5b55c4b32 | ||
|
|
0301a8b36d | ||
|
|
3d84cb1793 | ||
|
|
356670f1f2 | ||
|
|
593e430cd6 | ||
|
|
63c2984922 | ||
|
|
cc28411296 | ||
|
|
d60c9a81ac | ||
|
|
b8578da640 | ||
|
|
69544d1e43 | ||
|
|
96dbe64813 | ||
|
|
ccfc0bdb53 | ||
|
|
f25870887b | ||
|
|
cec5cf0ced | ||
|
|
e40b459617 | ||
|
|
fc4c4fddf6 | ||
|
|
6570b2050e | ||
|
|
b8323067e8 | ||
|
|
f7a9c7c9d7 | ||
|
|
3cc1878faf | ||
|
|
4b80e43c8c | ||
|
|
57e0c20cb5 | ||
|
|
4fd42c53f3 | ||
|
|
2a800dc3f3 | ||
|
|
c6a8472baf | ||
|
|
470038745c | ||
|
|
390df92f0b | ||
|
|
c59fe1d776 | ||
|
|
72a21cf09b | ||
|
|
5bac5d9ad6 | ||
|
|
141430a295 | ||
|
|
1e908b34a6 | ||
|
|
1359e4740a | ||
|
|
17806392f1 | ||
|
|
cdce14fad4 | ||
|
|
c8d6cc3cf0 | ||
|
|
a73b31ce5c | ||
|
|
1202c76486 | ||
|
|
50268344c0 | ||
|
|
62b15edfd1 | ||
|
|
43c863f5be | ||
|
|
a9c0b699c0 | ||
|
|
1a53e1dd5c | ||
|
|
854f383c28 | ||
|
|
1c99b9d1fe | ||
|
|
8e71d87482 | ||
|
|
709ad61b07 | ||
|
|
d128901ace | ||
|
|
f011353675 | ||
|
|
34b22f5cda | ||
|
|
0f7e980b29 | ||
|
|
30b03dc22e | ||
|
|
0dc11c08d7 | ||
|
|
f8024c3f9a | ||
|
|
b4c1da6282 | ||
|
|
0ef7478b5b | ||
|
|
8200fa1597 | ||
|
|
091945b239 | ||
|
|
0e7b2e3217 | ||
|
|
16f7c8f6d3 | ||
|
|
3e912fda81 | ||
|
|
ee0220bc26 | ||
|
|
89e0240c1c | ||
|
|
e56d9637ae | ||
|
|
8098f65556 | ||
|
|
16940e077c | ||
|
|
c5dbc13d28 | ||
|
|
011f8ae8d2 | ||
|
|
2aa072d76a | ||
|
|
43fe02cbaf | ||
|
|
bed061426d | ||
|
|
fb2666b560 | ||
|
|
d22840ec12 | ||
|
|
e34092fdf1 | ||
|
|
47cf82b461 | ||
|
|
1eed0e6ebc | ||
|
|
c5b7697bbb | ||
|
|
5945c2f849 | ||
|
|
fa2923436b | ||
|
|
310d42144b | ||
|
|
85002bf34a | ||
|
|
22b06e9685 | ||
|
|
b7c036bce3 | ||
|
|
92323d1fb0 | ||
|
|
0fb356a385 | ||
|
|
44dea3f9a9 | ||
|
|
14af86e41b | ||
|
|
03f7c8c304 | ||
|
|
c686014c1b | ||
|
|
0788a69514 | ||
|
|
daf01d61ff | ||
|
|
82ae74d7bd | ||
|
|
8cec7bd40b | ||
|
|
b385e0723b | ||
|
|
aa73d688e7 | ||
|
|
bb9f92b9b1 | ||
|
|
c104b6f93e | ||
|
|
7391c4d5ac | ||
|
|
cff501187c | ||
|
|
7c332bdc98 | ||
|
|
a4f9a5ff92 | ||
|
|
b5a2114d76 | ||
|
|
a8905e8ae8 | ||
|
|
813c16222f | ||
|
|
3f3e7326b7 | ||
|
|
095accd14b | ||
|
|
5036166022 | ||
|
|
cd0f6eec7b | ||
|
|
3f9634e550 | ||
|
|
583e5b645c | ||
|
|
aa7bcb99df | ||
|
|
95ef1a54cf | ||
|
|
46546fc577 | ||
|
|
3476e0ef42 | ||
|
|
96f33fed86 | ||
|
|
dc5a311a1e | ||
|
|
c53b4e67e4 | ||
|
|
f7457fb231 | ||
|
|
e2f27a8c53 | ||
|
|
ef9d8cd510 | ||
|
|
f7bf6c31f3 | ||
|
|
bdc4add8ca | ||
|
|
e9e46c9a0c | ||
|
|
0e90dee8e8 | ||
|
|
e0aacf2433 | ||
|
|
3c0003c3c3 | ||
|
|
adb7d667fc | ||
|
|
7cd0df84f1 | ||
|
|
02adbb932d | ||
|
|
9fb0fd4f35 | ||
|
|
bd69257a77 | ||
|
|
178c276419 | ||
|
|
eadfad244e | ||
|
|
9f73ebd49b | ||
|
|
965fa82940 | ||
|
|
d417ddc4e4 | ||
|
|
f97ec54645 | ||
|
|
b2d7470c15 | ||
|
|
b75e66135f | ||
|
|
141e2a7816 | ||
|
|
1dd70ebd58 | ||
|
|
c796a107b6 | ||
|
|
43168646d8 | ||
|
|
e7b8fd08c5 | ||
|
|
17f9fd29d3 | ||
|
|
dc2a6c8b0e | ||
|
|
f25a2ba6b8 | ||
|
|
a6393224c4 | ||
|
|
db99fbe83f | ||
|
|
b24ca7cd89 | ||
|
|
63314aa43c | ||
|
|
c1b00fffdf | ||
|
|
f93e89ef90 | ||
|
|
c4b456d347 | ||
|
|
5fe67f3911 | ||
|
|
7f63a64fa0 | ||
|
|
b04b5990df | ||
|
|
88d2f3022e | ||
|
|
86eb23bc8f | ||
|
|
eec3bb75e9 | ||
|
|
e0810df35e | ||
|
|
65a6b30b47 | ||
|
|
6aff01075d | ||
|
|
5e013e56f0 | ||
|
|
d1989e2e1d | ||
|
|
1a25e72cf6 | ||
|
|
a59a9826fd | ||
|
|
1a40f80c98 | ||
|
|
e343549ca9 | ||
|
|
45fbd9a23f | ||
|
|
ab1440bd4e | ||
|
|
cdeb832472 | ||
|
|
8528c879e3 | ||
|
|
17fca5734b | ||
|
|
d178788e71 | ||
|
|
fe4c3e7e67 | ||
|
|
ec2dd17919 | ||
|
|
872dac835c | ||
|
|
90ec4b7f6c | ||
|
|
f32555dd93 | ||
|
|
386497990a | ||
|
|
aeace7f71c | ||
|
|
4eafa17565 | ||
|
|
daaa64bd90 | ||
|
|
d0d2daa661 | ||
|
|
b193e10034 | ||
|
|
a0f8f3acf1 | ||
|
|
284df0e263 | ||
|
|
740201f3ab | ||
|
|
a7e03923fa | ||
|
|
25fc51a879 | ||
|
|
88017d47a9 | ||
|
|
fa7d914e6c | ||
|
|
cbe57a487b | ||
|
|
21aecce0f9 | ||
|
|
25092d2922 | ||
|
|
794515225f | ||
|
|
78b7d77bcd | ||
|
|
cc2fa5ec1e | ||
|
|
b49fe8792a | ||
|
|
5351da81e0 | ||
|
|
c9d586ea17 | ||
|
|
3f72974141 | ||
|
|
8ca86b3a03 | ||
|
|
aa1af9bbda | ||
|
|
ac4fea7998 | ||
|
|
87206f2cf1 | ||
|
|
fe22b071dc | ||
|
|
fa8058da9e | ||
|
|
9d21381bac | ||
|
|
07aec23c00 | ||
|
|
67ab83538f | ||
|
|
ba44ca6d1a | ||
|
|
bbdd6305db | ||
|
|
8573d302fc | ||
|
|
d70dbab77a | ||
|
|
51a4c3e3b0 | ||
|
|
92c8f58d97 | ||
|
|
b7d17a492f | ||
|
|
a3d566d442 | ||
|
|
c86c39abef | ||
|
|
2081f50307 | ||
|
|
66eae7974d | ||
|
|
28af3d867c | ||
|
|
4e13e84e56 | ||
|
|
b624c94856 | ||
|
|
04e80baa32 | ||
|
|
b2e2e9b07d | ||
|
|
bc1cf01cf2 | ||
|
|
a936af564c | ||
|
|
5121223465 | ||
|
|
a21eec9ec5 | ||
|
|
e3734b84cf | ||
|
|
f9d4005539 | ||
|
|
dbc56d8f0b | ||
|
|
a79b8a1584 | ||
|
|
48f39bb4df | ||
|
|
053cfcddf1 | ||
|
|
93cd84df63 | ||
|
|
f4b1fa4f3c | ||
|
|
49818a594a | ||
|
|
9277a306a7 | ||
|
|
d5e2a158e1 | ||
|
|
18866643f7 | ||
|
|
ca53deb88f | ||
|
|
d4c4b8e1a0 | ||
|
|
47043f959f | ||
|
|
73a04e69b7 | ||
|
|
a321606813 | ||
|
|
389b31cd71 | ||
|
|
21026747df | ||
|
|
59624ca858 | ||
|
|
1f44478c26 | ||
|
|
eeada7b1da | ||
|
|
132867de71 | ||
|
|
de73de1748 | ||
|
|
1865baa72c | ||
|
|
ce7d92a9f2 | ||
|
|
52eab6562d | ||
|
|
98b23b9519 | ||
|
|
0467a5ddf0 | ||
|
|
16cc9f03a0 | ||
|
|
3152aecbc6 | ||
|
|
c506fc3056 | ||
|
|
aa42823871 | ||
|
|
efe0cddae8 | ||
|
|
f75835bdad | ||
|
|
2cd5ce6cdb | ||
|
|
c962563095 | ||
|
|
be00894104 | ||
|
|
1a78d573c7 | ||
|
|
db8ff59f61 | ||
|
|
91bf46b188 | ||
|
|
a7b1d6933b | ||
|
|
31df9ad845 | ||
|
|
07f392ebef | ||
|
|
c3578acfbb | ||
|
|
9efd73ec66 | ||
|
|
4985ddaa7a | ||
|
|
8c3635ff24 | ||
|
|
74a35e6985 | ||
|
|
40f1c0007c | ||
|
|
e75fdee420 | ||
|
|
33028f4c0b | ||
|
|
33871a10a8 | ||
|
|
8990963a7f | ||
|
|
daae8f9e6d | ||
|
|
6a7fb94bfb | ||
|
|
ff99babdfe | ||
|
|
30d6b1b290 | ||
|
|
6ccd0b31c1 | ||
|
|
23c9cc0490 | ||
|
|
ce50dbd746 | ||
|
|
d975e8d59c | ||
|
|
e73ba5e8ca | ||
|
|
92750e4c60 | ||
|
|
0ec45a682c | ||
|
|
320abd4348 | ||
|
|
d7a6506e30 | ||
|
|
8fe05def12 | ||
|
|
524e2766d8 | ||
|
|
cc19857a2a | ||
|
|
ef8810e9f3 | ||
|
|
e9dabdfad8 | ||
|
|
f6df57d216 | ||
|
|
d745dda77e | ||
|
|
e744219bb6 | ||
|
|
e5a2dd7b55 | ||
|
|
5dd6f58789 | ||
|
|
2f1071d57e | ||
|
|
46ecfc49b6 | ||
|
|
ea811130ea | ||
|
|
d2789cf0b8 | ||
|
|
a9c94590dd | ||
|
|
84cfe81b1d | ||
|
|
21344ef620 | ||
|
|
3f2b4d1a81 | ||
|
|
3dac5878ec | ||
|
|
5341c0fbfc | ||
|
|
fc3ff2a2ad | ||
|
|
81455e8e7a | ||
|
|
efd4f11754 | ||
|
|
e11645f434 | ||
|
|
774683685f | ||
|
|
f6b58fe538 | ||
|
|
19ce697dfd | ||
|
|
73b5d90fe2 | ||
|
|
cb758e96cc | ||
|
|
3188131f72 | ||
|
|
e42b251403 | ||
|
|
83e1a1a137 | ||
|
|
1d5a880fe4 | ||
|
|
6e4146c41e | ||
|
|
99fcda8a7b | ||
|
|
73bf57e2c8 | ||
|
|
7f8c105f61 | ||
|
|
396d4091e7 | ||
|
|
19e29ee1a9 | ||
|
|
74a2742144 | ||
|
|
b46d4213d5 | ||
|
|
e114c3cc54 | ||
|
|
f9b7d78007 | ||
|
|
ca9c260868 | ||
|
|
5d983f5fc2 | ||
|
|
3056d3e752 | ||
|
|
e230377407 | ||
|
|
f42e3a2f67 | ||
|
|
be174e5ef3 | ||
|
|
0789b67232 | ||
|
|
005a9c32df | ||
|
|
ff2b3cd928 | ||
|
|
4fc40ff8f3 | ||
|
|
be42d97a79 | ||
|
|
99373ce472 | ||
|
|
5aec2afe2f | ||
|
|
6c69e691ca | ||
|
|
43c918828d | ||
|
|
4eb8b75659 | ||
|
|
df6da5a52d | ||
|
|
21aecde5f6 | ||
|
|
f1a19118e5 | ||
|
|
958bfd2067 | ||
|
|
b7b78edb1c | ||
|
|
28d468d6f2 | ||
|
|
d55ffb0249 | ||
|
|
b5ea6ce03a | ||
|
|
cc0e476fe8 | ||
|
|
c5dbdc3357 | ||
|
|
3f078c0fca | ||
|
|
66a93674b2 | ||
|
|
0d5b9c9031 | ||
|
|
c9f0c1346e | ||
|
|
cfe1288b8d | ||
|
|
e42b99698c | ||
|
|
cf94fd6209 | ||
|
|
f81ef4b580 | ||
|
|
af18fdb4df | ||
|
|
08bcec5020 | ||
|
|
7782b8a62f | ||
|
|
e661c180ea | ||
|
|
1c22ca9a69 | ||
|
|
d44892fed9 | ||
|
|
5fdbaed168 | ||
|
|
18288f17ac | ||
|
|
4250985ae8 | ||
|
|
ec5010a3eb | ||
|
|
bc1369732f | ||
|
|
7d8848f363 | ||
|
|
ed12a00309 | ||
|
|
6a0db4492c | ||
|
|
ccd86b215f | ||
|
|
822b726b33 | ||
|
|
115c2cc180 | ||
|
|
fc524edf65 | ||
|
|
53d3e4e3df | ||
|
|
c821711f69 | ||
|
|
6a0debbd91 | ||
|
|
f41e08dbcd | ||
|
|
77529e0fe2 | ||
|
|
b879aa7b47 | ||
|
|
8eb8284d2d | ||
|
|
08dad2dcf9 | ||
|
|
6c724b85b4 | ||
|
|
25239370fd | ||
|
|
6c0314d638 | ||
|
|
600dc5f153 | ||
|
|
17334a6b6a | ||
|
|
7d462559da | ||
|
|
b78d6c32e3 | ||
|
|
34f71cb866 | ||
|
|
4542e71b8b | ||
|
|
09fd6d8293 | ||
|
|
d0d4b8a063 | ||
|
|
22099030ad | ||
|
|
4a9950ecb0 | ||
|
|
adcc602041 | ||
|
|
a45289370a | ||
|
|
ca3a74469a | ||
|
|
f8e98fee04 | ||
|
|
055b36b6a6 | ||
|
|
f7ff879bd2 | ||
|
|
c63d87b5e6 | ||
|
|
4d7219f90b | ||
|
|
01323d49bf | ||
|
|
5e3b8dcbb5 | ||
|
|
535714bdcf | ||
|
|
3e4f356646 | ||
|
|
4dedb13f51 | ||
|
|
f8861eaf9f | ||
|
|
86065b0ad6 | ||
|
|
c6f1e92f0b | ||
|
|
f797ec85a0 | ||
|
|
033d0b4b0b | ||
|
|
21d1b9a029 | ||
|
|
10ca8645cc | ||
|
|
a4c3ed4c8f | ||
|
|
0b716507a1 | ||
|
|
00c05e22f1 | ||
|
|
dadddb7665 | ||
|
|
54ce53cadc | ||
|
|
8912efca03 | ||
|
|
c3fc8394a0 | ||
|
|
45d26abb40 | ||
|
|
971dd2c6d5 | ||
|
|
5c67ea6cd9 | ||
|
|
33a68ac643 | ||
|
|
608b647ad9 | ||
|
|
fc6171d58e | ||
|
|
fd49ceb35c | ||
|
|
7024b3c0c2 | ||
|
|
e3501b1306 | ||
|
|
b40c88a9c2 | ||
|
|
ce96d01c93 | ||
|
|
0f596201dc | ||
|
|
600d5bdbf5 | ||
|
|
64ebd2f4b9 | ||
|
|
74b2fe3e4f | ||
|
|
969b804f2a | ||
|
|
b9f5ebd65c | ||
|
|
258f43b7d7 | ||
|
|
cc1ce5f9b4 | ||
|
|
e77a16ca02 | ||
|
|
d9c48c7b7c | ||
|
|
2f9f40ba35 | ||
|
|
48ff08895d | ||
|
|
03711240c8 | ||
|
|
a31b11bd96 | ||
|
|
e8a5d5d4da | ||
|
|
9e0bee42cd | ||
|
|
39525c22be | ||
|
|
288c757d70 | ||
|
|
0d35da3f2b | ||
|
|
b78c312722 | ||
|
|
473959f052 | ||
|
|
794c8c3375 | ||
|
|
86d08fdb18 | ||
|
|
735abf545c | ||
|
|
140acd3c83 | ||
|
|
7ddffdadea | ||
|
|
4e09245441 | ||
|
|
a2fc392426 | ||
|
|
dfd39dbdea | ||
|
|
3bfa763c48 | ||
|
|
250e475b26 | ||
|
|
592fd0e4d6 | ||
|
|
801a3027be | ||
|
|
c5052c81ab | ||
|
|
8e832f715b | ||
|
|
f0f5575291 | ||
|
|
ecadc4c2c4 | ||
|
|
64498f2538 | ||
|
|
9cc836a27b | ||
|
|
bcfcea0174 | ||
|
|
a40994852d | ||
|
|
265c162a28 | ||
|
|
3d171e951a | ||
|
|
f2c2503eab | ||
|
|
dd77d2be32 | ||
|
|
ab2163d5da | ||
|
|
ce93814031 | ||
|
|
529f58a5d7 | ||
|
|
16cf79e9aa | ||
|
|
39b27f1eaf | ||
|
|
a885261b5d | ||
|
|
7bd29c01f0 | ||
|
|
ac625d8f79 | ||
|
|
e73bb80170 | ||
|
|
e81db8b5fd | ||
|
|
d187a1c3d7 | ||
|
|
91a05f64e6 | ||
|
|
6af96df768 | ||
|
|
4d569e12e3 | ||
|
|
073b57bb8e | ||
|
|
a706f4cc6b | ||
|
|
e7850aa9b5 | ||
|
|
a18f3b98c6 | ||
|
|
3569288126 | ||
|
|
e80fdf7d2e | ||
|
|
c35fc5bd15 |
50
.bzrignore → .gitignore
vendored
50
.bzrignore → .gitignore
vendored
@@ -7,11 +7,14 @@
|
||||
*.1
|
||||
*.8
|
||||
aclocal.m4
|
||||
ahci_test
|
||||
ascii.bitmaps
|
||||
ascii.h
|
||||
autom4te.cache
|
||||
build_env.mk
|
||||
.bzrignore
|
||||
cdboot_test
|
||||
cmp_test
|
||||
config.cache
|
||||
config.guess
|
||||
config.h
|
||||
@@ -21,21 +24,29 @@ config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
core_compress_test
|
||||
DISTLIST
|
||||
docs/*.info
|
||||
docs/stamp-vti
|
||||
docs/version.texi
|
||||
ehci_test
|
||||
*.elf
|
||||
example_grub_script_test
|
||||
example_scripted_test
|
||||
example_unit_test
|
||||
*.exec
|
||||
fddboot_test
|
||||
genkernsyms.sh
|
||||
gensymlist.sh
|
||||
gentrigtables
|
||||
gettext_strings_test
|
||||
grub-bin2h
|
||||
grub-bios-setup
|
||||
grub_cmd_date
|
||||
grub_cmd_echo
|
||||
grub_cmd_regexp
|
||||
grub_cmd_set_date
|
||||
grub_cmd_sleep
|
||||
grub-editenv
|
||||
grub-emu
|
||||
grub_emu_init.c
|
||||
@@ -43,12 +54,14 @@ grub_emu_init.h
|
||||
grub-fstest
|
||||
grub_fstest_init.c
|
||||
grub_fstest_init.h
|
||||
grub_func_test
|
||||
grub-install
|
||||
grub-kbdcomp
|
||||
grub-macho2img
|
||||
grub-menulst2cfg
|
||||
grub-mk*
|
||||
grub-mount
|
||||
grub-ofpathname
|
||||
grub-pe2elf
|
||||
grub-probe
|
||||
grub_probe_init.c
|
||||
@@ -65,15 +78,22 @@ grub_script_continue
|
||||
grub_script_dollar
|
||||
grub_script_echo1
|
||||
grub_script_echo_keywords
|
||||
grub_script_escape_comma
|
||||
grub_script_eval
|
||||
grub_script_expansion
|
||||
grub_script_final_semicolon
|
||||
grub_script_for1
|
||||
grub_script_functions
|
||||
grub_script_gettext
|
||||
grub_script_if
|
||||
grub_script_leading_whitespace
|
||||
grub_script_no_commands
|
||||
grub_script_not
|
||||
grub_script_return
|
||||
grub_script_setparams
|
||||
grub_script_shift
|
||||
grub_script_strcmp
|
||||
grub_script_test
|
||||
grub_script_vars1
|
||||
grub_script_while1
|
||||
grub_script.tab.c
|
||||
@@ -86,6 +106,10 @@ grub_setup_init.c
|
||||
grub_setup_init.h
|
||||
grub-shell
|
||||
grub-shell-tester
|
||||
grub-sparc64-setup
|
||||
gzcompress_test
|
||||
hddboot_test
|
||||
help_test
|
||||
*.img
|
||||
*.image
|
||||
include/grub/cpu
|
||||
@@ -93,27 +117,39 @@ include/grub/machine
|
||||
install-sh
|
||||
lib/libgcrypt-grub
|
||||
libgrub_a_init.c
|
||||
*.log
|
||||
*.lst
|
||||
lzocompress_test
|
||||
*.marker
|
||||
Makefile
|
||||
*.mod
|
||||
mod-*.c
|
||||
missing
|
||||
netboot_test
|
||||
*.o
|
||||
ohci_test
|
||||
partmap_test
|
||||
pata_test
|
||||
*.pf2
|
||||
*.pp
|
||||
po/*.mo
|
||||
po/grub.pot
|
||||
po/POTFILES
|
||||
po/stamp-po
|
||||
printf_test
|
||||
priority_queue_unit_test
|
||||
pseries_test
|
||||
stamp-h
|
||||
stamp-h1
|
||||
stamp-h.in
|
||||
symlist.c
|
||||
symlist.h
|
||||
trigtables.c
|
||||
*.trs
|
||||
uhci_test
|
||||
update-grub_lib
|
||||
unidata.c
|
||||
xzcompress_test
|
||||
Makefile.in
|
||||
GPATH
|
||||
GRTAGS
|
||||
@@ -131,6 +167,7 @@ grub-core/lib/libgcrypt-grub
|
||||
**/.dirstamp
|
||||
Makefile.util.am
|
||||
contrib
|
||||
grub-core/bootinfo.txt
|
||||
grub-core/Makefile.core.am
|
||||
grub-core/Makefile.gcry.def
|
||||
grub-core/contrib
|
||||
@@ -138,6 +175,7 @@ grub-core/gdb_grub
|
||||
grub-core/genmod.sh
|
||||
grub-core/gensyminfo.sh
|
||||
grub-core/gmodule.pl
|
||||
grub-core/grub.chrp
|
||||
grub-core/modinfo.sh
|
||||
grub-core/*.module
|
||||
grub-core/*.pp
|
||||
@@ -147,6 +185,7 @@ grub-core/gnulib/arg-nonnull.h
|
||||
grub-core/gnulib/c++defs.h
|
||||
grub-core/gnulib/charset.alias
|
||||
grub-core/gnulib/configmake.h
|
||||
grub-core/gnulib/float.h
|
||||
grub-core/gnulib/getopt.h
|
||||
grub-core/gnulib/langinfo.h
|
||||
grub-core/gnulib/ref-add.sed
|
||||
@@ -169,3 +208,14 @@ Makefile.utilgcry.def
|
||||
po/*.po
|
||||
po/*.gmo
|
||||
po/LINGUAS
|
||||
po/remove-potcdate.sed
|
||||
include/grub/gcrypt/gcrypt.h
|
||||
include/grub/gcrypt/g10lib.h
|
||||
po/POTFILES.in
|
||||
po/POTFILES-shell.in
|
||||
grub-glue-efi
|
||||
grub-render-label
|
||||
grub-core/gnulib/locale.h
|
||||
grub-core/gnulib/unitypes.h
|
||||
grub-core/gnulib/uniwidth.h
|
||||
build-aux/test-driver
|
||||
107
INSTALL
107
INSTALL
@@ -23,11 +23,11 @@ On GNU/Linux, you also need:
|
||||
|
||||
* libdevmapper 1.02.34 or later (recommended)
|
||||
|
||||
To build grub-emu, you need:
|
||||
For optional grub-emu features, you need:
|
||||
|
||||
* ncurses
|
||||
* libusb (recommended)
|
||||
* SDL (recommended)
|
||||
* libpciaccess (optional)
|
||||
* libusb (optional)
|
||||
|
||||
To build GRUB's graphical terminal (gfxterm), you need:
|
||||
|
||||
@@ -45,6 +45,7 @@ need the following.
|
||||
Prerequisites for make-check:
|
||||
|
||||
* qemu, specifically the binary 'qemu-system-i386'
|
||||
* xorriso 1.2.9 or later, for grub-mkrescue and grub-shell
|
||||
|
||||
Configuring the GRUB
|
||||
====================
|
||||
@@ -75,9 +76,14 @@ Building the GRUB
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code. If
|
||||
you don't use a release tarball you have to type `./autogen.sh'.
|
||||
Type `./configure' to configure the package for your system.
|
||||
1. `cd' to the directory containing the package's source code.
|
||||
|
||||
2. Skip this and following step if you use release tarball and proceed to
|
||||
step 4. If you want translations type `./linguas.sh'.
|
||||
|
||||
3. Type `./autogen.sh'.
|
||||
|
||||
4. Type `./configure' to configure the package for your system.
|
||||
If you're using `csh' on an old version of System V, you might
|
||||
need to type `sh ./configure' instead to prevent `csh' from trying
|
||||
to execute `configure' itself.
|
||||
@@ -85,15 +91,15 @@ The simplest way to compile this package is:
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
6. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
7. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
8. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
9. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
@@ -102,6 +108,87 @@ The simplest way to compile this package is:
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Cross-compiling the GRUB
|
||||
========================
|
||||
|
||||
GRUB defines 3 platforms:
|
||||
|
||||
- "Build" is the one which build systems runs on.
|
||||
- "Host" is where you execute GRUB utils.
|
||||
- "Target" is where GRUB itself runs.
|
||||
|
||||
For grub-emu host and target must be the same but may differ from build.
|
||||
|
||||
If build and host are different make check isn't available.
|
||||
|
||||
If build and host are different man pages are not generated.
|
||||
|
||||
As an example imagine you have a build system running on FreeBSD on sparc
|
||||
which prepares packages for developpers running amd64 GNU/Linux laptop and
|
||||
they need to make images for ARM board running U-boot. In this case:
|
||||
|
||||
build=sparc64-freebsd
|
||||
host=amd64-linux-gnu
|
||||
target=arm-uboot
|
||||
|
||||
For this example the configure line might look like (more details below)
|
||||
(some options are optional and included here for completeness but some rarely
|
||||
used options are omited):
|
||||
|
||||
./configure BUILD_CC=gcc BUILD_FREETYPE=freetype-config --host=amd64-linux-gnu
|
||||
CC=amd64-linux-gnu-gcc CFLAGS="-g -O2" FREETYPE=amd64-linux-gnu-freetype-config
|
||||
--target=arm --with-platform=uboot TARGET_CC=arm-elf-gcc
|
||||
TARGET_CFLAGS="-Os -march=armv6" TARGET_CCASFLAGS="-march=armv6"
|
||||
TARGET_OBJCOPY="arm-elf-objcopy" TARGET_STRIP="arm-elf-strip"
|
||||
TARGET_NM=arm-elf-nm TARGET_RANLIB=arm-elf-ranlib LEX=gflex
|
||||
|
||||
You need to use following options to specify tools and platforms. For minimum
|
||||
version look at prerequisites. All tools not mentioned in this section under
|
||||
corresponding platform are not needed for the platform in question.
|
||||
|
||||
- For build
|
||||
1. BUILD_CC= to gcc able to compile for build. This is used, for
|
||||
example, to compile build-gentrigtables which is then run to
|
||||
generate sin and cos tables.
|
||||
2. BUILD_CFLAGS= for C options for build.
|
||||
3. BUILD_CPPFLAGS= for C preprocessor options for build.
|
||||
4. BUILD_FREETYPE= for freetype-config for build (optional).
|
||||
|
||||
- For host
|
||||
1. --host= to autoconf name of host.
|
||||
2. CC= for gcc able to compile for host
|
||||
3. CFLAGS= for C options for host.
|
||||
4. CPPFLAGS= for C preprocessor options for host.
|
||||
5. LDFLAGS= for linker options for host.
|
||||
6. FREETYPE= for freetype-config for host (optional).
|
||||
7. Libdevmapper if any must be in standard linker folders (-ldevmapper) (optional).
|
||||
8. Libfuse if any must be in standard linker folders (-lfuse) (optional).
|
||||
9. Libzfs if any must be in standard linker folders (-lzfs) (optional).
|
||||
10. Liblzma if any must be in standard linker folders (-llzma) (optional).
|
||||
|
||||
- For target
|
||||
1. --target= to autoconf cpu name of target.
|
||||
2. --with-platform to choose firmware.
|
||||
3. TARGET_CC= for gcc able to compile for target
|
||||
4. TARGET_CFLAGS= for C options for target.
|
||||
5. TARGET_CPPFLAGS= for C preprocessor options for target.
|
||||
6. TARGET_CCASFLAGS= for assembler options for target.
|
||||
7. TARGET_LDFLAGS= for linker options for target.
|
||||
8. TARGET_OBJCOPY= for objcopy for target.
|
||||
9. TARGET_STRIP= for strip for target.
|
||||
10. TARGET_NM= for nm for target.
|
||||
11. TARGET_RANLIB= for ranlib for target.
|
||||
|
||||
- Additionally for emu, for host and target.
|
||||
1. SDL is looked for in stadard linker directories (-lSDL) (optional)
|
||||
2. libpciaccess is looked for in stadard linker directories (-lpciaccess) (optional)
|
||||
3. libusb is looked for in stadard linker directories (-lusb) (optional)
|
||||
|
||||
- Platform-agnostic tools and data.
|
||||
1. make is the tool you execute after ./configure.
|
||||
2. Bison is specified in YACC= variable
|
||||
3. Flex is specified in LEX= variable
|
||||
4. GNU unifont and Djvu sans are looked for in standard directories.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
148
Makefile.am
148
Makefile.am
@@ -60,26 +60,33 @@ grub_fstest_init.c: grub_fstest_init.lst $(top_srcdir)/geninit.sh
|
||||
sh $(top_srcdir)/geninit.sh `cat $<` > $@ || (rm -f $@; exit 1)
|
||||
CLEANFILES += grub_fstest_init.c
|
||||
|
||||
if COND_GRUB_MKFONT
|
||||
if COND_HAVE_FONT_SOURCE
|
||||
pkgdata_DATA += unicode.pf2 ascii.pf2 euro.pf2 ascii.h widthspec.h
|
||||
endif
|
||||
endif
|
||||
|
||||
starfield_theme_files = $(srcdir)/themes/starfield/blob_w.png $(srcdir)/themes/starfield/boot_menu_c.png $(srcdir)/themes/starfield/boot_menu_e.png $(srcdir)/themes/starfield/boot_menu_ne.png $(srcdir)/themes/starfield/boot_menu_n.png $(srcdir)/themes/starfield/boot_menu_nw.png $(srcdir)/themes/starfield/boot_menu_se.png $(srcdir)/themes/starfield/boot_menu_s.png $(srcdir)/themes/starfield/boot_menu_sw.png $(srcdir)/themes/starfield/boot_menu_w.png $(srcdir)/themes/starfield/slider_c.png $(srcdir)/themes/starfield/slider_n.png $(srcdir)/themes/starfield/slider_s.png $(srcdir)/themes/starfield/starfield.png $(srcdir)/themes/starfield/terminal_box_c.png $(srcdir)/themes/starfield/terminal_box_e.png $(srcdir)/themes/starfield/terminal_box_ne.png $(srcdir)/themes/starfield/terminal_box_n.png $(srcdir)/themes/starfield/terminal_box_nw.png $(srcdir)/themes/starfield/terminal_box_se.png $(srcdir)/themes/starfield/terminal_box_s.png $(srcdir)/themes/starfield/terminal_box_sw.png $(srcdir)/themes/starfield/terminal_box_w.png $(srcdir)/themes/starfield/theme.txt $(srcdir)/themes/starfield/README $(srcdir)/themes/starfield/COPYING.CC-BY-SA-3.0
|
||||
|
||||
build-grub-mkfont: util/grub-mkfont.c grub-core/unidata.c grub-core/kern/emu/misc.c util/misc.c
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-mkfont\" $^ $(build_freetype_cflags) $(build_freetype_libs)
|
||||
|
||||
build-grub-gen-asciih: util/grub-gen-asciih.c
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
||||
|
||||
build-grub-gen-widthspec: util/grub-gen-widthspec.c
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_MKFONT=1 -DGRUB_BUILD=1 -DGRUB_UTIL=1 $^ $(build_freetype_cflags) $(build_freetype_libs) -Wall -Werror
|
||||
|
||||
if COND_STARFIELD
|
||||
starfield_DATA = dejavu_10.pf2 dejavu_12.pf2 dejavu_bold_14.pf2 dejavu_14.pf2 dejavu_16.pf2 $(starfield_theme_files)
|
||||
dejavu_10.pf2: $(DJVU_FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_12.pf2: $(DJVU_FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_14.pf2: $(DJVU_FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_16.pf2: $(DJVU_FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_10.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -s 10 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_12.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -s 12 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -s 14 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_bold_14.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -b -s 14 -o $@ $(DJVU_FONT_SOURCE)
|
||||
dejavu_16.pf2: $(DJVU_FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -s 16 -o $@ $(DJVU_FONT_SOURCE)
|
||||
else
|
||||
starfield_DATA =
|
||||
endif
|
||||
@@ -87,36 +94,28 @@ endif
|
||||
EXTRA_DIST += $(starfield_theme_files)
|
||||
EXTRA_DIST += $(srcdir)/themes/starfield/src/slider_s.xcf $(srcdir)/themes/starfield/src/slider_n.xcf $(srcdir)/themes/starfield/src/slider_c.xcf $(srcdir)/themes/starfield/src/blob_nw.xcf $(srcdir)/themes/starfield/src/bootmenu/center.xcf $(srcdir)/themes/starfield/src/bootmenu/corner.xcf $(srcdir)/themes/starfield/src/bootmenu/side.xcf $(srcdir)/themes/starfield/src/terminalbox/side.xcf $(srcdir)/themes/starfield/src/terminalbox/corner.xcf $(srcdir)/themes/starfield/src/terminalbox/center.xcf
|
||||
|
||||
unicode.pf2: $(FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -o $@ $(FONT_SOURCE)
|
||||
unicode.pf2: $(FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -o $@ $(FONT_SOURCE)
|
||||
CLEANFILES += unicode.pf2
|
||||
|
||||
# Arrows and lines are needed to draw the menu, so always include them
|
||||
UNICODE_ARROWS=0x2190-0x2193
|
||||
UNICODE_LINES=0x2501-0x251B
|
||||
|
||||
ascii.pf2: $(FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
|
||||
ascii.pf2: $(FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES)
|
||||
CLEANFILES += ascii.pf2
|
||||
|
||||
euro.pf2: $(FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES)
|
||||
euro.pf2: $(FONT_SOURCE) build-grub-mkfont
|
||||
./build-grub-mkfont -o $@ $(FONT_SOURCE) -r 0x0-0x4ff,0x1e00-0x1fff,$(UNICODE_ARROWS),$(UNICODE_LINES)
|
||||
CLEANFILES += euro.pf2
|
||||
|
||||
ascii.bitmaps: $(FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont --ascii-bitmaps -o $@ $(FONT_SOURCE)
|
||||
CLEANFILES += ascii.bitmaps
|
||||
ascii.h: $(FONT_SOURCE) build-grub-gen-asciih
|
||||
./build-grub-gen-asciih $(FONT_SOURCE) $@
|
||||
CLEANFILES += ascii.h
|
||||
|
||||
ascii.h: ascii.bitmaps grub-bin2h
|
||||
$(builddir)/grub-bin2h ascii_bitmaps < $< > $@
|
||||
CLEANFILES += ascii.h $(top_builddir)/grub-core/include/ascii.h
|
||||
|
||||
widthspec.bin: $(FONT_SOURCE) grub-mkfont
|
||||
$(builddir)/grub-mkfont --width-spec -o $@ $(FONT_SOURCE)
|
||||
CLEANFILES += widthspec.bin
|
||||
|
||||
widthspec.h: widthspec.bin grub-bin2h
|
||||
$(builddir)/grub-bin2h widthspec < $< > $@
|
||||
widthspec.h: $(FONT_SOURCE) build-grub-gen-widthspec
|
||||
./build-grub-gen-widthspec $(FONT_SOURCE) $@
|
||||
CLEANFILES += widthspec.h
|
||||
|
||||
# Install config.h into platformdir
|
||||
@@ -153,10 +152,10 @@ if COND_x86_64_efi
|
||||
QEMU32=qemu-system-x86_64
|
||||
endif
|
||||
|
||||
linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S
|
||||
linux.init.x86_64: $(srcdir)/grub-core/tests/boot/linux.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S
|
||||
linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux.init.mips: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
@@ -171,46 +170,46 @@ linux.init.mipsel: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
linux.init.loongson: $(srcdir)/grub-core/tests/boot/linux.init-mips.S
|
||||
$(TARGET_CC) -o $@ $< -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -DREBOOT=1
|
||||
|
||||
multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
multiboot.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
kfreebsd.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include
|
||||
|
||||
kfreebsd.aout: kfreebsd.elf
|
||||
$(OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id -R .note.gnu.gold-version
|
||||
$(TARGET_OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id -R .note.gnu.gold-version
|
||||
|
||||
pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
|
||||
pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x7c00 -m32
|
||||
|
||||
pc-chainloader.bin: pc-chainloader.elf
|
||||
$(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
$(TARGET_OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S
|
||||
ntldr.elf: $(srcdir)/grub-core/tests/boot/kernel-8086.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0 -m32
|
||||
|
||||
ntldr.bin: ntldr.elf
|
||||
$(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
$(TARGET_OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@;
|
||||
|
||||
multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S
|
||||
multiboot2.elf: $(srcdir)/grub-core/tests/boot/kernel-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,--build-id=none -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1
|
||||
|
||||
kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S
|
||||
kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S
|
||||
kfreebsd.init.i386: $(srcdir)/grub-core/tests/boot/kfreebsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@
|
||||
|
||||
knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
|
||||
knetbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_NETBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S
|
||||
kopenbsd.init.i386: $(srcdir)/grub-core/tests/boot/kbsd.init-i386.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DTARGET_OPENBSD=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
|
||||
knetbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_NETBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S
|
||||
kopenbsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kbsd.init-x86_64.S $(srcdir)/grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
$(TARGET_CC) -o $@ $< -m64 -DTARGET_OPENBSD=1 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\"
|
||||
|
||||
linux-initramfs.mips: linux.init.mips Makefile
|
||||
@@ -244,7 +243,7 @@ kopenbsd.image.x86_64: kopenbsd.init.x86_64 $(srcdir)/grub-core/tests/boot/kopen
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 128k -f 10 -o minfree=0,version=1 $@ $$TDIR && bsdlabel -f -R $@ $(srcdir)/grub-core/tests/boot/kopenbsdlabel.txt && rm -rf $$TDIR || rm -f $@
|
||||
|
||||
knetbsd.miniroot-image.i386.img: knetbsd.image.i386 $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386
|
||||
$(OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386 $@
|
||||
$(TARGET_OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.i386 $@
|
||||
|
||||
kfreebsd-mfsroot.x86_64.img: kfreebsd.init.x86_64 Makefile
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -t ffs -s 30m -f 1000 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR
|
||||
@@ -253,7 +252,7 @@ knetbsd.image.x86_64: knetbsd.init.x86_64 $(srcdir)/grub-core/tests/boot/kbsd.sp
|
||||
TDIR=`mktemp -d "$${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` && mkdir $$TDIR/dev && mkdir $$TDIR/sbin && cp $< $$TDIR/sbin/init && makefs -F $(srcdir)/grub-core/tests/boot/kbsd.spec.txt -t ffs -s 64k -f 10 -o minfree=0,version=1 $@ $$TDIR && rm -rf $$TDIR
|
||||
|
||||
knetbsd.miniroot-image.x86_64.img: knetbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.x86_64
|
||||
$(OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 $@
|
||||
$(TARGET_OBJCOPY) --add-section=miniroot=$< $(GRUB_PAYLOADS_DIR)/knetbsd.miniroot.x86_64 $@
|
||||
|
||||
CLEANFILES += linux.init.i386 kfreebsd.init.i386 linux.init.x86_64 linux-initramfs.i386 linux-initramfs.x86_64
|
||||
|
||||
@@ -261,70 +260,70 @@ kfreebsd-mfsroot.i386.gz: kfreebsd-mfsroot.i386.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-kfreebsd-i386: kfreebsd-mfsroot.i386.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.i386 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/mfsroot.gz=kfreebsd-mfsroot.i386.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.i386 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.i386 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
kfreebsd-mfsroot.x86_64.gz: kfreebsd-mfsroot.x86_64.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-kfreebsd-x86_64: kfreebsd-mfsroot.x86_64.gz $(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 $(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/mfsroot.gz=kfreebsd-mfsroot.x86_64.gz --files=/kfreebsd=$(GRUB_PAYLOADS_DIR)/kfreebsd.x86_64 --files=/kfreebsd_env=$(GRUB_PAYLOADS_DIR)/kfreebsd_env.x86_64 $(srcdir)/grub-core/tests/boot/kfreebsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
knetbsd.miniroot-image.i386.gz: knetbsd.miniroot-image.i386.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-knetbsd-i386: knetbsd.miniroot-image.i386.gz $(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/miniroot.gz=knetbsd.miniroot-image.i386.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.i386 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kopenbsd-i386: kopenbsd.image.i386 $(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ramdisk=kopenbsd.image.i386 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.i386 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kopenbsd-x86_64: kopenbsd.image.x86_64 $(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/ramdisk=kopenbsd.image.x86_64 --files=/kopenbsd=$(GRUB_PAYLOADS_DIR)/kopenbsd.x86_64 $(srcdir)/grub-core/tests/boot/kopenbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
knetbsd.miniroot-image.x86_64.gz: knetbsd.miniroot-image.x86_64.img
|
||||
gzip < $< > $@
|
||||
|
||||
bootcheck-knetbsd-x86_64: knetbsd.miniroot-image.x86_64.gz $(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/miniroot.gz=knetbsd.miniroot-image.x86_64.gz --files=/knetbsd=$(GRUB_PAYLOADS_DIR)/knetbsd.x86_64 $(srcdir)/grub-core/tests/boot/knetbsd.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-mips: linux-initramfs.mips $(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mips --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mips $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-ppc: linux-initramfs.ppc $(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.ppc --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.ppc $(srcdir)/grub-core/tests/boot/linux-ppc.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-mipsel: linux-initramfs.mipsel $(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.mipsel --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.mipsel $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux-loongson: linux-initramfs.loongson $(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --files=/initrd=linux-initramfs.loongson --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.loongson $(srcdir)/grub-core/tests/boot/linux.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux16-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-linux16-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/grub-core/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-multiboot: multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot.elf=multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-multiboot2: multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-kfreebsd-aout: kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-pc-chainloader: pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell
|
||||
timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
./grub-shell --timeout=$(BOOTCHECK_TIMEOUT) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
|
||||
|
||||
if COND_i386_efi
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64 bootcheck-kfreebsd-x86_64 bootcheck-kfreebsd-i386
|
||||
@@ -335,18 +334,17 @@ BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-
|
||||
endif
|
||||
|
||||
if COND_i386_multiboot
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
# FreeBSD requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
if COND_i386_coreboot
|
||||
# 64-bit NetBSD crashes because memory at 0-0x1000 is occupied
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64
|
||||
# Freebsd requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
if COND_i386_qemu
|
||||
# Freebsd crashes because memory at 0-0x1000 is occupied and requires ACPI
|
||||
# FreeBSD requires ACPI
|
||||
BOOTCHECKS = bootcheck-kfreebsd-aout bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 bootcheck-multiboot bootcheck-multiboot2 bootcheck-linux-i386 bootcheck-linux-x86_64 bootcheck-knetbsd-x86_64
|
||||
endif
|
||||
|
||||
@@ -377,7 +375,7 @@ if COND_powerpc_ieee1275
|
||||
BOOTCHECKS = bootcheck-linux-ppc
|
||||
endif
|
||||
|
||||
EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg
|
||||
EXTRA_DIST += grub-core/tests/boot/kbsd.init-i386.S grub-core/tests/boot/kbsd.init-x86_64.S grub-core/tests/boot/kbsd.spec.txt grub-core/tests/boot/kernel-8086.S grub-core/tests/boot/kernel-i386.S grub-core/tests/boot/kfreebsd-aout.cfg grub-core/tests/boot/kfreebsd.cfg grub-core/tests/boot/kfreebsd.init-i386.S grub-core/tests/boot/kfreebsd.init-x86_64.S grub-core/tests/boot/knetbsd.cfg grub-core/tests/boot/kopenbsd.cfg grub-core/tests/boot/kopenbsdlabel.txt grub-core/tests/boot/linux16.cfg grub-core/tests/boot/linux.cfg grub-core/tests/boot/linux.init-i386.S grub-core/tests/boot/linux.init-mips.S grub-core/tests/boot/linux.init-ppc.S grub-core/tests/boot/linux.init-x86_64.S grub-core/tests/boot/linux-ppc.cfg grub-core/tests/boot/multiboot2.cfg grub-core/tests/boot/multiboot.cfg grub-core/tests/boot/ntldr.cfg grub-core/tests/boot/pc-chainloader.cfg grub-core/tests/boot/qemu-shutdown-x86.S
|
||||
|
||||
.PHONY: bootcheck-linux-i386 bootcheck-linux-x86_64 \
|
||||
bootcheck-kfreebsd-i386 bootcheck-kfreebsd-x86_64 \
|
||||
@@ -390,3 +388,5 @@ SUCCESSFUL_BOOT_STRING=3e49994fd5d82b7c9298d672d774080d
|
||||
BOOTCHECK_TIMEOUT=180
|
||||
|
||||
bootcheck: $(BOOTCHECKS)
|
||||
|
||||
EXTRA_DIST += linguas.sh
|
||||
|
||||
@@ -9,9 +9,22 @@ library = {
|
||||
common = grub-core/kern/command.c;
|
||||
common = grub-core/kern/device.c;
|
||||
common = grub-core/kern/disk.c;
|
||||
common = grub-core/lib/disk.c;
|
||||
common = util/getroot.c;
|
||||
common = util/raid.c;
|
||||
common = grub-core/osdep/unix/getroot.c;
|
||||
common = grub-core/osdep/getroot.c;
|
||||
common = grub-core/osdep/devmapper/getroot.c;
|
||||
common = grub-core/osdep/relpath.c;
|
||||
extra_dist = grub-core/osdep/unix/relpath.c;
|
||||
extra_dist = grub-core/osdep/aros/relpath.c;
|
||||
extra_dist = grub-core/osdep/windows/relpath.c;
|
||||
common = grub-core/kern/emu/hostdisk.c;
|
||||
common = grub-core/osdep/devmapper/hostdisk.c;
|
||||
common = grub-core/osdep/hostdisk.c;
|
||||
common = grub-core/osdep/unix/hostdisk.c;
|
||||
common = grub-core/osdep/exec.c;
|
||||
common = grub-core/osdep/sleep.c;
|
||||
common = grub-core/osdep/password.c;
|
||||
common = grub-core/kern/emu/misc.c;
|
||||
common = grub-core/kern/emu/mm.c;
|
||||
common = grub-core/kern/env.c;
|
||||
@@ -32,11 +45,13 @@ library = {
|
||||
common = grub-core/disk/ldm.c;
|
||||
common = grub-core/disk/diskfilter.c;
|
||||
common = grub-core/partmap/gpt.c;
|
||||
common = grub-core/partmap/msdos.c;
|
||||
common = grub-core/fs/proc.c;
|
||||
};
|
||||
|
||||
library = {
|
||||
name = libgrubmods.a;
|
||||
cflags = '$(CFLAGS_POSIX) -Wno-undef -Wno-error=missing-noreturn';
|
||||
cflags = '-fno-builtin -Wno-undef';
|
||||
cppflags = '-I$(top_srcdir)/grub-core/lib/minilzo -I$(srcdir)/grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H';
|
||||
|
||||
common_nodist = grub_script.tab.c;
|
||||
@@ -57,10 +72,24 @@ library = {
|
||||
common = grub-core/disk/mdraid1x_linux.c;
|
||||
common = grub-core/disk/raid5_recover.c;
|
||||
common = grub-core/disk/raid6_recover.c;
|
||||
common = grub-core/font/font.c;
|
||||
common = grub-core/gfxmenu/font.c;
|
||||
common = grub-core/normal/charset.c;
|
||||
common = grub-core/video/fb/fbblit.c;
|
||||
common = grub-core/video/fb/fbutil.c;
|
||||
common = grub-core/video/fb/fbfill.c;
|
||||
common = grub-core/video/fb/video_fb.c;
|
||||
common = grub-core/video/video.c;
|
||||
common = grub-core/video/capture.c;
|
||||
common = grub-core/video/colors.c;
|
||||
common = grub-core/unidata.c;
|
||||
common = grub-core/io/bufio.c;
|
||||
common = grub-core/fs/affs.c;
|
||||
common = grub-core/fs/afs.c;
|
||||
common = grub-core/fs/bfs.c;
|
||||
common = grub-core/fs/btrfs.c;
|
||||
common = grub-core/fs/cbfs.c;
|
||||
common = grub-core/fs/archelp.c;
|
||||
common = grub-core/fs/cpio.c;
|
||||
common = grub-core/fs/cpio_be.c;
|
||||
common = grub-core/fs/odc.c;
|
||||
@@ -71,6 +100,7 @@ library = {
|
||||
common = grub-core/fs/fshelp.c;
|
||||
common = grub-core/fs/hfs.c;
|
||||
common = grub-core/fs/hfsplus.c;
|
||||
common = grub-core/fs/hfspluscomp.c;
|
||||
common = grub-core/fs/iso9660.c;
|
||||
common = grub-core/fs/jfs.c;
|
||||
common = grub-core/fs/minix.c;
|
||||
@@ -90,11 +120,13 @@ library = {
|
||||
common = grub-core/fs/udf.c;
|
||||
common = grub-core/fs/ufs2.c;
|
||||
common = grub-core/fs/ufs.c;
|
||||
common = grub-core/fs/ufs_be.c;
|
||||
common = grub-core/fs/xfs.c;
|
||||
common = grub-core/fs/zfs/zfscrypt.c;
|
||||
common = grub-core/fs/zfs/zfs.c;
|
||||
common = grub-core/fs/zfs/zfsinfo.c;
|
||||
common = grub-core/fs/zfs/zfs_lzjb.c;
|
||||
common = grub-core/fs/zfs/zfs_lz4.c;
|
||||
common = grub-core/fs/zfs/zfs_sha256.c;
|
||||
common = grub-core/fs/zfs/zfs_fletcher.c;
|
||||
common = grub-core/lib/envblk.c;
|
||||
@@ -109,12 +141,12 @@ library = {
|
||||
common = grub-core/partmap/acorn.c;
|
||||
common = grub-core/partmap/amiga.c;
|
||||
common = grub-core/partmap/apple.c;
|
||||
common = grub-core/partmap/msdos.c;
|
||||
common = grub-core/partmap/sun.c;
|
||||
common = grub-core/partmap/plan.c;
|
||||
common = grub-core/partmap/dvh.c;
|
||||
common = grub-core/partmap/sunpc.c;
|
||||
common = grub-core/partmap/bsdlabel.c;
|
||||
common = grub-core/partmap/dfly.c;
|
||||
common = grub-core/script/function.c;
|
||||
common = grub-core/script/lexer.c;
|
||||
common = grub-core/script/main.c;
|
||||
@@ -129,24 +161,17 @@ library = {
|
||||
common = grub-core/lib/xzembed/xz_dec_stream.c;
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-bin2h;
|
||||
common = util/bin2h.c;
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER)';
|
||||
installdir = noinst;
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-mkimage;
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-mkimage.c;
|
||||
common = util/mkimage.c;
|
||||
common = util/resolve.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
common = grub-core/kern/arm/dl_helper.c;
|
||||
|
||||
extra_dist = util/grub-mkimagexx.c;
|
||||
|
||||
@@ -165,6 +190,7 @@ program = {
|
||||
|
||||
common = util/grub-mkrelpath.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -179,6 +205,7 @@ program = {
|
||||
|
||||
common = util/grub-script-check.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -192,6 +219,8 @@ program = {
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-editenv.c;
|
||||
common = util/editenv.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -206,14 +235,14 @@ program = {
|
||||
|
||||
common = util/grub-mkpasswd-pbkdf2.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/random.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
cflags = '$(CFLAGS_GCRY)';
|
||||
cppflags = '$(CPPFLAGS_GCRY)';
|
||||
};
|
||||
|
||||
program = {
|
||||
@@ -223,19 +252,6 @@ program = {
|
||||
condition = COND_APPLE_CC;
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-pe2elf;
|
||||
mansection = 1;
|
||||
common = util/grub-pe2elf.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL)';
|
||||
condition = COND_GRUB_PE2ELF;
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-fstest;
|
||||
mansection = 1;
|
||||
@@ -243,9 +259,7 @@ program = {
|
||||
common = util/grub-fstest.c;
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
|
||||
cflags = '$(CFLAGS_GCRY)';
|
||||
cppflags = '$(CPPFLAGS_GCRY)';
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -261,12 +275,13 @@ program = {
|
||||
common = util/grub-mount.c;
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) -lfuse';
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM) -lfuse';
|
||||
condition = COND_GRUB_MOUNT;
|
||||
};
|
||||
|
||||
@@ -274,10 +289,11 @@ program = {
|
||||
name = grub-mkfont;
|
||||
mansection = 1;
|
||||
common = util/grub-mkfont.c;
|
||||
common = grub-core/unidata.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
cflags = '$(freetype_cflags)';
|
||||
cppflags = '-DGRUB_MKFONT=1';
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -293,8 +309,9 @@ program = {
|
||||
installdir = sbin;
|
||||
mansection = 8;
|
||||
common = util/grub-probe.c;
|
||||
common = util/ieee1275/ofpath.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -308,16 +325,22 @@ program = {
|
||||
installdir = sbin;
|
||||
mansection = 8;
|
||||
common = util/grub-setup.c;
|
||||
common = util/lvm.c;
|
||||
common = util/setup_bios.c;
|
||||
extra_dist = util/setup.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
extra_dist = grub-core/osdep/generic/blocklist.c;
|
||||
extra_dist = grub-core/osdep/linux/blocklist.c;
|
||||
extra_dist = grub-core/osdep/windows/blocklist.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
cppflags = '-DGRUB_SETUP_BIOS=1';
|
||||
cppflags = '-DGRUB_SETUP_FUNC=grub_util_bios_setup';
|
||||
};
|
||||
|
||||
program = {
|
||||
@@ -325,17 +348,19 @@ program = {
|
||||
installdir = sbin;
|
||||
mansection = 8;
|
||||
common = util/grub-setup.c;
|
||||
common = util/lvm.c;
|
||||
common = util/setup_sparc.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = util/ieee1275/ofpath.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
cppflags = '-DGRUB_SETUP_SPARC64=1';
|
||||
cppflags = '-DGRUB_SETUP_FUNC=grub_util_sparc_setup';
|
||||
};
|
||||
|
||||
program = {
|
||||
@@ -343,7 +368,8 @@ program = {
|
||||
installdir = sbin;
|
||||
mansection = 8;
|
||||
common = util/ieee1275/grub-ofpathname.c;
|
||||
common = util/ieee1275/ofpath.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -358,6 +384,7 @@ program = {
|
||||
|
||||
common = util/grub-mklayout.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
@@ -454,26 +481,15 @@ script = {
|
||||
script = {
|
||||
mansection = 1;
|
||||
name = grub-mkrescue;
|
||||
x86 = util/grub-mkrescue.in;
|
||||
mips_qemu_mips = util/grub-mkrescue.in;
|
||||
mips_loongson = util/grub-mkrescue.in;
|
||||
ia64_efi = util/grub-mkrescue.in;
|
||||
powerpc_ieee1275 = util/powerpc/ieee1275/grub-mkrescue.in;
|
||||
enable = i386_pc;
|
||||
enable = i386_efi;
|
||||
enable = x86_64_efi;
|
||||
enable = i386_qemu;
|
||||
enable = i386_multiboot;
|
||||
enable = i386_coreboot;
|
||||
enable = mips_qemu_mips;
|
||||
enable = mips_loongson;
|
||||
enable = ia64_efi;
|
||||
enable = powerpc_ieee1275;
|
||||
common = util/grub-install_header;
|
||||
common = util/grub-mkrescue.in;
|
||||
enable = noemu;
|
||||
};
|
||||
|
||||
script = {
|
||||
mansection = 1;
|
||||
name = grub-mkstandalone;
|
||||
common = util/grub-install_header;
|
||||
common = util/grub-mkstandalone.in;
|
||||
};
|
||||
|
||||
@@ -482,15 +498,17 @@ script = {
|
||||
installdir = sbin;
|
||||
name = grub-install;
|
||||
|
||||
common = util/grub-install_header;
|
||||
common = util/grub-install.in;
|
||||
enable = noemu;
|
||||
};
|
||||
|
||||
script = {
|
||||
mansection = 8;
|
||||
installdir = sbin;
|
||||
mansection = 1;
|
||||
installdir = bin;
|
||||
name = grub-mknetdir;
|
||||
|
||||
common = util/grub-install_header;
|
||||
common = util/grub-mknetdir.in;
|
||||
};
|
||||
|
||||
@@ -545,12 +563,61 @@ script = {
|
||||
common = tests/example_scripted_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = gettext_strings_test;
|
||||
common = tests/gettext_strings_test.in;
|
||||
extra_dist = po/exclude.pot;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = pata_test;
|
||||
common = tests/pata_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ahci_test;
|
||||
common = tests/ahci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = uhci_test;
|
||||
common = tests/uhci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ohci_test;
|
||||
common = tests/ohci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ehci_test;
|
||||
common = tests/ehci_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = example_grub_script_test;
|
||||
common = tests/example_grub_script_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_eval;
|
||||
common = tests/grub_script_eval.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_test;
|
||||
common = tests/grub_script_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_echo1;
|
||||
@@ -665,6 +732,24 @@ script = {
|
||||
common = tests/grub_cmd_regexp.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_date;
|
||||
common = tests/grub_cmd_date.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_set_date;
|
||||
common = tests/grub_cmd_set_date.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_sleep;
|
||||
common = tests/grub_cmd_sleep.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_expansion;
|
||||
@@ -677,30 +762,126 @@ script = {
|
||||
common = tests/grub_script_not.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_no_commands;
|
||||
common = tests/grub_script_no_commands.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = partmap_test;
|
||||
common = tests/partmap_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = hddboot_test;
|
||||
common = tests/hddboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = fddboot_test;
|
||||
common = tests/fddboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = cdboot_test;
|
||||
common = tests/cdboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = netboot_test;
|
||||
common = tests/netboot_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = pseries_test;
|
||||
common = tests/pseries_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = core_compress_test;
|
||||
common = tests/core_compress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = xzcompress_test;
|
||||
common = tests/xzcompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = gzcompress_test;
|
||||
common = tests/gzcompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = lzocompress_test;
|
||||
common = tests/lzocompress_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_echo;
|
||||
common = tests/grub_cmd_echo.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = help_test;
|
||||
common = tests/help_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_gettext;
|
||||
common = tests/grub_script_gettext.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_escape_comma;
|
||||
common = tests/grub_script_escape_comma.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_script_strcmp;
|
||||
common = tests/grub_script_strcmp.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = test_sha512sum;
|
||||
common = tests/test_sha512sum.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = test_unset;
|
||||
common = tests/test_unset.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_func_test;
|
||||
common = tests/grub_func_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = grub_cmd_tr;
|
||||
common = tests/grub_cmd_tr.in;
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = example_unit_test;
|
||||
@@ -731,6 +912,38 @@ program = {
|
||||
ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = date_test;
|
||||
common = tests/date_unit_test.c;
|
||||
common = tests/lib/unit_test.c;
|
||||
common = grub-core/kern/list.c;
|
||||
common = grub-core/kern/misc.c;
|
||||
common = grub-core/tests/lib/test.c;
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = priority_queue_unit_test;
|
||||
common = tests/priority_queue_unit_test.cc;
|
||||
common = tests/lib/unit_test.c;
|
||||
common = grub-core/kern/list.c;
|
||||
common = grub-core/kern/misc.c;
|
||||
common = grub-core/tests/lib/test.c;
|
||||
common = grub-core/lib/priority_queue.c;
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
condition = COND_HAVE_CXX;
|
||||
};
|
||||
|
||||
program = {
|
||||
testcase;
|
||||
name = cmp_test;
|
||||
@@ -752,6 +965,41 @@ program = {
|
||||
common = util/grub-menulst2cfg.c;
|
||||
common = grub-core/lib/legacy_parse.c;
|
||||
common = grub-core/lib/i386/pc/vesa_modes_table.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-glue-efi;
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-glue-efi.c;
|
||||
common = util/glue-efi.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
program = {
|
||||
name = grub-render-label;
|
||||
mansection = 1;
|
||||
|
||||
common = util/grub-render-label.c;
|
||||
common = util/render-label.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
|
||||
2
NEWS
2
NEWS
@@ -1,6 +1,6 @@
|
||||
New in 2.00:
|
||||
|
||||
* Appearence:
|
||||
* Appearance:
|
||||
* Official theme for gfxmenu (starfield)
|
||||
* Menu is organised with submenus.
|
||||
* Better default video mode selection using EDID.
|
||||
|
||||
106
acinclude.m4
106
acinclude.m4
@@ -74,7 +74,7 @@ AC_MSG_RESULT([$grub_cv_asm_uscore])
|
||||
dnl Some versions of `objcopy -O binary' vary their output depending
|
||||
dnl on the link address.
|
||||
AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE],
|
||||
[AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses])
|
||||
[AC_MSG_CHECKING([whether ${TARGET_OBJCOPY} works for absolute addresses])
|
||||
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
|
||||
[cat > conftest.c <<\EOF
|
||||
void cmain (void);
|
||||
@@ -95,9 +95,9 @@ for link_addr in 0x2000 0x8000 0x7C00; do
|
||||
else
|
||||
AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
|
||||
fi
|
||||
if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
|
||||
if AC_TRY_COMMAND([${TARGET_OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
|
||||
else
|
||||
AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
|
||||
AC_MSG_ERROR([${TARGET_OBJCOPY-objcopy} cannot create binary files])
|
||||
fi
|
||||
if test ! -f conftest.old || AC_TRY_COMMAND([cmp -s conftest.old conftest]); then
|
||||
mv -f conftest conftest.old
|
||||
@@ -134,6 +134,54 @@ if test "x$grub_cv_prog_ld_build_id_none" = xyes; then
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Supply -P to nm
|
||||
AC_DEFUN([grub_PROG_NM_MINUS_P],
|
||||
[AC_MSG_CHECKING([whether nm accepts -P])
|
||||
AC_CACHE_VAL(grub_cv_prog_nm_minus_p,
|
||||
[
|
||||
nm_minus_p_tmp_dir="$(mktemp -d "./confXXXXXX")"
|
||||
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])])
|
||||
$TARGET_CC conftest.c -o "$nm_minus_p_tmp_dir/ef"
|
||||
if $TARGET_NM -P "$nm_minus_p_tmp_dir/ef" 2>&1 > /dev/null; then
|
||||
grub_cv_prog_nm_minus_p=yes
|
||||
else
|
||||
grub_cv_prog_nm_minus_p=no
|
||||
fi
|
||||
rm "$nm_minus_p_tmp_dir/ef"
|
||||
])
|
||||
AC_MSG_RESULT([$grub_cv_prog_nm_minus_p])
|
||||
|
||||
if test "x$grub_cv_prog_nm_minus_p" = xyes; then
|
||||
TARGET_NMFLAGS_MINUS_P="-P"
|
||||
else
|
||||
TARGET_NMFLAGS_MINUS_P=
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Supply --defined-only to nm
|
||||
AC_DEFUN([grub_PROG_NM_DEFINED_ONLY],
|
||||
[AC_MSG_CHECKING([whether nm accepts --defined-only])
|
||||
AC_CACHE_VAL(grub_cv_prog_nm_defined_only,
|
||||
[
|
||||
nm_defined_only_tmp_dir="$(mktemp -d "./confXXXXXX")"
|
||||
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])])
|
||||
$TARGET_CC conftest.c -o "$nm_defined_only_tmp_dir/ef"
|
||||
if $TARGET_NM --defined-only "$nm_defined_only_tmp_dir/ef" 2>&1 > /dev/null; then
|
||||
grub_cv_prog_nm_defined_only=yes
|
||||
else
|
||||
grub_cv_prog_nm_defined_only=no
|
||||
fi
|
||||
rm "$nm_defined_only_tmp_dir/ef"
|
||||
])
|
||||
AC_MSG_RESULT([$grub_cv_prog_nm_defined_only])
|
||||
|
||||
if test "x$grub_cv_prog_nm_defined_only" = xyes; then
|
||||
TARGET_NMFLAGS_DEFINED_ONLY=--defined-only
|
||||
else
|
||||
TARGET_NMFLAGS_DEFINED_ONLY=
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl Mass confusion!
|
||||
dnl Older versions of GAS interpret `.code16' to mean ``generate 32-bit
|
||||
@@ -313,32 +361,6 @@ else
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Check if the C compiler generates calls to `__enable_execute_stack()'.
|
||||
AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
|
||||
AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
|
||||
void f (int (*p) (void));
|
||||
void g (int i)
|
||||
{
|
||||
int nestedfunc (void) { return i; }
|
||||
f (nestedfunc);
|
||||
}
|
||||
]])])
|
||||
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -S conftest.c]) && test -s conftest.s; then
|
||||
true
|
||||
else
|
||||
AC_MSG_ERROR([${CC-cc} failed to produce assembly code])
|
||||
fi
|
||||
if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then
|
||||
NEED_ENABLE_EXECUTE_STACK=1
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
NEED_ENABLE_EXECUTE_STACK=0
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
rm -f conftest*
|
||||
])
|
||||
|
||||
|
||||
dnl Check if the C compiler supports `-fstack-protector'.
|
||||
AC_DEFUN([grub_CHECK_STACK_PROTECTOR],[
|
||||
@@ -452,3 +474,29 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
[fi]
|
||||
])
|
||||
|
||||
dnl Create an output variable with the transformed name of a GRUB utility
|
||||
dnl program.
|
||||
AC_DEFUN([grub_TRANSFORM],[dnl
|
||||
AC_SUBST(AS_TR_SH([$1]), [`AS_ECHO([$1]) | sed "$program_transform_name"`])dnl
|
||||
])
|
||||
|
||||
dnl Check if the C compiler supports `-mno-unaligned-access'.
|
||||
AC_DEFUN([grub_CHECK_NO_UNALIGNED_ACCESS],[
|
||||
[# foobar
|
||||
nua_possible=yes]
|
||||
AC_MSG_CHECKING([whether `$CC' supports `-mno-unaligned-access'])
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
]])])
|
||||
|
||||
[if eval "$ac_compile -S -mno-unaligned-access -o conftest.s" 2> /dev/null; then]
|
||||
AC_MSG_RESULT([yes])
|
||||
[rm -f conftest.s
|
||||
else
|
||||
nua_possible=no]
|
||||
AC_MSG_RESULT([no])
|
||||
[fi]
|
||||
])
|
||||
|
||||
20
autogen.sh
20
autogen.sh
@@ -2,10 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
export LC_CTYPE=C
|
||||
export LC_COLLATE=C
|
||||
unset LC_ALL
|
||||
|
||||
find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
|
||||
find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
|
||||
|
||||
autogen --version >/dev/null || exit 1
|
||||
|
||||
echo "Importing unicode..."
|
||||
@@ -13,6 +15,22 @@ python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt
|
||||
|
||||
echo "Importing libgcrypt..."
|
||||
python util/import_gcry.py grub-core/lib/libgcrypt/ grub-core
|
||||
sed -n -f util/import_gcrypth.sed < grub-core/lib/libgcrypt/src/gcrypt.h.in > include/grub/gcrypt/gcrypt.h
|
||||
if [ -f include/grub/gcrypt/g10lib.h ]; then
|
||||
rm include/grub/gcrypt/g10lib.h
|
||||
fi
|
||||
if [ -d grub-core/lib/libgcrypt-grub/mpi/generic ]; then
|
||||
rm -rf grub-core/lib/libgcrypt-grub/mpi/generic
|
||||
fi
|
||||
ln -s ../../../grub-core/lib/libgcrypt-grub/src/g10lib.h include/grub/gcrypt/g10lib.h
|
||||
cp -R grub-core/lib/libgcrypt/mpi/generic grub-core/lib/libgcrypt-grub/mpi/generic
|
||||
|
||||
for x in mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c; do
|
||||
if [ -h grub-core/lib/libgcrypt-grub/mpi/"$x" ] || [ -f grub-core/lib/libgcrypt-grub/mpi/"$x" ]; then
|
||||
rm grub-core/lib/libgcrypt-grub/mpi/"$x"
|
||||
fi
|
||||
ln -s generic/"$x" grub-core/lib/libgcrypt-grub/mpi/"$x"
|
||||
done
|
||||
|
||||
echo "Creating Makefile.tpl..."
|
||||
python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2006 Free Software Foundation, Inc.
|
||||
# Copyright 1996-2013 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
@@ -25,7 +25,7 @@
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except MSVC,
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
@@ -47,7 +47,7 @@ for cc_temp in $CC""; do
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
@@ -57,14 +57,7 @@ else
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
darwin*)
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
@@ -72,24 +65,37 @@ else
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
icc* | ecc*)
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
pgcc | pgf77 | pgf90)
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
@@ -97,22 +103,36 @@ else
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
@@ -121,7 +141,7 @@ else
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
@@ -129,7 +149,7 @@ hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
@@ -155,22 +175,21 @@ if test "$with_gnu_ld" = yes; then
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we cannot use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
@@ -179,7 +198,7 @@ if test "$with_gnu_ld" = yes; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
@@ -189,11 +208,13 @@ if test "$with_gnu_ld" = yes; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
interix3*)
|
||||
haiku*)
|
||||
;;
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
linux*)
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
@@ -251,7 +272,7 @@ else
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
@@ -261,7 +282,7 @@ else
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
@@ -280,7 +301,7 @@ else
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
@@ -316,14 +337,18 @@ else
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
@@ -333,24 +358,15 @@ else
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=no
|
||||
if test "$GCC" = yes ; then
|
||||
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
case $cc_basename in
|
||||
xlc*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
@@ -359,7 +375,7 @@ else
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd* | kfreebsd*-gnu | dragonfly*)
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
@@ -411,19 +427,25 @@ else
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
@@ -471,7 +493,7 @@ else
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
@@ -487,34 +509,58 @@ else
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
kfreebsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd* | dragonfly*)
|
||||
case "$host_os" in
|
||||
freebsd[123]*)
|
||||
library_names_spec='$libname$shrext$versuffix' ;;
|
||||
*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
esac
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case $host_cpu in
|
||||
@@ -528,10 +574,13 @@ case "$host_os" in
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix3*)
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
@@ -548,41 +597,62 @@ case "$host_os" in
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx*)
|
||||
*nto* | *qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
tpf*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
@@ -596,6 +666,12 @@ libext="$libext"
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
10
build-aux/snippet/_Noreturn.h
Normal file
10
build-aux/snippet/_Noreturn.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#if !defined _Noreturn && __STDC_VERSION__ < 201112
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* A C macro for declaring that specific arguments must not be NULL.
|
||||
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2013 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
|
||||
@@ -9,7 +9,7 @@
|
||||
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
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
@@ -1,5 +1,5 @@
|
||||
/* C++ compatible function declaration macros.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2013 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
|
||||
@@ -9,7 +9,7 @@
|
||||
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
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
@@ -1,5 +1,5 @@
|
||||
/* A C macro for emitting warnings if a function is used.
|
||||
Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2013 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
|
||||
@@ -9,7 +9,7 @@
|
||||
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
|
||||
Lesser General Public License for more details.
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
@@ -55,7 +55,7 @@
|
||||
rather than issue the nice warning, but the end result of informing
|
||||
the developer about their portability problem is still achieved):
|
||||
#if HAVE_RAW_DECL_ENVIRON
|
||||
static inline char ***rpl_environ (void) { return &environ; }
|
||||
static char ***rpl_environ (void) { return &environ; }
|
||||
_GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
|
||||
# undef environ
|
||||
# define environ (*rpl_environ ())
|
||||
@@ -3,43 +3,45 @@
|
||||
CFLAGS_PLATFORM=
|
||||
|
||||
export LC_COLLATE := C
|
||||
export LC_CTYPE := C
|
||||
unexport LC_ALL
|
||||
|
||||
# Platform specific options
|
||||
if COND_i386_pc
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
endif
|
||||
if COND_i386_efi
|
||||
LDFLAGS_PLATFORM = -Wl,-melf_i386
|
||||
endif
|
||||
if COND_x86_64_efi
|
||||
LDFLAGS_PLATFORM = -Wl,-melf_x86_64
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3 -freg-struct-return
|
||||
endif
|
||||
if COND_i386_qemu
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3 -freg-struct-return
|
||||
endif
|
||||
if COND_i386_coreboot
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3 -freg-struct-return
|
||||
endif
|
||||
if COND_i386_ieee1275
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3 -freg-struct-return
|
||||
endif
|
||||
if COND_mips_loongson
|
||||
CFLAGS_PLATFORM += -mexplicit-relocs
|
||||
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
|
||||
CPPFLAGS_PLATFORM = -DUSE_ASCII_FALLBACK
|
||||
endif
|
||||
if COND_mips
|
||||
CFLAGS_PLATFORM += -mflush-func=grub_cpu_flush_cache
|
||||
CFLAGS_PLATFORM += -mflush-func=grub_red_herring
|
||||
CCASFLAGS_PLATFORM = -march=mips3
|
||||
endif
|
||||
if COND_sparc64_ieee1275
|
||||
CFLAGS_PLATFORM += -mno-app-regs
|
||||
LDFLAGS_PLATFORM = -Wl,-melf64_sparc -mno-relax
|
||||
endif
|
||||
if COND_arm
|
||||
CFLAGS_PLATFORM += -mthumb-interwork -mlong-calls
|
||||
LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
|
||||
endif
|
||||
|
||||
# Other options
|
||||
|
||||
if ! COND_emu
|
||||
CFLAGS_PLATFORM += -Dfloat=__grub_poison
|
||||
CFLAGS_PLATFORM += -Ddouble=__grub_poison
|
||||
endif
|
||||
|
||||
CPPFLAGS_DEFAULT = -DGRUB_FILE=\"$(subst $(srcdir)/,,$<)\"
|
||||
CPPFLAGS_DEFAULT += -I$(builddir)
|
||||
CPPFLAGS_DEFAULT += -I$(srcdir)
|
||||
@@ -47,7 +49,10 @@ CPPFLAGS_DEFAULT += -I$(top_builddir)
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/include
|
||||
CPPFLAGS_DEFAULT += -I$(top_builddir)/include
|
||||
CCASFLAGS_DEFAULT = -DASM_FILE=1
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/include
|
||||
CPPFLAGS_DEFAULT += -I$(top_srcdir)/grub-core/lib/libgcrypt-grub/src/
|
||||
CCASFLAGS_DEFAULT = $(CPPFLAGS_DEFAULT) -DASM_FILE=1
|
||||
BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT)
|
||||
|
||||
LDADD_KERNEL =
|
||||
|
||||
@@ -69,7 +74,7 @@ endif
|
||||
|
||||
CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
||||
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -static-libgcc
|
||||
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
||||
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1
|
||||
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
||||
if COND_CYGWIN
|
||||
STRIPFLAGS_KERNEL = -F elf32-i386 -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version
|
||||
@@ -102,15 +107,15 @@ grubconfdir = $(sysconfdir)/grub.d
|
||||
platformdir = $(pkglibdir)/$(target_cpu)-$(platform)
|
||||
starfielddir = $(pkgdatadir)/themes/starfield
|
||||
|
||||
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers
|
||||
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap
|
||||
|
||||
CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations
|
||||
CPPFLAGS_GNULIB = -I$(top_builddir)/grub-core/gnulib -I$(top_srcdir)/grub-core/gnulib
|
||||
|
||||
CFLAGS_POSIX = -fno-builtin
|
||||
CPPFLAGS_POSIX = -I$(top_srcdir)/grub-core/lib/posix_wrap
|
||||
|
||||
CFLAGS_GCRY = -Wno-error -Wno-missing-field-initializers -Wno-redundant-decls $(CFLAGS_POSIX)
|
||||
CPPFLAGS_GCRY = -I$(top_srcdir)/grub-core/lib/libgcrypt_wrap $(CPPFLAGS_POSIX) -D_GCRYPT_IN_LIBGCRYPT=1 -I$(top_srcdir)/include/grub/gcrypt
|
||||
|
||||
CPPFLAGS_EFIEMU = -I$(top_srcdir)/grub-core/efiemu/runtime
|
||||
|
||||
# List file macros for recognizing /interesting/ modules
|
||||
@@ -144,7 +149,7 @@ bin_PROGRAMS =
|
||||
platform_DATA =
|
||||
sbin_PROGRAMS =
|
||||
check_SCRIPTS =
|
||||
grubconf_DATA =
|
||||
dist_grubconf_DATA =
|
||||
check_PROGRAMS =
|
||||
noinst_SCRIPTS =
|
||||
noinst_PROGRAMS =
|
||||
@@ -167,12 +172,12 @@ $(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
|
||||
mv $@.new $@
|
||||
|
||||
.PRECIOUS: $(top_srcdir)/Makefile.util.am
|
||||
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.tpl
|
||||
autogen -T $(top_srcdir)/Makefile.tpl $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
||||
$(top_srcdir)/Makefile.util.am: $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def $(top_srcdir)/Makefile.tpl
|
||||
cat $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
||||
mv $@.new $@
|
||||
|
||||
.PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
|
||||
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def $(top_srcdir)/Makefile.tpl
|
||||
if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
|
||||
autogen -T $(top_srcdir)/Makefile.tpl $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
||||
cat $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def | autogen -T $(top_srcdir)/Makefile.tpl | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
||||
mv $@.new $@
|
||||
|
||||
@@ -26,7 +26,8 @@ EXTRA_DIST += grub-core/gensymlist.sh
|
||||
EXTRA_DIST += grub-core/genemuinit.sh
|
||||
EXTRA_DIST += grub-core/genemuinitheader.sh
|
||||
|
||||
EXTRA_DIST += grub-core/lib/libgcrypt/cipher
|
||||
EXTRA_DIST += grub-core/lib/libgcrypt
|
||||
EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/include -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/lib -name '*.h')
|
||||
EXTRA_DIST += $(shell find $(top_srcdir)/grub-core/gnulib -name '*.h')
|
||||
@@ -34,8 +35,16 @@ EXTRA_DIST += grub-core/efiemu/runtime/config.h
|
||||
|
||||
EXTRA_DIST += grub-core/lib/LzmaDec.c
|
||||
|
||||
EXTRA_DIST += grub-core/fs/cpio_common.c
|
||||
|
||||
EXTRA_DIST += BUGS
|
||||
EXTRA_DIST += util/i386/efi/grub-dumpdevtree
|
||||
EXTRA_DIST += util/spkmodem-recv.c
|
||||
EXTRA_DIST += util/import_gcrypth.sed
|
||||
EXTRA_DIST += util/bin2h.c
|
||||
EXTRA_DIST += util/grub-gen-asciih.c
|
||||
EXTRA_DIST += util/grub-gen-widthspec.c
|
||||
EXTRA_DIST += util/grub-pe2elf.c
|
||||
|
||||
EXTRA_DIST += m4/gnulib-cache.m4
|
||||
EXTRA_DIST += m4/glibc2.m4
|
||||
@@ -51,3 +60,46 @@ EXTRA_DIST += m4/printf-posix.m4
|
||||
EXTRA_DIST += m4/threadlib.m4
|
||||
EXTRA_DIST += m4/uintmax_t.m4
|
||||
EXTRA_DIST += m4/visibility.m4
|
||||
EXTRA_DIST += m4/math_h.m4
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/apple/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/aros/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/basic/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/bsd/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/freebsd/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/hurd/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/linux/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/windows/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/sun/hostdisk.c
|
||||
EXTRA_DIST += grub-core/osdep/haiku/hostdisk.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/basic/init.c
|
||||
EXTRA_DIST += grub-core/osdep/windows/init.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/apple/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/aros/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/basic/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/bsd/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/windows/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/freebsd/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/hurd/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/linux/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/sun/getroot.c
|
||||
EXTRA_DIST += grub-core/osdep/haiku/getroot.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/basic/random.c
|
||||
EXTRA_DIST += grub-core/osdep/basic/ofpath.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/unix/password.c
|
||||
EXTRA_DIST += grub-core/osdep/unix/random.c
|
||||
EXTRA_DIST += grub-core/osdep/unix/sleep.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/linux/ofpath.c
|
||||
|
||||
EXTRA_DIST += grub-core/osdep/windows/password.c
|
||||
EXTRA_DIST += grub-core/osdep/windows/random.c
|
||||
EXTRA_DIST += grub-core/osdep/windows/sleep.c
|
||||
|
||||
EXTRA_DIST += tests/dfly-mbr-mbexample.mbr.img.gz
|
||||
EXTRA_DIST += tests/dfly-mbr-mbexample.dfly.img.gz
|
||||
|
||||
|
||||
31
config.h.in
31
config.h.in
@@ -5,9 +5,26 @@
|
||||
#if defined(__PPC__) && !defined(__powerpc__)
|
||||
#define __powerpc__ 1
|
||||
#endif
|
||||
#if defined (GRUB_UTIL) || !defined (GRUB_MACHINE)
|
||||
|
||||
/* Define to 1 to enable disk cache statistics. */
|
||||
#define DISK_CACHE_STATS @DISK_CACHE_STATS@
|
||||
#define BOOT_TIME_STATS @BOOT_TIME_STATS@
|
||||
|
||||
#if defined (GRUB_BUILD)
|
||||
#undef ENABLE_NLS
|
||||
#define BUILD_SIZEOF_LONG @BUILD_SIZEOF_LONG@
|
||||
#define BUILD_SIZEOF_VOID_P @BUILD_SIZEOF_VOID_P@
|
||||
#if defined __APPLE__
|
||||
# if defined __BIG_ENDIAN__
|
||||
# define BUILD_WORDS_BIGENDIAN 1
|
||||
# else
|
||||
# define BUILD_WORDS_BIGENDIAN 0
|
||||
# endif
|
||||
#else
|
||||
#define BUILD_WORDS_BIGENDIAN @BUILD_WORDS_BIGENDIAN@
|
||||
#endif
|
||||
#elif defined (GRUB_UTIL) || !defined (GRUB_MACHINE)
|
||||
#include <config-util.h>
|
||||
#define NESTED_FUNC_ATTR
|
||||
#else
|
||||
/* Define if C symbols get an underscore after compilation. */
|
||||
#define HAVE_ASM_USCORE @HAVE_ASM_USCORE@
|
||||
@@ -35,22 +52,14 @@
|
||||
#define GRUB_BOOT_DIR_NAME "@bootdirname@"
|
||||
/* Default grub directory name */
|
||||
#define GRUB_DIR_NAME "@grubdirname@"
|
||||
/* Define to 1 if GCC generates calls to __enable_execute_stack(). */
|
||||
#define NEED_ENABLE_EXECUTE_STACK @NEED_ENABLE_EXECUTE_STACK@
|
||||
/* Define to 1 if GCC generates calls to __register_frame_info(). */
|
||||
#define NEED_REGISTER_FRAME_INFO @NEED_REGISTER_FRAME_INFO@
|
||||
/* Define to 1 to enable disk cache statistics. */
|
||||
#define DISK_CACHE_STATS @DISK_CACHE_STATS@
|
||||
|
||||
#define GRUB_TARGET_CPU "@GRUB_TARGET_CPU@"
|
||||
#define GRUB_PLATFORM "@GRUB_PLATFORM@"
|
||||
|
||||
#define RE_ENABLE_I18N 1
|
||||
|
||||
#if defined(__i386__)
|
||||
#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1)))
|
||||
#else
|
||||
#define NESTED_FUNC_ATTR
|
||||
#endif
|
||||
#define _GNU_SOURCE 1
|
||||
|
||||
#endif
|
||||
|
||||
411
configure.ac
411
configure.ac
@@ -50,12 +50,31 @@ AC_CONFIG_HEADER([config-util.h])
|
||||
|
||||
# Program name transformations
|
||||
AC_ARG_PROGRAM
|
||||
grub_TRANSFORM([grub-bios-setup])
|
||||
grub_TRANSFORM([grub-editenv])
|
||||
grub_TRANSFORM([grub-install])
|
||||
grub_TRANSFORM([grub-mkconfig])
|
||||
grub_TRANSFORM([grub-mkfont])
|
||||
grub_TRANSFORM([grub-mkimage])
|
||||
grub_TRANSFORM([grub-glue-efi])
|
||||
grub_TRANSFORM([grub-mklayout])
|
||||
grub_TRANSFORM([grub-mkpasswd-pbkdf2])
|
||||
grub_TRANSFORM([grub-mkrelpath])
|
||||
grub_TRANSFORM([grub-mkrescue])
|
||||
grub_TRANSFORM([grub-probe])
|
||||
grub_TRANSFORM([grub-reboot])
|
||||
grub_TRANSFORM([grub-script-check])
|
||||
grub_TRANSFORM([grub-set-default])
|
||||
grub_TRANSFORM([grub-sparc64-setup])
|
||||
grub_TRANSFORM([grub-render-label])
|
||||
|
||||
# Optimization flag. Allow user to override.
|
||||
if test "x$TARGET_CFLAGS" = x; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
|
||||
fi
|
||||
|
||||
BUILD_CPPFLAGS="$BUILD_CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\""
|
||||
|
||||
# Default HOST_CPPFLAGS
|
||||
HOST_CPPFLAGS="$HOST_CPPFLAGS -Wall -W"
|
||||
HOST_CPPFLAGS="$HOST_CPPFLAGS -I\$(top_builddir)/include"
|
||||
@@ -79,6 +98,9 @@ case "$target_cpu" in
|
||||
target_cpu=mips;
|
||||
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_CPU_MIPS=1";
|
||||
;;
|
||||
arm*)
|
||||
target_cpu=arm;
|
||||
;;
|
||||
esac
|
||||
|
||||
# Specify the platform (such as firmware).
|
||||
@@ -99,6 +121,7 @@ if test "x$with_platform" = x; then
|
||||
mipsel-*) platform=loongson ;;
|
||||
mips-*) platform=arc ;;
|
||||
ia64-*) platform=efi ;;
|
||||
arm-*) platform=uboot ;;
|
||||
*) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;;
|
||||
esac
|
||||
else
|
||||
@@ -128,11 +151,14 @@ case "$target_cpu"-"$platform" in
|
||||
mips-qemu_mips) ;;
|
||||
mips-qemu-mips) platform=qemu_mips;;
|
||||
mips-arc) ;;
|
||||
mipsel-arc) ;;
|
||||
mipsel-qemu_mips) ;;
|
||||
mipsel-qemu-mips) platform=qemu_mips;;
|
||||
mipsel-yeeloong) platform=loongson ;;
|
||||
mipsel-fuloong) platform=loongson ;;
|
||||
mipsel-loongson) ;;
|
||||
arm-uboot) ;;
|
||||
arm-efi) ;;
|
||||
*-emu) ;;
|
||||
*) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
|
||||
esac
|
||||
@@ -142,8 +168,8 @@ case "$target_cpu" in
|
||||
x86_64 | sparc64) target_m64=1 ;;
|
||||
esac
|
||||
|
||||
case "$host_os" in
|
||||
mingw32*) host_os=cygwin ;;
|
||||
case "$target_os" in
|
||||
windows* | mingw32*) target_os=cygwin ;;
|
||||
esac
|
||||
|
||||
# This normalizes the names, and creates a new variable ("host_kernel")
|
||||
@@ -156,7 +182,7 @@ case "$host_os" in
|
||||
netbsd*) host_kernel=netbsd ;;
|
||||
solaris*) host_kernel=illumos ;;
|
||||
darwin*) host_kernel=xnu ;;
|
||||
cygwin) host_kernel=windows ;;
|
||||
cygwin | windows* | mingw32*) host_kernel=windows ;;
|
||||
esac
|
||||
|
||||
case "$platform" in
|
||||
@@ -164,6 +190,7 @@ case "$platform" in
|
||||
multiboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MULTIBOOT=1" ;;
|
||||
efi) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EFI=1" ;;
|
||||
ieee1275) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_IEEE1275=1" ;;
|
||||
uboot) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_UBOOT=1" ;;
|
||||
qemu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_QEMU=1" ;;
|
||||
pc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_PCBIOS=1" ;;
|
||||
emu) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_EMU=1" ;;
|
||||
@@ -172,6 +199,7 @@ case "$platform" in
|
||||
arc) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARC=1" ;;
|
||||
esac
|
||||
case "$target_cpu" in
|
||||
arm) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_ARM=1" ;;
|
||||
mips |mipsel) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_MIPS=1" ;;
|
||||
sparc64) machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE_SPARC64=1" ;;
|
||||
esac
|
||||
@@ -181,6 +209,23 @@ else
|
||||
machine_CPPFLAGS="$machine_CPPFLAGS -DGRUB_MACHINE=`echo ${target_cpu}_$platform | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,` -DGRUB_TARGET_CPU_`echo ${target_cpu} | sed y,abcdefghijklmnopqrstuvwxyz,ABCDEFGHIJKLMNOPQRSTUVWXYZ,`=1"
|
||||
fi
|
||||
|
||||
case "${target_cpu}-$platform" in
|
||||
mips-arc)
|
||||
TARGET_LINK_ADDR=0x88200000
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x88100000
|
||||
;;
|
||||
mipsel-arc)
|
||||
TARGET_LINK_ADDR=0x80700000
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x80600000
|
||||
;;
|
||||
mips*-qemu_mips | mips*-loongson)
|
||||
TARGET_DECOMPRESSOR_LINK_ADDR=0x80100000
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(TARGET_LINK_ADDR)
|
||||
AC_SUBST(TARGET_DECOMPRESSOR_LINK_ADDR)
|
||||
|
||||
TARGET_CPPFLAGS="$TARGET_CPPFLAGS $machine_CPPFLAGS"
|
||||
|
||||
AC_SUBST(host_cpu)
|
||||
@@ -239,23 +284,6 @@ if test "x$YACC" = x; then
|
||||
AC_MSG_ERROR([bison is not found])
|
||||
fi
|
||||
|
||||
FONT_SOURCE=
|
||||
|
||||
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
|
||||
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont; do
|
||||
if test -f "$dir/unifont.$ext"; then
|
||||
FONT_SOURCE="$dir/unifont.$ext"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips); then
|
||||
AC_MSG_ERROR([qemu and loongson ports need unifont])
|
||||
fi
|
||||
|
||||
AC_SUBST([FONT_SOURCE])
|
||||
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_AWK
|
||||
@@ -285,21 +313,34 @@ AC_PATH_PROGS(MAKEINFO, makeinfo true)
|
||||
|
||||
AC_PROG_CC
|
||||
gl_EARLY
|
||||
AC_PROG_CXX
|
||||
AM_PROG_CC_C_O
|
||||
AM_PROG_AS
|
||||
|
||||
# Must be GCC.
|
||||
test "x$GCC" = xyes || AC_MSG_ERROR([GCC is required])
|
||||
|
||||
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
||||
|
||||
AC_GNU_SOURCE
|
||||
AM_GNU_GETTEXT([external])
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# Identify characteristics of the host architecture.
|
||||
unset ac_cv_c_bigendian
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
AC_CHECK_SIZEOF(void *)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
|
||||
case "$host_os" in
|
||||
cygwin | windows* | mingw32*)
|
||||
HOST_CPPFLAGS="$HOST_CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
|
||||
CPPFLAGS="$CPPFLAGS -DUNICODE=1 -D_WIN32_WINNT=0x0500"
|
||||
AC_CHECK_SIZEOF(TCHAR,,[#include <windows.h>])
|
||||
;;
|
||||
esac
|
||||
|
||||
grub_apple_cc
|
||||
if test x$grub_cv_apple_cc = xyes ; then
|
||||
HOST_CPPFLAGS="$HOST_CPPFLAGS -fnested-functions"
|
||||
@@ -317,7 +358,7 @@ else
|
||||
fi
|
||||
|
||||
# Check for functions and headers.
|
||||
AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
|
||||
AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
|
||||
AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h sys/mkdev.h limits.h)
|
||||
|
||||
AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
|
||||
@@ -342,13 +383,32 @@ AC_CHECK_HEADER([util.h], [
|
||||
])
|
||||
AC_SUBST([LIBUTIL])
|
||||
|
||||
AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_host_cc_wtrampolines], [
|
||||
SAVED_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$HOST_CFLAGS -Wtrampolines"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
||||
int va_arg_func (int fixed, va_list args);]], [[]])],
|
||||
[grub_cv_host_cc_wtrampolines=yes],
|
||||
[grub_cv_host_cc_wtrampolines=no])
|
||||
CFLAGS="$SAVED_CFLAGS"
|
||||
])
|
||||
|
||||
if test x"$grub_host_cv_cc_wtrampolines" = xyes ; then
|
||||
HOST_CFLAGS="$HOST_CFLAGS -Wtrampolines"
|
||||
fi
|
||||
|
||||
#
|
||||
# Check for host and build compilers.
|
||||
#
|
||||
HOST_CC=$CC
|
||||
AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
|
||||
[AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
|
||||
AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc])
|
||||
test -z "$BUILD_CC" && AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])
|
||||
BUILD_CPP="$BUILD_CC -E"
|
||||
|
||||
case "$build_os" in
|
||||
haiku*) BUILD_LIBM= ;;
|
||||
*) BUILD_LIBM=-lm ;;
|
||||
esac
|
||||
# For gnulib.
|
||||
gl_INIT
|
||||
|
||||
@@ -363,22 +423,31 @@ if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then
|
||||
|
||||
AC_CHECK_TOOLS(TARGET_CC, [gcc egcs cc],
|
||||
[AC_MSG_ERROR([none of gcc, egcs and cc is found. set TARGET_CC manually.])])
|
||||
AC_CHECK_TOOL(OBJCOPY, objcopy)
|
||||
AC_CHECK_TOOL(STRIP, strip)
|
||||
AC_CHECK_TOOL(NM, nm)
|
||||
AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
|
||||
AC_CHECK_TOOL(TARGET_STRIP, strip)
|
||||
AC_CHECK_TOOL(TARGET_NM, nm)
|
||||
AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
|
||||
|
||||
ac_tool_prefix="$tmp_ac_tool_prefix"
|
||||
else
|
||||
if test "x$TARGET_CC" = x; then
|
||||
TARGET_CC=$CC
|
||||
fi
|
||||
AC_CHECK_TOOL(OBJCOPY, objcopy)
|
||||
AC_CHECK_TOOL(STRIP, strip)
|
||||
AC_CHECK_TOOL(NM, nm)
|
||||
AC_CHECK_TOOL(TARGET_OBJCOPY, objcopy)
|
||||
AC_CHECK_TOOL(TARGET_STRIP, strip)
|
||||
AC_CHECK_TOOL(TARGET_NM, nm)
|
||||
AC_CHECK_TOOL(TARGET_RANLIB, ranlib)
|
||||
fi
|
||||
|
||||
AC_SUBST(HOST_CC)
|
||||
AC_SUBST(BUILD_CC)
|
||||
AC_SUBST(BUILD_CFLAGS)
|
||||
AC_SUBST(BUILD_CPPFLAGS)
|
||||
AC_SUBST(TARGET_CC)
|
||||
AC_SUBST(TARGET_NM)
|
||||
AC_SUBST(TARGET_RANLIB)
|
||||
AC_SUBST(TARGET_STRIP)
|
||||
AC_SUBST(TARGET_OBJCOPY)
|
||||
|
||||
# Test the C compiler for the target environment.
|
||||
tmp_CC="$CC"
|
||||
@@ -392,8 +461,13 @@ CPPFLAGS="$TARGET_CPPFLAGS"
|
||||
LDFLAGS="$TARGET_LDFLAGS"
|
||||
LIBS=""
|
||||
|
||||
grub_PROG_NM_MINUS_P
|
||||
grub_PROG_NM_DEFINED_ONLY
|
||||
AC_SUBST(TARGET_NMFLAGS_MINUS_P)
|
||||
AC_SUBST(TARGET_NMFLAGS_DEFINED_ONLY)
|
||||
|
||||
# debug flags.
|
||||
WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
|
||||
WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
|
||||
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
|
||||
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
|
||||
@@ -412,7 +486,9 @@ if test "x$target_cpu" = xi386; then
|
||||
else
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$platform" != xemu; then
|
||||
# Some toolchains enable these features by default, but they need
|
||||
# registers that aren't set up properly in GRUB.
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
|
||||
@@ -435,6 +511,19 @@ if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm"
|
||||
fi
|
||||
|
||||
if test x"$target_os" = xcygwin; then
|
||||
AC_CACHE_CHECK([whether option -fno-reorder-functions works], grub_cv_cc_no_reorder_functions, [
|
||||
CFLAGS="$CFLAGS -fno-reorder-functions"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
[grub_cv_cc_no_reorder_functions=yes],
|
||||
[grub_cv_cc_no_reorder_functions=no])
|
||||
])
|
||||
fi
|
||||
|
||||
if test x"$target_os" = xcygwin && test "x$grub_cv_cc_no_reorder_functions" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -fno-reorder-functions"
|
||||
fi
|
||||
|
||||
# By default, GCC 4.6 generates .eh_frame sections containing unwind
|
||||
# information in some cases where it previously did not. GRUB doesn't need
|
||||
# these and they just use up vital space. Restore the old compiler
|
||||
@@ -458,11 +547,11 @@ if test x$grub_cv_apple_target_cc = xyes ; then
|
||||
|
||||
CFLAGS="$CFLAGS -fnested-functions"
|
||||
TARGET_APPLE_CC=1
|
||||
AC_CHECK_PROG([OBJCONV], [objconv], [objconv], [])
|
||||
if test "x$OBJCONV" = x ; then
|
||||
AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.])
|
||||
AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [objconv], [])
|
||||
if test "x$TARGET_OBJCONV" = x ; then
|
||||
AC_CHECK_PROG([TARGET_OBJCONV], [objconv], [./objconv], [], [.])
|
||||
fi
|
||||
if test "x$OBJCONV" = x ; then
|
||||
if test "x$TARGET_OBJCONV" = x ; then
|
||||
AC_MSG_ERROR([objconv not found which is required when building with apple compiler])
|
||||
fi
|
||||
TARGET_IMG_LDSCRIPT=
|
||||
@@ -475,10 +564,10 @@ else
|
||||
TARGET_APPLE_CC=0
|
||||
TARGET_LDFLAGS_OLDMAGIC="-Wl,-N"
|
||||
# Use linker script if present, otherwise use builtin -N script.
|
||||
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then
|
||||
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
|
||||
if test -f "${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"; then
|
||||
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/${grub_coredir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"
|
||||
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
|
||||
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"
|
||||
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/${grub_coredir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"
|
||||
TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
|
||||
else
|
||||
TARGET_IMG_LDSCRIPT=
|
||||
@@ -493,8 +582,8 @@ AC_SUBST(TARGET_LDFLAGS_OLDMAGIC)
|
||||
|
||||
# For platforms where ELF is not the default link format.
|
||||
AC_MSG_CHECKING([for command to convert module to ELF format])
|
||||
case "${host_os}" in
|
||||
cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf';
|
||||
case "${target_os}" in
|
||||
cygwin) TARGET_OBJ2ELF='./build-grub-pe2elf';
|
||||
# FIXME: put proper test here
|
||||
NEED_REGISTER_FRAME_INFO=1
|
||||
;;
|
||||
@@ -509,6 +598,9 @@ AC_ARG_ENABLE([efiemu],
|
||||
if test x"$enable_efiemu" = xno ; then
|
||||
efiemu_excuse="explicitly disabled"
|
||||
fi
|
||||
if test x"$target_os" = xcygwin ; then
|
||||
efiemu_excuse="not available on cygwin"
|
||||
fi
|
||||
if test x"$target_cpu" != xi386 ; then
|
||||
efiemu_excuse="only available on i386"
|
||||
fi
|
||||
@@ -556,7 +648,44 @@ if test "x$target_m64" = x1; then
|
||||
TARGET_MODULE_FORMAT="elf64"
|
||||
fi
|
||||
|
||||
if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
case "$target_os" in
|
||||
cygwin)
|
||||
;;
|
||||
freebsd)
|
||||
if test x"$target_cpu" = xi386; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_i386_fbsd"
|
||||
fi
|
||||
if test x"$target_cpu" = xx86_64; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_x86_64_fbsd"
|
||||
fi
|
||||
;;
|
||||
openbsd*)
|
||||
if test x"$target_cpu" = xi386; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_i386_obsd"
|
||||
fi
|
||||
if test x"$target_cpu" = xx86_64; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_x86_64_obsd"
|
||||
fi
|
||||
;;
|
||||
haiku*)
|
||||
if test x"$target_cpu" = xi386; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_i386_haiku"
|
||||
fi
|
||||
if test x"$target_cpu" = xx86_64; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_x86_64_haiku"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if test x"$target_cpu" = xi386; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_i386"
|
||||
fi
|
||||
if test x"$target_cpu" = xx86_64; then
|
||||
TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,-melf_x86_64"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$target_cpu" = x86_64; then
|
||||
# Use large model to support 4G memory
|
||||
AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [
|
||||
SAVED_CFLAGS=$CFLAGS
|
||||
@@ -570,7 +699,9 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
else
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$target_cpu"-"$platform" = x86_64-efi; then
|
||||
# EFI writes to stack below %rsp, we must not use the red zone
|
||||
AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [
|
||||
CFLAGS="$CFLAGS -m64 -mno-red-zone"
|
||||
@@ -589,9 +720,6 @@ fi
|
||||
# Compiler features.
|
||||
#
|
||||
|
||||
# Need __enable_execute_stack() for nested function trampolines?
|
||||
grub_CHECK_ENABLE_EXECUTE_STACK
|
||||
|
||||
# Position independent executable.
|
||||
grub_CHECK_PIE
|
||||
[# Need that, because some distributions ship compilers that include
|
||||
@@ -622,6 +750,14 @@ if test x"$sap_possible" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe"
|
||||
fi
|
||||
|
||||
# -mno-unaligned-access
|
||||
if test "$target_cpu" = arm; then
|
||||
grub_CHECK_NO_UNALIGNED_ACCESS
|
||||
if test x"$nua_possible" = xyes; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -mno-unaligned-access"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([werror],
|
||||
[AS_HELP_STRING([--disable-werror],
|
||||
[do not use -Werror when building GRUB])])
|
||||
@@ -639,7 +775,7 @@ GRUB_PLATFORM="${platform}"
|
||||
AC_SUBST(GRUB_TARGET_CPU)
|
||||
AC_SUBST(GRUB_PLATFORM)
|
||||
|
||||
AC_SUBST(OBJCONV)
|
||||
AC_SUBST(TARGET_OBJCONV)
|
||||
AC_SUBST(TARGET_CPP)
|
||||
AC_SUBST(TARGET_CCAS)
|
||||
AC_SUBST(TARGET_OBJ2ELF)
|
||||
@@ -661,6 +797,8 @@ AC_SUBST(HOST_LDFLAGS)
|
||||
AC_SUBST(HOST_CPPFLAGS)
|
||||
AC_SUBST(HOST_CCASFLAGS)
|
||||
|
||||
AC_SUBST(BUILD_LIBM)
|
||||
|
||||
# Set them to their new values for the tests below.
|
||||
CC="$TARGET_CC"
|
||||
if test "x$TARGET_APPLE_CC" = x1 ; then
|
||||
@@ -683,7 +821,7 @@ CFLAGS="$CFLAGS -Wl,--defsym,abort=main"
|
||||
fi
|
||||
|
||||
# Check for libgcc symbols
|
||||
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2 _restgpr_14_x __ia64_trampoline __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
|
||||
AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucmpdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umodsi3 __moddi3 __divdi3 __ctzdi2 __ctzsi2)
|
||||
|
||||
if test "x$TARGET_APPLE_CC" = x1 ; then
|
||||
CFLAGS="$TARGET_CFLAGS -nostdlib"
|
||||
@@ -717,6 +855,7 @@ AC_CACHE_CHECK([whether -nostdinc -isystem works], [grub_cv_cc_isystem], [
|
||||
SAVED_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$TARGET_CPPFLAGS -nostdinc -isystem `$TARGET_CC -print-file-name=include`"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
int va_arg_func (int fixed, va_list args);]], [[]])],
|
||||
[grub_cv_cc_isystem=yes],
|
||||
[grub_cv_cc_isystem=no])
|
||||
@@ -728,21 +867,18 @@ if test x"$grub_cv_cc_isystem" = xyes ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([whether -Wno-trampolines work], [grub_cv_cc_wnotrampolines], [
|
||||
AC_CACHE_CHECK([whether -Wtrampolines work], [grub_cv_cc_wtrampolines], [
|
||||
SAVED_CFLAGS="$CFLAGS"
|
||||
# Test for -Wtrampolines rather than -Wno-trampolines to reduce confusion
|
||||
# in the event of later failures (since -Wno-* is always accepted, but
|
||||
# produces a diagnostic if something else is wrong).
|
||||
CFLAGS="$TARGET_CFLAGS -Wtrampolines"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
|
||||
int va_arg_func (int fixed, va_list args);]], [[]])],
|
||||
[grub_cv_cc_wnotrampolines=yes],
|
||||
[grub_cv_cc_wnotrampolines=no])
|
||||
[grub_cv_cc_wtrampolines=yes],
|
||||
[grub_cv_cc_wtrampolines=no])
|
||||
CFLAGS="$SAVED_CFLAGS"
|
||||
])
|
||||
|
||||
if test x"$grub_cv_cc_wnotrampolines" = xyes ; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Wno-trampolines"
|
||||
if test x"$grub_cv_cc_wtrampolines" = xyes ; then
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Wtrampolines"
|
||||
fi
|
||||
|
||||
# Restore the flags.
|
||||
@@ -774,6 +910,17 @@ else
|
||||
fi
|
||||
AC_SUBST([DISK_CACHE_STATS])
|
||||
|
||||
AC_ARG_ENABLE([boot-time],
|
||||
AS_HELP_STRING([--enable-boot-time],
|
||||
[enable boot time statistics collection]))
|
||||
|
||||
if test x$enable_boot_time = xyes; then
|
||||
BOOT_TIME_STATS=1
|
||||
else
|
||||
BOOT_TIME_STATS=0
|
||||
fi
|
||||
AC_SUBST([BOOT_TIME_STATS])
|
||||
|
||||
AC_ARG_ENABLE([grub-emu-usb],
|
||||
[AS_HELP_STRING([--enable-grub-emu-usb],
|
||||
[build and install the `grub-emu' debugging utility with USB support (default=guessed)])])
|
||||
@@ -787,22 +934,6 @@ AC_ARG_ENABLE([grub-emu-pci],
|
||||
[build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])])
|
||||
|
||||
if test "$platform" = emu; then
|
||||
missing_ncurses=
|
||||
[# Check for curses libraries.]
|
||||
AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"],
|
||||
[AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"],
|
||||
[missing_ncurses=[true]])])
|
||||
AC_SUBST([LIBCURSES])
|
||||
[if [ x"$missing_ncurses" = x ]; then ]
|
||||
[# Check for headers.]
|
||||
AC_CHECK_HEADERS([ncurses/curses.h], [],
|
||||
[AC_CHECK_HEADERS([ncurses.h], [],
|
||||
[AC_CHECK_HEADERS([curses.h], [],
|
||||
[missing_ncurses=[true]])])])
|
||||
[fi]
|
||||
if test x"$missing_ncurses" = xtrue ; then
|
||||
AC_MSG_ERROR([grub-emu can't be compiled without ncurses])
|
||||
fi
|
||||
|
||||
if test x"$enable_grub_emu_usb" != xyes ; then
|
||||
grub_emu_usb_excuse="not enabled"
|
||||
@@ -898,16 +1029,18 @@ fi
|
||||
|
||||
if test x"$grub_mkfont_excuse" = x ; then
|
||||
# Check for freetype libraries.
|
||||
AC_CHECK_PROGS([FREETYPE], [freetype-config])
|
||||
AC_CHECK_TOOLS([FREETYPE], [freetype-config])
|
||||
if test "x$FREETYPE" = x ; then
|
||||
grub_mkfont_excuse=["need freetype2 library"]
|
||||
fi
|
||||
fi
|
||||
|
||||
unset ac_cv_header_ft2build_h
|
||||
|
||||
if test x"$grub_mkfont_excuse" = x ; then
|
||||
# Check for freetype libraries.
|
||||
freetype_cflags=`freetype-config --cflags`
|
||||
freetype_libs=`freetype-config --libs`
|
||||
freetype_cflags=`$FREETYPE --cflags`
|
||||
freetype_libs=`$FREETYPE --libs`
|
||||
SAVED_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $freetype_cflags"
|
||||
AC_CHECK_HEADERS([ft2build.h], [],
|
||||
@@ -923,19 +1056,80 @@ enable_grub_mkfont=yes
|
||||
else
|
||||
enable_grub_mkfont=no
|
||||
fi
|
||||
if test x"$enable_grub_mkfont" = xno && test "x$platform" = xloongson; then
|
||||
AC_MSG_ERROR([loongson port needs grub-mkfont])
|
||||
fi
|
||||
AC_SUBST([enable_grub_mkfont])
|
||||
AC_SUBST([freetype_cflags])
|
||||
AC_SUBST([freetype_libs])
|
||||
|
||||
SAVED_CC="$CC"
|
||||
SAVED_CPP="$CPP"
|
||||
SAVED_CFLAGS="$CFLAGS"
|
||||
SAVED_CPPFLAGS="$CPPFLAGS"
|
||||
CC="$BUILD_CC"
|
||||
CPP="$BUILD_CPP"
|
||||
CFLAGS="$BUILD_CFLAGS"
|
||||
CPPFLAGS="$BUILD_CPPFLAGS"
|
||||
|
||||
unset ac_cv_c_bigendian
|
||||
unset ac_cv_header_ft2build_h
|
||||
|
||||
AC_COMPUTE_INT([BUILD_SIZEOF_VOID_P], [sizeof (void *)])
|
||||
AC_COMPUTE_INT([BUILD_SIZEOF_LONG], [sizeof (long)])
|
||||
AC_C_BIGENDIAN([BUILD_WORDS_BIGENDIAN=1], [BUILD_WORDS_BIGENDIAN=0], [BUILD_WORDS_BIGENDIAN=err], [BUILD_WORDS_BIGENDIAN=err])
|
||||
|
||||
if test x$BUILD_WORDS_BIGENDIAN = xerr ; then
|
||||
AC_MSG_ERROR([couldnt determine build endianness])
|
||||
fi
|
||||
|
||||
AC_SUBST([BUILD_SIZEOF_LONG])
|
||||
AC_SUBST([BUILD_SIZEOF_VOID_P])
|
||||
AC_SUBST([BUILD_WORDS_BIGENDIAN])
|
||||
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
# Check for freetype libraries.
|
||||
AC_CHECK_PROGS([BUILD_FREETYPE], [freetype-config])
|
||||
if test "x$BUILD_FREETYPE" = x ; then
|
||||
grub_build_mkfont_excuse=["need freetype2 library"]
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
# Check for freetype libraries.
|
||||
build_freetype_cflags=`$BUILD_FREETYPE --cflags`
|
||||
build_freetype_libs=`$BUILD_FREETYPE --libs`
|
||||
SAVED_CPPFLAGS_2="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $build_freetype_cflags"
|
||||
AC_CHECK_HEADERS([ft2build.h], [],
|
||||
[grub_build_mkfont_excuse=["need freetype2 headers"]])
|
||||
CPPFLAGS="$SAVED_CPPFLAGS_2"
|
||||
fi
|
||||
|
||||
if test x"$enable_build_grub_mkfont" = xyes && test x"$grub_build_mkfont_excuse" != x ; then
|
||||
AC_MSG_ERROR([build-grub-mkfont was explicitly requested but can't be compiled])
|
||||
fi
|
||||
if test x"$grub_build_mkfont_excuse" = x ; then
|
||||
enable_build_grub_mkfont=yes
|
||||
else
|
||||
enable_build_grub_mkfont=no
|
||||
fi
|
||||
if test x"$enable_build_grub_mkfont" = xno && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports needs build-time grub-mkfont])
|
||||
fi
|
||||
|
||||
AC_SUBST([build_freetype_cflags])
|
||||
AC_SUBST([build_freetype_libs])
|
||||
|
||||
CC="$SAVED_CC"
|
||||
CPP="$SAVED_CPP"
|
||||
CFLAGS="$SAVED_CFLAGS"
|
||||
CPPFLAGS="$SAVED_CPPFLAGS"
|
||||
|
||||
|
||||
DJVU_FONT_SOURCE=
|
||||
|
||||
starfield_excuse=
|
||||
|
||||
if test x$enable_grub_mkfont = xno; then
|
||||
starfield_excuse="No grub-mkfont"
|
||||
if test x"$enable_build_grub_mkfont" = xno ; then
|
||||
starfield_excuse="No build-time grub-mkfont"
|
||||
fi
|
||||
|
||||
if test x"$starfield_excuse" = x; then
|
||||
@@ -955,6 +1149,32 @@ fi
|
||||
|
||||
AC_SUBST([DJVU_FONT_SOURCE])
|
||||
|
||||
FONT_SOURCE=
|
||||
|
||||
for ext in pcf pcf.gz bdf bdf.gz ttf ttf.gz; do
|
||||
for dir in . /usr/src /usr/share/fonts/X11/misc /usr/share/fonts/unifont /usr/share/fonts/uni /usr/share/fonts/truetype/unifont /usr/share/fonts/misc; do
|
||||
if test -f "$dir/unifont.$ext"; then
|
||||
FONT_SOURCE="$dir/unifont.$ext"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if test x"$enable_build_grub_mkfont" = xno ; then
|
||||
FONT_SOURCE=
|
||||
fi
|
||||
|
||||
if test "x$FONT_SOURCE" = x && ( test "x$platform" = xqemu || test "x$platform" = xloongson || test "x$platform" = xqemu_mips || test "x$target_cpu"-"$platform" = xpowerpc-ieee1275 ); then
|
||||
AC_MSG_ERROR([qemu, powerpc-ieee1275 and loongson ports need unifont])
|
||||
fi
|
||||
|
||||
AC_SUBST([FONT_SOURCE])
|
||||
|
||||
if test x"$FONT_SOURCE" = x && test x"$DJVU_FONT_SOURCE" = x && test x"$grub_build_mkfont_excuse" = x; then
|
||||
grub_build_mkfont_excuse="no fonts"
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_ENABLE([grub-mount],
|
||||
[AS_HELP_STRING([--enable-grub-mount],
|
||||
[build and install the `grub-mount' utility (default=guessed)])])
|
||||
@@ -1054,7 +1274,7 @@ if test x"$libzfs_excuse" = x ; then
|
||||
fi
|
||||
|
||||
if test x"$libzfs_excuse" = x ; then
|
||||
AC_CHECK_LIB([nvpair], [nvlist_print],
|
||||
AC_CHECK_LIB([nvpair], [nvlist_lookup_string],
|
||||
[],
|
||||
[libzfs_excuse="need nvpair library"])
|
||||
fi
|
||||
@@ -1091,7 +1311,6 @@ AC_SUBST(BSS_START_SYMBOL)
|
||||
AC_SUBST(END_SYMBOL)
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
AC_SUBST(NEED_ENABLE_EXECUTE_STACK)
|
||||
AC_SUBST(NEED_REGISTER_FRAME_INFO)
|
||||
|
||||
#
|
||||
@@ -1109,12 +1328,15 @@ AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform =
|
||||
AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi])
|
||||
AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu = xmipsel -a x$platform = xloongson])
|
||||
AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xqemu_mips])
|
||||
AM_CONDITIONAL([COND_mips_arc], [test x$target_cpu = xmips -a x$platform = xarc])
|
||||
AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu = xmipsel ")" -a x$platform = xarc])
|
||||
AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
|
||||
AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
|
||||
AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
|
||||
AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
|
||||
AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
|
||||
AM_CONDITIONAL([COND_arm], [test x$target_cpu = xarm ])
|
||||
AM_CONDITIONAL([COND_arm_uboot], [test x$target_cpu = xarm -a x$platform = xuboot])
|
||||
AM_CONDITIONAL([COND_arm_efi], [test x$target_cpu = xarm -a x$platform = xefi])
|
||||
|
||||
AM_CONDITIONAL([COND_HOST_HURD], [test x$host_kernel = xhurd])
|
||||
AM_CONDITIONAL([COND_HOST_LINUX], [test x$host_kernel = xlinux])
|
||||
@@ -1129,15 +1351,19 @@ AM_CONDITIONAL([COND_GRUB_EMU_USB], [test x$enable_grub_emu_usb = xyes])
|
||||
AM_CONDITIONAL([COND_GRUB_EMU_SDL], [test x$enable_grub_emu_sdl = xyes])
|
||||
AM_CONDITIONAL([COND_GRUB_EMU_PCI], [test x$enable_grub_emu_pci = xyes])
|
||||
AM_CONDITIONAL([COND_GRUB_MKFONT], [test x$enable_grub_mkfont = xyes])
|
||||
AM_CONDITIONAL([COND_BUILD_GRUB_MKFONT], [test x$enable_build_grub_mkfont = xyes])
|
||||
AM_CONDITIONAL([COND_GRUB_MOUNT], [test x$enable_grub_mount = xyes])
|
||||
AM_CONDITIONAL([COND_HAVE_FONT_SOURCE], [test x$FONT_SOURCE != x])
|
||||
AM_CONDITIONAL([COND_GRUB_PE2ELF], [test x$TARGET_OBJ2ELF != x])
|
||||
AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
|
||||
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
|
||||
AM_CONDITIONAL([COND_ENABLE_CACHE_STATS], [test x$DISK_CACHE_STATS = x1])
|
||||
AM_CONDITIONAL([COND_ENABLE_BOOT_TIME_STATS], [test x$BOOT_TIME_STATS = x1])
|
||||
|
||||
AM_CONDITIONAL([COND_HAVE_CXX], [test x$HAVE_CXX = xyes])
|
||||
|
||||
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
|
||||
AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
|
||||
AM_CONDITIONAL([COND_CYGWIN], [test x$target_os = xcygwin])
|
||||
AM_CONDITIONAL([COND_STARFIELD], [test "x$starfield_excuse" = x])
|
||||
|
||||
# Output files.
|
||||
@@ -1207,6 +1433,13 @@ echo With disk cache statistics: Yes
|
||||
else
|
||||
echo With disk cache statistics: No
|
||||
fi
|
||||
|
||||
if [ x"$enable_boot_time" = xyes ]; then
|
||||
echo With boot time statistics: Yes
|
||||
else
|
||||
echo With boot time statistics: No
|
||||
fi
|
||||
|
||||
if [ x"$efiemu_excuse" = x ]; then
|
||||
echo efiemu runtime: Yes
|
||||
else
|
||||
@@ -1232,5 +1465,21 @@ echo With libzfs support: Yes
|
||||
else
|
||||
echo With libzfs support: No "($libzfs_excuse)"
|
||||
fi
|
||||
if [ x"$grub_build_mkfont_excuse" = x ]; then
|
||||
echo Build-time grub-mkfont: Yes
|
||||
if test "x$FONT_SOURCE" = x ; then
|
||||
echo "Without unifont"
|
||||
else
|
||||
echo "With unifont from $FONT_SOURCE"
|
||||
fi
|
||||
else
|
||||
echo Build-time grub-mkfont: No "($grub_build_mkfont_excuse)"
|
||||
echo "Without unifont (no build-time grub-mkfont)"
|
||||
fi
|
||||
if test "x$LIBLZMA" = x ; then
|
||||
echo "Without liblzma (no support for XZ-compressed mips images)"
|
||||
else
|
||||
echo "With liblzma from $LIBLZMA (support for XZ-compressed mips images)"
|
||||
fi
|
||||
echo "*******************************************************"
|
||||
]
|
||||
|
||||
@@ -74,8 +74,8 @@ This edition documents version @value{VERSION}.
|
||||
|
||||
@menu
|
||||
* Getting the source code::
|
||||
* Finding your way around::
|
||||
* Coding style::
|
||||
* Finding your way around::
|
||||
* Contributing Changes::
|
||||
* Porting::
|
||||
* Error Handling::
|
||||
@@ -286,14 +286,19 @@ live under @file{grub-core/term/}.
|
||||
|
||||
@item
|
||||
The @samp{efiemu_*} commands live under @file{grub-core/efiemu/}.
|
||||
|
||||
@item
|
||||
OS-dependent code should be under @file{grub-core/osdep/}
|
||||
|
||||
@item
|
||||
Utility programs meant to be run from a full operating system
|
||||
(except OS-dependent code mentioned previously) are in @file{util/}.
|
||||
|
||||
@end itemize
|
||||
|
||||
There are a few other special-purpose exceptions; grep for them if they
|
||||
matter to you.
|
||||
|
||||
Utility programs meant to be run from a full operating system are in
|
||||
@file{util/}.
|
||||
|
||||
@node Contributing Changes
|
||||
@chapter Contributing changes
|
||||
@c By YoshinoriOkuji, VesaJääskeläinen, ColinWatson
|
||||
@@ -948,8 +953,8 @@ driver manager works are not included here.
|
||||
|
||||
@menu
|
||||
* Video API::
|
||||
* Bitmap API::
|
||||
* Example usage of Video API::
|
||||
* Bitmap API::
|
||||
@end menu
|
||||
|
||||
@node Video API
|
||||
@@ -1394,8 +1399,8 @@ grub_video_blit_glyph (&glyph, color, 0, 0);
|
||||
|
||||
@node Bitmap API
|
||||
@section Bitmap API
|
||||
@itemize
|
||||
@subsection grub_video_bitmap_create
|
||||
@itemize
|
||||
@item Prototype:
|
||||
@example
|
||||
grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format)
|
||||
|
||||
1741
docs/grub.texi
1741
docs/grub.texi
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
[NAME]
|
||||
grub-setup \- set up a device to boot using GRUB
|
||||
grub-bios-setup \- set up a device to boot using GRUB
|
||||
[SEE ALSO]
|
||||
.BR grub-install (8),
|
||||
.BR grub-mkimage (1),
|
||||
|
||||
4
docs/man/grub-glue-efi.h2m
Normal file
4
docs/man/grub-glue-efi.h2m
Normal file
@@ -0,0 +1,4 @@
|
||||
[NAME]
|
||||
grub-glue-efi \- generate a fat binary for EFI
|
||||
[DESCRIPTION]
|
||||
grub-glue-efi processes ia32 and amd64 EFI images and glues them according to Apple format.
|
||||
@@ -3,5 +3,4 @@ grub-install \- install GRUB to a device
|
||||
[SEE ALSO]
|
||||
.BR grub-mkconfig (8),
|
||||
.BR grub-mkimage (1),
|
||||
.BR grub-setup (8),
|
||||
.BR grub-mkrescue (1)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
[NAME]
|
||||
grub-mkdevicemap \- generate a GRUB device map file automatically
|
||||
[SEE ALSO]
|
||||
.BR grub-install (8)
|
||||
@@ -2,6 +2,5 @@
|
||||
grub-mkimage \- make a bootable image of GRUB
|
||||
[SEE ALSO]
|
||||
.BR grub-install (8),
|
||||
.BR grub-setup (8),
|
||||
.BR grub-mkrescue (1),
|
||||
.BR grub-mknetdir (8)
|
||||
|
||||
3
docs/man/grub-render-label.h2m
Normal file
3
docs/man/grub-render-label.h2m
Normal file
@@ -0,0 +1,3 @@
|
||||
[NAME]
|
||||
grub-render-label \- generate a .disk_label for Apple Macs.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[NAME]
|
||||
grub-setup \- set up a device to boot using GRUB
|
||||
grub-sparc64-setup \- set up a device to boot using GRUB
|
||||
[SEE ALSO]
|
||||
.BR grub-install (8),
|
||||
.BR grub-mkimage (1),
|
||||
|
||||
325
docs/osdetect.cfg
Normal file
325
docs/osdetect.cfg
Normal file
@@ -0,0 +1,325 @@
|
||||
# Sample GRUB script to autodetect operating systems
|
||||
#
|
||||
# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# GRUB 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 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
set saved_root=$root
|
||||
|
||||
function freebsd_ufs_variants {
|
||||
set device=$1
|
||||
set fstype=$2
|
||||
set uuid=$3
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device)" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
freebsd /boot/kernel/kernel
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
set FreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
|
||||
frebsd_loadenv /boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (single)" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
freebsd /boot/kernel/kernel --single
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
set FreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
|
||||
frebsd_loadenv /boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (verbose)" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
freebsd /boot/kernel/kernel --verbose
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
set FreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
|
||||
frebsd_loadenv /boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (without ACPI)" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
freebsd /boot/kernel/kernel --verbose
|
||||
unset FreeBSD.acpi_load
|
||||
set FreeBSD.hint.acpi.0.disabled=1
|
||||
set FreeBSD.loader.acpi_disabled_by_user=1
|
||||
set FreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
|
||||
frebsd_loadenv /boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (safe mode)" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
freebsd /boot/kernel/kernel --verbose
|
||||
unset FreeBSD.acpi_load
|
||||
set FreeBSD.hint.acpi.0.disabled=1
|
||||
set FreeBSD.loader.acpi_disabled_by_user=1
|
||||
set FreeBSD.hint.apic.0.disabled=1
|
||||
set FreeBSD.hw.ata.ata_dma=0
|
||||
set FreeBSD.hw.ata.atapi_dma=0
|
||||
set FreeBSD.hw.ata.wc=0
|
||||
set FreeBSD.hw.eisa_slots=0
|
||||
set FreeBSD.hint.kbdmux.0.disabled=1
|
||||
set FreeBSD.vfs.root.mountfrom=ufs:ufsid/$uuid
|
||||
frebsd_loadenv /boot/device.hints
|
||||
}
|
||||
}
|
||||
|
||||
function freebsd_zfs_variants {
|
||||
set device=$1
|
||||
set fstype=zfs
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device)" $device {
|
||||
set root=$2
|
||||
|
||||
freebsd /@/boot/kernel/kernel
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
freebsd_module_elf /@/boot/kernel/opensolaris.ko
|
||||
freebsd_module_elf /@/boot/kernel/zfs.ko
|
||||
freebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
probe -l -s name $root
|
||||
set FreeBSD.vfs.root.mountfrom=zfs:$name
|
||||
freebsd_loadenv /@/boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (single)" $device {
|
||||
set root=$2
|
||||
|
||||
freebsd /@/boot/kernel/kernel --single
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
freebsd_module_elf /@/boot/kernel/opensolaris.ko
|
||||
freebsd_module_elf /@/boot/kernel/zfs.ko
|
||||
freebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
probe -l -s name $root
|
||||
set FreeBSD.vfs.root.mountfrom=zfs:$name
|
||||
freebsd_loadenv /@/boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (verbose)" $device {
|
||||
set root=$2
|
||||
|
||||
freebsd /@/boot/kernel/kernel --verbose
|
||||
set FreeBSD.acpi_load=YES
|
||||
set FreeBSD.hint.acpi.0.disabled=0
|
||||
freebsd_module_elf /@/boot/kernel/opensolaris.ko
|
||||
freebsd_module_elf /@/boot/kernel/zfs.ko
|
||||
freebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
probe -l -s name $root
|
||||
set FreeBSD.vfs.root.mountfrom=zfs:$name
|
||||
freebsd_loadenv /@/boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (without ACPI)" $device {
|
||||
set root=$2
|
||||
|
||||
freebsd /@/boot/kernel/kernel --verbose
|
||||
unset FreeBSD.acpi_load
|
||||
set FreeBSD.hint.acpi.0.disabled=1
|
||||
set FreeBSD.loader.acpi_disabled_by_user=1
|
||||
freebsd_module_elf /@/boot/kernel/opensolaris.ko
|
||||
freebsd_module_elf /@/boot/kernel/zfs.ko
|
||||
freebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
probe -l -s name $root
|
||||
set FreeBSD.vfs.root.mountfrom=zfs:$name
|
||||
freebsd_loadenv /@/boot/device.hints
|
||||
}
|
||||
|
||||
menuentry "FreeBSD (on $fstype $device) (safe mode)" $device {
|
||||
set root=$2
|
||||
|
||||
freebsd /@/boot/kernel/kernel --verbose
|
||||
unset FreeBSD.acpi_load
|
||||
set FreeBSD.hint.acpi.0.disabled=1
|
||||
set FreeBSD.loader.acpi_disabled_by_user=1
|
||||
set FreeBSD.hint.apic.0.disabled=1
|
||||
set FreeBSD.hw.ata.ata_dma=0
|
||||
set FreeBSD.hw.ata.atapi_dma=0
|
||||
set FreeBSD.hw.ata.wc=0
|
||||
set FreeBSD.hw.eisa_slots=0
|
||||
set FreeBSD.hint.kbdmux.0.disabled=1
|
||||
freebsd_module_elf /@/boot/kernel/opensolaris.ko
|
||||
freebsd_module_elf /@/boot/kernel/zfs.ko
|
||||
freebsd_module /@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
|
||||
probe -l -s name $root
|
||||
set FreeBSD.vfs.root.mountfrom=zfs:$name
|
||||
freebsd_loadenv /@/boot/device.hints
|
||||
}
|
||||
}
|
||||
|
||||
insmod regexp
|
||||
for dev in (*); do
|
||||
# $device: parenthesis removed from $dev
|
||||
regexp -s device '\((.*)\)' $dev
|
||||
# $fstype: filesystem type identified
|
||||
probe -s fstype -f $dev
|
||||
# uuid: filesystem UUID
|
||||
probe -s uuid -u $dev
|
||||
|
||||
if test -f ($device)/bootmgr -a -f ($device)/boot/bcd; then
|
||||
menuentry "Windows Vista bootmgr (on $device)" $device {
|
||||
set root=$2
|
||||
chainloader +1
|
||||
}
|
||||
elif test -f ($device)/ntldr -a \
|
||||
-e ($device)/ntdetect.com -a -f ($device)/boot.ini; then
|
||||
menuentry "Windows NT/2000/XP loader (on $device)" $device {
|
||||
set root=$2
|
||||
regexp -s devnum 'hd([0-9]+)' $root
|
||||
if test "$devnum" != "0"; then
|
||||
drivemap -s hd0 $root
|
||||
fi
|
||||
chainloader +1
|
||||
}
|
||||
elif test -f ($device)/windows/win.com; then
|
||||
menuentry "Windows 98/ME (on $device)" $device {
|
||||
set root=$2
|
||||
regexp -s devnum 'hd([0-9]+)' $root
|
||||
if test "$devnum" != "0"; then
|
||||
drivemap -s hd0 $root
|
||||
fi
|
||||
chainloader +1
|
||||
}
|
||||
elif test -f ($device)/io.sys -a -f ($device)/command.com; then
|
||||
menuentry "MS-DOS (on $device)" $device {
|
||||
set root=$2
|
||||
regexp -s devnum 'hd([0-9]+)' $root
|
||||
if test "$devnum" != "0"; then
|
||||
drivemap -s hd0 $root
|
||||
fi
|
||||
chainloader +1
|
||||
}
|
||||
elif test -f ($device)/kernel.sys; then
|
||||
menuentry "FreeDOS (on $device)" $device {
|
||||
set root=$2
|
||||
regexp -s type '([fh])d[0-9]+' $root
|
||||
regexp -s devnum '[fh]d([0-9]+)' $root
|
||||
if test $type = 'h' -a "$devnum" != "0"; then
|
||||
drivemap -s hd0 $root
|
||||
fi
|
||||
chainloader +1
|
||||
}
|
||||
elif test "$fstype" = ufs1 -o "$fstype" = ufs2 -a \
|
||||
-e ($device)/boot/kernel/kernel -a \
|
||||
-e ($device)/boot/device.hints; then
|
||||
|
||||
freebsd_ufs_variants $device $fstype $uuid
|
||||
|
||||
elif test "$fstype" = zfs -a \
|
||||
-e ($device)/@/boot/kernel/kernel -a \
|
||||
-e ($device)/@/boot/device.hints; then
|
||||
|
||||
freebsd_zfs_variants $device
|
||||
|
||||
elif test "$fstype" = hfsplus -a -f ($device)/mach_kernel; then
|
||||
menuentry "Mac OS X/Darwin" $device $uuid {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
|
||||
insmod vbe
|
||||
do_resume=0
|
||||
if [ /var/vm/sleepimage -nt10 / ]; then
|
||||
if xnu_resume /var/vm/sleepimage; then
|
||||
do_resume=1
|
||||
fi
|
||||
fi
|
||||
if [ $do_resume = 1 ]; then
|
||||
xnu_uuid $uuid uuid
|
||||
if [ -f /Extra/DSDT.aml ]; then
|
||||
acpi -e /Extra/DSDT.aml
|
||||
fi
|
||||
xnu_kernel /mach_kernel boot-uuid=${uuid} rd=*uuid
|
||||
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
|
||||
xnu_mkext /System/Library/Extensions.mkext
|
||||
else
|
||||
xnu_mkext /System/Library/Extensions
|
||||
fi
|
||||
if [ -f /Extra/Extensions.mkext ]; then
|
||||
xnu_mkext /Extra/Extensions.mkext
|
||||
fi
|
||||
if [ -d /Extra/Extensions ]; then
|
||||
xnu_kextdir /Extra/Extensions
|
||||
fi
|
||||
if [ -f /Extra/devtree.txt ]; then
|
||||
xnu_devtree /Extra/devtree.txt
|
||||
fi
|
||||
if [ -f /Extra/splash.jpg ]; then
|
||||
insmod jpeg
|
||||
xnu_splash /Extra/splash.jpg
|
||||
fi
|
||||
if [ -f /Extra/splash.png ]; then
|
||||
insmod png
|
||||
xnu_splash /Extra/splash.png
|
||||
fi
|
||||
if [ -f /Extra/splash.tga ]; then
|
||||
insmod tga
|
||||
xnu_splash /Extra/splash.tga
|
||||
fi
|
||||
fi
|
||||
}
|
||||
else
|
||||
set root=$device
|
||||
for file in /boot/vmlinuz-* /boot/linux-*; do
|
||||
if test -f $file; then
|
||||
regexp -s version '/boot/vmlinuz-(.*)' $file
|
||||
regexp -s version '/boot/linux-(.*)' $file
|
||||
|
||||
menuentry "Linux $file" $device $uuid $file $version {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
set kernel=$4
|
||||
set version=$5
|
||||
|
||||
linux $kernel root=UUID=$uuid ro
|
||||
if test -f /boot/initrd-$version.img; then
|
||||
initrd /boot/initrd-$version.img
|
||||
elif test -f /boot/initrd.img-$version; then
|
||||
initrd /boot/initrd.img-$version
|
||||
elif test -f /boot/initrd-$version; then
|
||||
initrd /boot/initrd-$version
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "Linux $file (single)" $device $uuid $file $version {
|
||||
set root=$2
|
||||
set uuid=$3
|
||||
set kernel=$4
|
||||
set version=$5
|
||||
|
||||
linux $kernel root=UUID=$uuid ro single
|
||||
if test -f /boot/initrd-$version.img; then
|
||||
initrd /boot/initrd-$version.img
|
||||
elif test -f /boot/initrd.img-$version; then
|
||||
initrd /boot/initrd.img-$version
|
||||
elif test -f /boot/initrd-$version; then
|
||||
initrd /boot/initrd-$version
|
||||
fi
|
||||
}
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
set root=$saved_root
|
||||
61
gentpl.py
61
gentpl.py
@@ -23,7 +23,7 @@ GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
|
||||
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
|
||||
"mips_loongson", "sparc64_ieee1275",
|
||||
"powerpc_ieee1275", "mips_arc", "ia64_efi",
|
||||
"mips_qemu_mips" ]
|
||||
"mips_qemu_mips", "arm_uboot", "arm_efi" ]
|
||||
|
||||
GROUPS = {}
|
||||
|
||||
@@ -36,10 +36,12 @@ GROUPS["x86"] = GROUPS["i386"] + GROUPS["x86_64"]
|
||||
GROUPS["mips"] = [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]
|
||||
GROUPS["sparc64"] = [ "sparc64_ieee1275" ]
|
||||
GROUPS["powerpc"] = [ "powerpc_ieee1275" ]
|
||||
GROUPS["arm"] = [ "arm_uboot", "arm_efi" ]
|
||||
|
||||
# Groups based on firmware
|
||||
GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi" ]
|
||||
GROUPS["efi"] = [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi" ]
|
||||
GROUPS["ieee1275"] = [ "i386_ieee1275", "sparc64_ieee1275", "powerpc_ieee1275" ]
|
||||
GROUPS["uboot"] = [ "arm_uboot" ]
|
||||
|
||||
# emu is a special case so many core functionality isn't needed on this platform
|
||||
GROUPS["noemu"] = GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu")
|
||||
@@ -52,15 +54,18 @@ GROUPS["pci"] = GROUPS["x86"] + ["mips_loongson"]
|
||||
GROUPS["usb"] = GROUPS["pci"]
|
||||
|
||||
# If gfxterm is main output console integrate it into kernel
|
||||
GROUPS["videoinkernel"] = ["mips_loongson", "mips_qemu_mips"]
|
||||
GROUPS["videoinkernel"] = ["mips_loongson", "i386_coreboot" ]
|
||||
GROUPS["videomodules"] = GRUB_PLATFORMS[:];
|
||||
for i in GROUPS["videoinkernel"]: GROUPS["videomodules"].remove(i)
|
||||
|
||||
# Similar for terminfo
|
||||
GROUPS["terminfoinkernel"] = ["mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"];
|
||||
GROUPS["terminfoinkernel"] = [ "emu", "mips_loongson", "mips_arc", "mips_qemu_mips" ] + GROUPS["ieee1275"] + GROUPS["uboot"];
|
||||
GROUPS["terminfomodule"] = GRUB_PLATFORMS[:];
|
||||
for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i)
|
||||
|
||||
# Flattened Device Trees (FDT)
|
||||
GROUPS["fdt"] = [ "arm_uboot", "arm_efi" ]
|
||||
|
||||
# Miscelaneous groups schedulded to disappear in future
|
||||
GROUPS["i386_coreboot_multiboot_qemu"] = ["i386_coreboot", "i386_multiboot", "i386_qemu"]
|
||||
GROUPS["nopc"] = GRUB_PLATFORMS[:]; GROUPS["nopc"].remove("i386_pc")
|
||||
@@ -326,6 +331,10 @@ def define_macro_for_platform_ldadd(p):
|
||||
return define_autogen_macro(
|
||||
"get_" + p + "_ldadd",
|
||||
platform_specific_values(p, "_ldadd", "ldadd"))
|
||||
def define_macro_for_platform_dependencies(p):
|
||||
return define_autogen_macro(
|
||||
"get_" + p + "_dependencies",
|
||||
platform_specific_values(p, "_dependencies", "dependencies"))
|
||||
def define_macro_for_platform_ldflags(p):
|
||||
return define_autogen_macro(
|
||||
"get_" + p + "_ldflags",
|
||||
@@ -351,6 +360,7 @@ def define_macro_for_platform_objcopyflags(p):
|
||||
#
|
||||
def platform_startup(p): return "[+ get_" + p + "_startup +]"
|
||||
def platform_ldadd(p): return "[+ get_" + p + "_ldadd +]"
|
||||
def platform_dependencies(p): return "[+ get_" + p + "_dependencies +]"
|
||||
def platform_cflags(p): return "[+ get_" + p + "_cflags +]"
|
||||
def platform_ldflags(p): return "[+ get_" + p + "_ldflags +]"
|
||||
def platform_cppflags(p): return "[+ get_" + p + "_cppflags +]"
|
||||
@@ -380,9 +390,9 @@ def module(platform):
|
||||
r += var_set(cname() + "_LDFLAGS", "$(AM_LDFLAGS) $(LDFLAGS_MODULE) " + platform_ldflags(platform))
|
||||
r += var_set(cname() + "_CPPFLAGS", "$(AM_CPPFLAGS) $(CPPFLAGS_MODULE) " + platform_cppflags(platform))
|
||||
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_MODULE) " + platform_ccasflags(platform))
|
||||
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
|
||||
r += var_set(cname() + "_DEPENDENCIES", "$(TARGET_OBJ2ELF) " + platform_dependencies(platform))
|
||||
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
|
||||
@@ -408,9 +418,9 @@ def kernel(platform):
|
||||
r += var_set(cname() + "_CPPFLAGS", "$(AM_CPPFLAGS) $(CPPFLAGS_KERNEL) " + platform_cppflags(platform))
|
||||
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_KERNEL) " + platform_ccasflags(platform))
|
||||
r += var_set(cname() + "_STRIPFLAGS", "$(AM_STRIPFLAGS) $(STRIPFLAGS_KERNEL) " + platform_stripflags(platform))
|
||||
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
|
||||
r += var_set(cname() + "_DEPENDENCIES", "$(TARGET_OBJ2ELF)")
|
||||
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
|
||||
@@ -419,14 +429,14 @@ def kernel(platform):
|
||||
r += rule("[+ name +].img", "[+ name +].exec$(EXEEXT)",
|
||||
if_platform_tagged(platform, "nostrip",
|
||||
"""if test x$(USE_APPLE_CC_FIXES) = xyes; then \
|
||||
$(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -wd1106 -nu -nd $< $@; \
|
||||
$(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -wd1106 -nu -nd $< $@; \
|
||||
elif test ! -z '$(TARGET_OBJ2ELF)'; then \
|
||||
cp $< $@.bin; $(TARGET_OBJ2ELF) $@.bin && cp $@.bin $@ || (rm -f $@.bin; exit 1); \
|
||||
else cp $< $@; fi""",
|
||||
"""if test x$(USE_APPLE_CC_FIXES) = xyes; then \
|
||||
$(STRIP) $(""" + cname() + """) -o $@.bin $<; \
|
||||
$(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -wd1106 -nu -nd $@.bin $@; \
|
||||
else """ + "$(STRIP) $(" + cname() + "_STRIPFLAGS) -o $@ $<; \
|
||||
$(TARGET_STRIP) $(""" + cname() + """) -o $@.bin $<; \
|
||||
$(TARGET_OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -ed2022 -wd1106 -nu -nd $@.bin $@; \
|
||||
else """ + "$(TARGET_STRIP) $(" + cname() + "_STRIPFLAGS) -o $@ $<; \
|
||||
fi"""))
|
||||
return r
|
||||
|
||||
@@ -443,7 +453,7 @@ def image(platform):
|
||||
r += var_set(cname() + "_OBJCOPYFLAGS", "$(OBJCOPYFLAGS_IMAGE) " + platform_objcopyflags(platform))
|
||||
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
|
||||
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
|
||||
@@ -453,7 +463,7 @@ def image(platform):
|
||||
if test x$(USE_APPLE_CC_FIXES) = xyes; then \
|
||||
$(MACHO2IMG) $< $@; \
|
||||
else \
|
||||
$(OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \
|
||||
$(TARGET_OBJCOPY) $(""" + cname() + """_OBJCOPYFLAGS) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn -R .note.gnu.gold-version $< $@; \
|
||||
fi
|
||||
""")
|
||||
return r
|
||||
@@ -476,7 +486,7 @@ def library(platform):
|
||||
r += var_add(cname() + "_CCASFLAGS", first_time("$(AM_CCASFLAGS) $(CCASFLAGS_LIBRARY) ") + platform_ccasflags(platform))
|
||||
# r += var_add(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
|
||||
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
r += first_time(gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)"))
|
||||
r += first_time(gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)"))
|
||||
return r
|
||||
@@ -484,10 +494,10 @@ def library(platform):
|
||||
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 +513,7 @@ def program(platform, test=False):
|
||||
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))
|
||||
@@ -515,15 +525,14 @@ def program(platform, test=False):
|
||||
r += var_set(cname() + "_CCASFLAGS", "$(AM_CCASFLAGS) $(CCASFLAGS_PROGRAM) " + platform_ccasflags(platform))
|
||||
# r += var_set(cname() + "_DEPENDENCIES", platform_dependencies(platform) + " " + platform_ldadd(platform))
|
||||
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
r += gvar_add("BUILT_SOURCES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
r += gvar_add("CLEANFILES", "$(nodist_" + cname() + "_SOURCES)")
|
||||
return r
|
||||
|
||||
def data(platform):
|
||||
r = gvar_add("EXTRA_DIST", platform_sources(platform))
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += var_add(installdir() + "_DATA", platform_sources(platform))
|
||||
r = var_add("dist_" + installdir() + "_DATA", platform_sources(platform))
|
||||
r += gvar_add("dist_noinst_DATA", extra_dist())
|
||||
return r
|
||||
|
||||
def script(platform):
|
||||
@@ -532,15 +541,16 @@ def script(platform):
|
||||
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", """
|
||||
$(top_builddir)/config.status --file=$@:$<
|
||||
r += rule("[+ name +]", "$(top_builddir)/config.status " + platform_sources(platform), """
|
||||
(skip=1; for x in $^; do if [ $$skip = 1 ]; then skip=0; else cat "$$x"; fi; done) | $(top_builddir)/config.status --file=$@:-
|
||||
chmod a+x [+ name +]
|
||||
""")
|
||||
|
||||
r += gvar_add("CLEANFILES", "[+ name +]")
|
||||
r += gvar_add("EXTRA_DIST", extra_dist())
|
||||
r += gvar_add("dist_noinst_DATA", platform_sources(platform))
|
||||
return r
|
||||
|
||||
@@ -600,6 +610,7 @@ for p in GRUB_PLATFORMS:
|
||||
print (define_macro_for_platform_startup(p))
|
||||
print (define_macro_for_platform_cflags(p))
|
||||
print (define_macro_for_platform_ldadd(p))
|
||||
print (define_macro_for_platform_dependencies(p))
|
||||
print (define_macro_for_platform_ldflags(p))
|
||||
print (define_macro_for_platform_cppflags(p))
|
||||
print (define_macro_for_platform_ccasflags(p))
|
||||
|
||||
@@ -7,11 +7,11 @@ include $(top_srcdir)/conf/Makefile.common
|
||||
CC=$(TARGET_CC)
|
||||
CPP=$(TARGET_CC)
|
||||
CCAS=$(TARGET_CC)
|
||||
RANLIB=$(TARGET_RANLIB)
|
||||
STRIP=$(TARGET_STRIP)
|
||||
|
||||
if COND_GRUB_MKFONT
|
||||
if COND_HAVE_FONT_SOURCE
|
||||
TARGET_CFLAGS += -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1
|
||||
endif
|
||||
TARGET_CFLAGS += -DUSE_ASCII_FALLBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1
|
||||
endif
|
||||
|
||||
MACHO2IMG=$(top_builddir)/grub-macho2img
|
||||
@@ -30,25 +30,19 @@ CFLAGS_LIBRARY += $(CFLAGS_PLATFORM) -fno-builtin
|
||||
CPPFLAGS_LIBRARY += $(CPPFLAGS_PLATFORM)
|
||||
CCASFLAGS_LIBRARY += $(CCASFLAGS_PLATFORM)
|
||||
|
||||
build-grub-pe2elf: $(top_srcdir)/util/grub-pe2elf.c $(top_srcdir)/grub-core/kern/emu/misc.c $(top_srcdir)/util/misc.c
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) -DGRUB_BUILD=1 -DGRUB_UTIL=1 -DGRUB_BUILD_PROGRAM_NAME=\"build-grub-pe2elf\" $^
|
||||
|
||||
# gentrigtables
|
||||
gentrigtables: gentrigtables.c
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(CPPFLAGS) $< -lm
|
||||
$(BUILD_CC) -o $@ -I$(top_srcdir)/include $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< $(BUILD_LIBM)
|
||||
CLEANFILES += gentrigtables
|
||||
|
||||
# trigtables.c
|
||||
trigtables.c: gentrigtables gentrigtables.c $(top_srcdir)/configure.ac
|
||||
$(builddir)/gentrigtables > $@
|
||||
./gentrigtables > $@
|
||||
CLEANFILES += trigtables.c
|
||||
|
||||
gensm712: video/sm712.c
|
||||
$(BUILD_CC) -DGENINIT -o $@ -I$(top_builddir) -I$(top_builddir)/include -I$(top_srcdir)/include $(CPPFLAGS) $<
|
||||
CLEANFILES += gensm712
|
||||
|
||||
# trigtables.c
|
||||
sm712_start.S: gensm712 video/sm712.c $(top_srcdir)/configure.ac
|
||||
$(builddir)/gensm712 > $@
|
||||
CLEANFILES += sm712_start.S
|
||||
|
||||
# XXX Use Automake's LEX & YACC support
|
||||
grub_script.tab.h: script/parser.y
|
||||
$(YACC) -d -p grub_script_yy -b grub_script $<
|
||||
@@ -60,12 +54,9 @@ grub_script.yy.h: script/yylex.l
|
||||
$(LEX) -o grub_script.yy.c --header-file=grub_script.yy.h $<
|
||||
grub_script.yy.c: grub_script.yy.h
|
||||
|
||||
rs_decoder.S: $(srcdir)/lib/reed_solomon.c
|
||||
rs_decoder.h: $(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/mips/loongson/fwstart.S: $(builddir)/sm712_start.S
|
||||
|
||||
CLEANFILES += grub_script.yy.c grub_script.yy.h
|
||||
|
||||
include $(srcdir)/Makefile.core.am
|
||||
@@ -98,29 +89,35 @@ if COND_i386_pc
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/pxe.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/int.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
endif
|
||||
|
||||
if COND_i386_efi
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
||||
endif
|
||||
|
||||
if COND_i386_coreboot
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/i386/pc/int.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
|
||||
endif
|
||||
|
||||
if COND_i386_multiboot
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/i386/pc/int.h
|
||||
endif
|
||||
|
||||
if COND_i386_qemu
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
endif
|
||||
|
||||
if COND_i386_ieee1275
|
||||
@@ -128,13 +125,13 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
endif
|
||||
|
||||
if COND_x86_64_efi
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
||||
endif
|
||||
|
||||
@@ -150,18 +147,13 @@ endif
|
||||
if COND_mips_arc
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arc/arc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
||||
endif
|
||||
|
||||
if COND_mips_qemu_mips
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
|
||||
@@ -174,11 +166,10 @@ KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.h
|
||||
KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/font.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap_scale.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bufio.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/cs5536.h
|
||||
@@ -210,10 +201,26 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
|
||||
endif
|
||||
|
||||
if COND_arm_uboot
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/uboot.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/uboot/disk.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/lib/arg.h
|
||||
endif
|
||||
|
||||
if COND_arm_efi
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/arm/efi/loader.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
|
||||
endif
|
||||
|
||||
if COND_emu
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/datetime.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/misc.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/export.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/net.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostdisk.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/emu/hostfile.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
|
||||
if COND_GRUB_EMU_SDL
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/sdl.h
|
||||
endif
|
||||
@@ -264,11 +271,11 @@ kern/emu/grub_emu_dyn-main.$(OBJEXT):grub_emu_init.h
|
||||
grub_emu_dyn-grub_emu_init.$(OBJEXT):grub_emu_init.h
|
||||
|
||||
grub_emu_init.h: genemuinitheader.sh $(MOD_FILES)
|
||||
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(NM) > $@
|
||||
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinitheader.sh $(TARGET_NM) > $@
|
||||
CLEANFILES += grub_emu_init.h
|
||||
|
||||
grub_emu_init.c: grub_emu_init.h genemuinit.sh $(MOD_FILES)
|
||||
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(NM) > $@
|
||||
rm -f $@; echo $(MOD_FILES) | sh $(srcdir)/genemuinit.sh $(TARGET_NM) > $@
|
||||
CLEANFILES += grub_emu_init.c
|
||||
endif
|
||||
|
||||
@@ -349,7 +356,7 @@ syminfo.lst: gensyminfo.sh kernel_syms.lst $(MODULE_FILES)
|
||||
|
||||
# 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
|
||||
|
||||
|
||||
@@ -30,6 +30,20 @@ script = {
|
||||
common = gdb_grub.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
installdir = platform;
|
||||
name = grub.chrp;
|
||||
common = boot/powerpc/grub.chrp.in;
|
||||
enable = powerpc_ieee1275;
|
||||
};
|
||||
|
||||
script = {
|
||||
installdir = platform;
|
||||
name = bootinfo.txt;
|
||||
common = boot/powerpc/bootinfo.txt.in;
|
||||
enable = powerpc_ieee1275;
|
||||
};
|
||||
|
||||
kernel = {
|
||||
name = kernel;
|
||||
|
||||
@@ -45,6 +59,9 @@ kernel = {
|
||||
ia64_efi_ldflags = '-Wl,-r,-d';
|
||||
ia64_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
|
||||
|
||||
arm_efi_ldflags = '-Wl,-r,-d';
|
||||
arm_efi_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x9000';
|
||||
|
||||
@@ -59,13 +76,16 @@ kernel = {
|
||||
mips_loongson_ldflags = '-Wl,-Ttext,0x80200000';
|
||||
powerpc_ieee1275_ldflags = '-Wl,-Ttext,0x200000';
|
||||
sparc64_ieee1275_ldflags = '-Wl,-Ttext,0x4400';
|
||||
mips_arc_ldflags = '-Wl,-Ttext,0x8bd00000';
|
||||
mips_arc_ldflags = '-Wl,-Ttext,$(TARGET_LINK_ADDR)';
|
||||
mips_qemu_mips_ldflags = '-Wl,-Ttext,0x80200000';
|
||||
|
||||
mips_loongson_cppflags = '-DUSE_ASCII_FAILBACK';
|
||||
mips_arc_cppflags = '-DGRUB_DECOMPRESSOR_LINK_ADDR=$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
mips_loongson_cppflags = '-DUSE_ASCII_FALLBACK';
|
||||
i386_qemu_cppflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
|
||||
emu_cflags = '$(CFLAGS_GNULIB)';
|
||||
emu_cppflags = '$(CPPFLAGS_GNULIB)';
|
||||
arm_uboot_ldflags = '-Wl,-Ttext=0x08000000';
|
||||
arm_uboot_stripflags = '--strip-unneeded -K start -R .note -R .comment -R .note.gnu.gold-version';
|
||||
|
||||
i386_pc_startup = kern/i386/pc/startup.S;
|
||||
i386_efi_startup = kern/i386/efi/startup.S;
|
||||
@@ -77,6 +97,8 @@ kernel = {
|
||||
mips_startup = kern/mips/startup.S;
|
||||
sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
|
||||
powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
|
||||
arm_uboot_startup = kern/arm/uboot/startup.S;
|
||||
arm_efi_startup = kern/arm/efi/startup.S;
|
||||
|
||||
common = kern/command.c;
|
||||
common = kern/corecmd.c;
|
||||
@@ -102,7 +124,6 @@ kernel = {
|
||||
|
||||
noemu_nodist = symlist.c;
|
||||
|
||||
i386_pc = kern/generic/rtc_get_time_ms.c;
|
||||
mips = kern/generic/rtc_get_time_ms.c;
|
||||
|
||||
ieee1275 = disk/ieee1275/ofdisk.c;
|
||||
@@ -113,6 +134,12 @@ kernel = {
|
||||
ieee1275 = term/ieee1275/console.c;
|
||||
ieee1275 = kern/ieee1275/init.c;
|
||||
|
||||
uboot = disk/uboot/ubootdisk.c;
|
||||
uboot = kern/uboot/uboot.c;
|
||||
uboot = kern/uboot/init.c;
|
||||
uboot = kern/uboot/hw.c;
|
||||
uboot = term/uboot/console.c;
|
||||
|
||||
terminfoinkernel = term/terminfo.c;
|
||||
terminfoinkernel = term/tparm.c;
|
||||
terminfoinkernel = commands/extcmd.c;
|
||||
@@ -120,13 +147,11 @@ kernel = {
|
||||
|
||||
i386 = kern/i386/dl.c;
|
||||
|
||||
i386_coreboot_multiboot_qemu = kern/i386/coreboot/init.c;
|
||||
i386_coreboot = kern/i386/coreboot/init.c;
|
||||
i386_multiboot = kern/i386/coreboot/init.c;
|
||||
i386_qemu = kern/i386/qemu/init.c;
|
||||
i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
|
||||
|
||||
i386_coreboot_multiboot_qemu = term/i386/vga_common.c;
|
||||
i386_pc = term/i386/vga_common.c;
|
||||
|
||||
x86 = kern/i386/pit.c;
|
||||
i386_coreboot = video/i386/coreboot/cbfb.c;
|
||||
|
||||
efi = disk/efi/efidisk.c;
|
||||
efi = kern/efi/efi.c;
|
||||
@@ -134,11 +159,11 @@ kernel = {
|
||||
efi = kern/efi/mm.c;
|
||||
efi = term/efi/console.c;
|
||||
|
||||
i386_efi = kern/i386/tsc.c;
|
||||
x86 = kern/i386/tsc.c;
|
||||
|
||||
i386_efi = kern/i386/efi/init.c;
|
||||
i386_efi = bus/pci.c;
|
||||
|
||||
x86_64_efi = kern/i386/tsc.c;
|
||||
x86_64_efi = kern/x86_64/dl.c;
|
||||
x86_64_efi = kern/x86_64/efi/callwrap.S;
|
||||
x86_64_efi = kern/i386/efi/init.c;
|
||||
@@ -149,21 +174,21 @@ kernel = {
|
||||
ia64_efi = kern/ia64/dl.c;
|
||||
ia64_efi = kern/ia64/dl_helper.c;
|
||||
|
||||
arm_efi = kern/arm/efi/init.c;
|
||||
arm_efi = kern/arm/efi/misc.c;
|
||||
|
||||
i386_pc = kern/i386/pc/init.c;
|
||||
i386_pc = kern/i386/pc/mmap.c;
|
||||
i386_pc = kern/i386/tsc.c;
|
||||
i386_pc = term/i386/pc/console.c;
|
||||
|
||||
i386_qemu = bus/pci.c;
|
||||
i386_qemu = kern/vga_init.c;
|
||||
i386_qemu = kern/i386/qemu/mmap.c;
|
||||
i386_qemu = kern/i386/tsc.c;
|
||||
|
||||
i386_coreboot = kern/i386/coreboot/mmap.c;
|
||||
i386_coreboot = kern/i386/tsc.c;
|
||||
i386_coreboot = kern/i386/coreboot/cbtable.c;
|
||||
|
||||
i386_multiboot = kern/i386/multiboot_mmap.c;
|
||||
i386_multiboot = kern/i386/tsc.c;
|
||||
|
||||
mips = kern/mips/cache.S;
|
||||
mips = kern/mips/dl.c;
|
||||
@@ -173,9 +198,9 @@ kernel = {
|
||||
mips_qemu_mips = term/ns8250.c;
|
||||
mips_qemu_mips = term/serial.c;
|
||||
mips_qemu_mips = term/at_keyboard.c;
|
||||
mips_qemu_mips = commands/boot.c;
|
||||
mips_qemu_mips = commands/keylayouts.c;
|
||||
mips_qemu_mips = term/i386/pc/vga_text.c;
|
||||
mips_qemu_mips = term/i386/vga_common.c;
|
||||
mips_qemu_mips = kern/vga_init.c;
|
||||
|
||||
mips_arc = kern/mips/arc/init.c;
|
||||
@@ -188,6 +213,7 @@ kernel = {
|
||||
mips_loongson = bus/pci.c;
|
||||
mips_loongson = kern/mips/loongson/init.c;
|
||||
mips_loongson = term/at_keyboard.c;
|
||||
mips_loongson = commands/boot.c;
|
||||
mips_loongson = term/serial.c;
|
||||
mips_loongson = video/sm712.c;
|
||||
mips_loongson = video/sis315pro.c;
|
||||
@@ -203,11 +229,22 @@ kernel = {
|
||||
sparc64_ieee1275 = kern/sparc64/dl.c;
|
||||
sparc64_ieee1275 = kern/sparc64/ieee1275/ieee1275.c;
|
||||
|
||||
arm = kern/arm/dl.c;
|
||||
arm = kern/arm/dl_helper.c;
|
||||
arm = kern/arm/cache_armv6.S;
|
||||
arm = kern/arm/cache_armv7.S;
|
||||
extra_dist = kern/arm/cache.S;
|
||||
arm = kern/arm/cache.c;
|
||||
arm = kern/arm/misc.S;
|
||||
|
||||
emu = disk/host.c;
|
||||
emu = gnulib/progname.c;
|
||||
emu = gnulib/error.c;
|
||||
emu = kern/emu/cache_s.S;
|
||||
emu = kern/emu/hostdisk.c;
|
||||
emu = osdep/unix/hostdisk.c;
|
||||
emu = osdep/exec.c;
|
||||
extra_dist = osdep/unix/exec.c;
|
||||
emu = osdep/devmapper/hostdisk.c;
|
||||
emu = osdep/hostdisk.c;
|
||||
emu = kern/emu/hostfs.c;
|
||||
emu = kern/emu/main.c;
|
||||
emu = kern/emu/argp_common.c;
|
||||
@@ -215,23 +252,28 @@ kernel = {
|
||||
emu = kern/emu/mm.c;
|
||||
emu = kern/emu/time.c;
|
||||
emu = kern/emu/cache.c;
|
||||
emu = term/emu/console.c;
|
||||
emu = osdep/emuconsole.c;
|
||||
extra_dist = osdep/unix/emuconsole.c;
|
||||
extra_dist = osdep/windows/emuconsole.c;
|
||||
emu = osdep/sleep.c;
|
||||
emu = osdep/init.c;
|
||||
emu = osdep/emunet.c;
|
||||
extra_dist = osdep/linux/emunet.c;
|
||||
extra_dist = osdep/basic/emunet.c;
|
||||
emu = osdep/cputime.c;
|
||||
extra_dist = osdep/unix/cputime.c;
|
||||
extra_dist = osdep/windows/cputime.c;
|
||||
|
||||
videoinkernel = term/gfxterm.c;
|
||||
videoinkernel = font/font.c;
|
||||
videoinkernel = font/font_cmd.c;
|
||||
videoinkernel = io/bufio.c;
|
||||
videoinkernel = video/bitmap.c;
|
||||
videoinkernel = video/bitmap_scale.c;
|
||||
videoinkernel = video/colors.c;
|
||||
videoinkernel = video/fb/fbblit.c;
|
||||
videoinkernel = video/fb/fbfill.c;
|
||||
videoinkernel = video/fb/fbutil.c;
|
||||
videoinkernel = video/fb/video_fb.c;
|
||||
videoinkernel = video/video.c;
|
||||
|
||||
videoinkernel = commands/boot.c;
|
||||
|
||||
extra_dist = kern/i386/int.S;
|
||||
extra_dist = kern/i386/realmode.S;
|
||||
extra_dist = boot/i386/pc/lzma_decode.S;
|
||||
@@ -245,9 +287,9 @@ program = {
|
||||
emu = kern/emu/full.c;
|
||||
emu_nodist = grub_emu_init.c;
|
||||
|
||||
ldadd = 'kernel.img$(EXEEXT)';
|
||||
ldadd = 'kernel.exec$(EXEEXT)';
|
||||
ldadd = '$(MODULE_FILES)';
|
||||
ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
ldadd = 'gnulib/libgnu.a $(LIBINTL) $(LIBUTIL) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
|
||||
enable = emu;
|
||||
};
|
||||
@@ -258,8 +300,8 @@ program = {
|
||||
emu = kern/emu/lite.c;
|
||||
emu_nodist = symlist.c;
|
||||
|
||||
ldadd = 'kernel.img$(EXEEXT)';
|
||||
ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
ldadd = 'kernel.exec$(EXEEXT)';
|
||||
ldadd = 'gnulib/libgnu.a $(LIBINTL) $(LIBUTIL) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
|
||||
enable = emu;
|
||||
};
|
||||
@@ -286,12 +328,34 @@ image = {
|
||||
enable = sparc64_ieee1275;
|
||||
};
|
||||
|
||||
image = {
|
||||
name = boot_hybrid;
|
||||
i386_pc = boot/i386/pc/boot.S;
|
||||
|
||||
cppflags = '-DHYBRID_BOOT=1';
|
||||
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
enable = i386_pc;
|
||||
};
|
||||
|
||||
image = {
|
||||
name = cdboot;
|
||||
|
||||
i386_pc = boot/i386/pc/cdboot.S;
|
||||
i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
|
||||
i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
|
||||
|
||||
sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;
|
||||
sparc64_ieee1275_objcopyflags = '-O a.out-sunos-big';
|
||||
sparc64_ieee1275_ldflags = ' -Wl,-Ttext=0x4000';
|
||||
sparc64_ieee1275_cppflags = '-DCDBOOT=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
|
||||
enable = sparc64_ieee1275;
|
||||
enable = i386_pc;
|
||||
};
|
||||
|
||||
@@ -345,9 +409,7 @@ image = {
|
||||
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/xzembed -DGRUB_EMBED_DECOMPRESSOR=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
mips_loongson_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_qemu_mips_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_arc_ldflags = '-static-libgcc -Wl,-Ttext,0x8bc00000';
|
||||
mips_ldflags = '-static-libgcc -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
ldadd = '-lgcc';
|
||||
cflags = '-Wno-unreachable-code -static-libgcc';
|
||||
enable = mips;
|
||||
@@ -361,9 +423,7 @@ image = {
|
||||
cppflags = '-DGRUB_EMBED_DECOMPRESSOR=1';
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
mips_loongson_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_qemu_mips_ldflags = '-static-libgcc -Wl,-Ttext,0x80100000';
|
||||
mips_arc_ldflags = '-static-libgcc -Wl,-Ttext,0x8bc00000';
|
||||
mips_ldflags = '-static-libgcc -Wl,-Ttext,$(TARGET_DECOMPRESSOR_LINK_ADDR)';
|
||||
ldadd = '-lgcc';
|
||||
cflags = '-static-libgcc';
|
||||
enable = mips;
|
||||
@@ -372,6 +432,7 @@ image = {
|
||||
image = {
|
||||
name = lzma_decompress;
|
||||
i386_pc = boot/i386/pc/startup_raw.S;
|
||||
i386_pc_nodist = rs_decoder.h;
|
||||
|
||||
objcopyflags = '-O binary';
|
||||
ldflags = '$(TARGET_IMG_LDFLAGS) $(TARGET_IMG_BASE_LDOPT),0x8200';
|
||||
@@ -394,6 +455,11 @@ image = {
|
||||
enable = mips_loongson;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = disk;
|
||||
common = lib/disk.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = trig;
|
||||
common_nodist = trigtables.c;
|
||||
@@ -451,10 +517,16 @@ module = {
|
||||
enable = usb;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = usbserial_usbdebug;
|
||||
common = bus/usb/serial/usbdebug_late.c;
|
||||
enable = usb;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = uhci;
|
||||
common = bus/usb/uhci.c;
|
||||
enable = x86;
|
||||
enable = pci;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -479,6 +551,15 @@ module = {
|
||||
enable = i386_multiboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = nativedisk;
|
||||
common = commands/nativedisk.c;
|
||||
|
||||
enable = x86;
|
||||
enable = mips_loongson;
|
||||
enable = mips_qemu_mips;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = emupci;
|
||||
common = bus/emu/pci.c;
|
||||
@@ -507,17 +588,53 @@ module = {
|
||||
enable = cmos;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cmosdump;
|
||||
common = commands/i386/cmosdump.c;
|
||||
enable = cmos;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = iorw;
|
||||
common = commands/iorw.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cbtable;
|
||||
common = kern/i386/coreboot/cbtable.c;
|
||||
enable = i386_pc;
|
||||
enable = i386_efi;
|
||||
enable = i386_qemu;
|
||||
enable = i386_multiboot;
|
||||
enable = i386_ieee1275;
|
||||
enable = x86_64_efi;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cbtime;
|
||||
common = commands/i386/coreboot/cb_timestamps.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cbls;
|
||||
common = commands/i386/coreboot/cbls.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cbmemc;
|
||||
common = term/i386/coreboot/cbmemc.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = regexp;
|
||||
common = commands/regexp.c;
|
||||
common = commands/wildcard.c;
|
||||
ldadd = libgnulib.a;
|
||||
dependencies = libgnulib.a;
|
||||
cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
|
||||
cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
|
||||
};
|
||||
@@ -572,6 +689,18 @@ module = {
|
||||
enable = efi;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = lsefi;
|
||||
common = commands/efi/lsefi.c;
|
||||
enable = efi;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = efifwsetup;
|
||||
efi = commands/efi/efifwsetup.c;
|
||||
enable = efi;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = blocklist;
|
||||
common = commands/blocklist.c;
|
||||
@@ -581,7 +710,14 @@ module = {
|
||||
name = boot;
|
||||
common = commands/boot.c;
|
||||
i386_pc = lib/i386/pc/biosnum.c;
|
||||
enable = videomodules;
|
||||
enable = x86;
|
||||
enable = emu;
|
||||
enable = sparc64_ieee1275;
|
||||
enable = powerpc_ieee1275;
|
||||
enable = mips_arc;
|
||||
enable = ia64_efi;
|
||||
enable = arm_efi;
|
||||
enable = arm_uboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -623,6 +759,11 @@ module = {
|
||||
common = commands/echo.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = eval;
|
||||
common = commands/eval.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = extcmd;
|
||||
common = commands/extcmd.c;
|
||||
@@ -657,6 +798,7 @@ module = {
|
||||
efi = lib/efi/halt.c;
|
||||
ieee1275 = lib/ieee1275/halt.c;
|
||||
emu = lib/emu/halt.c;
|
||||
uboot = lib/uboot/halt.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -665,11 +807,13 @@ module = {
|
||||
i386 = lib/i386/reboot_trampoline.S;
|
||||
ia64_efi = lib/efi/reboot.c;
|
||||
x86_64_efi = lib/efi/reboot.c;
|
||||
arm_efi = lib/efi/reboot.c;
|
||||
powerpc_ieee1275 = lib/ieee1275/reboot.c;
|
||||
sparc64_ieee1275 = lib/ieee1275/reboot.c;
|
||||
mips_arc = lib/mips/arc/reboot.c;
|
||||
mips_loongson = lib/mips/loongson/reboot.c;
|
||||
mips_qemu_mips = lib/mips/qemu_mips/reboot.c;
|
||||
uboot = lib/uboot/reboot.c;
|
||||
common = commands/reboot.c;
|
||||
};
|
||||
|
||||
@@ -678,6 +822,13 @@ module = {
|
||||
common = commands/hashsum.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = verify;
|
||||
common = commands/verify.c;
|
||||
cflags = '$(CFLAGS_POSIX)';
|
||||
cppflags = '-I$(srcdir)/lib/posix_wrap';
|
||||
};
|
||||
|
||||
module = {
|
||||
name = hdparm;
|
||||
common = commands/hdparm.c;
|
||||
@@ -763,6 +914,18 @@ module = {
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = spkmodem;
|
||||
x86 = term/spkmodem.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = morse;
|
||||
x86 = term/morse.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = probe;
|
||||
common = commands/probe.c;
|
||||
@@ -800,6 +963,12 @@ module = {
|
||||
enable = pci;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = pcidump;
|
||||
common = commands/pcidump.c;
|
||||
enable = pci;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = sleep;
|
||||
common = commands/sleep.c;
|
||||
@@ -1007,6 +1176,11 @@ module = {
|
||||
enable = videomodules;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = procfs;
|
||||
common = fs/proc.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = affs;
|
||||
common = fs/affs.c;
|
||||
@@ -1030,6 +1204,16 @@ module = {
|
||||
cppflags = '-I$(srcdir)/lib/posix_wrap -I$(srcdir)/lib/minilzo -DMINILZO_HAVE_CONFIG_H';
|
||||
};
|
||||
|
||||
module = {
|
||||
name = archelp;
|
||||
common = fs/archelp.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cbfs;
|
||||
common = fs/cbfs.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cpio;
|
||||
common = fs/cpio.c;
|
||||
@@ -1080,6 +1264,11 @@ module = {
|
||||
common = fs/hfsplus.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = hfspluscomp;
|
||||
common = fs/hfspluscomp.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = iso9660;
|
||||
common = fs/iso9660.c;
|
||||
@@ -1172,6 +1361,11 @@ module = {
|
||||
common = fs/ufs.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = ufs1_be;
|
||||
common = fs/ufs_be.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = ufs2;
|
||||
common = fs/ufs2.c;
|
||||
@@ -1186,6 +1380,7 @@ module = {
|
||||
name = zfs;
|
||||
common = fs/zfs/zfs.c;
|
||||
common = fs/zfs/zfs_lzjb.c;
|
||||
common = fs/zfs/zfs_lz4.c;
|
||||
common = fs/zfs/zfs_sha256.c;
|
||||
common = fs/zfs/zfs_fletcher.c;
|
||||
};
|
||||
@@ -1250,6 +1445,8 @@ module = {
|
||||
module = {
|
||||
name = elf;
|
||||
common = kern/elf.c;
|
||||
|
||||
extra_dist = kern/elfXX.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1292,6 +1489,7 @@ module = {
|
||||
name = datetime;
|
||||
cmos = lib/cmos_datetime.c;
|
||||
efi = lib/efi/datetime.c;
|
||||
uboot = lib/uboot/datetime.c;
|
||||
sparc64_ieee1275 = lib/ieee1275/datetime.c;
|
||||
powerpc_ieee1275 = lib/ieee1275/datetime.c;
|
||||
sparc64_ieee1275 = lib/ieee1275/cmos.c;
|
||||
@@ -1311,6 +1509,7 @@ module = {
|
||||
extra_dist = lib/powerpc/setjmp.S;
|
||||
extra_dist = lib/ia64/setjmp.S;
|
||||
extra_dist = lib/ia64/longjmp.S;
|
||||
extra_dist = lib/arm/setjmp.S;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1340,9 +1539,10 @@ module = {
|
||||
|
||||
module = {
|
||||
name = linux16;
|
||||
i386_pc = loader/i386/pc/linux.c;
|
||||
i386_pc = lib/cmdline.c;
|
||||
enable = i386_pc;
|
||||
common = loader/i386/pc/linux.c;
|
||||
common = loader/linux.c;
|
||||
common = lib/cmdline.c;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1389,6 +1589,9 @@ module = {
|
||||
powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c;
|
||||
sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
|
||||
ia64_efi = loader/ia64/efi/linux.c;
|
||||
arm = loader/arm/linux.c;
|
||||
arm = lib/fdt.c;
|
||||
common = loader/linux.c;
|
||||
common = lib/cmdline.c;
|
||||
enable = noemu;
|
||||
};
|
||||
@@ -1439,6 +1642,7 @@ module = {
|
||||
|
||||
enable = x86;
|
||||
enable = ia64_efi;
|
||||
enable = arm_efi;
|
||||
enable = mips;
|
||||
};
|
||||
|
||||
@@ -1533,6 +1737,11 @@ module = {
|
||||
common = partmap/sunpc.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = part_dfly;
|
||||
common = partmap/dfly.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = msdospart;
|
||||
common = parttool/msdospart.c;
|
||||
@@ -1550,15 +1759,22 @@ module = {
|
||||
enable = videomodules;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = gfxterm_background;
|
||||
common = term/gfxterm_background.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = serial;
|
||||
common = term/serial.c;
|
||||
x86 = term/ns8250.c;
|
||||
ieee1275 = term/ieee1275/serial.c;
|
||||
mips_arc = term/arc/serial.c;
|
||||
efi = term/efi/serial.c;
|
||||
|
||||
enable = terminfomodule;
|
||||
enable = ieee1275;
|
||||
enable = mips_arc;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1584,17 +1800,21 @@ module = {
|
||||
name = vga;
|
||||
common = video/i386/pc/vga.c;
|
||||
enable = i386_pc;
|
||||
enable = i386_coreboot;
|
||||
enable = i386_multiboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = vga_text;
|
||||
common = term/i386/pc/vga_text.c;
|
||||
common = term/i386/vga_common.c;
|
||||
enable = i386_pc;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = mda_text;
|
||||
common = term/i386/pc/mda_text.c;
|
||||
enable = i386_pc;
|
||||
enable = i386_coreboot_multiboot_qemu;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = video_cirrus;
|
||||
x86 = video/cirrus.c;
|
||||
@@ -1611,6 +1831,10 @@ module = {
|
||||
name = functional_test;
|
||||
common = tests/lib/functional_test.c;
|
||||
common = tests/lib/test.c;
|
||||
common = tests/checksums.h;
|
||||
common = tests/video_checksum.c;
|
||||
common = tests/fake_input.c;
|
||||
common = video/capture.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1618,16 +1842,34 @@ module = {
|
||||
common = tests/example_functional_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = setjmp_test;
|
||||
common = tests/setjmp_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = videotest_checksum;
|
||||
common = tests/videotest_checksum.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = gfxterm_menu;
|
||||
common = tests/gfxterm_menu.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = cmdline_cat_test;
|
||||
common = tests/cmdline_cat_test.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = bitmap;
|
||||
common = video/bitmap.c;
|
||||
enable = videomodules;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = bitmap_scale;
|
||||
common = video/bitmap_scale.c;
|
||||
enable = videomodules;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1662,8 +1904,6 @@ module = {
|
||||
name = vbe;
|
||||
common = video/i386/pc/vbe.c;
|
||||
enable = i386_pc;
|
||||
enable = i386_coreboot;
|
||||
enable = i386_multiboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1678,10 +1918,14 @@ module = {
|
||||
module = {
|
||||
name = video;
|
||||
common = video/video.c;
|
||||
common = video/colors.c;
|
||||
enable = videomodules;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = video_colors;
|
||||
common = video/colors.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = ieee1275_fb;
|
||||
ieee1275 = video/ieee1275.c;
|
||||
@@ -1731,6 +1975,12 @@ module = {
|
||||
enable = ieee1275;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = ubootnet;
|
||||
common = net/drivers/uboot/ubootnet.c;
|
||||
enable = uboot;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = efinet;
|
||||
common = net/drivers/efi/efinet.c;
|
||||
@@ -1748,7 +1998,12 @@ module = {
|
||||
common = commands/legacycfg.c;
|
||||
common = lib/legacy_parse.c;
|
||||
emu = lib/i386/pc/vesa_modes_table.c;
|
||||
i386_efi = lib/i386/pc/vesa_modes_table.c;
|
||||
x86_64_efi = lib/i386/pc/vesa_modes_table.c;
|
||||
|
||||
enable = i386_pc;
|
||||
enable = i386_efi;
|
||||
enable = x86_64_efi;
|
||||
enable = emu;
|
||||
};
|
||||
|
||||
@@ -1796,7 +2051,7 @@ module = {
|
||||
module = {
|
||||
name = keylayouts;
|
||||
common = commands/keylayouts.c;
|
||||
enable = videomodules;
|
||||
enable = x86;
|
||||
};
|
||||
|
||||
module = {
|
||||
@@ -1815,6 +2070,12 @@ module = {
|
||||
condition = COND_ENABLE_CACHE_STATS;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = boottime;
|
||||
common = commands/boottime.c;
|
||||
condition = COND_ENABLE_BOOT_TIME_STATS;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = adler32;
|
||||
common = lib/adler32.c;
|
||||
@@ -1825,6 +2086,36 @@ module = {
|
||||
common = lib/crc64.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = mpi;
|
||||
common = lib/libgcrypt-grub/mpi/mpiutil.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-bit.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-add.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-mul.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-mod.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-gcd.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-div.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-cmp.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-inv.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-pow.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-mpow.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-lshift.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-mul.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-mul1.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-mul2.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-mul3.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-add1.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-sub1.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-div.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpicoder.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpih-rshift.c;
|
||||
common = lib/libgcrypt-grub/mpi/mpi-inline.c;
|
||||
common = lib/libgcrypt_wrap/mem.c;
|
||||
|
||||
cflags = '$(CFLAGS_GCRY) -Wno-redundant-decls -Wno-sign-compare';
|
||||
cppflags = '$(CPPFLAGS_GCRY)';
|
||||
};
|
||||
|
||||
module = {
|
||||
name = all_video;
|
||||
common = lib/fake_module.c;
|
||||
@@ -1840,3 +2131,17 @@ module = {
|
||||
enable = i386;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = testspeed;
|
||||
common = commands/testspeed.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = tr;
|
||||
common = commands/tr.c;
|
||||
};
|
||||
|
||||
module = {
|
||||
name = progress;
|
||||
common = lib/progress.c;
|
||||
};
|
||||
|
||||
@@ -28,6 +28,81 @@
|
||||
#define MSG(x) movw $x, %si; call LOCAL(message)
|
||||
#define ERR(x) movw $x, %si; jmp LOCAL(error_message)
|
||||
|
||||
.macro floppy
|
||||
part_start:
|
||||
|
||||
probe_values:
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
|
||||
movw $probe_values - 1, %si
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int $0x13
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
cmpb $0, %cl
|
||||
jne 1f
|
||||
|
||||
/*
|
||||
* Floppy disk probe failure.
|
||||
*/
|
||||
MSG(fd_probe_error_string)
|
||||
jmp LOCAL(general_error)
|
||||
|
||||
/* "Floppy" */
|
||||
fd_probe_error_string: .asciz "Floppy"
|
||||
|
||||
1:
|
||||
/* perform read */
|
||||
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw $0x201, %ax
|
||||
movb $0, %ch
|
||||
movb $0, %dh
|
||||
int $0x13
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb $1, %dh
|
||||
movb $79, %ch
|
||||
|
||||
jmp LOCAL(final_init)
|
||||
.endm
|
||||
|
||||
.macro scratch
|
||||
|
||||
/* scratch space */
|
||||
mode:
|
||||
.byte 0
|
||||
disk_address_packet:
|
||||
sectors:
|
||||
.long 0
|
||||
heads:
|
||||
.long 0
|
||||
cylinders:
|
||||
.word 0
|
||||
sector_start:
|
||||
.byte 0
|
||||
head_start:
|
||||
.byte 0
|
||||
cylinder_start:
|
||||
.word 0
|
||||
/* more space... */
|
||||
.endm
|
||||
|
||||
.file "boot.S"
|
||||
|
||||
.text
|
||||
@@ -51,6 +126,34 @@ start:
|
||||
jmp LOCAL(after_BPB)
|
||||
nop /* do I care about this ??? */
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
nop
|
||||
nop
|
||||
jmp LOCAL(after_BPB)
|
||||
#else
|
||||
/*
|
||||
* This space is for the BIOS parameter block!!!! Don't change
|
||||
* the first jump, nor start the code anywhere but right after
|
||||
@@ -59,27 +162,14 @@ start:
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BPB_START
|
||||
. = _start + 4
|
||||
|
||||
/* scratch space */
|
||||
mode:
|
||||
.byte 0
|
||||
disk_address_packet:
|
||||
sectors:
|
||||
.long 0
|
||||
heads:
|
||||
.long 0
|
||||
cylinders:
|
||||
.word 0
|
||||
sector_start:
|
||||
.byte 0
|
||||
head_start:
|
||||
.byte 0
|
||||
cylinder_start:
|
||||
.word 0
|
||||
/* more space... */
|
||||
#endif
|
||||
#ifdef HYBRID_BOOT
|
||||
floppy
|
||||
#else
|
||||
scratch
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BPB_END
|
||||
|
||||
/*
|
||||
* End of BIOS parameter block.
|
||||
*/
|
||||
@@ -87,9 +177,11 @@ cylinder_start:
|
||||
kernel_address:
|
||||
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
|
||||
#ifndef HYBRID_BOOT
|
||||
. = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR
|
||||
kernel_sector:
|
||||
.long 1, 0
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE
|
||||
boot_drive:
|
||||
@@ -410,6 +502,11 @@ LOCAL(message):
|
||||
* number here.
|
||||
*/
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
. = _start + 0x1b0
|
||||
kernel_sector:
|
||||
.long 1, 0
|
||||
#endif
|
||||
. = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
|
||||
nt_magic:
|
||||
.long 0
|
||||
@@ -419,62 +516,17 @@ nt_magic:
|
||||
* This is where an MBR would go if on a hard disk. The code
|
||||
* here isn't even referenced unless we're on a floppy. Kinda
|
||||
* sneaky, huh?
|
||||
*/
|
||||
*/
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_PART_START
|
||||
part_start:
|
||||
|
||||
probe_values:
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
|
||||
movw $probe_values - 1, %si
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int $0x13
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
cmpb $0, %cl
|
||||
jne 1f
|
||||
|
||||
/*
|
||||
* Floppy disk probe failure.
|
||||
*/
|
||||
MSG(fd_probe_error_string)
|
||||
jmp LOCAL(general_error)
|
||||
|
||||
/* "Floppy" */
|
||||
fd_probe_error_string: .asciz "Floppy"
|
||||
|
||||
1:
|
||||
/* perform read */
|
||||
movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw $0x201, %ax
|
||||
movb $0, %ch
|
||||
movb $0, %dh
|
||||
int $0x13
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb $1, %dh
|
||||
movb $79, %ch
|
||||
|
||||
jmp LOCAL(final_init)
|
||||
#ifndef HYBRID_BOOT
|
||||
floppy
|
||||
#else
|
||||
scratch
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_PART_END
|
||||
|
||||
|
||||
/* the last 2 bytes in the sector 0 contain the signature */
|
||||
.word GRUB_BOOT_MACHINE_SIGNATURE
|
||||
|
||||
@@ -93,11 +93,12 @@ LOCAL(read_cdrom):
|
||||
pushw $CDBLK_LENG
|
||||
|
||||
/* Block number. */
|
||||
incl %esi
|
||||
pushl %eax
|
||||
pushl %esi
|
||||
|
||||
/* Buffer address. */
|
||||
pushw $((DATA_ADDR - 0x400)>> 4)
|
||||
pushw $((DATA_ADDR - 0x200)>> 4)
|
||||
pushl %eax
|
||||
pushw $0x10
|
||||
|
||||
@@ -167,6 +168,6 @@ err_noboot_msg:
|
||||
err_cdfail_msg:
|
||||
.ascii "cdrom read fails\0"
|
||||
|
||||
. = start + 0x1FF
|
||||
. = start + 0x7FF
|
||||
|
||||
.byte 0
|
||||
|
||||
@@ -207,6 +207,10 @@ real_code_2:
|
||||
2:
|
||||
call LOCAL(move_memory)
|
||||
|
||||
movb %dh, %ss:(DATA_ADDR + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 2)
|
||||
movb (reg_edx + 2 - start), %dh
|
||||
movb %dh, %ss:(DATA_ADDR + GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE + 1)
|
||||
|
||||
movb $0xFF, %dh
|
||||
|
||||
ljmp $(DATA_ADDR >> 4), $0
|
||||
|
||||
@@ -100,7 +100,6 @@ LOCAL (codestart):
|
||||
/* The ".code32" directive takes GAS out of 16-bit mode. */
|
||||
.code32
|
||||
|
||||
incl %eax
|
||||
cld
|
||||
call grub_gate_a20
|
||||
|
||||
@@ -119,12 +118,12 @@ LOCAL (codestart):
|
||||
|
||||
#include "../../../kern/i386/realmode.S"
|
||||
|
||||
#include <rs_decoder.S>
|
||||
#include <rs_decoder.h>
|
||||
|
||||
.text
|
||||
|
||||
/*
|
||||
* grub_gate_a20(int on)
|
||||
* grub_gate_a20(void)
|
||||
*
|
||||
* Gate address-line 20 for high memory.
|
||||
*
|
||||
@@ -134,12 +133,10 @@ LOCAL (codestart):
|
||||
*/
|
||||
|
||||
grub_gate_a20:
|
||||
movl %eax, %edx
|
||||
|
||||
gate_a20_test_current_state:
|
||||
/* first of all, test if already in a good state */
|
||||
call gate_a20_check_state
|
||||
cmpb %al, %dl
|
||||
testb %al, %al
|
||||
jnz gate_a20_try_bios
|
||||
ret
|
||||
|
||||
@@ -149,18 +146,15 @@ gate_a20_try_bios:
|
||||
call prot_to_real
|
||||
|
||||
.code16
|
||||
movw $0x2400, %ax
|
||||
testb %dl, %dl
|
||||
jz 1f
|
||||
incw %ax
|
||||
1: int $0x15
|
||||
movw $0x2401, %ax
|
||||
int $0x15
|
||||
|
||||
DATA32 call real_to_prot
|
||||
.code32
|
||||
|
||||
popl %ebp
|
||||
call gate_a20_check_state
|
||||
cmpb %al, %dl
|
||||
testb %al, %al
|
||||
jnz gate_a20_try_system_control_port_a
|
||||
ret
|
||||
|
||||
@@ -172,20 +166,13 @@ gate_a20_try_system_control_port_a:
|
||||
/* fourth, try the system control port A */
|
||||
inb $0x92
|
||||
andb $(~0x03), %al
|
||||
testb %dl, %dl
|
||||
jz 6f
|
||||
orb $0x02, %al
|
||||
6: outb $0x92
|
||||
outb $0x92
|
||||
|
||||
/* When turning off Gate A20, do not check the state strictly,
|
||||
because a failure is not fatal usually, and Gate A20 is always
|
||||
on some modern machines. */
|
||||
testb %dl, %dl
|
||||
jz 7f
|
||||
call gate_a20_check_state
|
||||
cmpb %al, %dl
|
||||
testb %al, %al
|
||||
jnz gate_a20_try_keyboard_controller
|
||||
7: ret
|
||||
ret
|
||||
|
||||
gate_a20_flush_keyboard_buffer:
|
||||
inb $0x64
|
||||
@@ -211,11 +198,8 @@ gate_a20_try_keyboard_controller:
|
||||
andb $0x02, %al
|
||||
jnz 4b
|
||||
|
||||
movb $0xdd, %al
|
||||
testb %dl, %dl
|
||||
jz 5f
|
||||
orb $0x02, %al
|
||||
5: outb $0x60
|
||||
movb $0xdf, %al
|
||||
outb $0x60
|
||||
call gate_a20_flush_keyboard_buffer
|
||||
|
||||
/* output a dummy command (USB keyboard hack) */
|
||||
@@ -224,7 +208,7 @@ gate_a20_try_keyboard_controller:
|
||||
call gate_a20_flush_keyboard_buffer
|
||||
|
||||
call gate_a20_check_state
|
||||
cmpb %al, %dl
|
||||
testb %al, %al
|
||||
/* everything failed, so restart from the beginning */
|
||||
jnz gate_a20_try_bios
|
||||
ret
|
||||
@@ -234,7 +218,7 @@ gate_a20_check_state:
|
||||
movl $100, %ecx
|
||||
1:
|
||||
call 3f
|
||||
cmpb %al, %dl
|
||||
testb %al, %al
|
||||
jz 2f
|
||||
loop 1b
|
||||
2:
|
||||
@@ -263,9 +247,8 @@ gate_a20_check_state:
|
||||
pushl %ebx
|
||||
addl $0x100000, %ebx
|
||||
movb (%ebx), %ch
|
||||
/* this result is 1 if A20 is on or 0 if it is off */
|
||||
/* this result is 0 if A20 is on or 1 if it is off */
|
||||
subb %ch, %al
|
||||
xorb $1, %al
|
||||
/* restore the original */
|
||||
popl %ebx
|
||||
movb %cl, (%ebx)
|
||||
|
||||
@@ -51,6 +51,13 @@ VARIABLE(grub_core_entry_addr)
|
||||
pushl $1f
|
||||
DATA32 jmp real_to_prot
|
||||
.code32
|
||||
/* Ensure A20 is enabled. We're in qemu, so control port A works
|
||||
and there is no need to wait since there is no real logic, it's
|
||||
all emulated. */
|
||||
inb $0x92
|
||||
andb $(~0x03), %al
|
||||
orb $0x02, %al
|
||||
outb $0x92
|
||||
1:
|
||||
movl grub_core_entry_addr, %edx
|
||||
jmp *%edx
|
||||
|
||||
@@ -754,140 +754,3 @@ continue:
|
||||
#endif
|
||||
|
||||
cached_continue:
|
||||
#ifndef FULOONG2F
|
||||
/* We have to init video early enough or watchdog will reboot us. */
|
||||
|
||||
/* Setup PCI controller. */
|
||||
|
||||
lui $t0, %hi (GRUB_CPU_LOONGSON_PCI_HIT1_SEL_LO)
|
||||
lui $t1, %hi(0x8000000c)
|
||||
addiu $t1, $t1, %lo(0x8000000c)
|
||||
|
||||
sw $t1, %lo (GRUB_CPU_LOONGSON_PCI_HIT1_SEL_LO) ($t0)
|
||||
li $t1, 0xffffffff
|
||||
sw $t1, %lo (GRUB_CPU_LOONGSON_PCI_HIT1_SEL_HI) ($t0)
|
||||
|
||||
li $t0, GRUB_MACHINE_PCI_CONTROLLER_HEADER
|
||||
li $t1, (GRUB_PCI_COMMAND_PARITY_ERROR | GRUB_PCI_COMMAND_BUS_MASTER \
|
||||
| GRUB_PCI_COMMAND_MEM_ENABLED)
|
||||
sh $t0, GRUB_PCI_REG_COMMAND ($t1)
|
||||
li $t1, ((1 << GRUB_PCI_STATUS_DEVSEL_TIMING_SHIFT) \
|
||||
| GRUB_PCI_STATUS_FAST_B2B_CAPABLE \
|
||||
| GRUB_PCI_STATUS_66MHZ_CAPABLE \
|
||||
| GRUB_PCI_STATUS_CAPABILITIES)
|
||||
sh $t0, GRUB_PCI_REG_STATUS ($t1)
|
||||
li $t0, 0xff
|
||||
sw $t0, GRUB_PCI_REG_CACHELINE ($t1)
|
||||
lui $t1, %hi(0x80000000 | GRUB_PCI_ADDR_MEM_TYPE_64 \
|
||||
| GRUB_PCI_ADDR_MEM_PREFETCH)
|
||||
addiu $t1, $t1, %lo(0x80000000 | GRUB_PCI_ADDR_MEM_TYPE_64 \
|
||||
| GRUB_PCI_ADDR_MEM_PREFETCH)
|
||||
sw $t0, GRUB_PCI_REG_ADDRESS_REG0 ($t1)
|
||||
sw $zero, GRUB_PCI_REG_ADDRESS_REG1 ($t1)
|
||||
|
||||
/* Find video. */
|
||||
/* $t4 chooses device in priority encoding. */
|
||||
/* Resulting value is kept in GRUB_MACHINE_PCI_CONF_CTRL_REG.
|
||||
This way we don't need to sacrifice a register for it. */
|
||||
retry_sm712:
|
||||
/* We have only one bus (0). Function is 0. */
|
||||
lui $t0, %hi(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR)
|
||||
lui $t1, %hi(GRUB_MACHINE_PCI_CONFSPACE)
|
||||
lui $t3, %hi(GRUB_SM712_PCIID)
|
||||
addiu $t3, $t3, %lo(GRUB_SM712_PCIID)
|
||||
ori $t4, $zero, 1
|
||||
1:
|
||||
andi $t4, $t4, ((1 << GRUB_PCI_NUM_DEVICES) - 1)
|
||||
/* In case of failure try again. SM712 may be slow to come up. */
|
||||
beql $t4, $zero, retry_sm712
|
||||
nop
|
||||
sw $t4, %lo(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR) ($t0)
|
||||
lw $t2, (%lo(GRUB_MACHINE_PCI_CONFSPACE) + GRUB_PCI_REG_PCI_ID) ($t1)
|
||||
bnel $t2, $t3, 1b
|
||||
sll $t4, $t4, 1
|
||||
|
||||
/* FIXME: choose address dynamically if needed. */
|
||||
#define SM712_MAP 0x04000000
|
||||
|
||||
lui $t2, %hi(SM712_MAP)
|
||||
sw $t4, %lo(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR) ($t0)
|
||||
sw $t2, (%lo(GRUB_MACHINE_PCI_CONFSPACE) + GRUB_PCI_REG_ADDRESS_REG0) ($t1)
|
||||
|
||||
/* Set latency. */
|
||||
li $t2, 0x8
|
||||
sw $t4, %lo(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR) ($t0)
|
||||
sw $t2, (%lo(GRUB_MACHINE_PCI_CONFSPACE) + GRUB_PCI_REG_CACHELINE) ($t1)
|
||||
|
||||
/* Enable address spaces. */
|
||||
li $t2, 0x7
|
||||
sw $t4, %lo(GRUB_MACHINE_PCI_CONF_CTRL_REG_ADDR) ($t0)
|
||||
sw $t2, (%lo(GRUB_MACHINE_PCI_CONFSPACE) + GRUB_PCI_REG_COMMAND) ($t1)
|
||||
|
||||
lui $t3, %hi(GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_INDEX)
|
||||
li $t2, 0x18
|
||||
sb $t2, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_INDEX)($t3)
|
||||
|
||||
lui $t3, %hi(GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_DATA)
|
||||
li $t2, 0x11
|
||||
sb $t2, %lo(GRUB_MACHINE_PCI_IO_BASE + GRUB_VGA_IO_SR_DATA)($t3)
|
||||
|
||||
li $t2, ((((SM712_MAP & ~GRUB_MACHINE_PCI_WIN_OFFSET_MASK) \
|
||||
>> GRUB_MACHINE_PCI_WIN_SHIFT) \
|
||||
& GRUB_MACHINE_PCI_WIN_MASK))
|
||||
lui $t3, %hi(0xbfe00110)
|
||||
addiu $t3, $t3, %lo(0xbfe00110)
|
||||
sw $t2, 0 ($t3)
|
||||
li $t2, (GRUB_MACHINE_PCI_WIN1_ADDR \
|
||||
| (SM712_MAP & GRUB_MACHINE_PCI_WIN_OFFSET_MASK))
|
||||
|
||||
lui $t3, %hi(GRUB_SM712_REG_BASE)
|
||||
addiu $t3, $t3, %lo(GRUB_SM712_REG_BASE)
|
||||
addu $t2, $t2, $t3
|
||||
lui $t0, %hi(init_table - 0x20000000)
|
||||
addiu $t0, $t0, %lo(init_table - 0x20000000)
|
||||
lui $t1, %hi(init_table_end - 0x20000000)
|
||||
addiu $t1, $t1, %lo(init_table_end - 0x20000000)
|
||||
li $t5, 0x80
|
||||
addiu $t6, $t2, 0x3c0
|
||||
|
||||
table_cont:
|
||||
lb $t3, 0($t0)
|
||||
andi $t5, $t3, 0x80
|
||||
andi $t3, $t3, 0x7f
|
||||
addu $t3, $t3, $t6
|
||||
lb $t4, 1($t0)
|
||||
|
||||
bne $zero, $t5, 1f
|
||||
addiu $t0, $t0, 2
|
||||
b 2f
|
||||
sb $t4, 0($t3)
|
||||
1:
|
||||
lb $t4, 0($t3)
|
||||
2:
|
||||
bne $t0, $t1, table_cont
|
||||
nop
|
||||
|
||||
lui $t3, %hi(0x40c000 - GRUB_SM712_REG_BASE)
|
||||
addiu $t3, $t3, %lo(0x40c000 - GRUB_SM712_REG_BASE)
|
||||
addu $t1, $t2, $t3
|
||||
sw $zero, 0xc ($t1)
|
||||
sw $zero, 0x40 ($t1)
|
||||
li $t3, 0x20000
|
||||
sw $t3, 0x0 ($t1)
|
||||
lui $t3, %hi(0x1020100)
|
||||
addiu $t3, $t3, %lo(0x1020100)
|
||||
sw $t3, 0x10 ($t1)
|
||||
|
||||
li $t4, 0x16
|
||||
sb $t4, GRUB_VGA_IO_SR_INDEX($t2)
|
||||
|
||||
lb $t4, GRUB_VGA_IO_SR_DATA($t2)
|
||||
|
||||
b init_end
|
||||
nop
|
||||
init_table:
|
||||
#include "sm712_start.S"
|
||||
init_table_end:
|
||||
.align 4
|
||||
init_end:
|
||||
#endif
|
||||
|
||||
@@ -196,6 +196,21 @@ do_check:
|
||||
argfw:
|
||||
not $s7, $a2
|
||||
cmdlinedone:
|
||||
#endif
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
lui $t0, %hi(_start - 256)
|
||||
addiu $t0, $t0, %lo(_start - 256)
|
||||
addiu $t3, $t0, 255
|
||||
lw $t1, 0($a1)
|
||||
1:
|
||||
bne $t0, $t3, 2f
|
||||
lb $t2, 0($t1)
|
||||
move $t2, $zero
|
||||
2:
|
||||
sb $t2, 0($t0)
|
||||
addiu $t0, $t0, 1
|
||||
bnez $t2, 1b
|
||||
addiu $t1, $t1, 1
|
||||
#endif
|
||||
/* Copy the decompressor. */
|
||||
lui $t1, %hi(base)
|
||||
@@ -253,10 +268,15 @@ cmdlinedone:
|
||||
lui $t0, %hi(EXT_C(grub_decompress_core))
|
||||
addiu $t0, $t0, %lo(EXT_C(grub_decompress_core))
|
||||
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
lui $sp, %hi(_start - 512)
|
||||
jalr $t0
|
||||
addiu $sp, $sp, %lo(_start - 512)
|
||||
#else
|
||||
lui $sp, %hi(_start - 256)
|
||||
jalr $t0
|
||||
addiu $sp, $sp, %lo(_start - 256)
|
||||
|
||||
#endif
|
||||
move $a0, $s1
|
||||
move $a1, $s6
|
||||
|
||||
|
||||
73
grub-core/boot/powerpc/bootinfo.txt.in
Normal file
73
grub-core/boot/powerpc/bootinfo.txt.in
Normal file
@@ -0,0 +1,73 @@
|
||||
<chrp-boot>
|
||||
<description>@PACKAGE@ @VERSION@</description>
|
||||
<os-name>@PACKAGE@ @VERSION@</os-name>
|
||||
<boot-script>boot &device;:\boot\grub\powerpc.elf</boot-script>
|
||||
<icon size=64,64 color-space=3,3,2>
|
||||
<bitmap>
|
||||
FF FF FF FF FF FF FF FF FF FF 92 6D 6D 6D 6D 6D 6D 6D 6D 6D DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 92 6D 92 92 92 DB FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF DB 6D 92 DB FF FF FF FF FF DB B6 FF FF 92 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 DB FF FF FF FF FF B6 6D 92 DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF 49 92 FF FF B6 B6 24 00 24 00 00 00 00 49 6D DB 6D 92 DB B6 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 6D DB 92 6D 24 49 92 6D 6D FF FF FF 92 6D FF FF FF FF FF FF
|
||||
FF FF FF FF B6 49 DB FF FF 24 00 00 00 92 92 B6 FF DB DB FF DB B6 FF DB 92 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 6D B6 FF 6D B6 6D 6D 92 24 24 00 00 24 6D FF FF 49 DB FF FF FF FF
|
||||
FF FF FF B6 49 FF DB 49 24 00 49 6D B6 FF B6 92 6D 6D 6D 92 DB DB DB B6 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB FF FF FF FF DB B6 B6 B6 FF DB 24 00 00 92 B6 FF 49 FF FF FF FF
|
||||
FF FF DB 49 FF FF 49 00 00 24 FF FF 6D 49 92 DB FF FF FF DB 92 92 92 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 92 6D 6D B6 DB DB B6 6D 6D FF FF 24 00 00 DB FF 49 FF FF FF
|
||||
FF FF 49 FF FF 49 00 00 6D DB DB 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 B6 24 00 24 DB DB 6D FF FF
|
||||
FF B6 92 FF B6 00 00 24 FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF 00 00 49 FF 92 B6 FF
|
||||
FF 6D FF FF 92 00 00 49 FF 6D FF FF FF FF FF FF FF FF FF FF FF FF FF B6 92 92 6D 6D 6D 6D DB FF FF FF FF FF FF B6 92 92 92 92 92 FF FF FF FF FF FF FF FF FF FF FF FF 6D FF 24 00 24 FF FF 6D FF
|
||||
DB 92 FF DB 00 00 49 FF 92 DB FF FF FF FF FF FF FF FF FF FF FF DB 6D B6 FF FF FF FF FF FF 92 6D FF FF FF FF 6D B6 FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF 92 DB 00 00 92 FF 92 DB
|
||||
92 FF FF B6 00 00 6D FF 6D FF FF FF FF FF FF FF FF FF FF FF DB 6D FF FF FF 92 49 49 49 92 FF FF 49 DB DB 24 DB FF B6 49 49 92 FF FF DB 92 FF FF FF FF FF FF FF FF FF FF 92 FF 00 00 6D FF DB 92
|
||||
6D FF FF FF 00 00 49 92 DB FF FF FF FF FF FF FF FF FF FF DB 6D FF FF 6D 00 00 00 00 00 00 00 B6 FF 49 00 24 24 49 24 00 00 00 00 6D FF DB 92 FF FF FF FF FF FF FF FF FF DB B6 00 00 92 FF FF 6D
|
||||
6D FF FF 24 00 00 DB 6D FF FF FF FF FF FF FF FF FF FF DB 6D FF DB 00 00 00 00 00 00 00 00 00 00 B6 FF DB B6 49 92 24 24 00 00 00 00 24 FF DB 92 FF FF FF FF FF FF FF FF FF 92 6D 00 00 DB FF 6D
|
||||
6D FF FF 24 00 00 FF 6D FF FF FF FF FF FF FF FF FF FF 49 FF B6 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF 92 DB DB 24 24 00 00 00 00 24 FF 92 DB FF FF FF FF FF FF FF FF 92 92 00 00 FF FF 6D
|
||||
6D FF FF B6 00 00 92 6D FF FF FF FF FF FF FF FF FF 49 FF DB 00 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF B6 B6 FF 92 24 00 00 00 00 00 49 FF 6D FF FF FF FF FF FF FF FF 92 24 00 49 FF FF 6D
|
||||
6D FF FF 00 00 00 DB 6D FF FF FF FF FF FF FF FF 6D DB DB 00 00 00 00 00 00 00 00 00 00 00 00 00 00 92 FF FF DB B6 FF B6 49 00 00 00 00 00 00 6D FF 6D FF FF FF FF FF FF FF 92 92 00 00 DB FF 6D
|
||||
6D FF FF DB 00 00 B6 6D FF FF FF FF FF FF FF 6D B6 FF 24 00 00 00 00 00 00 00 00 00 00 00 24 B6 DB 6D FF FF FF FF FF 6D 49 24 00 00 00 00 00 00 B6 DB B6 FF FF FF FF FF B6 DB 24 00 92 FF FF 6D
|
||||
6D FF FF 6D 00 00 24 DB 92 FF FF FF FF FF 92 92 FF 49 00 00 00 00 00 49 B6 FF FF DB B6 DB FF FF FF B6 92 FF FF DB 92 FF FF FF 49 6D 92 24 00 00 00 DB B6 DB FF FF FF FF 6D FF 00 00 00 DB FF 6D
|
||||
6D FF FF 92 24 00 49 FF 6D B6 FF FF FF 6D 92 FF 49 00 00 49 DB FF FF FF FF FF FF B6 FF FF FF FF FF FF B6 6D 92 92 FF FF FF FF 6D FF FF FF DB 24 00 24 FF 92 B6 FF FF 92 B6 FF 00 00 B6 FF FF 6D
|
||||
92 FF FF FF 00 00 24 92 FF 92 6D 92 49 B6 DB 24 00 24 DB FF FF FF FF FF DB 92 24 00 FF FF FF FF 6D 6D FF FF FF 6D 6D FF FF B6 DB 6D FF FF FF FF 00 00 24 DB B6 6D 6D B6 DB 00 00 00 6D FF FF 6D
|
||||
DB 92 FF DB 49 00 00 00 B6 FF FF DB FF 6D 00 00 6D FF FF FF FF FF FF FF 24 92 00 49 FF FF FF FF FF 6D B6 FF FF 6D 6D FF 6D 00 DB DB 92 FF FF FF DB 00 00 00 6D FF FF DB 6D 00 00 24 FF FF 92 DB
|
||||
FF 49 FF FF 6D 00 00 00 24 49 B6 FF 24 00 00 6D FF FF FF FF FF FF FF 49 92 B6 00 DB FF FF DB DB FF FF B6 FF FF FF FF FF 00 49 DB FF 92 FF FF FF FF 92 00 00 00 24 6D 00 00 00 00 24 DB FF 49 FF
|
||||
FF 92 B6 FF 92 49 00 00 00 00 00 24 00 00 00 FF FF FF FF FF FF FF 92 6D FF B6 DB FF DB B6 DB B6 B6 FF FF B6 FF FF FF DB 00 B6 DB FF 92 FF FF FF FF FF 24 00 00 00 00 00 00 00 00 B6 FF 92 B6 FF
|
||||
FF FF 49 FF FF 49 24 00 00 00 00 00 00 00 B6 FF FF FF FF FF FF FF B6 FF FF FF FF FF FF FF FF FF 6D FF FF 6D FF FF FF DB 24 FF FF FF 92 FF FF FF FF FF 6D 00 00 00 00 00 00 00 DB FF FF 6D FF FF
|
||||
FF FF DB 6D FF FF 6D 49 00 00 00 00 00 24 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 6D 49 24 24 24 FF FF DB FF FF FF FF 24 24 00 00 92 FF FF FF FF FF DB 00 00 00 00 00 00 FF DB FF 6D FF FF FF
|
||||
FF FF FF 92 B6 FF FF DB 49 24 00 00 00 92 FF FF FF FF FF FF FF FF FF DB FF FF FF 49 49 24 00 24 FF FF FF FF FF FF FF FF 49 6D 00 24 49 FF FF FF FF FF FF 49 00 24 6D 6D B6 FF FF 6D B6 FF FF FF
|
||||
FF FF FF FF 6D B6 FF FF DB 92 B6 49 00 FF FF FF FF FF FF FF FF FF FF B6 FF FF FF 92 DB 92 00 24 FF FF FF FF FF FF FF FF FF 00 00 6D FF FF FF FF FF FF FF DB 00 6D DB FF FF FF 6D B6 FF FF FF FF
|
||||
FF FF FF FF FF 92 6D FF FF FF FF B6 49 FF FF FF FF FF FF FF FF FF FF 6D FF FF FF FF B6 92 92 B6 B6 DB FF FF FF FF FF FF FF B6 6D 49 6D FF FF FF FF FF FF FF 92 24 FF FF B6 6D DB FF FF FF FF FF
|
||||
FF FF FF FF FF FF DB 49 6D B6 FF 6D 92 FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF FF 92 FF FF FF FF FF FF FF FF 6D DB 92 FF FF FF FF FF FF FF FF 6D 49 6D DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF DB 92 49 00 FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 6D FF FF FF FF FF FF FF DB 92 FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF DB 00 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 92 6D B6 FF FF FF FF FF FF 49 DB FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF 49 DB 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 6D FF 92 49 92 FF FF FF FF DB 49 DB FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF FF FF 6D 92 FF 92 FF FF FF FF FF FF FF FF FF FF B6 6D 49 6D DB FF FF FF FF FF 6D 49 FF FF FF DB 6D 6D 92 92 6D 49 FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF 6D 92 FF FF FF DB FF FF FF FF FF FF FF FF 6D 6D FF FF FF 92 6D FF FF FF FF FF 49 92 B6 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF DB 24 92 FF FF FF FF FF FF FF FF FF FF FF FF FF 49 49 6D DB FF FF DB 6D B6 FF FF FF FF B6 B6 DB 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF 24 B6 FF FF FF FF B6 49 49 24 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF 00 49 FF DB DB FF FF FF B6 92 FF FF FF FF FF FF 92 DB FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF 24 B6 FF FF B6 24 00 6D DB FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB DB 00 00 24 FF FF FF FF B6 FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF B6 B6 DB B6 6D 49 49 92 FF FF FF B6 6D FF FF FF FF FF FF FF 92 92 FF FF FF FF FF FF FF 49 92 DB 49 FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF 92 24 49 49 6D FF 6D 92 FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF DB FF FF FF FF FF FF FF FF B6 FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF B6 DB DB FF FF FF FF FF FF FF DB FF FF FF FF FF FF FF 6D 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF 24 92 FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF B6 92 FF FF FF FF FF FF FF FF FF FF FF DB 6D 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 6D 92 FF FF FF FF DB 49 FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF 92 6D FF FF FF FF FF 00 24 DB FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF 92 6D FF FF FF FF FF FF FF FF FF FF 6D B6 FF FF FF FF FF FF FF FF FF FF FF FF B6 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 FF FF FF FF FF FF FF 49 00 DB FF FF FF FF FF FF FF FF FF 6D 6D B6 DB DB DB 92 49 00 00 00 00 00 49 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 DB FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF FF FF DB 6D 49 49 6D B6 DB FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 92 FF FF FF FF FF FF B6 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF DB 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF DB 6D 00 49 FF FF FF FF FF FF FF FF FF FF FF FF DB B6 92 6D 6D 6D 49 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 49 FF FF FF FF FF FF FF FF 49 00 92 FF FF FF FF FF FF FF FF 49 00 00 00 00 00 49 B6 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 6D FF FF FF FF FF FF FF FF 6D 6D FF B6 B6 FF FF FF FF FF FF 92 92 FF FF 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 B6 FF FF FF FF FF FF DB 00 DB 6D 00 B6 FF FF FF FF FF FF FF FF FF FF 24 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 DB FF FF FF FF FF 92 00 FF 24 00 00 49 FF FF FF FF FF FF FF FF FF B6 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 FF FF FF FF FF FF 49 24 24 00 00 6D FF FF FF FF FF FF FF DB FF DB 6D FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 FF FF FF FF FF FF 6D 00 24 24 24 FF FF FF FF FF FF DB B6 DB 49 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 00 B6 00 49 DB FF FF FF DB 24 6D 24 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 B6 6D 00 00 DB FF 6D 00 00 00 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 00 6D FF FF 00 00 DB 49 00 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 92 DB FF FF 6D 00 00 92 24 00 00 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF B6 FF FF 00 6D 00 00 24 00 00 00 00 00 00 24 92 DB FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 6D DB 00 00 00 00 00 00 00 00 00 00 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 00 24 00 00 6D 00 00 00 B6 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF DB 49 92 6D 6D DB B6 92 92 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
|
||||
</bitmap>
|
||||
</icon>
|
||||
</chrp-boot>
|
||||
172
grub-core/boot/powerpc/grub.chrp.in
Normal file
172
grub-core/boot/powerpc/grub.chrp.in
Normal file
@@ -0,0 +1,172 @@
|
||||
<CHRP-BOOT>
|
||||
<COMPATIBLE>
|
||||
MacRISC MacRISC3 MacRISC4
|
||||
</COMPATIBLE>
|
||||
<DESCRIPTION>
|
||||
@PACKAGE@ @VERSION@
|
||||
</DESCRIPTION>
|
||||
<OS-BADGE-ICONS>
|
||||
3434
|
||||
00000000000000F781FB8181818181FBFAF500000000000000000000000000000000000000F6FAFAFAFA81F9F600000000000000
|
||||
0000000000F8FBF9F500F95656FCFB5656FBF800000000000000000000000000000000F5FAF9F5F7F600F6F6F9FAF70000000000
|
||||
000000F5FBFA0056FDFEFEFDFDFAAC81FB56568181560000000000000000000000F9F9F9F7FCFDFEFEFEFFFC81F656FA00000000
|
||||
0000F5AC2BF7FBFEFEFD2BF6568181F9F7F6F6F8FBF50000000000000000000000FAF700F600F5F7F7F6F7FEFFACF82BFB000000
|
||||
0000FC2BF5FEFFFFF5F7FC81F70000F7F9FAFAF8000000000000000000000000000056F9F9FAF9F7F7FA812BF7FFFF56F7FA0000
|
||||
005656F5FEFFAC2BF9FA000000000000000000000000000000000000000000000000000000000000000000FA56FAFEFEF8F9F700
|
||||
00FB00F7FFFF56F9F800000000000000000000F656FAFA56F50000000000F5F8F9F8F5000000000000000000F9F7FCFFFB00FB00
|
||||
F8F800ACFFACF6FA000000000000000000F6FA562BF5F5F781FA000000F9FA2B00F556F9F5000000000000000081F8FFFEF6562B
|
||||
810000FFFFF9FAF500000000000000002B8100F5F9FCACFBF82BFBF6FCFAF6FAFC81F600FA2B000000000000002BF8FEFFF8F5FA
|
||||
FA00F5FEFFFA8100000000000000002B8100F9FEFFFFFFFFFFFBF6FDFEACFDFEFFFFFFFBF581F600000000000000F9FEFFF700FA
|
||||
FA00FBFFFEF6F900000000000000F6FB00FCFFFFFFFFFFFFFFFFFCF600FCF7ACFEFFFFFFFDF6810000000000000056F9FFAC00FA
|
||||
FA00F6FFFFF856000000000000F5FBF5ACFFFFFFFFFFFFFFFFFFFF2B002BF8F5ACFFFFFFFFFDF6FA000000000000F9FCFF560081
|
||||
FA0081FFFFF8F9000000000000FBF6FBFFFFFFFFFFFFFFFFFFFFFFF800F55600FCFFFFFFFFFF81F8F80000000000F981FFAC0081
|
||||
FA0000FEFEF8FB0000000000812BFAFFFFFFFFFFFFFEFFFFFDF92BFA0000F6F981ACFEFFFFFFFF56F9F600000000F9FDFF2B0081
|
||||
FA00FAFFFF81812B000000FAF8F9FFFFFEACFBF80000F500000000F9F900562B0000FCF7F9ACFFFF2BF9F50000F9F6FEFFFB0081
|
||||
810000FCFFFBF6FB56F7FBF8F9FFFE5600000000F5FAAC000000F82BF6FAFBF800F556F80000F9FFFE2BFAFAFAF8FAFFFEF60081
|
||||
FAF6F5ACFFFFAC00F856F7ACFFFCF500000000FAFCFFFC00000056AC00F581F92BFEF9FAF6000081FFFFFBF6F62BFFFFACF6F6FA
|
||||
F6FA00FAFFFFFFACFA56FFFFAC0000000000F6FD2BFEF6F5565600F5F800F60081FEF7F656000000FDFFFFFDFDFFFFFFAC0081F5
|
||||
0081F52BFDFFFFFFFFFFFFFFF60000000000FBF6F6F5F656F52BF900FA000000FCFAF5F656000000F7FFFFFFFFFFFFFDF7F68100
|
||||
00F6FB00F8FDFFFFFFFFFF810000000000F6F5000000F52B56F9FC00F7F70000FCF881FCF500000000FEFFFFFFFFAC5600FBF500
|
||||
000056F900F8ACFDFFFFFFF5000000000000002B0000FDFEFFFE560000F60000F9ACFFFE810000000081FFFEFDFAF800FAF70000
|
||||
000000FAF9002B56FAFDFC0000000000000000F80000FBF5FEFEF5000000000000ACFFFA2B0000000000FEFB2BF5008156000000
|
||||
00000000F9FBF600F6FBF800000000000000F7F8000000F9F9F9F82B0000000000F6ACACF70000000000F7FD2BFA812B00000000
|
||||
0000000000F681FCFBFD0000000000000000FBF6000000000000F52B000000000000F92B810000000000008181F6000000000000
|
||||
0000000000000000F6FC00000000000000F6FF0000000000000000000000000000000081FBFB2B00000000F7F900000000000000
|
||||
000000000000000000FC00000000000000FCFAF600000000000000000000000000000056ACF581FBF700000081FB000000000000
|
||||
0000000000000000FAF90000000000008156F5F8000000000000002BFBFCFBF800000000FD2B000056FB8181FBF8000000000000
|
||||
0000000000000000AC0000000000F5FBF90000F6000000000000F5AC56F6005681F50000F6ACFCFBF70000000000000000000000
|
||||
00000000000000F881000000F5FAFDFD00000000000000000000F7FEFA2B0000F581F70000000000810000000000000000000000
|
||||
000000000000F9FCF500FAFDACFAF5FD00000000000000000000F5ACF5FDFEFA0000F82B00000000810000000000000000000000
|
||||
000000000000FCF8F9AC81FD000000FD000000000000FAF7000000F50081F9FAF800000000000000FB0000000000000000000000
|
||||
000000000000FC81F956F5FD000000FD0000000000000000F800F5000000000056000000000000F7FB0000000000000000000000
|
||||
00000000000000000000F5AC000000ACF800000000000000F5FAF80000000000F50000000000F8ACF50000000000000000000000
|
||||
00000000000000000000F5AC000000F5AC000000000000000056F9000000000000000000F7ACFCF5000000000000000000000000
|
||||
00000000000000000000F5FD00000000AC000000000000000000FB0000000000000000F5F6F5FCF6000000000000000000000000
|
||||
0000000000000000000000FD00000000FBFDF600000000000000F8F900000000000000000000F5FB000000000000000000000000
|
||||
0000000000000000000000FDF500000000F9ACF800000000000000815600000000F656818181AC56000000000000000000000000
|
||||
000000000000000000000081F80000000000F9FC0000000000000000F9ACACACFCFBFAFA81FD2B00000000000000000000000000
|
||||
0000000000000000000000F7FB0000000000FBF70000000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000ACF500000000F9FD56F5000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000F8FA0000000000F6FEFEF5000000000000F55681FCACFDACFC560000000000000000000000000000
|
||||
00000000000000000000000000FBF600000000002BFCFA00F700000000F9FDFDFAFEF90000000000000000000000000000000000
|
||||
00000000000000000000000000F5FB0000000000F5FEF7ACAC0000000000000000FCF50000000000000000000000000000000000
|
||||
0000000000000000000000000000F6FA000000002BFF2BFFFFAC00000000000000F7FA0000000000000000000000000000000000
|
||||
000000000000000000000000000000F65600000000FAFEFFFFAC0000000000F800F6810000000000000000000000000000000000
|
||||
00000000000000000000000000000000F52B00000000F8FEFBFF5600000000FCFAACF60000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F9FCFCFFFB00F8FEFFFDF5000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000F9FDF7F5FFFD56FFFFFFFD00000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000810000FBFFFFFBFFFFFFFFACF9F5F5000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F600FC81FFFEFFFFFFFFFFFE8100000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000F7F6FDFFFFFFFEFFFFACF500000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000F5FC81FC81FAFBF9F500000000000000000000000000000000
|
||||
|
||||
00000000000000F781FB8181818181FBFAF500000000000000000000000000000000000000F6FAFAFAFA81F9F600000000000000
|
||||
0000000000F8FBF9F500F95656FCFB5656FBF800000000000000000000000000000000F5FAF9F5F7F600F6F6F9FAF70000000000
|
||||
000000F5FBFA0056FDFEFEFDFDFAAC81FB56568181560000000000000000000000F9F9F9F7FCFDFEFEFEFFFC81F656FA00000000
|
||||
0000F5AC2BF7FBFEFEFD2BF6568181F9F7F6F6F8FBF50000000000000000000000FAF700F600F5F7F7F6F7FEFFACF82BFB000000
|
||||
0000FC2BF5FEFFFFF5F7FC81F70000F7F9FAFAF8000000000000000000000000000056F9F9FAF9F7F7FA812BF7FFFF56F7FA0000
|
||||
005656F5FEFFAC2BF9FA000000000000000000000000000000000000000000000000000000000000000000FA56FAFEFEF8F9F700
|
||||
00FB00F7FFFF56F9F800000000000000000000F656FAFA56F50000000000F5F8F9F8F5000000000000000000F9F7FCFFFB00FB00
|
||||
F8F800ACFFACF6FA000000000000000000F6FA562BF5F5F781FA000000F9FA2B00F556F9F5000000000000000081F8FFFEF6562B
|
||||
810000FFFFF9FAF500000000000000002B8100F5F9FCACFBF82BFBF6FCFAF6FAFC81F600FA2B000000000000002BF8FEFFF8F5FA
|
||||
FA00F5FEFFFA8100000000000000002B8100F9FEFFFFFFFFFFFBF6FDFEACFDFEFFFFFFFBF581F600000000000000F9FEFFF700FA
|
||||
FA00FBFFFEF6F900000000000000F6FB00FCFFFFFFFFFFFFFFFFFCF600FCF7ACFEFFFFFFFDF6810000000000000056F9FFAC00FA
|
||||
FA00F6FFFFF856000000000000F5FBF5ACFFFFFFFFFFFFFFFFFFFF2B002BF8F5ACFFFFFFFFFDF6FA000000000000F9FCFF560081
|
||||
FA0081FFFFF8F9000000000000FBF6FBFFFFFFFFFFFFFFFFFFFFFFF800F55600FCFFFFFFFFFF81F8F80000000000F981FFAC0081
|
||||
FA0000FEFEF8FB0000000000812BFAFFFFFFFFFFFFFEFFFFFDF92BFA0000F6F981ACFEFFFFFFFF56F9F600000000F9FDFF2B0081
|
||||
FA00FAFFFF81812B000000FAF8F9FFFFFEACFBF80000F500000000F9F900562B0000FCF7F9ACFFFF2BF9F50000F9F6FEFFFB0081
|
||||
810000FCFFFBF6FB56F7FBF8F9FFFE5600000000F5FAAC000000F82BF6FAFBF800F556F80000F9FFFE2BFAFAFAF8FAFFFEF60081
|
||||
FAF6F5ACFFFFAC00F856F7ACFFFCF500000000FAFCFFFC00000056AC00F581F92BFEF9FAF6000081FFFFFBF6F62BFFFFACF6F6FA
|
||||
F6FA00FAFFFFFFACFA56FFFFAC0000000000F6FD2BFEF6F5565600F5F800F60081FEF7F656000000FDFFFFFDFDFFFFFFAC0081F5
|
||||
0081F52BFDFFFFFFFFFFFFFFF60000000000FBF6F6F5F656F52BF900FA000000FCFAF5F656000000F7FFFFFFFFFFFFFDF7F68100
|
||||
00F6FB00F8FDFFFFFFFFFF810000000000F6F5000000F52B56F9FC00F7F70000FCF881FCF500000000FEFFFFFFFFAC5600FBF500
|
||||
000056F900F8ACFDFFFFFFF5000000000000002B0000FDFEFFFE560000F60000F9ACFFFE810000000081FFFEFDFAF800FAF70000
|
||||
000000FAF9002B56FAFDFC0000000000000000F80000FBF5FEFEF5000000000000ACFFFA2B0000000000FEFB2BF5008156000000
|
||||
00000000F9FBF600F6FBF800000000000000F7F8000000F9F9F9F82B0000000000F6ACACF70000000000F7FD2BFA812B00000000
|
||||
0000000000F681FCFBFD0000000000000000FBF6000000000000F52B000000000000F92B810000000000008181F6000000000000
|
||||
0000000000000000F6FC00000000000000F6FF0000000000000000000000000000000081FBFB2B00000000F7F900000000000000
|
||||
000000000000000000FC00000000000000FCFAF600000000000000000000000000000056ACF581FBF700000081FB000000000000
|
||||
0000000000000000FAF90000000000008156F5F8000000000000002BFBFCFBF800000000FD2B000056FB8181FBF8000000000000
|
||||
0000000000000000AC0000000000F5FBF90000F6000000000000F5AC56F6005681F50000F6ACFCFBF70000000000000000000000
|
||||
00000000000000F881000000F5FAFDFD00000000000000000000F7FEFA2B0000F581F70000000000810000000000000000000000
|
||||
000000000000F9FCF500FAFDACFAF5FD00000000000000000000F5ACF5FDFEFA0000F82B00000000810000000000000000000000
|
||||
000000000000FCF8F9AC81FD000000FD000000000000FAF7000000F50081F9FAF800000000000000FB0000000000000000000000
|
||||
000000000000FC81F956F5FD000000FD0000000000000000F800F5000000000056000000000000F7FB0000000000000000000000
|
||||
00000000000000000000F5AC000000ACF800000000000000F5FAF80000000000F50000000000F8ACF50000000000000000000000
|
||||
00000000000000000000F5AC000000F5AC000000000000000056F9000000000000000000F7ACFCF5000000000000000000000000
|
||||
00000000000000000000F5FD00000000AC000000000000000000FB0000000000000000F5F6F5FCF6000000000000000000000000
|
||||
0000000000000000000000FD00000000FBFDF600000000000000F8F900000000000000000000F5FB000000000000000000000000
|
||||
0000000000000000000000FDF500000000F9ACF800000000000000815600000000F656818181AC56000000000000000000000000
|
||||
000000000000000000000081F80000000000F9FC0000000000000000F9ACACACFCFBFAFA81FD2B00000000000000000000000000
|
||||
0000000000000000000000F7FB0000000000FBF70000000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000ACF500000000F9FD56F5000000000000000000000000000000FB0000000000000000000000000000
|
||||
000000000000000000000000F8FA0000000000F6FEFEF5000000000000F55681FCACFDACFC560000000000000000000000000000
|
||||
00000000000000000000000000FBF600000000002BFCFA00F700000000F9FDFDFAFEF90000000000000000000000000000000000
|
||||
00000000000000000000000000F5FB0000000000F5FEF7ACAC0000000000000000FCF50000000000000000000000000000000000
|
||||
0000000000000000000000000000F6FA000000002BFF2BFFFFAC00000000000000F7FA0000000000000000000000000000000000
|
||||
000000000000000000000000000000F65600000000FAFEFFFFAC0000000000F800F6810000000000000000000000000000000000
|
||||
00000000000000000000000000000000F52B00000000F8FEFBFF5600000000FCFAACF60000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F9FCFCFFFB00F8FEFFFDF5000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000F9FDF7F5FFFD56FFFFFFFD00000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000810000FBFFFFFBFFFFFFFFACF9F5F5000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000F600FC81FFFEFFFFFFFFFFFE8100000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000F7F6FDFFFFFFFEFFFFACF500000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000F5FC81FC81FAFBF9F500000000000000000000000000000000
|
||||
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
</OS-BADGE-ICONS>
|
||||
<BOOT-SCRIPT>
|
||||
boot &device;:&partition;,\System\Library\CoreServices\grub.elf
|
||||
</BOOT-SCRIPT>
|
||||
</CHRP-BOOT>
|
||||
@@ -28,6 +28,7 @@ pic_base:
|
||||
call boot_continue
|
||||
mov %o4, CIF_REG
|
||||
|
||||
#ifndef CDBOOT
|
||||
/* The offsets to these locations are defined by the
|
||||
* GRUB_BOOT_MACHINE_foo macros in include/grub/sparc/ieee1275/boot.h,
|
||||
* and grub-setup uses this to patch these next three values as needed.
|
||||
@@ -43,9 +44,19 @@ pic_base:
|
||||
. = _start + GRUB_BOOT_MACHINE_BOOT_DEVPATH
|
||||
boot_path:
|
||||
. = _start + GRUB_BOOT_MACHINE_KERNEL_BYTE
|
||||
boot_path_end:
|
||||
kernel_byte: .xword (2 << 9)
|
||||
boot_path_end:
|
||||
kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
#else
|
||||
#define boot_path (_start + 512)
|
||||
#define boot_path_end (_start + 1024)
|
||||
#include <grub/offsets.h>
|
||||
|
||||
. = _start + 8
|
||||
kernel_byte: .xword (2 << 9)
|
||||
kernel_size: .word 512
|
||||
kernel_address: .word GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS
|
||||
#endif
|
||||
|
||||
prom_finddev_name: .asciz "finddevice"
|
||||
prom_chosen_path: .asciz "/chosen"
|
||||
@@ -158,8 +169,10 @@ boot_continue:
|
||||
mov GRUB_NAME_LEN, %o3
|
||||
|
||||
GET_ABS(boot_path, %o3)
|
||||
#ifndef CDBOOT
|
||||
ldub [%o3], %o1
|
||||
brnz,pn %o1, bootpath_known
|
||||
#endif
|
||||
|
||||
/* getprop(chosen_node, "bootpath", &buffer, buffer_size) */
|
||||
GET_ABS(prom_bootpath_name, %o2)
|
||||
@@ -194,12 +207,19 @@ bootpath_known:
|
||||
GET_ABS(prom_read_name, %o0)
|
||||
LDUW_ABS(kernel_address, 0x00, %o2)
|
||||
call prom_call_3_1_o1
|
||||
#ifdef CDBOOT
|
||||
LDUW_ABS(kernel_size, 0x00, %o3)
|
||||
#else
|
||||
mov 512, %o3
|
||||
#endif
|
||||
|
||||
LDUW_ABS(kernel_address, 0x00, %o2)
|
||||
jmpl %o2, %o7
|
||||
#ifdef CDBOOT
|
||||
mov CIF_REG, %o4
|
||||
#else
|
||||
nop
|
||||
|
||||
#endif
|
||||
. = _start + GRUB_BOOT_MACHINE_CODE_END
|
||||
|
||||
/* the last 4 bytes in the sector 0 contain the signature */
|
||||
|
||||
@@ -29,28 +29,39 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* Context for grub_cs5536_find. */
|
||||
struct grub_cs5536_find_ctx
|
||||
{
|
||||
grub_pci_device_t *devp;
|
||||
int found;
|
||||
};
|
||||
|
||||
/* Helper for grub_cs5536_find. */
|
||||
static int
|
||||
grub_cs5536_find_iter (grub_pci_device_t dev, grub_pci_id_t pciid, void *data)
|
||||
{
|
||||
struct grub_cs5536_find_ctx *ctx = data;
|
||||
|
||||
if (pciid == GRUB_CS5536_PCIID)
|
||||
{
|
||||
*ctx->devp = dev;
|
||||
ctx->found = 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_cs5536_find (grub_pci_device_t *devp)
|
||||
{
|
||||
int found = 0;
|
||||
auto int NESTED_FUNC_ATTR hook (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid);
|
||||
struct grub_cs5536_find_ctx ctx = {
|
||||
.devp = devp,
|
||||
.found = 0
|
||||
};
|
||||
|
||||
int NESTED_FUNC_ATTR hook (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid)
|
||||
{
|
||||
if (pciid == GRUB_CS5536_PCIID)
|
||||
{
|
||||
*devp = dev;
|
||||
found = 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
grub_pci_iterate (grub_cs5536_find_iter, &ctx);
|
||||
|
||||
grub_pci_iterate (hook);
|
||||
|
||||
return found;
|
||||
return ctx.found;
|
||||
}
|
||||
|
||||
grub_uint64_t
|
||||
|
||||
@@ -32,7 +32,7 @@ grub_pci_make_address (grub_pci_device_t dev, int reg)
|
||||
}
|
||||
|
||||
void
|
||||
grub_pci_iterate (grub_pci_iteratefunc_t hook)
|
||||
grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data)
|
||||
{
|
||||
struct pci_device_iterator *iter;
|
||||
struct pci_slot_match slot;
|
||||
@@ -43,7 +43,7 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook)
|
||||
slot.func = PCI_MATCH_ANY;
|
||||
iter = pci_slot_match_iterator_create (&slot);
|
||||
while ((dev = pci_device_next (iter)))
|
||||
hook (dev, dev->vendor_id | (dev->device_id << 16));
|
||||
hook (dev, dev->vendor_id | (dev->device_id << 16), hook_data);
|
||||
pci_iterator_destroy (iter);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ grub_pci_make_address (grub_pci_device_t dev, int reg)
|
||||
}
|
||||
|
||||
void
|
||||
grub_pci_iterate (grub_pci_iteratefunc_t hook)
|
||||
grub_pci_iterate (grub_pci_iteratefunc_t hook, void *hook_data)
|
||||
{
|
||||
grub_pci_device_t dev;
|
||||
grub_pci_address_t addr;
|
||||
@@ -125,7 +125,7 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hook (dev, id))
|
||||
if (hook (dev, id, hook_data))
|
||||
return;
|
||||
|
||||
/* Probe only func = 0 if the device if not multifunction */
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <grub/time.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -454,9 +455,9 @@ grub_ehci_reset (struct grub_ehci *e)
|
||||
}
|
||||
|
||||
/* PCI iteration function... */
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid __attribute__ ((unused)))
|
||||
static int
|
||||
grub_ehci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint8_t release;
|
||||
grub_uint32_t class_code;
|
||||
@@ -533,6 +534,11 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
"EHCI grub_ehci_pci_iter: registers above 4G are not supported\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
|
||||
|
||||
grub_dprintf ("ehci", "EHCI grub_ehci_pci_iter: 32-bit EHCI OK\n");
|
||||
}
|
||||
@@ -664,7 +670,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
grub_cpu_to_le32 (GRUB_EHCI_TERMINATE);
|
||||
e->tdfree_virt = e->td_virt;
|
||||
/* Set Terminate in first QH, which is used in framelist */
|
||||
e->qh_virt[0].qh_hptr = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE);
|
||||
e->qh_virt[0].qh_hptr = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH);
|
||||
e->qh_virt[0].td_overlay.next_td = grub_cpu_to_le32 (GRUB_EHCI_TERMINATE);
|
||||
e->qh_virt[0].td_overlay.alt_next_td =
|
||||
grub_cpu_to_le32 (GRUB_EHCI_TERMINATE);
|
||||
@@ -710,6 +716,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
usblegsup = grub_pci_read (pciaddr_eecp);
|
||||
if (usblegsup & GRUB_EHCI_BIOS_OWNED)
|
||||
{
|
||||
grub_boot_time ("Taking ownership of EHCI controller");
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI grub_ehci_pci_iter: EHCI owned by: BIOS\n");
|
||||
/* Ownership change - set OS_OWNED bit */
|
||||
@@ -730,11 +737,6 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
/* Disable SMI. */
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
|
||||
grub_pci_write (pciaddr_eecp, 0);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
}
|
||||
else if (usblegsup & GRUB_EHCI_OS_OWNED)
|
||||
@@ -750,12 +752,14 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
grub_pci_write (pciaddr_eecp, GRUB_EHCI_OS_OWNED);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
/* Disable SMI, just to be sure. */
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
|
||||
grub_pci_write (pciaddr_eecp, 0);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
}
|
||||
|
||||
/* Disable SMI, just to be sure. */
|
||||
pciaddr_eecp = grub_pci_make_address (dev, eecp_offset + 4);
|
||||
grub_pci_write (pciaddr_eecp, 0);
|
||||
/* Ensure PCI register is written */
|
||||
grub_pci_read (pciaddr_eecp);
|
||||
|
||||
}
|
||||
|
||||
grub_dprintf ("ehci", "inithw: EHCI grub_ehci_pci_iter: ownership OK\n");
|
||||
@@ -791,7 +795,7 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
/* Set ownership of root hub ports to EHCI */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_CONFIG_FLAG, GRUB_EHCI_CF_EHCI_OWNER);
|
||||
|
||||
/* Enable asynchronous list */
|
||||
/* Enable both lists */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND,
|
||||
GRUB_EHCI_CMD_AS_ENABL
|
||||
| GRUB_EHCI_CMD_PS_ENABL
|
||||
@@ -865,7 +869,7 @@ fail:
|
||||
}
|
||||
|
||||
static int
|
||||
grub_ehci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
grub_ehci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
struct grub_ehci *e;
|
||||
struct grub_usb_controller dev;
|
||||
@@ -873,7 +877,7 @@ grub_ehci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
for (e = ehci; e; e = e->next)
|
||||
{
|
||||
dev.data = e;
|
||||
if (hook (&dev))
|
||||
if (hook (&dev, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -935,9 +939,9 @@ grub_ehci_setup_qh (grub_ehci_qh_t qh, grub_usb_transfer_t transfer)
|
||||
* SplitCompletionMask - AFAIK it is ignored in asynchronous list,
|
||||
* InterruptScheduleMask - AFAIK it should be zero in async. list */
|
||||
ep_cap |= GRUB_EHCI_MULT_THREE;
|
||||
ep_cap |= (transfer->dev->port << GRUB_EHCI_DEVPORT_OFF)
|
||||
ep_cap |= (transfer->dev->split_hubport << GRUB_EHCI_DEVPORT_OFF)
|
||||
& GRUB_EHCI_DEVPORT_MASK;
|
||||
ep_cap |= (transfer->dev->hubaddr << GRUB_EHCI_HUBADDR_OFF)
|
||||
ep_cap |= (transfer->dev->split_hubaddr << GRUB_EHCI_HUBADDR_OFF)
|
||||
& GRUB_EHCI_HUBADDR_MASK;
|
||||
if (transfer->dev->speed == GRUB_USB_SPEED_LOW
|
||||
&& transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL)
|
||||
@@ -969,6 +973,10 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer)
|
||||
int i;
|
||||
grub_ehci_qh_t qh = e->qh_virt;
|
||||
grub_ehci_qh_t head;
|
||||
grub_uint32_t qh_phys;
|
||||
grub_uint32_t qh_terminate =
|
||||
GRUB_EHCI_TERMINATE | GRUB_EHCI_HPTR_TYPE_QH;
|
||||
grub_ehci_qh_t qh_iter;
|
||||
|
||||
/* Prepare part of EP Characteristic to find existing QH */
|
||||
target = ((transfer->endpoint << GRUB_EHCI_EP_NUM_OFF) |
|
||||
@@ -976,21 +984,58 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer)
|
||||
target = grub_cpu_to_le32 (target);
|
||||
mask = grub_cpu_to_le32 (GRUB_EHCI_TARGET_MASK);
|
||||
|
||||
/* First try to find existing QH with proper target */
|
||||
for (i = 2; i < GRUB_EHCI_N_QH; i++) /* We ignore zero and first QH */
|
||||
/* low speed interrupt transfers are linked to the periodic */
|
||||
/* schedule, everything else to the asynchronous schedule */
|
||||
if (transfer->dev->speed == GRUB_USB_SPEED_LOW
|
||||
&& transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL)
|
||||
head = &qh[0];
|
||||
else
|
||||
head = &qh[1];
|
||||
|
||||
/* First try to find existing QH with proper target in proper list */
|
||||
qh_phys = grub_le_to_cpu32( head->qh_hptr );
|
||||
if (qh_phys != qh_terminate)
|
||||
qh_iter = grub_dma_phys2virt ( qh_phys & GRUB_EHCI_QHTDPTR_MASK,
|
||||
e->qh_chunk );
|
||||
else
|
||||
qh_iter = NULL;
|
||||
|
||||
for (
|
||||
i = 0;
|
||||
(qh_phys != qh_terminate) && (qh_iter != NULL) &&
|
||||
(qh_iter != head) && (i < GRUB_EHCI_N_QH);
|
||||
i++ )
|
||||
{
|
||||
if (!qh[i].ep_char)
|
||||
break; /* Found first not-allocated QH, finish */
|
||||
if (target == (qh[i].ep_char & mask))
|
||||
if (target == (qh_iter->ep_char & mask))
|
||||
{
|
||||
/* Found proper existing (and linked) QH, do setup of QH */
|
||||
grub_dprintf ("ehci", "find_qh: found, i=%d, QH=%p\n",
|
||||
i, &qh[i]);
|
||||
grub_ehci_setup_qh (&qh[i], transfer);
|
||||
return &qh[i];
|
||||
grub_dprintf ("ehci", "find_qh: found, QH=%p\n", qh_iter);
|
||||
grub_ehci_setup_qh (qh_iter, transfer);
|
||||
return qh_iter;
|
||||
}
|
||||
|
||||
qh_phys = grub_le_to_cpu32( qh_iter->qh_hptr );
|
||||
if (qh_phys != qh_terminate)
|
||||
qh_iter = grub_dma_phys2virt ( qh_phys & GRUB_EHCI_QHTDPTR_MASK,
|
||||
e->qh_chunk );
|
||||
else
|
||||
qh_iter = NULL;
|
||||
}
|
||||
/* QH with target_addr does not exist, we have to add it */
|
||||
|
||||
/* variable "i" should be never equal to GRUB_EHCI_N_QH here */
|
||||
if (i >= GRUB_EHCI_N_QH)
|
||||
{ /* Something very bad happened in QH list(s) ! */
|
||||
grub_dprintf ("ehci", "find_qh: Mismatch in QH list! head=%p\n",
|
||||
head);
|
||||
}
|
||||
|
||||
/* QH with target_addr does not exist, we have to find and add it */
|
||||
for (i = 2; i < GRUB_EHCI_N_QH; i++) /* We ignore zero and first QH */
|
||||
{
|
||||
if (!qh[i].ep_char)
|
||||
break; /* Found first not-allocated QH, finish */
|
||||
}
|
||||
|
||||
/* Have we any free QH in array ? */
|
||||
if (i >= GRUB_EHCI_N_QH) /* No. */
|
||||
{
|
||||
@@ -1005,14 +1050,6 @@ grub_ehci_find_qh (struct grub_ehci *e, grub_usb_transfer_t transfer)
|
||||
/* We should preset new QH and link it into AL */
|
||||
grub_ehci_setup_qh (&qh[i], transfer);
|
||||
|
||||
/* low speed interrupt transfers are linked to the periodic
|
||||
* scheudle, everything else to the asynchronous schedule */
|
||||
if (transfer->dev->speed == GRUB_USB_SPEED_LOW
|
||||
&& transfer->type != GRUB_USB_TRANSACTION_TYPE_CONTROL)
|
||||
head = &qh[0];
|
||||
else
|
||||
head = &qh[1];
|
||||
|
||||
/* Linking - this new (last) QH will copy the QH from the head QH */
|
||||
qh[i].qh_hptr = head->qh_hptr;
|
||||
/* Linking - the head QH will point to this new QH */
|
||||
@@ -1254,16 +1291,6 @@ grub_ehci_setup_transfer (grub_usb_controller_t dev,
|
||||
/* XXX: Fix it: Currently we don't do anything to restart EHCI */
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
|
||||
/* Check if transfer is not high speed and connected to root hub.
|
||||
* It should not happened but... */
|
||||
if ((transfer->dev->speed != GRUB_USB_SPEED_HIGH)
|
||||
&& !transfer->dev->hubaddr)
|
||||
{
|
||||
grub_error (GRUB_USB_ERR_BADDEVICE,
|
||||
"FULL/LOW speed device on EHCI port!?!");
|
||||
return GRUB_USB_ERR_BADDEVICE;
|
||||
}
|
||||
|
||||
/* Allocate memory for controller transfer data. */
|
||||
cdata = grub_malloc (sizeof (*cdata));
|
||||
if (!cdata)
|
||||
@@ -1540,17 +1567,20 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev,
|
||||
int i;
|
||||
grub_uint64_t maxtime;
|
||||
grub_uint32_t qh_phys;
|
||||
grub_uint32_t interrupt =
|
||||
cdata->qh_virt->ep_cap & GRUB_EHCI_SMASK_MASK;
|
||||
|
||||
/* QH can be active and should be de-activated and halted */
|
||||
|
||||
grub_dprintf ("ehci", "cancel_transfer: begin\n");
|
||||
|
||||
/* First check if EHCI is running and AL is enabled and if not,
|
||||
* there is no problem... */
|
||||
if (((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)
|
||||
& GRUB_EHCI_ST_HC_HALTED) != 0) ||
|
||||
((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS)
|
||||
& (GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0))
|
||||
/* First check if EHCI is running - if not, there is no problem */
|
||||
/* to cancel any transfer. Or, if transfer is asynchronous, check */
|
||||
/* if AL is enabled - if not, transfer can be canceled also. */
|
||||
if (((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) &
|
||||
GRUB_EHCI_ST_HC_HALTED) != 0) ||
|
||||
(!interrupt && ((grub_ehci_oper_read32 (e, GRUB_EHCI_STATUS) &
|
||||
(GRUB_EHCI_ST_AS_STATUS | GRUB_EHCI_ST_PS_STATUS)) == 0)))
|
||||
{
|
||||
grub_ehci_pre_finish_transfer (transfer);
|
||||
grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual);
|
||||
@@ -1560,13 +1590,14 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev,
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* EHCI and AL are running. What to do?
|
||||
* Try to Halt QH via de-scheduling QH. */
|
||||
/* EHCI and (AL or SL) are running. What to do? */
|
||||
/* Try to Halt QH via de-scheduling QH. */
|
||||
/* Find index of previous QH */
|
||||
qh_phys = grub_dma_virt2phys(cdata->qh_virt, e->qh_chunk);
|
||||
for (i = 0; i < GRUB_EHCI_N_QH; i++)
|
||||
{
|
||||
if ((e->qh_virt[i].qh_hptr & GRUB_EHCI_QHTDPTR_MASK) == qh_phys)
|
||||
if ((grub_le_to_cpu32(e->qh_virt[i].qh_hptr)
|
||||
& GRUB_EHCI_QHTDPTR_MASK) == qh_phys)
|
||||
break;
|
||||
}
|
||||
if (i == GRUB_EHCI_N_QH)
|
||||
@@ -1620,24 +1651,12 @@ grub_ehci_cancel_transfer (grub_usb_controller_t dev,
|
||||
grub_ehci_free_tds (e, cdata->td_first_virt, transfer, &actual);
|
||||
grub_ehci_free_td (e, cdata->td_alt_virt);
|
||||
|
||||
/* FIXME Putting the QH back on the list should work, but for some
|
||||
* strange reason doing that will affect other QHs on the periodic
|
||||
* list. So free the QH instead of putting it back on the list
|
||||
* which does seem to work, but I would like to know why. */
|
||||
|
||||
#if 0
|
||||
/* Finaly we should return QH back to the AL... */
|
||||
e->qh_virt[i].qh_hptr =
|
||||
grub_cpu_to_le32 (grub_dma_virt2phys
|
||||
(cdata->qh_virt, e->qh_chunk));
|
||||
#else
|
||||
/* Free the QH */
|
||||
/* "Free" the QH - link it to itself */
|
||||
cdata->qh_virt->ep_char = 0;
|
||||
cdata->qh_virt->qh_hptr =
|
||||
grub_cpu_to_le32 ((grub_dma_virt2phys (cdata->qh_virt,
|
||||
e->qh_chunk)
|
||||
& GRUB_EHCI_POINTER_MASK) | GRUB_EHCI_HPTR_TYPE_QH);
|
||||
#endif
|
||||
|
||||
grub_free (cdata);
|
||||
|
||||
@@ -1692,6 +1711,8 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
|
||||
grub_dprintf ("ehci", "portstatus: enable\n");
|
||||
|
||||
grub_boot_time ("Resetting port %d", port);
|
||||
|
||||
/* Now we will do reset - if HIGH speed device connected, it will
|
||||
* result in Enabled state, otherwise port remains disabled. */
|
||||
/* Set RESET bit for 50ms */
|
||||
@@ -1705,6 +1726,7 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO,
|
||||
"portstatus: EHCI Timed out - reset port");
|
||||
grub_boot_time ("Port %d reset", port);
|
||||
/* Remember "we did the reset" - needed by detect_dev */
|
||||
e->reset |= (1 << port);
|
||||
/* Test if port enabled, i.e. HIGH speed device connected */
|
||||
@@ -1810,7 +1832,7 @@ grub_ehci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
||||
static void
|
||||
grub_ehci_inithw (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ehci_pci_iter);
|
||||
grub_pci_iterate (grub_ehci_pci_iter, NULL);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -1877,13 +1899,16 @@ grub_ehci_fini_hw (int noreturn __attribute__ ((unused)))
|
||||
/* We should disable all EHCI HW to prevent any DMA access etc. */
|
||||
for (e = ehci; e; e = e->next)
|
||||
{
|
||||
/* Disable both lists */
|
||||
grub_ehci_oper_write32 (e, GRUB_EHCI_COMMAND,
|
||||
~(GRUB_EHCI_CMD_AS_ENABL | GRUB_EHCI_CMD_PS_ENABL)
|
||||
& grub_ehci_oper_read32 (e, GRUB_EHCI_COMMAND));
|
||||
|
||||
/* Check if EHCI is halted and halt it if not */
|
||||
if (grub_ehci_halt (e) != GRUB_USB_ERR_NONE)
|
||||
grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI halt timeout");
|
||||
grub_ehci_halt (e);
|
||||
|
||||
/* Reset EHCI */
|
||||
if (grub_ehci_reset (e) != GRUB_USB_ERR_NONE)
|
||||
grub_error (GRUB_ERR_TIMEOUT, "restore_hw: EHCI reset timeout");
|
||||
grub_ehci_reset (e);
|
||||
}
|
||||
|
||||
return GRUB_USB_ERR_NONE;
|
||||
@@ -1897,15 +1922,23 @@ static struct grub_usb_controller_dev usb_controller = {
|
||||
.cancel_transfer = grub_ehci_cancel_transfer,
|
||||
.hubports = grub_ehci_hubports,
|
||||
.portstatus = grub_ehci_portstatus,
|
||||
.detect_dev = grub_ehci_detect_dev
|
||||
.detect_dev = grub_ehci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = GRUB_EHCI_N_TD * 3 / 4
|
||||
};
|
||||
|
||||
GRUB_MOD_INIT (ehci)
|
||||
{
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_td) == 64);
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ehci_qh) == 96);
|
||||
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_boot_time ("Initing EHCI hardware");
|
||||
grub_ehci_inithw ();
|
||||
grub_boot_time ("Registering EHCI driver");
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
grub_boot_time ("EHCI driver registered");
|
||||
grub_loader_register_preboot_hook (grub_ehci_fini_hw, grub_ehci_restore_hw,
|
||||
GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ grub_usb_poll_devices (void)
|
||||
|
||||
|
||||
int
|
||||
grub_usb_iterate (int (*hook) (grub_usb_device_t dev))
|
||||
grub_usb_iterate (grub_usb_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -96,7 +96,7 @@ grub_usb_iterate (int (*hook) (grub_usb_device_t dev))
|
||||
{
|
||||
if (grub_usb_devs[i])
|
||||
{
|
||||
if (hook (grub_usb_devs[i]))
|
||||
if (hook (grub_usb_devs[i], hook_data))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <grub/time.h>
|
||||
#include <grub/cs5536.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -213,9 +214,9 @@ grub_ohci_writereg32 (struct grub_ohci *o,
|
||||
|
||||
/* Iterate over all PCI devices. Determine if a device is an OHCI
|
||||
controller. If this is the case, initialize it. */
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid)
|
||||
static int
|
||||
grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint32_t interf;
|
||||
grub_uint32_t base;
|
||||
@@ -270,6 +271,11 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
/* Set bus master - needed for coreboot, VMware, broken BIOSes etc. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
|
||||
|
||||
grub_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x\n",
|
||||
class, subclass, interf);
|
||||
}
|
||||
@@ -472,13 +478,13 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||
static void
|
||||
grub_ohci_inithw (void)
|
||||
{
|
||||
grub_pci_iterate (grub_ohci_pci_iter);
|
||||
grub_pci_iterate (grub_ohci_pci_iter, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static int
|
||||
grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
grub_ohci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
struct grub_ohci *o;
|
||||
struct grub_usb_controller dev;
|
||||
@@ -486,7 +492,7 @@ grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
for (o = ohci; o; o = o->next)
|
||||
{
|
||||
dev.data = o;
|
||||
if (hook (&dev))
|
||||
if (hook (&dev, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1426,7 +1432,9 @@ static struct grub_usb_controller_dev usb_controller =
|
||||
.cancel_transfer = grub_ohci_cancel_transfer,
|
||||
.hubports = grub_ohci_hubports,
|
||||
.portstatus = grub_ohci_portstatus,
|
||||
.detect_dev = grub_ohci_detect_dev
|
||||
.detect_dev = grub_ohci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = GRUB_OHCI_TDS * 3 / 4
|
||||
};
|
||||
|
||||
static struct grub_preboot *fini_hnd;
|
||||
@@ -1435,6 +1443,9 @@ GRUB_MOD_INIT(ohci)
|
||||
{
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_td) == 32);
|
||||
COMPILE_TIME_ASSERT (sizeof (struct grub_ohci_ed) == 16);
|
||||
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_ohci_inithw ();
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
fini_hnd = grub_loader_register_preboot_hook (grub_ohci_fini_hw,
|
||||
|
||||
@@ -42,7 +42,8 @@ static int usbnum = 0;
|
||||
|
||||
int
|
||||
grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno,
|
||||
struct grub_serial_driver *driver)
|
||||
struct grub_serial_driver *driver, int in_endp,
|
||||
int out_endp)
|
||||
{
|
||||
struct grub_serial_port *port;
|
||||
int j;
|
||||
@@ -51,7 +52,7 @@ grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno,
|
||||
|
||||
interf = usbdev->config[configno].interf[interfno].descif;
|
||||
|
||||
port = grub_malloc (sizeof (*port));
|
||||
port = grub_zalloc (sizeof (*port));
|
||||
if (!port)
|
||||
{
|
||||
grub_print_error ();
|
||||
@@ -73,12 +74,16 @@ grub_usbserial_attach (grub_usb_device_t usbdev, int configno, int interfno,
|
||||
struct grub_usb_desc_endp *endp;
|
||||
endp = &usbdev->config[0].interf[interfno].descendp[j];
|
||||
|
||||
if ((endp->endp_addr & 128) && (endp->attrib & 3) == 2)
|
||||
if ((endp->endp_addr & 128) && (endp->attrib & 3) == 2
|
||||
&& (in_endp == GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING
|
||||
|| in_endp == endp->endp_addr))
|
||||
{
|
||||
/* Bulk IN endpoint. */
|
||||
port->in_endp = endp;
|
||||
}
|
||||
else if (!(endp->endp_addr & 128) && (endp->attrib & 3) == 2)
|
||||
else if (!(endp->endp_addr & 128) && (endp->attrib & 3) == 2
|
||||
&& (out_endp == GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING
|
||||
|| out_endp == endp->endp_addr))
|
||||
{
|
||||
/* Bulk OUT endpoint. */
|
||||
port->out_endp = endp;
|
||||
@@ -119,7 +124,7 @@ grub_usbserial_fetch (struct grub_serial_port *port, grub_size_t header_size)
|
||||
if (port->bufstart < port->bufend)
|
||||
return port->buf[port->bufstart++];
|
||||
|
||||
err = grub_usb_bulk_read_extended (port->usbdev, port->in_endp->endp_addr,
|
||||
err = grub_usb_bulk_read_extended (port->usbdev, port->in_endp,
|
||||
sizeof (port->buf), port->buf, 10,
|
||||
&actual);
|
||||
if (err != GRUB_USB_ERR_NONE)
|
||||
|
||||
@@ -128,7 +128,7 @@ ftdi_hw_put (struct grub_serial_port *port, const int c)
|
||||
|
||||
real_config (port);
|
||||
|
||||
grub_usb_bulk_write (port->usbdev, port->out_endp->endp_addr, 1, &cc);
|
||||
grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -193,7 +193,9 @@ grub_ftdi_attach (grub_usb_device_t usbdev, int configno, int interfno)
|
||||
return 0;
|
||||
|
||||
return grub_usbserial_attach (usbdev, configno, interfno,
|
||||
&grub_ftdi_driver);
|
||||
&grub_ftdi_driver,
|
||||
GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING,
|
||||
GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING);
|
||||
}
|
||||
|
||||
static struct grub_usb_attach_desc attach_hook =
|
||||
|
||||
@@ -146,7 +146,7 @@ pl2303_hw_put (struct grub_serial_port *port, const int c)
|
||||
|
||||
real_config (port);
|
||||
|
||||
grub_usb_bulk_write (port->usbdev, port->out_endp->endp_addr, 1, &cc);
|
||||
grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -208,7 +208,9 @@ grub_pl2303_attach (grub_usb_device_t usbdev, int configno, int interfno)
|
||||
return 0;
|
||||
|
||||
return grub_usbserial_attach (usbdev, configno, interfno,
|
||||
&grub_pl2303_driver);
|
||||
&grub_pl2303_driver,
|
||||
GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING,
|
||||
GRUB_USB_SERIAL_ENDPOINT_LAST_MATCHING);
|
||||
}
|
||||
|
||||
static struct grub_usb_attach_desc attach_hook =
|
||||
|
||||
93
grub-core/bus/usb/serial/usbdebug_late.c
Normal file
93
grub-core/bus/usb/serial/usbdebug_late.c
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009,2010,2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/serial.h>
|
||||
#include <grub/types.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/usb.h>
|
||||
#include <grub/usbserial.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
||||
/* Fetch a key. */
|
||||
static int
|
||||
usbdebug_late_hw_fetch (struct grub_serial_port *port)
|
||||
{
|
||||
return grub_usbserial_fetch (port, 0);
|
||||
}
|
||||
|
||||
/* Put a character. */
|
||||
static void
|
||||
usbdebug_late_hw_put (struct grub_serial_port *port, const int c)
|
||||
{
|
||||
char cc = c;
|
||||
|
||||
grub_usb_bulk_write (port->usbdev, port->out_endp, 1, &cc);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
usbdebug_late_hw_configure (struct grub_serial_port *port __attribute__ ((unused)),
|
||||
struct grub_serial_config *config __attribute__ ((unused)))
|
||||
{
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static struct grub_serial_driver grub_usbdebug_late_driver =
|
||||
{
|
||||
.configure = usbdebug_late_hw_configure,
|
||||
.fetch = usbdebug_late_hw_fetch,
|
||||
.put = usbdebug_late_hw_put,
|
||||
.fini = grub_usbserial_fini
|
||||
};
|
||||
|
||||
static int
|
||||
grub_usbdebug_late_attach (grub_usb_device_t usbdev, int configno, int interfno)
|
||||
{
|
||||
grub_usb_err_t err;
|
||||
struct grub_usb_desc_debug debugdesc;
|
||||
|
||||
err = grub_usb_get_descriptor (usbdev, GRUB_USB_DESCRIPTOR_DEBUG, configno,
|
||||
sizeof (debugdesc), (char *) &debugdesc);
|
||||
if (err)
|
||||
return 0;
|
||||
|
||||
return grub_usbserial_attach (usbdev, configno, interfno,
|
||||
&grub_usbdebug_late_driver,
|
||||
debugdesc.in_endp, debugdesc.out_endp);
|
||||
}
|
||||
|
||||
static struct grub_usb_attach_desc attach_hook =
|
||||
{
|
||||
.class = 0xff,
|
||||
.hook = grub_usbdebug_late_attach
|
||||
};
|
||||
|
||||
GRUB_MOD_INIT(usbserial_usbdebug_late)
|
||||
{
|
||||
grub_usb_register_attach_hook_class (&attach_hook);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(usbserial_usbdebug_late)
|
||||
{
|
||||
grub_serial_unregister_driver (&grub_usbdebug_late_driver);
|
||||
grub_usb_unregister_attach_hook_class (&attach_hook);
|
||||
}
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <grub/cpu/io.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/cpu/pci.h>
|
||||
#include <grub/disk.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -44,12 +45,22 @@ typedef enum
|
||||
GRUB_UHCI_REG_USBLEGSUP = 0xc0
|
||||
} grub_uhci_reg_t;
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_UHCI_DETECT_CHANGED = (1 << 1),
|
||||
GRUB_UHCI_DETECT_HAVE_DEVICE = 1,
|
||||
GRUB_UHCI_DETECT_LOW_SPEED = (1 << 8)
|
||||
};
|
||||
|
||||
/* R/WC legacy support bits */
|
||||
#define GRUB_UHCI_LEGSUP_END_A20GATE (1 << 15)
|
||||
#define GRUB_UHCI_TRAP_BY_64H_WSTAT (1 << 11)
|
||||
#define GRUB_UHCI_TRAP_BY_64H_RSTAT (1 << 10)
|
||||
#define GRUB_UHCI_TRAP_BY_60H_WSTAT (1 << 9)
|
||||
#define GRUB_UHCI_TRAP_BY_60H_RSTAT (1 << 8)
|
||||
enum
|
||||
{
|
||||
GRUB_UHCI_LEGSUP_END_A20GATE = (1 << 15),
|
||||
GRUB_UHCI_TRAP_BY_64H_WSTAT = (1 << 11),
|
||||
GRUB_UHCI_TRAP_BY_64H_RSTAT = (1 << 10),
|
||||
GRUB_UHCI_TRAP_BY_60H_WSTAT = (1 << 9),
|
||||
GRUB_UHCI_TRAP_BY_60H_RSTAT = (1 << 8)
|
||||
};
|
||||
|
||||
/* Reset all legacy support - clear all R/WC bits and all R/W bits */
|
||||
#define GRUB_UHCI_RESET_LEGSUP_SMI ( GRUB_UHCI_LEGSUP_END_A20GATE \
|
||||
@@ -125,7 +136,7 @@ typedef volatile struct grub_uhci_qh *grub_uhci_qh_t;
|
||||
|
||||
struct grub_uhci
|
||||
{
|
||||
int iobase;
|
||||
grub_port_t iobase;
|
||||
volatile grub_uint32_t *framelist_virt;
|
||||
grub_uint32_t framelist_phys;
|
||||
struct grub_pci_dma_chunk *framelist_chunk;
|
||||
@@ -185,9 +196,10 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
|
||||
/* Iterate over all PCI devices. Determine if a device is an UHCI
|
||||
controller. If this is the case, initialize it. */
|
||||
static int NESTED_FUNC_ATTR
|
||||
static int
|
||||
grub_uhci_pci_iter (grub_pci_device_t dev,
|
||||
grub_pci_id_t pciid __attribute__((unused)))
|
||||
grub_pci_id_t pciid __attribute__((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint32_t class_code;
|
||||
grub_uint32_t class;
|
||||
@@ -212,22 +224,28 @@ grub_uhci_pci_iter (grub_pci_device_t dev,
|
||||
|
||||
/* Set bus master - needed for coreboot or broken BIOSes */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_COMMAND);
|
||||
grub_pci_write_word(addr,
|
||||
GRUB_PCI_COMMAND_BUS_MASTER | grub_pci_read_word(addr));
|
||||
grub_pci_write_word(addr, GRUB_PCI_COMMAND_IO_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER
|
||||
| grub_pci_read_word (addr));
|
||||
|
||||
/* Determine IO base address. */
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG4);
|
||||
base = grub_pci_read (addr);
|
||||
/* Stop if there is no IO space base address defined. */
|
||||
if (! (base & 1))
|
||||
if ((base & GRUB_PCI_ADDR_SPACE_MASK) != GRUB_PCI_ADDR_SPACE_IO)
|
||||
return 0;
|
||||
|
||||
if ((base & GRUB_UHCI_IOMASK) == 0)
|
||||
return 0;
|
||||
|
||||
grub_dprintf ("uhci", "base = %x\n", base);
|
||||
|
||||
/* Allocate memory for the controller and register it. */
|
||||
u = grub_zalloc (sizeof (*u));
|
||||
if (! u)
|
||||
return 1;
|
||||
|
||||
u->iobase = base & GRUB_UHCI_IOMASK;
|
||||
u->iobase = (base & GRUB_UHCI_IOMASK) + GRUB_MACHINE_PCI_IO_BASE;
|
||||
|
||||
/* Reset PIRQ and SMI */
|
||||
addr = grub_pci_make_address (dev, GRUB_UHCI_REG_USBLEGSUP);
|
||||
@@ -351,7 +369,7 @@ grub_uhci_pci_iter (grub_pci_device_t dev,
|
||||
static void
|
||||
grub_uhci_inithw (void)
|
||||
{
|
||||
grub_pci_iterate (grub_uhci_pci_iter);
|
||||
grub_pci_iterate (grub_uhci_pci_iter, NULL);
|
||||
}
|
||||
|
||||
static grub_uhci_td_t
|
||||
@@ -391,6 +409,7 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td,
|
||||
{
|
||||
grub_uhci_td_t tdprev;
|
||||
|
||||
grub_dprintf ("uhci", "Freeing %p\n", td);
|
||||
/* Check state of TD and possibly set last_trans */
|
||||
if (transfer && (td->linkptr & 1))
|
||||
transfer->last_trans = i;
|
||||
@@ -399,7 +418,10 @@ grub_free_queue (struct grub_uhci *u, grub_uhci_qh_t qh, grub_uhci_td_t td,
|
||||
|
||||
/* Unlink the queue. */
|
||||
tdprev = td;
|
||||
td = grub_dma_phys2virt (td->linkptr2, u->td_chunk);
|
||||
if (!td->linkptr2)
|
||||
td = 0;
|
||||
else
|
||||
td = grub_dma_phys2virt (td->linkptr2, u->td_chunk);
|
||||
|
||||
/* Free the TD. */
|
||||
grub_free_td (u, tdprev);
|
||||
@@ -582,10 +604,17 @@ grub_uhci_check_transfer (grub_usb_controller_t dev,
|
||||
|
||||
*actual = 0;
|
||||
|
||||
errtd = grub_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk);
|
||||
if (cdata->qh->elinkptr & ~0x0f)
|
||||
errtd = grub_dma_phys2virt (cdata->qh->elinkptr & ~0x0f, u->qh_chunk);
|
||||
else
|
||||
errtd = 0;
|
||||
|
||||
grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p\n",
|
||||
errtd->ctrl_status, errtd->buffer & (~15), errtd);
|
||||
if (errtd)
|
||||
{
|
||||
grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p, %x\n",
|
||||
errtd->ctrl_status, errtd->buffer & (~15), errtd,
|
||||
cdata->qh->elinkptr);
|
||||
}
|
||||
|
||||
/* Check if the transaction completed. */
|
||||
if (cdata->qh->elinkptr & 1)
|
||||
@@ -671,7 +700,7 @@ grub_uhci_cancel_transfer (grub_usb_controller_t dev,
|
||||
}
|
||||
|
||||
static int
|
||||
grub_uhci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
grub_uhci_iterate (grub_usb_controller_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
struct grub_uhci *u;
|
||||
struct grub_usb_controller dev;
|
||||
@@ -679,7 +708,7 @@ grub_uhci_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
for (u = uhci; u; u = u->next)
|
||||
{
|
||||
dev.data = u;
|
||||
if (hook (&dev))
|
||||
if (hook (&dev, hook_data))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -787,7 +816,7 @@ grub_uhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
||||
grub_dprintf ("uhci", "detect=0x%02x port=%d\n", status, port);
|
||||
|
||||
/* Connect Status Change bit - it detects change of connection */
|
||||
if (status & (1 << 1))
|
||||
if (status & GRUB_UHCI_DETECT_CHANGED)
|
||||
{
|
||||
*changed = 1;
|
||||
/* Reset bit Connect Status Change */
|
||||
@@ -797,9 +826,9 @@ grub_uhci_detect_dev (grub_usb_controller_t dev, int port, int *changed)
|
||||
else
|
||||
*changed = 0;
|
||||
|
||||
if (! (status & 1))
|
||||
if (! (status & GRUB_UHCI_DETECT_HAVE_DEVICE))
|
||||
return GRUB_USB_SPEED_NONE;
|
||||
else if (status & (1 << 8))
|
||||
else if (status & GRUB_UHCI_DETECT_LOW_SPEED)
|
||||
return GRUB_USB_SPEED_LOW;
|
||||
else
|
||||
return GRUB_USB_SPEED_FULL;
|
||||
@@ -822,11 +851,15 @@ static struct grub_usb_controller_dev usb_controller =
|
||||
.cancel_transfer = grub_uhci_cancel_transfer,
|
||||
.hubports = grub_uhci_hubports,
|
||||
.portstatus = grub_uhci_portstatus,
|
||||
.detect_dev = grub_uhci_detect_dev
|
||||
.detect_dev = grub_uhci_detect_dev,
|
||||
/* estimated max. count of TDs for one bulk transfer */
|
||||
.max_bulk_tds = N_TD * 3 / 4
|
||||
};
|
||||
|
||||
GRUB_MOD_INIT(uhci)
|
||||
{
|
||||
grub_stop_disk_firmware ();
|
||||
|
||||
grub_uhci_inithw ();
|
||||
grub_usb_controller_dev_register (&usb_controller);
|
||||
grub_dprintf ("uhci", "registered\n");
|
||||
|
||||
@@ -26,67 +26,44 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_usb_controller_dev_t grub_usb_list;
|
||||
static struct grub_usb_attach_desc *attach_hooks;
|
||||
|
||||
void
|
||||
grub_usb_controller_dev_register (grub_usb_controller_dev_t usb)
|
||||
{
|
||||
auto int iterate_hook (grub_usb_controller_t dev);
|
||||
|
||||
/* Iterate over all controllers found by the driver. */
|
||||
int iterate_hook (grub_usb_controller_t dev)
|
||||
{
|
||||
dev->dev = usb;
|
||||
|
||||
/* Enable the ports of the USB Root Hub. */
|
||||
grub_usb_root_hub (dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
usb->next = grub_usb_list;
|
||||
grub_usb_list = usb;
|
||||
|
||||
if (usb->iterate)
|
||||
usb->iterate (iterate_hook);
|
||||
}
|
||||
|
||||
void
|
||||
grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb)
|
||||
{
|
||||
grub_usb_controller_dev_t *p, q;
|
||||
|
||||
for (p = &grub_usb_list, q = *p; q; p = &(q->next), q = q->next)
|
||||
if (q == usb)
|
||||
{
|
||||
*p = q->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
int
|
||||
grub_usb_controller_iterate (int (*hook) (grub_usb_controller_t dev))
|
||||
/* Context for grub_usb_controller_iterate. */
|
||||
struct grub_usb_controller_iterate_ctx
|
||||
{
|
||||
grub_usb_controller_iterate_hook_t hook;
|
||||
void *hook_data;
|
||||
grub_usb_controller_dev_t p;
|
||||
};
|
||||
|
||||
auto int iterate_hook (grub_usb_controller_t dev);
|
||||
/* Helper for grub_usb_controller_iterate. */
|
||||
static int
|
||||
grub_usb_controller_iterate_iter (grub_usb_controller_t dev, void *data)
|
||||
{
|
||||
struct grub_usb_controller_iterate_ctx *ctx = data;
|
||||
|
||||
int iterate_hook (grub_usb_controller_t dev)
|
||||
{
|
||||
dev->dev = p;
|
||||
if (hook (dev))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
dev->dev = ctx->p;
|
||||
if (ctx->hook (dev, ctx->hook_data))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
grub_usb_controller_iterate (grub_usb_controller_iterate_hook_t hook,
|
||||
void *hook_data)
|
||||
{
|
||||
struct grub_usb_controller_iterate_ctx ctx = {
|
||||
.hook = hook,
|
||||
.hook_data = hook_data
|
||||
};
|
||||
|
||||
/* Iterate over all controller drivers. */
|
||||
for (p = grub_usb_list; p; p = p->next)
|
||||
for (ctx.p = grub_usb_list; ctx.p; ctx.p = ctx.p->next)
|
||||
{
|
||||
/* Iterate over the busses of the controllers. XXX: Actually, a
|
||||
hub driver should do this. */
|
||||
if (p->iterate (iterate_hook))
|
||||
if (ctx.p->iterate (grub_usb_controller_iterate_iter, &ctx))
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -132,31 +109,6 @@ grub_usb_get_descriptor (grub_usb_device_t dev,
|
||||
0, size, data);
|
||||
}
|
||||
|
||||
struct grub_usb_desc_endp *
|
||||
grub_usb_get_endpdescriptor (grub_usb_device_t usbdev, int addr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < usbdev->config[0].descconf->numif; i++)
|
||||
{
|
||||
struct grub_usb_desc_if *interf;
|
||||
int j;
|
||||
|
||||
interf = usbdev->config[0].interf[i].descif;
|
||||
|
||||
for (j = 0; j < interf->endpointcnt; j++)
|
||||
{
|
||||
struct grub_usb_desc_endp *endp;
|
||||
endp = &usbdev->config[0].interf[i].descendp[j];
|
||||
|
||||
if (endp->endp_addr == addr)
|
||||
return endp;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_device_initialize (grub_usb_device_t dev)
|
||||
{
|
||||
@@ -196,6 +148,7 @@ grub_usb_device_initialize (grub_usb_device_t dev)
|
||||
int pos;
|
||||
int currif;
|
||||
char *data;
|
||||
struct grub_usb_desc *desc;
|
||||
|
||||
/* First just read the first 4 bytes of the configuration
|
||||
descriptor, after that it is known how many bytes really have
|
||||
@@ -222,18 +175,35 @@ grub_usb_device_initialize (grub_usb_device_t dev)
|
||||
/* Read all interfaces. */
|
||||
for (currif = 0; currif < dev->config[i].descconf->numif; currif++)
|
||||
{
|
||||
while (pos < config.totallen
|
||||
&& ((struct grub_usb_desc *)&data[pos])->type
|
||||
!= GRUB_USB_DESCRIPTOR_INTERFACE)
|
||||
pos += ((struct grub_usb_desc *)&data[pos])->length;
|
||||
while (pos < config.totallen)
|
||||
{
|
||||
desc = (struct grub_usb_desc *)&data[pos];
|
||||
if (desc->type == GRUB_USB_DESCRIPTOR_INTERFACE)
|
||||
break;
|
||||
if (!desc->length)
|
||||
{
|
||||
err = GRUB_USB_ERR_BADDEVICE;
|
||||
goto fail;
|
||||
}
|
||||
pos += desc->length;
|
||||
}
|
||||
|
||||
dev->config[i].interf[currif].descif
|
||||
= (struct grub_usb_desc_if *) &data[pos];
|
||||
pos += dev->config[i].interf[currif].descif->length;
|
||||
|
||||
while (pos < config.totallen
|
||||
&& ((struct grub_usb_desc *)&data[pos])->type
|
||||
!= GRUB_USB_DESCRIPTOR_ENDPOINT)
|
||||
pos += ((struct grub_usb_desc *)&data[pos])->length;
|
||||
while (pos < config.totallen)
|
||||
{
|
||||
desc = (struct grub_usb_desc *)&data[pos];
|
||||
if (desc->type == GRUB_USB_DESCRIPTOR_ENDPOINT)
|
||||
break;
|
||||
if (!desc->length)
|
||||
{
|
||||
err = GRUB_USB_ERR_BADDEVICE;
|
||||
goto fail;
|
||||
}
|
||||
pos += desc->length;
|
||||
}
|
||||
|
||||
/* Point to the first endpoint. */
|
||||
dev->config[i].interf[currif].descendp
|
||||
@@ -272,8 +242,13 @@ void grub_usb_device_attach (grub_usb_device_t dev)
|
||||
continue;
|
||||
|
||||
for (desc = attach_hooks; desc; desc = desc->next)
|
||||
if (interf->class == desc->class && desc->hook (dev, 0, i))
|
||||
dev->config[0].interf[i].attached = 1;
|
||||
if (interf->class == desc->class)
|
||||
{
|
||||
grub_boot_time ("Probing USB device driver class %x", desc->class);
|
||||
if (desc->hook (dev, 0, i))
|
||||
dev->config[0].interf[i].attached = 1;
|
||||
grub_boot_time ("Probed USB device driver class %x", desc->class);
|
||||
}
|
||||
|
||||
if (dev->config[0].interf[i].attached)
|
||||
continue;
|
||||
@@ -282,59 +257,66 @@ void grub_usb_device_attach (grub_usb_device_t dev)
|
||||
{
|
||||
case GRUB_USB_CLASS_MASS_STORAGE:
|
||||
grub_dl_load ("usbms");
|
||||
grub_print_error ();
|
||||
break;
|
||||
case GRUB_USB_CLASS_HID:
|
||||
grub_dl_load ("usb_keyboard");
|
||||
grub_print_error ();
|
||||
break;
|
||||
case 0xff:
|
||||
/* FIXME: don't load useless modules. */
|
||||
grub_dl_load ("usbserial_ftdi");
|
||||
grub_print_error ();
|
||||
grub_dl_load ("usbserial_pl2303");
|
||||
grub_print_error ();
|
||||
grub_dl_load ("usbserial_usbdebug");
|
||||
grub_print_error ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Helper for grub_usb_register_attach_hook_class. */
|
||||
static int
|
||||
grub_usb_register_attach_hook_class_iter (grub_usb_device_t usbdev, void *data)
|
||||
{
|
||||
struct grub_usb_attach_desc *desc = data;
|
||||
struct grub_usb_desc_device *descdev = &usbdev->descdev;
|
||||
int i;
|
||||
|
||||
if (descdev->class != 0 || descdev->subclass || descdev->protocol != 0
|
||||
|| descdev->configcnt == 0)
|
||||
return 0;
|
||||
|
||||
/* XXX: Just check configuration 0 for now. */
|
||||
for (i = 0; i < usbdev->config[0].descconf->numif; i++)
|
||||
{
|
||||
struct grub_usb_desc_if *interf;
|
||||
|
||||
interf = usbdev->config[0].interf[i].descif;
|
||||
|
||||
grub_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n",
|
||||
i, interf->class, interf->subclass, interf->protocol);
|
||||
|
||||
if (usbdev->config[0].interf[i].attached)
|
||||
continue;
|
||||
|
||||
if (interf->class != desc->class)
|
||||
continue;
|
||||
if (desc->hook (usbdev, 0, i))
|
||||
usbdev->config[0].interf[i].attached = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
grub_usb_register_attach_hook_class (struct grub_usb_attach_desc *desc)
|
||||
{
|
||||
auto int usb_iterate (grub_usb_device_t dev);
|
||||
|
||||
int usb_iterate (grub_usb_device_t usbdev)
|
||||
{
|
||||
struct grub_usb_desc_device *descdev = &usbdev->descdev;
|
||||
int i;
|
||||
|
||||
if (descdev->class != 0 || descdev->subclass || descdev->protocol != 0
|
||||
|| descdev->configcnt == 0)
|
||||
return 0;
|
||||
|
||||
/* XXX: Just check configuration 0 for now. */
|
||||
for (i = 0; i < usbdev->config[0].descconf->numif; i++)
|
||||
{
|
||||
struct grub_usb_desc_if *interf;
|
||||
|
||||
interf = usbdev->config[0].interf[i].descif;
|
||||
|
||||
grub_dprintf ("usb", "iterate: interf=%d, class=%d, subclass=%d, protocol=%d\n",
|
||||
i, interf->class, interf->subclass, interf->protocol);
|
||||
|
||||
if (usbdev->config[0].interf[i].attached)
|
||||
continue;
|
||||
|
||||
if (interf->class != desc->class)
|
||||
continue;
|
||||
if (desc->hook (usbdev, 0, i))
|
||||
usbdev->config[0].interf[i].attached = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
desc->next = attach_hooks;
|
||||
attach_hooks = desc;
|
||||
|
||||
grub_usb_iterate (usb_iterate);
|
||||
grub_usb_iterate (grub_usb_register_attach_hook_class_iter, desc);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
static struct grub_usb_device *grub_usb_devs[GRUB_USBHUB_MAX_DEVICES];
|
||||
|
||||
static int rescan = 0;
|
||||
static int npending = 0;
|
||||
|
||||
struct grub_usb_hub
|
||||
{
|
||||
@@ -36,30 +37,34 @@ struct grub_usb_hub
|
||||
grub_usb_controller_t controller;
|
||||
int nports;
|
||||
struct grub_usb_device **devices;
|
||||
struct grub_usb_hub_port *ports;
|
||||
grub_usb_device_t dev;
|
||||
};
|
||||
|
||||
static struct grub_usb_hub *hubs;
|
||||
static grub_usb_controller_dev_t grub_usb_list;
|
||||
|
||||
/* Add a device that currently has device number 0 and resides on
|
||||
CONTROLLER, the Hub reported that the device speed is SPEED. */
|
||||
static grub_usb_device_t
|
||||
grub_usb_hub_add_dev (grub_usb_controller_t controller,
|
||||
grub_usb_speed_t speed,
|
||||
int port, int hubaddr)
|
||||
int split_hubport, int split_hubaddr)
|
||||
{
|
||||
grub_usb_device_t dev;
|
||||
int i;
|
||||
grub_usb_err_t err;
|
||||
|
||||
grub_boot_time ("Attaching USB device");
|
||||
|
||||
dev = grub_zalloc (sizeof (struct grub_usb_device));
|
||||
if (! dev)
|
||||
return NULL;
|
||||
|
||||
dev->controller = *controller;
|
||||
dev->speed = speed;
|
||||
dev->port = port;
|
||||
dev->hubaddr = hubaddr;
|
||||
dev->split_hubport = split_hubport;
|
||||
dev->split_hubaddr = split_hubaddr;
|
||||
|
||||
err = grub_usb_device_initialize (dev);
|
||||
if (err)
|
||||
@@ -103,13 +108,17 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller,
|
||||
|
||||
grub_dprintf ("usb", "Added new usb device: %p, addr=%d\n",
|
||||
dev, i);
|
||||
grub_dprintf ("usb", "speed=%d, port=%d, hubaddr=%d\n",
|
||||
speed, port, hubaddr);
|
||||
grub_dprintf ("usb", "speed=%d, split_hubport=%d, split_hubaddr=%d\n",
|
||||
speed, split_hubport, split_hubaddr);
|
||||
|
||||
/* Wait "recovery interval", spec. says 2ms */
|
||||
grub_millisleep (2);
|
||||
|
||||
grub_boot_time ("Probing USB device driver");
|
||||
|
||||
grub_usb_device_attach (dev);
|
||||
|
||||
grub_boot_time ("Attached USB device");
|
||||
|
||||
return dev;
|
||||
}
|
||||
@@ -139,10 +148,15 @@ grub_usb_add_hub (grub_usb_device_t dev)
|
||||
grub_dprintf ("usb", "Hub set configuration\n");
|
||||
grub_usb_set_configuration (dev, 1);
|
||||
|
||||
dev->children = grub_zalloc (hubdesc.portcnt * sizeof (dev->children[0]));
|
||||
if (!dev->children)
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
dev->nports = hubdesc.portcnt;
|
||||
dev->children = grub_zalloc (hubdesc.portcnt * sizeof (dev->children[0]));
|
||||
dev->ports = grub_zalloc (dev->nports * sizeof (dev->ports[0]));
|
||||
if (!dev->children || !dev->ports)
|
||||
{
|
||||
grub_free (dev->children);
|
||||
grub_free (dev->ports);
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
}
|
||||
|
||||
/* Power on all Hub ports. */
|
||||
for (i = 1; i <= hubdesc.portcnt; i++)
|
||||
@@ -173,7 +187,7 @@ grub_usb_add_hub (grub_usb_device_t dev)
|
||||
if (len > sizeof (dev->statuschange))
|
||||
len = sizeof (dev->statuschange);
|
||||
dev->hub_transfer
|
||||
= grub_usb_bulk_read_background (dev, endp->endp_addr, len,
|
||||
= grub_usb_bulk_read_background (dev, endp, len,
|
||||
(char *) &dev->statuschange);
|
||||
break;
|
||||
}
|
||||
@@ -190,47 +204,29 @@ attach_root_port (struct grub_usb_hub *hub, int portno,
|
||||
{
|
||||
grub_usb_device_t dev;
|
||||
grub_err_t err;
|
||||
int total, i;
|
||||
grub_usb_speed_t current_speed = GRUB_USB_SPEED_NONE;
|
||||
int changed=0;
|
||||
|
||||
#if 0
|
||||
/* Specification does not say about disabling of port when device
|
||||
* connected. If disabling is really necessary for some devices,
|
||||
* delete this #if 0 and related #endif */
|
||||
/* Disable the port. XXX: Why? */
|
||||
err = hub->controller->dev->portstatus (hub->controller, portno, 0);
|
||||
if (err)
|
||||
return;
|
||||
#endif
|
||||
/* Wait for completion of insertion and stable power (USB spec.)
|
||||
* Should be at least 100ms, some devices requires more...
|
||||
* There is also another thing - some devices have worse contacts
|
||||
* and connected signal is unstable for some time - we should handle
|
||||
* it - but prevent deadlock in case when device is too faulty... */
|
||||
for (total = i = 0; (i < 250) && (total < 2000); i++, total++)
|
||||
{
|
||||
grub_millisleep (1);
|
||||
current_speed = hub->controller->dev->detect_dev
|
||||
(hub->controller, portno, &changed);
|
||||
if (current_speed == GRUB_USB_SPEED_NONE)
|
||||
i = 0;
|
||||
}
|
||||
grub_dprintf ("usb", "total=%d\n", total);
|
||||
if (total >= 2000)
|
||||
return;
|
||||
grub_boot_time ("After detect_dev");
|
||||
|
||||
/* Enable the port. */
|
||||
err = hub->controller->dev->portstatus (hub->controller, portno, 1);
|
||||
if (err)
|
||||
return;
|
||||
hub->controller->dev->pending_reset = grub_get_time_ms () + 5000;
|
||||
npending++;
|
||||
|
||||
grub_millisleep (10);
|
||||
|
||||
grub_boot_time ("Port enabled");
|
||||
|
||||
/* Enable the port and create a device. */
|
||||
dev = grub_usb_hub_add_dev (hub->controller, speed, portno, 0);
|
||||
/* High speed device needs not transaction translation
|
||||
and full/low speed device cannot be connected to EHCI root hub
|
||||
and full/low speed device connected to OHCI/UHCI needs not
|
||||
transaction translation - e.g. hubport and hubaddr should be
|
||||
always none (zero) for any device connected to any root hub. */
|
||||
dev = grub_usb_hub_add_dev (hub->controller, speed, 0, 0);
|
||||
hub->controller->dev->pending_reset = 0;
|
||||
npending--;
|
||||
if (! dev)
|
||||
return;
|
||||
|
||||
@@ -239,14 +235,20 @@ attach_root_port (struct grub_usb_hub *hub, int portno,
|
||||
/* If the device is a Hub, scan it for more devices. */
|
||||
if (dev->descdev.class == 0x09)
|
||||
grub_usb_add_hub (dev);
|
||||
|
||||
grub_boot_time ("Attached root port");
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_root_hub (grub_usb_controller_t controller)
|
||||
/* Iterate over all controllers found by the driver. */
|
||||
static int
|
||||
grub_usb_controller_dev_register_iter (grub_usb_controller_t controller, void *data)
|
||||
{
|
||||
int i;
|
||||
grub_usb_controller_dev_t usb = data;
|
||||
struct grub_usb_hub *hub;
|
||||
int changed=0;
|
||||
|
||||
controller->dev = usb;
|
||||
|
||||
grub_boot_time ("Registering USB root hub");
|
||||
|
||||
hub = grub_malloc (sizeof (*hub));
|
||||
if (!hub)
|
||||
@@ -267,27 +269,122 @@ grub_usb_root_hub (grub_usb_controller_t controller)
|
||||
/* Query the number of ports the root Hub has. */
|
||||
hub->nports = controller->dev->hubports (controller);
|
||||
hub->devices = grub_zalloc (sizeof (hub->devices[0]) * hub->nports);
|
||||
if (!hub->devices)
|
||||
hub->ports = grub_zalloc (sizeof (hub->ports[0]) * hub->nports);
|
||||
if (!hub->devices || !hub->ports)
|
||||
{
|
||||
grub_free (hub->devices);
|
||||
grub_free (hub->ports);
|
||||
grub_free (hub->controller);
|
||||
grub_free (hub);
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
grub_print_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < hub->nports; i++)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb)
|
||||
{
|
||||
grub_usb_controller_dev_t *p, q;
|
||||
|
||||
for (p = &grub_usb_list, q = *p; q; p = &(q->next), q = q->next)
|
||||
if (q == usb)
|
||||
{
|
||||
*p = q->next;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
grub_usb_controller_dev_register (grub_usb_controller_dev_t usb)
|
||||
{
|
||||
int portno;
|
||||
int continue_waiting = 0;
|
||||
struct grub_usb_hub *hub;
|
||||
|
||||
usb->next = grub_usb_list;
|
||||
grub_usb_list = usb;
|
||||
|
||||
if (usb->iterate)
|
||||
usb->iterate (grub_usb_controller_dev_register_iter, usb);
|
||||
|
||||
grub_boot_time ("waiting for stable power on USB root\n");
|
||||
|
||||
while (1)
|
||||
{
|
||||
grub_usb_speed_t speed;
|
||||
if (!controller->dev->pending_reset)
|
||||
{
|
||||
speed = controller->dev->detect_dev (hub->controller, i,
|
||||
&changed);
|
||||
for (hub = hubs; hub; hub = hub->next)
|
||||
if (hub->controller->dev == usb)
|
||||
{
|
||||
/* Wait for completion of insertion and stable power (USB spec.)
|
||||
* Should be at least 100ms, some devices requires more...
|
||||
* There is also another thing - some devices have worse contacts
|
||||
* and connected signal is unstable for some time - we should handle
|
||||
* it - but prevent deadlock in case when device is too faulty... */
|
||||
for (portno = 0; portno < hub->nports; portno++)
|
||||
{
|
||||
grub_usb_speed_t speed;
|
||||
int changed = 0;
|
||||
|
||||
if (speed != GRUB_USB_SPEED_NONE)
|
||||
attach_root_port (hub, i, speed);
|
||||
}
|
||||
speed = hub->controller->dev->detect_dev (hub->controller, portno,
|
||||
&changed);
|
||||
|
||||
if (hub->ports[portno].state == PORT_STATE_NORMAL
|
||||
&& speed != GRUB_USB_SPEED_NONE)
|
||||
{
|
||||
hub->ports[portno].soft_limit_time = grub_get_time_ms () + 250;
|
||||
hub->ports[portno].hard_limit_time = hub->ports[portno].soft_limit_time + 1750;
|
||||
hub->ports[portno].state = PORT_STATE_WAITING_FOR_STABLE_POWER;
|
||||
grub_boot_time ("Scheduling stable power wait for port %p:%d",
|
||||
usb, portno);
|
||||
continue_waiting++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER
|
||||
&& speed == GRUB_USB_SPEED_NONE)
|
||||
{
|
||||
hub->ports[portno].soft_limit_time = grub_get_time_ms () + 250;
|
||||
continue;
|
||||
}
|
||||
if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER
|
||||
&& grub_get_time_ms () > hub->ports[portno].soft_limit_time)
|
||||
{
|
||||
hub->ports[portno].state = PORT_STATE_STABLE_POWER;
|
||||
grub_boot_time ("Got stable power wait for port %p:%d",
|
||||
usb, portno);
|
||||
continue_waiting--;
|
||||
continue;
|
||||
}
|
||||
if (hub->ports[portno].state == PORT_STATE_WAITING_FOR_STABLE_POWER
|
||||
&& grub_get_time_ms () > hub->ports[portno].hard_limit_time)
|
||||
{
|
||||
hub->ports[portno].state = PORT_STATE_FAILED_DEVICE;
|
||||
continue_waiting--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!continue_waiting)
|
||||
break;
|
||||
grub_millisleep (1);
|
||||
}
|
||||
|
||||
return GRUB_USB_ERR_NONE;
|
||||
grub_boot_time ("After the stable power wait on USB root");
|
||||
|
||||
for (hub = hubs; hub; hub = hub->next)
|
||||
if (hub->controller->dev == usb)
|
||||
for (portno = 0; portno < hub->nports; portno++)
|
||||
if (hub->ports[portno].state == PORT_STATE_STABLE_POWER)
|
||||
{
|
||||
grub_usb_speed_t speed;
|
||||
int changed = 0;
|
||||
hub->ports[portno].state = PORT_STATE_NORMAL;
|
||||
speed = hub->controller->dev->detect_dev (hub->controller, portno, &changed);
|
||||
attach_root_port (hub, portno, speed);
|
||||
}
|
||||
|
||||
grub_boot_time ("USB root hub registered");
|
||||
}
|
||||
|
||||
static void detach_device (grub_usb_device_t dev);
|
||||
@@ -319,14 +416,78 @@ detach_device (grub_usb_device_t dev)
|
||||
grub_usb_devs[dev->addr] = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
wait_power_nonroot_hub (grub_usb_device_t dev)
|
||||
{
|
||||
grub_usb_err_t err;
|
||||
int continue_waiting = 0;
|
||||
unsigned i;
|
||||
|
||||
for (i = 1; i <= dev->nports; i++)
|
||||
if (dev->ports[i - 1].state == PORT_STATE_WAITING_FOR_STABLE_POWER)
|
||||
{
|
||||
grub_uint64_t tm;
|
||||
grub_uint32_t current_status = 0;
|
||||
|
||||
/* Get the port status. */
|
||||
err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN
|
||||
| GRUB_USB_REQTYPE_CLASS
|
||||
| GRUB_USB_REQTYPE_TARGET_OTHER),
|
||||
GRUB_USB_REQ_GET_STATUS,
|
||||
0, i,
|
||||
sizeof (current_status),
|
||||
(char *) ¤t_status);
|
||||
if (err)
|
||||
{
|
||||
dev->ports[i - 1].state = PORT_STATE_FAILED_DEVICE;
|
||||
continue;
|
||||
}
|
||||
tm = grub_get_time_ms ();
|
||||
if (!(current_status & GRUB_USB_HUB_STATUS_PORT_CONNECTED))
|
||||
dev->ports[i - 1].soft_limit_time = tm + 250;
|
||||
if (tm >= dev->ports[i - 1].soft_limit_time)
|
||||
{
|
||||
if (dev->controller.dev->pending_reset)
|
||||
continue;
|
||||
/* Now do reset of port. */
|
||||
grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT
|
||||
| GRUB_USB_REQTYPE_CLASS
|
||||
| GRUB_USB_REQTYPE_TARGET_OTHER),
|
||||
GRUB_USB_REQ_SET_FEATURE,
|
||||
GRUB_USB_HUB_FEATURE_PORT_RESET,
|
||||
i, 0, 0);
|
||||
dev->ports[i - 1].state = PORT_STATE_NORMAL;
|
||||
grub_boot_time ("Resetting port %p:%d", dev, i - 1);
|
||||
|
||||
rescan = 1;
|
||||
/* We cannot reset more than one device at the same time !
|
||||
* Resetting more devices together results in very bad
|
||||
* situation: more than one device has default address 0
|
||||
* at the same time !!!
|
||||
* Additionaly, we cannot perform another reset
|
||||
* anywhere on the same OHCI controller until
|
||||
* we will finish addressing of reseted device ! */
|
||||
dev->controller.dev->pending_reset = grub_get_time_ms () + 5000;
|
||||
npending++;
|
||||
continue;
|
||||
}
|
||||
if (tm >= dev->ports[i - 1].hard_limit_time)
|
||||
{
|
||||
dev->ports[i - 1].state = PORT_STATE_FAILED_DEVICE;
|
||||
continue;
|
||||
}
|
||||
continue_waiting = 1;
|
||||
}
|
||||
return continue_waiting && dev->controller.dev->pending_reset == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
poll_nonroot_hub (grub_usb_device_t dev)
|
||||
{
|
||||
grub_usb_err_t err;
|
||||
unsigned i;
|
||||
grub_uint8_t changed;
|
||||
grub_uint32_t changed;
|
||||
grub_size_t actual, len;
|
||||
int j, total;
|
||||
|
||||
if (!dev->hub_transfer)
|
||||
return;
|
||||
@@ -342,7 +503,7 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
if (len > sizeof (dev->statuschange))
|
||||
len = sizeof (dev->statuschange);
|
||||
dev->hub_transfer
|
||||
= grub_usb_bulk_read_background (dev, dev->hub_endpoint->endp_addr, len,
|
||||
= grub_usb_bulk_read_background (dev, dev->hub_endpoint, len,
|
||||
(char *) &dev->statuschange);
|
||||
|
||||
if (err || actual == 0 || changed == 0)
|
||||
@@ -352,9 +513,9 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
for (i = 1; i <= dev->nports; i++)
|
||||
{
|
||||
grub_uint32_t status;
|
||||
grub_uint32_t current_status = 0;
|
||||
|
||||
if (!(changed & (1 << i)))
|
||||
if (!(changed & (1 << i))
|
||||
|| dev->ports[i - 1].state == PORT_STATE_WAITING_FOR_STABLE_POWER)
|
||||
continue;
|
||||
|
||||
/* Get the port status. */
|
||||
@@ -407,52 +568,19 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
/* Connected and status of connection changed ? */
|
||||
if (status & GRUB_USB_HUB_STATUS_PORT_CONNECTED)
|
||||
{
|
||||
grub_boot_time ("Before the stable power wait portno=%d", i);
|
||||
/* A device is actually connected to this port. */
|
||||
/* Wait for completion of insertion and stable power (USB spec.)
|
||||
* Should be at least 100ms, some devices requires more...
|
||||
* There is also another thing - some devices have worse contacts
|
||||
* and connected signal is unstable for some time - we should handle
|
||||
* it - but prevent deadlock in case when device is too faulty... */
|
||||
for (total = j = 0; (j < 250) && (total < 2000); j++, total++)
|
||||
{
|
||||
grub_millisleep (1);
|
||||
/* Get the port status. */
|
||||
err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN
|
||||
| GRUB_USB_REQTYPE_CLASS
|
||||
| GRUB_USB_REQTYPE_TARGET_OTHER),
|
||||
GRUB_USB_REQ_GET_STATUS,
|
||||
0, i,
|
||||
sizeof (current_status),
|
||||
(char *) ¤t_status);
|
||||
if (err)
|
||||
{
|
||||
total = 2000;
|
||||
break;
|
||||
}
|
||||
if (!(current_status & GRUB_USB_HUB_STATUS_PORT_CONNECTED))
|
||||
j = 0;
|
||||
}
|
||||
grub_dprintf ("usb", "(non-root) total=%d\n", total);
|
||||
if (total >= 2000)
|
||||
continue;
|
||||
|
||||
/* Now do reset of port. */
|
||||
grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT
|
||||
| GRUB_USB_REQTYPE_CLASS
|
||||
| GRUB_USB_REQTYPE_TARGET_OTHER),
|
||||
GRUB_USB_REQ_SET_FEATURE,
|
||||
GRUB_USB_HUB_FEATURE_PORT_RESET,
|
||||
i, 0, 0);
|
||||
rescan = 1;
|
||||
/* We cannot reset more than one device at the same time !
|
||||
* Resetting more devices together results in very bad
|
||||
* situation: more than one device has default address 0
|
||||
* at the same time !!!
|
||||
* Additionaly, we cannot perform another reset
|
||||
* anywhere on the same OHCI controller until
|
||||
* we will finish addressing of reseted device ! */
|
||||
dev->controller.dev->pending_reset = grub_get_time_ms () + 5000;
|
||||
return;
|
||||
/* Wait for completion of insertion and stable power (USB spec.)
|
||||
* Should be at least 100ms, some devices requires more...
|
||||
* There is also another thing - some devices have worse contacts
|
||||
* and connected signal is unstable for some time - we should handle
|
||||
* it - but prevent deadlock in case when device is too faulty... */
|
||||
dev->ports[i - 1].soft_limit_time = grub_get_time_ms () + 250;
|
||||
dev->ports[i - 1].hard_limit_time = dev->ports[i - 1].soft_limit_time + 1750;
|
||||
dev->ports[i - 1].state = PORT_STATE_WAITING_FOR_STABLE_POWER;
|
||||
grub_boot_time ("Scheduling stable power wait for port %p:%d",
|
||||
dev, i - 1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,10 +592,14 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
GRUB_USB_REQ_CLEAR_FEATURE,
|
||||
GRUB_USB_HUB_FEATURE_C_PORT_RESET, i, 0, 0);
|
||||
|
||||
grub_boot_time ("Port %d reset", i);
|
||||
|
||||
if (status & GRUB_USB_HUB_STATUS_PORT_CONNECTED)
|
||||
{
|
||||
grub_usb_speed_t speed;
|
||||
grub_usb_device_t next_dev;
|
||||
int split_hubport = 0;
|
||||
int split_hubaddr = 0;
|
||||
|
||||
/* Determine the device speed. */
|
||||
if (status & GRUB_USB_HUB_STATUS_PORT_LOWSPEED)
|
||||
@@ -483,9 +615,42 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
/* Wait a recovery time after reset, spec. says 10ms */
|
||||
grub_millisleep (10);
|
||||
|
||||
/* Find correct values for SPLIT hubport and hubaddr */
|
||||
if (speed == GRUB_USB_SPEED_HIGH)
|
||||
{
|
||||
/* HIGH speed device needs not transaction translation */
|
||||
split_hubport = 0;
|
||||
split_hubaddr = 0;
|
||||
}
|
||||
else
|
||||
/* FULL/LOW device needs hub port and hub address
|
||||
for transaction translation (if connected to EHCI) */
|
||||
if (dev->speed == GRUB_USB_SPEED_HIGH)
|
||||
{
|
||||
/* This port is the first FULL/LOW speed port
|
||||
in the chain from root hub. Attached device
|
||||
should use its port number and hub address */
|
||||
split_hubport = i;
|
||||
split_hubaddr = dev->addr;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This port is NOT the first FULL/LOW speed port
|
||||
in the chain from root hub. Attached device
|
||||
should use values inherited from some parent
|
||||
HIGH speed hub - if any. */
|
||||
split_hubport = dev->split_hubport;
|
||||
split_hubaddr = dev->split_hubaddr;
|
||||
}
|
||||
|
||||
/* Add the device and assign a device address to it. */
|
||||
next_dev = grub_usb_hub_add_dev (&dev->controller, speed, i, dev->addr);
|
||||
dev->controller.dev->pending_reset = 0;
|
||||
next_dev = grub_usb_hub_add_dev (&dev->controller, speed,
|
||||
split_hubport, split_hubaddr);
|
||||
if (dev->controller.dev->pending_reset)
|
||||
{
|
||||
dev->controller.dev->pending_reset = 0;
|
||||
npending--;
|
||||
}
|
||||
if (! next_dev)
|
||||
continue;
|
||||
|
||||
@@ -500,7 +665,7 @@ poll_nonroot_hub (grub_usb_device_t dev)
|
||||
}
|
||||
|
||||
void
|
||||
grub_usb_poll_devices (void)
|
||||
grub_usb_poll_devices (int wait_for_completion)
|
||||
{
|
||||
struct grub_usb_hub *hub;
|
||||
int i;
|
||||
@@ -514,7 +679,7 @@ grub_usb_poll_devices (void)
|
||||
grub_usb_speed_t speed = GRUB_USB_SPEED_NONE;
|
||||
int changed = 0;
|
||||
|
||||
if (!hub->controller->dev->pending_reset)
|
||||
if (hub->controller->dev->pending_reset)
|
||||
{
|
||||
/* Check for possible timeout */
|
||||
if (grub_get_time_ms () > hub->controller->dev->pending_reset)
|
||||
@@ -522,10 +687,13 @@ grub_usb_poll_devices (void)
|
||||
/* Something went wrong, reset device was not
|
||||
* addressed properly, timeout happened */
|
||||
hub->controller->dev->pending_reset = 0;
|
||||
speed = hub->controller->dev->detect_dev (hub->controller,
|
||||
i, &changed);
|
||||
npending--;
|
||||
}
|
||||
}
|
||||
if (!hub->controller->dev->pending_reset)
|
||||
speed = hub->controller->dev->detect_dev (hub->controller,
|
||||
i, &changed);
|
||||
|
||||
if (changed)
|
||||
{
|
||||
detach_device (hub->devices[i]);
|
||||
@@ -548,15 +716,30 @@ grub_usb_poll_devices (void)
|
||||
if (dev && dev->descdev.class == 0x09)
|
||||
poll_nonroot_hub (dev);
|
||||
}
|
||||
if (!rescan)
|
||||
break;
|
||||
grub_millisleep (50);
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
int continue_waiting = 0;
|
||||
for (i = 0; i < GRUB_USBHUB_MAX_DEVICES; i++)
|
||||
{
|
||||
grub_usb_device_t dev = grub_usb_devs[i];
|
||||
|
||||
if (dev && dev->descdev.class == 0x09)
|
||||
continue_waiting = continue_waiting || wait_power_nonroot_hub (dev);
|
||||
}
|
||||
if (!continue_waiting)
|
||||
break;
|
||||
grub_millisleep (1);
|
||||
}
|
||||
|
||||
if (!(rescan || (npending && wait_for_completion)))
|
||||
break;
|
||||
grub_millisleep (25);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
grub_usb_iterate (int (*hook) (grub_usb_device_t dev))
|
||||
grub_usb_iterate (grub_usb_iterate_hook_t hook, void *hook_data)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -564,7 +747,7 @@ grub_usb_iterate (int (*hook) (grub_usb_device_t dev))
|
||||
{
|
||||
if (grub_usb_devs[i])
|
||||
{
|
||||
if (hook (grub_usb_devs[i]))
|
||||
if (hook (grub_usb_devs[i], hook_data))
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,19 @@
|
||||
#include <grub/usbtrans.h>
|
||||
#include <grub/time.h>
|
||||
|
||||
|
||||
static inline unsigned int
|
||||
grub_usb_bulk_maxpacket (grub_usb_device_t dev,
|
||||
struct grub_usb_desc_endp *endpoint)
|
||||
{
|
||||
/* Use the maximum packet size given in the endpoint descriptor. */
|
||||
if (dev->initialized && endpoint)
|
||||
return endpoint->maxpacket;
|
||||
|
||||
return 64;
|
||||
}
|
||||
|
||||
|
||||
static grub_usb_err_t
|
||||
grub_usb_execute_and_wait_transfer (grub_usb_device_t dev,
|
||||
grub_usb_transfer_t transfer,
|
||||
@@ -199,7 +212,8 @@ grub_usb_control_msg (grub_usb_device_t dev,
|
||||
|
||||
static grub_usb_transfer_t
|
||||
grub_usb_bulk_setup_readwrite (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size0, char *data_in,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size0, char *data_in,
|
||||
grub_transfer_type_t type)
|
||||
{
|
||||
int i;
|
||||
@@ -210,7 +224,7 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev,
|
||||
grub_uint32_t data_addr;
|
||||
struct grub_pci_dma_chunk *data_chunk;
|
||||
grub_size_t size = size0;
|
||||
int toggle = dev->toggle[endpoint];
|
||||
int toggle = dev->toggle[endpoint->endp_addr];
|
||||
|
||||
grub_dprintf ("usb", "bulk: size=0x%02lx type=%d\n", (unsigned long) size,
|
||||
type);
|
||||
@@ -224,20 +238,6 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev,
|
||||
if (type == GRUB_USB_TRANSFER_TYPE_OUT)
|
||||
grub_memcpy ((char *) data, data_in, size);
|
||||
|
||||
/* Use the maximum packet size given in the endpoint descriptor. */
|
||||
if (dev->initialized)
|
||||
{
|
||||
struct grub_usb_desc_endp *endpdesc;
|
||||
endpdesc = grub_usb_get_endpdescriptor (dev, endpoint);
|
||||
|
||||
if (endpdesc)
|
||||
max = endpdesc->maxpacket;
|
||||
else
|
||||
max = 64;
|
||||
}
|
||||
else
|
||||
max = 64;
|
||||
|
||||
/* Create a transfer. */
|
||||
transfer = grub_malloc (sizeof (struct grub_usb_transfer));
|
||||
if (! transfer)
|
||||
@@ -246,10 +246,12 @@ grub_usb_bulk_setup_readwrite (grub_usb_device_t dev,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
max = grub_usb_bulk_maxpacket (dev, endpoint);
|
||||
|
||||
datablocks = ((size + max - 1) / max);
|
||||
transfer->transcnt = datablocks;
|
||||
transfer->size = size - 1;
|
||||
transfer->endpoint = endpoint;
|
||||
transfer->endpoint = endpoint->endp_addr;
|
||||
transfer->devaddr = dev->addr;
|
||||
transfer->type = GRUB_USB_TRANSACTION_TYPE_BULK;
|
||||
transfer->dir = type;
|
||||
@@ -315,7 +317,8 @@ grub_usb_bulk_finish_readwrite (grub_usb_transfer_t transfer)
|
||||
|
||||
static grub_usb_err_t
|
||||
grub_usb_bulk_readwrite (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size0, char *data_in,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size0, char *data_in,
|
||||
grub_transfer_type_t type, int timeout,
|
||||
grub_size_t *actual)
|
||||
{
|
||||
@@ -333,31 +336,61 @@ grub_usb_bulk_readwrite (grub_usb_device_t dev,
|
||||
return err;
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_bulk_write (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, char *data)
|
||||
static grub_usb_err_t
|
||||
grub_usb_bulk_readwrite_packetize (grub_usb_device_t dev,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_transfer_type_t type,
|
||||
grub_size_t size, char *data)
|
||||
{
|
||||
grub_size_t actual;
|
||||
grub_usb_err_t err;
|
||||
grub_size_t actual, transferred;
|
||||
grub_usb_err_t err = GRUB_USB_ERR_NONE;
|
||||
grub_size_t current_size, position;
|
||||
grub_size_t max_bulk_transfer_len = MAX_USB_TRANSFER_LEN;
|
||||
grub_size_t max;
|
||||
|
||||
err = grub_usb_bulk_readwrite (dev, endpoint, size, data,
|
||||
GRUB_USB_TRANSFER_TYPE_OUT, 1000, &actual);
|
||||
if (!err && actual != size)
|
||||
if (dev->controller.dev->max_bulk_tds)
|
||||
{
|
||||
max = grub_usb_bulk_maxpacket (dev, endpoint);
|
||||
|
||||
/* Calculate max. possible length of bulk transfer */
|
||||
max_bulk_transfer_len = dev->controller.dev->max_bulk_tds * max;
|
||||
}
|
||||
|
||||
for (position = 0, transferred = 0;
|
||||
position < size; position += max_bulk_transfer_len)
|
||||
{
|
||||
current_size = size - position;
|
||||
if (current_size >= max_bulk_transfer_len)
|
||||
current_size = max_bulk_transfer_len;
|
||||
err = grub_usb_bulk_readwrite (dev, endpoint, current_size,
|
||||
&data[position], type, 1000, &actual);
|
||||
transferred += actual;
|
||||
if (err || (current_size != actual)) break;
|
||||
}
|
||||
|
||||
if (!err && transferred != size)
|
||||
err = GRUB_USB_ERR_DATA;
|
||||
return err;
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_bulk_read (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, char *data)
|
||||
grub_usb_bulk_write (grub_usb_device_t dev,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size, char *data)
|
||||
{
|
||||
grub_size_t actual;
|
||||
grub_usb_err_t err;
|
||||
err = grub_usb_bulk_readwrite (dev, endpoint, size, data,
|
||||
GRUB_USB_TRANSFER_TYPE_IN, 1000, &actual);
|
||||
if (!err && actual != size)
|
||||
err = GRUB_USB_ERR_DATA;
|
||||
return err;
|
||||
return grub_usb_bulk_readwrite_packetize (dev, endpoint,
|
||||
GRUB_USB_TRANSFER_TYPE_OUT,
|
||||
size, data);
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_bulk_read (grub_usb_device_t dev,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size, char *data)
|
||||
{
|
||||
return grub_usb_bulk_readwrite_packetize (dev, endpoint,
|
||||
GRUB_USB_TRANSFER_TYPE_IN,
|
||||
size, data);
|
||||
}
|
||||
|
||||
grub_usb_err_t
|
||||
@@ -378,7 +411,8 @@ grub_usb_check_transfer (grub_usb_transfer_t transfer, grub_size_t *actual)
|
||||
|
||||
grub_usb_transfer_t
|
||||
grub_usb_bulk_read_background (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, void *data)
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size, void *data)
|
||||
{
|
||||
grub_usb_err_t err;
|
||||
grub_usb_transfer_t transfer;
|
||||
@@ -405,7 +439,8 @@ grub_usb_cancel_transfer (grub_usb_transfer_t transfer)
|
||||
|
||||
grub_usb_err_t
|
||||
grub_usb_bulk_read_extended (grub_usb_device_t dev,
|
||||
int endpoint, grub_size_t size, char *data,
|
||||
struct grub_usb_desc_endp *endpoint,
|
||||
grub_size_t size, char *data,
|
||||
int timeout, grub_size_t *actual)
|
||||
{
|
||||
return grub_usb_bulk_readwrite (dev, endpoint, size, data,
|
||||
|
||||
@@ -142,49 +142,59 @@ iszero (grub_uint8_t *reg, int size)
|
||||
}
|
||||
|
||||
#if defined (__i386__) || defined (__x86_64__)
|
||||
/* Context for grub_acpi_create_ebda. */
|
||||
struct grub_acpi_create_ebda_ctx {
|
||||
int ebda_len;
|
||||
grub_uint64_t highestlow;
|
||||
};
|
||||
|
||||
/* Helper for grub_acpi_create_ebda. */
|
||||
static int
|
||||
find_hook (grub_uint64_t start, grub_uint64_t size, grub_memory_type_t type,
|
||||
void *data)
|
||||
{
|
||||
struct grub_acpi_create_ebda_ctx *ctx = data;
|
||||
grub_uint64_t end = start + size;
|
||||
if (type != GRUB_MEMORY_AVAILABLE)
|
||||
return 0;
|
||||
if (end > 0x100000)
|
||||
end = 0x100000;
|
||||
if (end > start + ctx->ebda_len
|
||||
&& ctx->highestlow < ((end - ctx->ebda_len) & (~0xf)) )
|
||||
ctx->highestlow = (end - ctx->ebda_len) & (~0xf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_acpi_create_ebda (void)
|
||||
{
|
||||
int ebda_kb_len;
|
||||
int ebda_len;
|
||||
struct grub_acpi_create_ebda_ctx ctx = {
|
||||
.highestlow = 0
|
||||
};
|
||||
int ebda_kb_len = 0;
|
||||
int mmapregion = 0;
|
||||
grub_uint8_t *ebda, *v1inebda = 0, *v2inebda = 0;
|
||||
grub_uint64_t highestlow = 0;
|
||||
grub_uint8_t *targetebda, *target;
|
||||
struct grub_acpi_rsdp_v10 *v1;
|
||||
struct grub_acpi_rsdp_v20 *v2;
|
||||
auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t,
|
||||
grub_uint32_t);
|
||||
int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size,
|
||||
grub_memory_type_t type)
|
||||
{
|
||||
grub_uint64_t end = start + size;
|
||||
if (type != GRUB_MEMORY_AVAILABLE)
|
||||
return 0;
|
||||
if (end > 0x100000)
|
||||
end = 0x100000;
|
||||
if (end > start + ebda_len
|
||||
&& highestlow < ((end - ebda_len) & (~0xf)) )
|
||||
highestlow = (end - ebda_len) & (~0xf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ebda = (grub_uint8_t *) (grub_addr_t) ((*((grub_uint16_t *)0x40e)) << 4);
|
||||
ebda_kb_len = *(grub_uint16_t *) ebda;
|
||||
if (! ebda || ebda_kb_len > 16)
|
||||
if (ebda)
|
||||
ebda_kb_len = *(grub_uint16_t *) ebda;
|
||||
if (ebda_kb_len > 16)
|
||||
ebda_kb_len = 0;
|
||||
ebda_len = (ebda_kb_len + 1) << 10;
|
||||
ctx.ebda_len = (ebda_kb_len + 1) << 10;
|
||||
|
||||
/* FIXME: use low-memory mm allocation once it's available. */
|
||||
grub_mmap_iterate (find_hook);
|
||||
targetebda = (grub_uint8_t *) (grub_addr_t) highestlow;
|
||||
grub_mmap_iterate (find_hook, &ctx);
|
||||
targetebda = (grub_uint8_t *) (grub_addr_t) ctx.highestlow;
|
||||
grub_dprintf ("acpi", "creating ebda @%llx\n",
|
||||
(unsigned long long) highestlow);
|
||||
if (! highestlow)
|
||||
(unsigned long long) ctx.highestlow);
|
||||
if (! ctx.highestlow)
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY,
|
||||
"couldn't find space for the new EBDA");
|
||||
|
||||
mmapregion = grub_mmap_register ((grub_addr_t) targetebda, ebda_len,
|
||||
mmapregion = grub_mmap_register ((grub_addr_t) targetebda, ctx.ebda_len,
|
||||
GRUB_MEMORY_RESERVED);
|
||||
if (! mmapregion)
|
||||
return grub_errno;
|
||||
@@ -207,7 +217,7 @@ grub_acpi_create_ebda (void)
|
||||
{
|
||||
grub_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n");
|
||||
for (; target < targetebda + 0x400 - v2->length; target += 0x10)
|
||||
if (grub_memcmp (target, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (target,
|
||||
sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& ((struct grub_acpi_rsdp_v10 *) target)->revision != 0
|
||||
@@ -228,7 +238,7 @@ grub_acpi_create_ebda (void)
|
||||
grub_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n");
|
||||
for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10);
|
||||
target += 0x10)
|
||||
if (grub_memcmp (target, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (target,
|
||||
sizeof (struct grub_acpi_rsdp_v10)) == 0)
|
||||
{
|
||||
@@ -289,7 +299,7 @@ grub_acpi_create_ebda (void)
|
||||
for (target = targetebda;
|
||||
target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10);
|
||||
target += 0x10)
|
||||
if (grub_memcmp (target, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (target, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (target,
|
||||
sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& target != v1inebda && target != v2inebda)
|
||||
@@ -355,13 +365,13 @@ setup_common_tables (void)
|
||||
numoftables++;
|
||||
|
||||
rsdt_addr = rsdt = (struct grub_acpi_table_header *) playground_ptr;
|
||||
playground_ptr += sizeof (struct grub_acpi_table_header) + 4 * numoftables;
|
||||
playground_ptr += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables;
|
||||
|
||||
rsdt_entry = (grub_uint32_t *) (rsdt + 1);
|
||||
|
||||
/* Fill RSDT header. */
|
||||
grub_memcpy (&(rsdt->signature), "RSDT", 4);
|
||||
rsdt->length = sizeof (struct grub_acpi_table_header) + 4 * numoftables;
|
||||
rsdt->length = sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables;
|
||||
rsdt->revision = 1;
|
||||
grub_memcpy (&(rsdt->oemid), root_oemid, sizeof (rsdt->oemid));
|
||||
grub_memcpy (&(rsdt->oemtable), root_oemtable, sizeof (rsdt->oemtable));
|
||||
@@ -384,7 +394,7 @@ setv1table (void)
|
||||
/* Create RSDP. */
|
||||
rsdpv1_new = (struct grub_acpi_rsdp_v10 *) playground_ptr;
|
||||
playground_ptr += sizeof (struct grub_acpi_rsdp_v10);
|
||||
grub_memcpy (&(rsdpv1_new->signature), "RSD PTR ",
|
||||
grub_memcpy (&(rsdpv1_new->signature), GRUB_RSDP_SIGNATURE,
|
||||
sizeof (rsdpv1_new->signature));
|
||||
grub_memcpy (&(rsdpv1_new->oemid), root_oemid, sizeof (rsdpv1_new->oemid));
|
||||
rsdpv1_new->revision = 0;
|
||||
@@ -409,13 +419,13 @@ setv2table (void)
|
||||
|
||||
/* Create XSDT. */
|
||||
xsdt = (struct grub_acpi_table_header *) playground_ptr;
|
||||
playground_ptr += sizeof (struct grub_acpi_table_header) + 8 * numoftables;
|
||||
playground_ptr += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables;
|
||||
|
||||
xsdt_entry = (grub_uint64_t *)(xsdt + 1);
|
||||
for (cur = acpi_tables; cur; cur = cur->next)
|
||||
*(xsdt_entry++) = (grub_addr_t) cur->addr;
|
||||
grub_memcpy (&(xsdt->signature), "XSDT", 4);
|
||||
xsdt->length = sizeof (struct grub_acpi_table_header) + 8 * numoftables;
|
||||
xsdt->length = sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables;
|
||||
xsdt->revision = 1;
|
||||
grub_memcpy (&(xsdt->oemid), root_oemid, sizeof (xsdt->oemid));
|
||||
grub_memcpy (&(xsdt->oemtable), root_oemtable, sizeof (xsdt->oemtable));
|
||||
@@ -428,7 +438,7 @@ setv2table (void)
|
||||
/* Create RSDPv2. */
|
||||
rsdpv2_new = (struct grub_acpi_rsdp_v20 *) playground_ptr;
|
||||
playground_ptr += sizeof (struct grub_acpi_rsdp_v20);
|
||||
grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ",
|
||||
grub_memcpy (&(rsdpv2_new->rsdpv1.signature), GRUB_RSDP_SIGNATURE,
|
||||
sizeof (rsdpv2_new->rsdpv1.signature));
|
||||
grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid,
|
||||
sizeof (rsdpv2_new->rsdpv1.oemid));
|
||||
@@ -698,11 +708,11 @@ grub_cmd_acpi (struct grub_extcmd_context *ctxt, int argc, char **args)
|
||||
/* DSDT. */
|
||||
playground_size += dsdt_size;
|
||||
/* RSDT. */
|
||||
playground_size += sizeof (struct grub_acpi_table_header) + 4 * numoftables;
|
||||
playground_size += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint32_t) * numoftables;
|
||||
/* RSDPv1. */
|
||||
playground_size += sizeof (struct grub_acpi_rsdp_v10);
|
||||
/* XSDT. */
|
||||
playground_size += sizeof (struct grub_acpi_table_header) + 8 * numoftables;
|
||||
playground_size += sizeof (struct grub_acpi_table_header) + sizeof (grub_uint64_t) * numoftables;
|
||||
/* RSDPv2. */
|
||||
playground_size += sizeof (struct grub_acpi_rsdp_v20);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define grub_dprintf(cond, args...) printf ( args )
|
||||
#define grub_printf printf
|
||||
@@ -41,6 +42,7 @@ typedef uint8_t grub_uint8_t;
|
||||
#endif
|
||||
|
||||
#ifndef GRUB_DSDT_TEST
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/cpu/io.h>
|
||||
@@ -146,6 +148,10 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end)
|
||||
ptr += skip_name_string (ptr, end);
|
||||
ptr++;
|
||||
break;
|
||||
case GRUB_ACPI_EXTOPCODE_EVENT_OP:
|
||||
ptr++;
|
||||
ptr += skip_name_string (ptr, end);
|
||||
break;
|
||||
case GRUB_ACPI_EXTOPCODE_OPERATION_REGION:
|
||||
ptr++;
|
||||
ptr += skip_name_string (ptr, end);
|
||||
@@ -158,7 +164,12 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end)
|
||||
return 0;
|
||||
break;
|
||||
case GRUB_ACPI_EXTOPCODE_FIELD_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_DEVICE_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_PROCESSOR_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_POWER_RES_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_THERMAL_ZONE_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP:
|
||||
case GRUB_ACPI_EXTOPCODE_BANK_FIELD_OP:
|
||||
ptr++;
|
||||
ptr += decode_length (ptr, 0);
|
||||
break;
|
||||
@@ -170,12 +181,13 @@ skip_ext_op (const grub_uint8_t *ptr, const grub_uint8_t *end)
|
||||
}
|
||||
|
||||
static int
|
||||
get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
|
||||
get_sleep_type (grub_uint8_t *table, grub_uint8_t *ptr, grub_uint8_t *end,
|
||||
grub_uint8_t *scope, int scope_len)
|
||||
{
|
||||
grub_uint8_t *ptr, *prev = table;
|
||||
int sleep_type = -1;
|
||||
grub_uint8_t *prev = table;
|
||||
|
||||
ptr = table + sizeof (struct grub_acpi_table_header);
|
||||
if (!ptr)
|
||||
ptr = table + sizeof (struct grub_acpi_table_header);
|
||||
while (ptr < end && prev < ptr)
|
||||
{
|
||||
int add;
|
||||
@@ -202,7 +214,8 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
|
||||
}
|
||||
case GRUB_ACPI_OPCODE_NAME:
|
||||
ptr++;
|
||||
if (memcmp (ptr, "_S5_", 4) == 0 || memcmp (ptr, "\\_S5_", 4) == 0)
|
||||
if ((!scope || memcmp (scope, "\\", scope_len) == 0) &&
|
||||
(memcmp (ptr, "_S5_", 4) == 0 || memcmp (ptr, "\\_S5_", 4) == 0))
|
||||
{
|
||||
int ll;
|
||||
grub_uint8_t *ptr2 = ptr;
|
||||
@@ -220,14 +233,11 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
|
||||
switch (*ptr2)
|
||||
{
|
||||
case GRUB_ACPI_OPCODE_ZERO:
|
||||
sleep_type = 0;
|
||||
break;
|
||||
return 0;
|
||||
case GRUB_ACPI_OPCODE_ONE:
|
||||
sleep_type = 1;
|
||||
break;
|
||||
return 1;
|
||||
case GRUB_ACPI_OPCODE_BYTE_CONST:
|
||||
sleep_type = ptr2[1];
|
||||
break;
|
||||
return ptr2[1];
|
||||
default:
|
||||
grub_printf ("Unknown data type in _S5: 0x%x\n", *ptr2);
|
||||
return -1;
|
||||
@@ -241,6 +251,25 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
|
||||
return -1;
|
||||
break;
|
||||
case GRUB_ACPI_OPCODE_SCOPE:
|
||||
{
|
||||
int scope_sleep_type;
|
||||
int ll;
|
||||
grub_uint8_t *name;
|
||||
int name_len;
|
||||
|
||||
ptr++;
|
||||
add = decode_length (ptr, &ll);
|
||||
name = ptr + ll;
|
||||
name_len = skip_name_string (name, ptr + add);
|
||||
if (!name_len)
|
||||
return -1;
|
||||
scope_sleep_type = get_sleep_type (table, name + name_len,
|
||||
ptr + add, name, name_len);
|
||||
if (scope_sleep_type != -2)
|
||||
return scope_sleep_type;
|
||||
ptr += add;
|
||||
break;
|
||||
}
|
||||
case GRUB_ACPI_OPCODE_IF:
|
||||
case GRUB_ACPI_OPCODE_METHOD:
|
||||
{
|
||||
@@ -254,8 +283,7 @@ get_sleep_type (grub_uint8_t *table, grub_uint8_t *end)
|
||||
}
|
||||
}
|
||||
|
||||
grub_dprintf ("acpi", "TYP = %d\n", sleep_type);
|
||||
return sleep_type;
|
||||
return -2;
|
||||
}
|
||||
|
||||
#ifdef GRUB_DSDT_TEST
|
||||
@@ -267,7 +295,7 @@ main (int argc, char **argv)
|
||||
unsigned char *buf;
|
||||
if (argc < 2)
|
||||
printf ("Usage: %s FILE\n", argv[0]);
|
||||
f = fopen (argv[1], "rb");
|
||||
f = grub_util_fopen (argv[1], "rb");
|
||||
if (!f)
|
||||
{
|
||||
printf ("Couldn't open file\n");
|
||||
@@ -279,19 +307,19 @@ main (int argc, char **argv)
|
||||
buf = malloc (len);
|
||||
if (!buf)
|
||||
{
|
||||
printf ("Couldn't malloc buffer\n");
|
||||
printf (_("error: %s.\n"), _("out of memory"));
|
||||
fclose (f);
|
||||
return 2;
|
||||
}
|
||||
if (fread (buf, 1, len, f) != len)
|
||||
{
|
||||
printf ("Read failed\n");
|
||||
printf (_("cannot read `%s': %s"), argv[1], strerror (errno));
|
||||
free (buf);
|
||||
fclose (f);
|
||||
return 2;
|
||||
}
|
||||
|
||||
printf ("Sleep type = %d\n", get_sleep_type (buf, buf + len));
|
||||
printf ("Sleep type = %d\n", get_sleep_type (buf, NULL, buf + len, NULL, 0));
|
||||
free (buf);
|
||||
fclose (f);
|
||||
return 0;
|
||||
@@ -304,8 +332,10 @@ grub_acpi_halt (void)
|
||||
{
|
||||
struct grub_acpi_rsdp_v20 *rsdp2;
|
||||
struct grub_acpi_rsdp_v10 *rsdp1;
|
||||
struct grub_acpi_table_header *rsdt;
|
||||
grub_uint32_t *entry_ptr;
|
||||
struct grub_acpi_table_header *rsdt;
|
||||
grub_uint32_t *entry_ptr;
|
||||
grub_uint32_t port = 0;
|
||||
int sleep_type = -1;
|
||||
|
||||
rsdp2 = grub_acpi_get_rsdpv2 ();
|
||||
if (rsdp2)
|
||||
@@ -324,35 +354,40 @@ grub_acpi_halt (void)
|
||||
{
|
||||
if (grub_memcmp ((void *) (grub_addr_t) *entry_ptr, "FACP", 4) == 0)
|
||||
{
|
||||
grub_uint32_t port;
|
||||
struct grub_acpi_fadt *fadt
|
||||
= ((struct grub_acpi_fadt *) (grub_addr_t) *entry_ptr);
|
||||
struct grub_acpi_table_header *dsdt
|
||||
= (struct grub_acpi_table_header *) (grub_addr_t) fadt->dsdt_addr;
|
||||
int sleep_type = -1;
|
||||
grub_uint8_t *buf = (grub_uint8_t *) dsdt;
|
||||
|
||||
port = fadt->pm1a;
|
||||
|
||||
grub_dprintf ("acpi", "PM1a port=%x\n", port);
|
||||
|
||||
if (grub_memcmp (dsdt->signature, "DSDT",
|
||||
sizeof (dsdt->signature)) != 0)
|
||||
break;
|
||||
sizeof (dsdt->signature)) == 0
|
||||
&& sleep_type < 0)
|
||||
sleep_type = get_sleep_type (buf, NULL, buf + dsdt->length,
|
||||
NULL, 0);
|
||||
}
|
||||
else if (grub_memcmp ((void *) (grub_addr_t) *entry_ptr, "SSDT", 4) == 0
|
||||
&& sleep_type < 0)
|
||||
{
|
||||
struct grub_acpi_table_header *ssdt
|
||||
= (struct grub_acpi_table_header *) (grub_addr_t) *entry_ptr;
|
||||
grub_uint8_t *buf = (grub_uint8_t *) ssdt;
|
||||
|
||||
sleep_type = get_sleep_type ((grub_uint8_t *) dsdt,
|
||||
(grub_uint8_t *) dsdt + dsdt->length);
|
||||
grub_dprintf ("acpi", "SSDT = %p\n", ssdt);
|
||||
|
||||
if (sleep_type < 0 || sleep_type >= 8)
|
||||
break;
|
||||
|
||||
grub_dprintf ("acpi", "SLP_TYP = %d, port = 0x%x\n",
|
||||
sleep_type, port);
|
||||
|
||||
grub_outw (GRUB_ACPI_SLP_EN
|
||||
| (sleep_type << GRUB_ACPI_SLP_TYP_OFFSET), port & 0xffff);
|
||||
sleep_type = get_sleep_type (buf, NULL, buf + ssdt->length, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
grub_dprintf ("acpi", "SLP_TYP = %d, port = 0x%x\n", sleep_type, port);
|
||||
if (port && sleep_type >= 0 && sleep_type < 8)
|
||||
grub_outw (GRUB_ACPI_SLP_EN | (sleep_type << GRUB_ACPI_SLP_TYP_OFFSET),
|
||||
port & 0xffff);
|
||||
|
||||
grub_millisleep (1500);
|
||||
|
||||
/* TRANSLATORS: It's computer shutdown using ACPI, not disabling ACPI. */
|
||||
|
||||
@@ -24,18 +24,22 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* Helper for grub_cmd_lsdev. */
|
||||
static int
|
||||
grub_cmd_lsdev_iter (const char *name,
|
||||
const struct grub_arc_component *comp __attribute__ ((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_printf ("%s\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_lsdev (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
auto int hook (const char *name, const struct grub_arc_component *comp);
|
||||
int hook (const char *name, const struct grub_arc_component *comp __attribute__ ((unused)))
|
||||
{
|
||||
grub_printf ("%s\n", name);
|
||||
return 0;
|
||||
}
|
||||
grub_arc_iterate_devs (hook, 0);
|
||||
grub_arc_iterate_devs (grub_cmd_lsdev_iter, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,58 +28,71 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* Context for grub_cmd_blocklist. */
|
||||
struct blocklist_ctx
|
||||
{
|
||||
unsigned long start_sector;
|
||||
unsigned num_sectors;
|
||||
int num_entries;
|
||||
grub_disk_addr_t part_start;
|
||||
};
|
||||
|
||||
/* Helper for grub_cmd_blocklist. */
|
||||
static void
|
||||
print_blocklist (grub_disk_addr_t sector, unsigned num,
|
||||
unsigned offset, unsigned length, struct blocklist_ctx *ctx)
|
||||
{
|
||||
if (ctx->num_entries++)
|
||||
grub_printf (",");
|
||||
|
||||
grub_printf ("%llu", (unsigned long long) (sector - ctx->part_start));
|
||||
if (num > 0)
|
||||
grub_printf ("+%u", num);
|
||||
if (offset != 0 || length != 0)
|
||||
grub_printf ("[%u-%u]", offset, offset + length);
|
||||
}
|
||||
|
||||
/* Helper for grub_cmd_blocklist. */
|
||||
static void
|
||||
read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length,
|
||||
void *data)
|
||||
{
|
||||
struct blocklist_ctx *ctx = data;
|
||||
|
||||
if (ctx->num_sectors > 0)
|
||||
{
|
||||
if (ctx->start_sector + ctx->num_sectors == sector
|
||||
&& offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
|
||||
{
|
||||
ctx->num_sectors++;
|
||||
return;
|
||||
}
|
||||
|
||||
print_blocklist (ctx->start_sector, ctx->num_sectors, 0, 0, ctx);
|
||||
ctx->num_sectors = 0;
|
||||
}
|
||||
|
||||
if (offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
|
||||
{
|
||||
ctx->start_sector = sector;
|
||||
ctx->num_sectors++;
|
||||
}
|
||||
else
|
||||
print_blocklist (sector, 0, offset, length, ctx);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_file_t file;
|
||||
char buf[GRUB_DISK_SECTOR_SIZE];
|
||||
unsigned long start_sector = 0;
|
||||
unsigned num_sectors = 0;
|
||||
int num_entries = 0;
|
||||
grub_disk_addr_t part_start = 0;
|
||||
auto void NESTED_FUNC_ATTR read_blocklist (grub_disk_addr_t sector, unsigned offset,
|
||||
unsigned length);
|
||||
auto void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num,
|
||||
unsigned offset, unsigned length);
|
||||
|
||||
void NESTED_FUNC_ATTR read_blocklist (grub_disk_addr_t sector, unsigned offset,
|
||||
unsigned length)
|
||||
{
|
||||
if (num_sectors > 0)
|
||||
{
|
||||
if (start_sector + num_sectors == sector
|
||||
&& offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
|
||||
{
|
||||
num_sectors++;
|
||||
return;
|
||||
}
|
||||
|
||||
print_blocklist (start_sector, num_sectors, 0, 0);
|
||||
num_sectors = 0;
|
||||
}
|
||||
|
||||
if (offset == 0 && length == GRUB_DISK_SECTOR_SIZE)
|
||||
{
|
||||
start_sector = sector;
|
||||
num_sectors++;
|
||||
}
|
||||
else
|
||||
print_blocklist (sector, 0, offset, length);
|
||||
}
|
||||
|
||||
void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num,
|
||||
unsigned offset, unsigned length)
|
||||
{
|
||||
if (num_entries++)
|
||||
grub_printf (",");
|
||||
|
||||
grub_printf ("%llu", (unsigned long long) (sector - part_start));
|
||||
if (num > 0)
|
||||
grub_printf ("+%u", num);
|
||||
if (offset != 0 || length != 0)
|
||||
grub_printf ("[%u-%u]", offset, offset + length);
|
||||
}
|
||||
struct blocklist_ctx ctx = {
|
||||
.start_sector = 0,
|
||||
.num_sectors = 0,
|
||||
.num_entries = 0,
|
||||
.part_start = 0
|
||||
};
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
@@ -93,15 +106,16 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)),
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE,
|
||||
"this command is available only for disk devices");
|
||||
|
||||
part_start = grub_partition_get_start (file->device->disk->partition);
|
||||
ctx.part_start = grub_partition_get_start (file->device->disk->partition);
|
||||
|
||||
file->read_hook = read_blocklist;
|
||||
file->read_hook_data = &ctx;
|
||||
|
||||
while (grub_file_read (file, buf, sizeof (buf)) > 0)
|
||||
;
|
||||
|
||||
if (num_sectors > 0)
|
||||
print_blocklist (start_sector, num_sectors, 0, 0);
|
||||
if (ctx.num_sectors > 0)
|
||||
print_blocklist (ctx.start_sector, ctx.num_sectors, 0, 0, &ctx);
|
||||
|
||||
grub_file_close (file);
|
||||
|
||||
|
||||
@@ -183,22 +183,14 @@ grub_cmd_boot (struct grub_command *cmd __attribute__ ((unused)),
|
||||
|
||||
static grub_command_t cmd_boot;
|
||||
|
||||
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
void grub_boot_init (void)
|
||||
#else
|
||||
GRUB_MOD_INIT(boot)
|
||||
#endif
|
||||
{
|
||||
cmd_boot =
|
||||
grub_register_command ("boot", grub_cmd_boot,
|
||||
0, N_("Boot an operating system."));
|
||||
}
|
||||
|
||||
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
void grub_boot_fini (void)
|
||||
#else
|
||||
GRUB_MOD_FINI(boot)
|
||||
#endif
|
||||
{
|
||||
grub_unregister_command (cmd_boot);
|
||||
}
|
||||
|
||||
65
grub-core/commands/boottime.c
Normal file
65
grub-core/commands/boottime.c
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_boottime (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char *argv[] __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_boot_time *cur;
|
||||
grub_uint64_t last_time = 0, start_time = 0;
|
||||
if (!grub_boot_time_head)
|
||||
{
|
||||
grub_puts_ (N_("No boot time statistics is available\n"));
|
||||
return 0;
|
||||
}
|
||||
start_time = last_time = grub_boot_time_head->tp;
|
||||
for (cur = grub_boot_time_head; cur; cur = cur->next)
|
||||
{
|
||||
grub_uint32_t tmabs = cur->tp - start_time;
|
||||
grub_uint32_t tmrel = cur->tp - last_time;
|
||||
last_time = cur->tp;
|
||||
|
||||
grub_printf ("%3d.%03ds %2d.%03ds %s:%d %s\n",
|
||||
tmabs / 1000, tmabs % 1000, tmrel / 1000, tmrel % 1000, cur->file, cur->line,
|
||||
cur->msg);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_command_t cmd_boottime;
|
||||
|
||||
GRUB_MOD_INIT(boottime)
|
||||
{
|
||||
cmd_boottime =
|
||||
grub_register_command ("boottime", grub_cmd_boottime,
|
||||
0, N_("Get boot time statistics."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(boottime)
|
||||
{
|
||||
grub_unregister_command (cmd_boottime);
|
||||
}
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/charset.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -39,9 +40,15 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
int dos = 0;
|
||||
grub_file_t file;
|
||||
char buf[GRUB_DISK_SECTOR_SIZE];
|
||||
unsigned char buf[GRUB_DISK_SECTOR_SIZE];
|
||||
grub_ssize_t size;
|
||||
int key = GRUB_TERM_NO_KEY;
|
||||
grub_uint32_t code = 0;
|
||||
int count = 0;
|
||||
unsigned char utbuf[GRUB_MAX_UTF8_PER_CODEPOINT + 1];
|
||||
int utcount = 0;
|
||||
int is_0d = 0;
|
||||
int j;
|
||||
|
||||
if (state[0].set)
|
||||
dos = 1;
|
||||
@@ -60,21 +67,65 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
unsigned char c = buf[i];
|
||||
utbuf[utcount++] = buf[i];
|
||||
|
||||
if ((grub_isprint (c) || grub_isspace (c)) && c != '\r')
|
||||
grub_printf ("%c", c);
|
||||
else if (dos && c == '\r' && i + 1 < size && buf[i + 1] == '\n')
|
||||
{
|
||||
grub_printf ("\n");
|
||||
i++;
|
||||
}
|
||||
else
|
||||
if (is_0d && buf[i] != '\n')
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
grub_printf ("<%x>", (int) c);
|
||||
grub_printf ("<%x>", (int) '\r');
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
|
||||
is_0d = 0;
|
||||
|
||||
if (!grub_utf8_process (buf[i], &code, &count))
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount - 1; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
code = 0;
|
||||
count = 0;
|
||||
if (utcount == 1 || !grub_utf8_process (buf[i], &code, &count))
|
||||
{
|
||||
grub_printf ("<%x>", (unsigned int) buf[i]);
|
||||
code = 0;
|
||||
count = 0;
|
||||
utcount = 0;
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
continue;
|
||||
}
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
utcount = 1;
|
||||
}
|
||||
if (count)
|
||||
continue;
|
||||
|
||||
if ((code >= 0xa1 || grub_isprint (code)
|
||||
|| grub_isspace (code)) && code != '\r')
|
||||
{
|
||||
grub_printf ("%C", code);
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dos && code == '\r')
|
||||
{
|
||||
is_0d = 1;
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
count = 0;
|
||||
code = 0;
|
||||
utcount = 0;
|
||||
}
|
||||
|
||||
do
|
||||
@@ -82,6 +133,18 @@ grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
while (key != GRUB_TERM_ESC && key != GRUB_TERM_NO_KEY);
|
||||
}
|
||||
|
||||
if (is_0d)
|
||||
{
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
grub_printf ("<%x>", (unsigned int) '\r');
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
}
|
||||
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT);
|
||||
for (j = 0; j < utcount; j++)
|
||||
grub_printf ("<%x>", (unsigned int) utbuf[j]);
|
||||
grub_setcolorstate (GRUB_TERM_COLOR_STANDARD);
|
||||
|
||||
grub_xputs ("\n");
|
||||
grub_refresh ();
|
||||
grub_file_close (file);
|
||||
|
||||
@@ -78,7 +78,7 @@ GRUB_MOD_INIT(configfile)
|
||||
cmd_extractor_configfile =
|
||||
grub_register_command ("extract_entries_configfile", grub_cmd_source,
|
||||
N_("FILE"),
|
||||
N_("Load another config file without changing context but take only menu entries.")
|
||||
N_("Load another config file but take only menu entries.")
|
||||
);
|
||||
|
||||
cmd_dot =
|
||||
|
||||
90
grub-core/commands/efi/efifwsetup.c
Normal file
90
grub-core/commands/efi/efifwsetup.c
Normal file
@@ -0,0 +1,90 @@
|
||||
/* fwsetup.c - Reboot into firmware setup menu. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/efi/api.h>
|
||||
#include <grub/efi/efi.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_fwsetup (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
grub_efi_uint64_t *old_os_indications;
|
||||
grub_efi_uint64_t os_indications = GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
|
||||
grub_err_t status;
|
||||
grub_size_t oi_size;
|
||||
grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
|
||||
|
||||
old_os_indications = grub_efi_get_variable ("OsIndications", &global,
|
||||
&oi_size);
|
||||
|
||||
if (old_os_indications != NULL && oi_size == sizeof (os_indications))
|
||||
os_indications |= *old_os_indications;
|
||||
|
||||
status = grub_efi_set_variable ("OsIndications", &global, &os_indications,
|
||||
sizeof (os_indications));
|
||||
if (status != GRUB_ERR_NONE)
|
||||
return status;
|
||||
|
||||
grub_reboot ();
|
||||
|
||||
return GRUB_ERR_BUG;
|
||||
}
|
||||
|
||||
static grub_command_t cmd = NULL;
|
||||
|
||||
static grub_efi_boolean_t
|
||||
efifwsetup_is_supported (void)
|
||||
{
|
||||
grub_efi_uint64_t *os_indications_supported = NULL;
|
||||
grub_size_t oi_size = 0;
|
||||
grub_efi_guid_t global = GRUB_EFI_GLOBAL_VARIABLE_GUID;
|
||||
|
||||
os_indications_supported = grub_efi_get_variable ("OsIndicationsSupported",
|
||||
&global, &oi_size);
|
||||
|
||||
if (!os_indications_supported)
|
||||
return 0;
|
||||
|
||||
if (*os_indications_supported & GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GRUB_MOD_INIT (efifwsetup)
|
||||
{
|
||||
if (efifwsetup_is_supported ())
|
||||
cmd = grub_register_command ("fwsetup", grub_cmd_fwsetup, NULL,
|
||||
N_("Reboot into firmware setup menu."));
|
||||
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI (efifwsetup)
|
||||
{
|
||||
if (cmd)
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <grub/pci.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -40,8 +41,9 @@ static struct grub_video_patch
|
||||
{0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
scan_card (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
static int
|
||||
scan_card (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_pci_address_t addr;
|
||||
|
||||
@@ -93,7 +95,7 @@ grub_cmd_fixvideo (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char *argv[] __attribute__ ((unused)))
|
||||
{
|
||||
grub_pci_iterate (scan_card);
|
||||
grub_pci_iterate (scan_card, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
153
grub-core/commands/efi/lsefi.c
Normal file
153
grub-core/commands/efi/lsefi.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <grub/types.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/efi/api.h>
|
||||
#include <grub/efi/edid.h>
|
||||
#include <grub/efi/pci.h>
|
||||
#include <grub/efi/efi.h>
|
||||
#include <grub/efi/uga_draw.h>
|
||||
#include <grub/efi/graphics_output.h>
|
||||
#include <grub/efi/console_control.h>
|
||||
#include <grub/command.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
struct known_protocol
|
||||
{
|
||||
grub_efi_guid_t guid;
|
||||
const char *name;
|
||||
} known_protocols[] =
|
||||
{
|
||||
{ GRUB_EFI_DISK_IO_GUID, "disk" },
|
||||
{ GRUB_EFI_BLOCK_IO_GUID, "block" },
|
||||
{ GRUB_EFI_SERIAL_IO_GUID, "serial" },
|
||||
{ GRUB_EFI_SIMPLE_NETWORK_GUID, "network" },
|
||||
{ GRUB_EFI_PXE_GUID, "pxe" },
|
||||
{ GRUB_EFI_DEVICE_PATH_GUID, "device path" },
|
||||
{ GRUB_EFI_PCI_IO_GUID, "PCI" },
|
||||
{ GRUB_EFI_PCI_ROOT_IO_GUID, "PCI root" },
|
||||
{ GRUB_EFI_EDID_ACTIVE_GUID, "active EDID" },
|
||||
{ GRUB_EFI_EDID_DISCOVERED_GUID, "discovered EDID" },
|
||||
{ GRUB_EFI_EDID_OVERRIDE_GUID, "override EDID" },
|
||||
{ GRUB_EFI_GOP_GUID, "GOP" },
|
||||
{ GRUB_EFI_UGA_DRAW_GUID, "UGA draw" },
|
||||
{ GRUB_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID, "simple text output" },
|
||||
{ GRUB_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID, "simple text input" },
|
||||
{ GRUB_EFI_SIMPLE_POINTER_PROTOCOL_GUID, "simple pointer" },
|
||||
{ GRUB_EFI_CONSOLE_CONTROL_GUID, "console control" },
|
||||
{ GRUB_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID, "absolute pointer" },
|
||||
{ GRUB_EFI_DRIVER_BINDING_PROTOCOL_GUID, "EFI driver binding" },
|
||||
{ GRUB_EFI_LOAD_FILE_PROTOCOL_GUID, "load file" },
|
||||
{ GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, "simple FS" },
|
||||
{ GRUB_EFI_TAPE_IO_PROTOCOL_GUID, "tape I/O" },
|
||||
{ GRUB_EFI_UNICODE_COLLATION_PROTOCOL_GUID, "unicode collation" },
|
||||
{ GRUB_EFI_SCSI_IO_PROTOCOL_GUID, "SCSI I/O" },
|
||||
{ GRUB_EFI_USB2_HC_PROTOCOL_GUID, "USB host" },
|
||||
{ GRUB_EFI_DEBUG_SUPPORT_PROTOCOL_GUID, "debug support" },
|
||||
{ GRUB_EFI_DEBUGPORT_PROTOCOL_GUID, "debug port" },
|
||||
{ GRUB_EFI_DECOMPRESS_PROTOCOL_GUID, "decompress" },
|
||||
{ GRUB_EFI_LOADED_IMAGE_PROTOCOL_GUID, "loaded image" },
|
||||
{ GRUB_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID, "device path to text" },
|
||||
{ GRUB_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID, "device path utilities" },
|
||||
{ GRUB_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID, "device path from text" },
|
||||
{ GRUB_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID, "HII config routing" },
|
||||
{ GRUB_EFI_HII_DATABASE_PROTOCOL_GUID, "HII database" },
|
||||
{ GRUB_EFI_HII_STRING_PROTOCOL_GUID, "HII string" },
|
||||
{ GRUB_EFI_HII_IMAGE_PROTOCOL_GUID, "HII image" },
|
||||
{ GRUB_EFI_HII_FONT_PROTOCOL_GUID, "HII font" },
|
||||
{ GRUB_EFI_COMPONENT_NAME2_PROTOCOL_GUID, "component name 2" },
|
||||
{ GRUB_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID,
|
||||
"HII configuration access" },
|
||||
{ GRUB_EFI_USB_IO_PROTOCOL_GUID, "USB I/O" },
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_lsefi (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
grub_efi_handle_t *handles;
|
||||
grub_efi_uintn_t num_handles;
|
||||
unsigned i, j, k;
|
||||
|
||||
handles = grub_efi_locate_handle (GRUB_EFI_ALL_HANDLES,
|
||||
NULL, NULL, &num_handles);
|
||||
|
||||
for (i = 0; i < num_handles; i++)
|
||||
{
|
||||
grub_efi_handle_t handle = handles[i];
|
||||
grub_efi_status_t status;
|
||||
grub_efi_uintn_t num_protocols;
|
||||
grub_efi_guid_t **protocols;
|
||||
grub_efi_device_path_t *dp;
|
||||
|
||||
grub_printf ("Handle %p\n", handle);
|
||||
|
||||
dp = grub_efi_get_device_path (handle);
|
||||
if (dp)
|
||||
{
|
||||
grub_printf (" ");
|
||||
grub_efi_print_device_path (dp);
|
||||
}
|
||||
|
||||
status = efi_call_3 (grub_efi_system_table->boot_services->protocols_per_handle,
|
||||
handle, &protocols, &num_protocols);
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
grub_printf ("Unable to retrieve protocols\n");
|
||||
for (j = 0; j < num_protocols; j++)
|
||||
{
|
||||
for (k = 0; k < ARRAY_SIZE (known_protocols); k++)
|
||||
if (grub_memcmp (protocols[j], &known_protocols[k].guid,
|
||||
sizeof (known_protocols[k].guid)) == 0)
|
||||
break;
|
||||
if (k < ARRAY_SIZE (known_protocols))
|
||||
grub_printf (" %s\n", known_protocols[k].name);
|
||||
else
|
||||
grub_printf (" %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
|
||||
protocols[j]->data1,
|
||||
protocols[j]->data2,
|
||||
protocols[j]->data3,
|
||||
(unsigned) protocols[j]->data4[0],
|
||||
(unsigned) protocols[j]->data4[1],
|
||||
(unsigned) protocols[j]->data4[2],
|
||||
(unsigned) protocols[j]->data4[3],
|
||||
(unsigned) protocols[j]->data4[4],
|
||||
(unsigned) protocols[j]->data4[5],
|
||||
(unsigned) protocols[j]->data4[6],
|
||||
(unsigned) protocols[j]->data4[7]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(lsefi)
|
||||
{
|
||||
cmd = grub_register_command ("lsefi", grub_cmd_lsefi,
|
||||
NULL, "Display EFI handles.");
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(lsefi)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
71
grub-core/commands/eval.c
Normal file
71
grub-core/commands/eval.c
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/script_sh.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/term.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_eval (grub_command_t cmd __attribute__((__unused__)),
|
||||
int argc, char *argv[])
|
||||
{
|
||||
int i;
|
||||
grub_size_t size = argc; /* +1 for final zero */
|
||||
char *str, *p;
|
||||
grub_err_t ret;
|
||||
|
||||
if (argc == 0)
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
size += grub_strlen (argv[i]);
|
||||
|
||||
str = p = grub_malloc (size);
|
||||
if (!str)
|
||||
return grub_errno;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
p = grub_stpcpy (p, argv[i]);
|
||||
*p++ = ' ';
|
||||
}
|
||||
*--p = '\0';
|
||||
|
||||
ret = grub_script_execute_sourcecode (str);
|
||||
grub_free (str);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(eval)
|
||||
{
|
||||
cmd = grub_register_command ("eval", grub_cmd_eval, N_("STRING ..."),
|
||||
N_("Evaluate arguments as GRUB commands"));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(eval)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@ GRUB_MOD_LICENSE ("GPLv3+");
|
||||
Is it a problem?
|
||||
*/
|
||||
static void
|
||||
lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch,
|
||||
lba_to_chs (grub_uint32_t lba, grub_uint8_t *cl, grub_uint8_t *ch,
|
||||
grub_uint8_t *dh)
|
||||
{
|
||||
int cylinder, head, sector;
|
||||
int sectors = 63, heads = 255, cylinders = 1024;
|
||||
grub_uint32_t cylinder, head, sector;
|
||||
grub_uint32_t sectors = 63, heads = 255, cylinders = 1024;
|
||||
|
||||
sector = lba % sectors + 1;
|
||||
head = (lba / sectors) % heads;
|
||||
|
||||
@@ -63,7 +63,7 @@ hextoval (char c)
|
||||
static grub_err_t
|
||||
hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result)
|
||||
{
|
||||
grub_uint8_t context[hash->contextsize];
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (context, hash->contextsize);
|
||||
grub_uint8_t readbuf[4096];
|
||||
|
||||
grub_memset (context, 0, sizeof (context));
|
||||
|
||||
@@ -99,12 +99,13 @@ grub_cmd_help (grub_extcmd_context_t ctxt __attribute__ ((unused)), int argc,
|
||||
else
|
||||
{
|
||||
int i;
|
||||
grub_command_t cmd_iter, cmd;
|
||||
grub_command_t cmd_iter, cmd, cmd_next;
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
{
|
||||
currarg = args[i];
|
||||
FOR_COMMANDS(cmd_iter)
|
||||
|
||||
FOR_COMMANDS_SAFE (cmd_iter, cmd_next)
|
||||
{
|
||||
if (!(cmd_iter->prio & GRUB_COMMAND_FLAG_ACTIVE))
|
||||
continue;
|
||||
|
||||
64
grub-core/commands/i386/cmosdump.c
Normal file
64
grub-core/commands/i386/cmosdump.c
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2009,2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/cmos.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_cmosdump (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)), char *argv[] __attribute__ ((unused)))
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
grub_err_t err;
|
||||
grub_uint8_t value;
|
||||
if ((i & 0xf) == 0)
|
||||
grub_printf ("%02x: ", i);
|
||||
|
||||
err = grub_cmos_read (i, &value);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
grub_printf ("%02x ", value);
|
||||
if ((i & 0xf) == 0xf)
|
||||
grub_printf ("\n");
|
||||
}
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
|
||||
GRUB_MOD_INIT(cmosdump)
|
||||
{
|
||||
cmd = grub_register_command ("cmosdump", grub_cmd_cmosdump,
|
||||
0,
|
||||
N_("Dump CMOS contents."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cmosdump)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
118
grub-core/commands/i386/coreboot/cb_timestamps.c
Normal file
118
grub-core/commands/i386/coreboot/cb_timestamps.c
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/i386/tsc.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_uint32_t
|
||||
tsc2ms (grub_uint64_t tsc)
|
||||
{
|
||||
grub_uint64_t ah = tsc >> 32;
|
||||
grub_uint64_t al = tsc & 0xffffffff;
|
||||
|
||||
return ((al * grub_tsc_rate) >> 32) + ah * grub_tsc_rate;
|
||||
}
|
||||
|
||||
static const char *descs[] = {
|
||||
[1] = "romstage",
|
||||
[2] = "before RAM init",
|
||||
[3] = "after RAM init",
|
||||
[4] = "end of romstage",
|
||||
[8] = "start of RAM copy",
|
||||
[9] = "end of RAM copy",
|
||||
[10] = "start of ramstage",
|
||||
[30] = "device enumerate",
|
||||
[40] = "device configure",
|
||||
[50] = "device enable",
|
||||
[60] = "device initialize",
|
||||
[70] = "device done",
|
||||
[75] = "CBMEM POST",
|
||||
[80] = "writing tables",
|
||||
[90] = "loading payload",
|
||||
[98] = "wake jump",
|
||||
[99] = "selfboot jump",
|
||||
};
|
||||
|
||||
static int
|
||||
iterate_linuxbios_table (grub_linuxbios_table_item_t table_item,
|
||||
void *data)
|
||||
{
|
||||
int *available = data;
|
||||
grub_uint64_t last_tsc = 0;
|
||||
struct grub_linuxbios_timestamp_table *ts_table;
|
||||
unsigned i;
|
||||
|
||||
if (table_item->tag != GRUB_LINUXBIOS_MEMBER_TIMESTAMPS)
|
||||
return 0;
|
||||
|
||||
*available = 1;
|
||||
ts_table = (struct grub_linuxbios_timestamp_table *) (grub_addr_t)
|
||||
*(grub_uint64_t *) (table_item + 1);
|
||||
|
||||
for (i = 0; i < ts_table->used; i++)
|
||||
{
|
||||
grub_uint32_t tmabs = tsc2ms (ts_table->entries[i].tsc);
|
||||
grub_uint32_t tmrel = tsc2ms (ts_table->entries[i].tsc - last_tsc);
|
||||
last_tsc = ts_table->entries[i].tsc;
|
||||
|
||||
grub_printf ("%3d.%03ds %2d.%03ds %02d %s\n",
|
||||
tmabs / 1000, tmabs % 1000, tmrel / 1000, tmrel % 1000,
|
||||
ts_table->entries[i].id,
|
||||
(ts_table->entries[i].id < ARRAY_SIZE (descs)
|
||||
&& descs[ts_table->entries[i].id])
|
||||
? descs[ts_table->entries[i].id] : "");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_coreboot_boottime (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char *argv[] __attribute__ ((unused)))
|
||||
{
|
||||
int available = 0;
|
||||
|
||||
grub_linuxbios_table_iterate (iterate_linuxbios_table, &available);
|
||||
if (!available)
|
||||
{
|
||||
grub_puts_ (N_("No boot time statistics is available\n"));
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_command_t cmd_boottime;
|
||||
|
||||
GRUB_MOD_INIT(cbtime)
|
||||
{
|
||||
cmd_boottime =
|
||||
grub_register_command ("coreboot_boottime", grub_cmd_coreboot_boottime,
|
||||
0, N_("Get coreboot boot time statistics."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cbtime)
|
||||
{
|
||||
grub_unregister_command (cmd_boottime);
|
||||
}
|
||||
143
grub-core/commands/i386/coreboot/cbls.c
Normal file
143
grub-core/commands/i386/coreboot/cbls.c
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/i386/coreboot/lbio.h>
|
||||
#include <grub/i386/tsc.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const char *console_descs[] = {
|
||||
"8250 UART",
|
||||
"VGA",
|
||||
"BTEXT",
|
||||
"log buffer console",
|
||||
"SROM",
|
||||
"EHCI debug",
|
||||
"memory-mapped 8250 UART"
|
||||
};
|
||||
|
||||
static const char *descs[] = {
|
||||
[GRUB_LINUXBIOS_MEMBER_MEMORY] = "memory map (`lsmmap' to list)",
|
||||
[GRUB_LINUXBIOS_MEMBER_MAINBOARD] = "mainboard",
|
||||
[4] = "version",
|
||||
[5] = "extra version",
|
||||
[6] = "build",
|
||||
[7] = "compile time",
|
||||
[8] = "compile by",
|
||||
[9] = "compile host",
|
||||
[0xa] = "compile domain",
|
||||
[0xb] = "compiler",
|
||||
[0xc] = "linker",
|
||||
[0xd] = "assembler",
|
||||
[0xf] = "serial",
|
||||
[GRUB_LINUXBIOS_MEMBER_CONSOLE] = "console",
|
||||
[GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER] = "framebuffer",
|
||||
[0x13] = "GPIO",
|
||||
[0x15] = "VDAT",
|
||||
[GRUB_LINUXBIOS_MEMBER_TIMESTAMPS] = "timestamps (`coreboot_boottime' to list)",
|
||||
[GRUB_LINUXBIOS_MEMBER_CBMEMC] = "CBMEM console (`cbmemc' to list)",
|
||||
[0x18] = "MRC cache",
|
||||
[0x19] = "VBNV",
|
||||
[0xc8] = "CMOS option table",
|
||||
[0xc9] = "CMOS option",
|
||||
[0xca] = "CMOS option enum",
|
||||
[0xcb] = "CMOS option defaults",
|
||||
[0xcc] = "CMOS checksum",
|
||||
};
|
||||
|
||||
static int
|
||||
iterate_linuxbios_table (grub_linuxbios_table_item_t table_item,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
if (table_item->tag < ARRAY_SIZE (descs) && descs[table_item->tag])
|
||||
grub_printf ("tag=%02x size=%02x %s",
|
||||
table_item->tag, table_item->size, descs[table_item->tag]);
|
||||
else
|
||||
grub_printf ("tag=%02x size=%02x",
|
||||
table_item->tag, table_item->size);
|
||||
|
||||
switch (table_item->tag)
|
||||
{
|
||||
case GRUB_LINUXBIOS_MEMBER_FRAMEBUFFER:
|
||||
{
|
||||
struct grub_linuxbios_table_framebuffer *fb;
|
||||
fb = (struct grub_linuxbios_table_framebuffer *) (table_item + 1);
|
||||
|
||||
grub_printf (": %dx%dx%d pitch=%d lfb=0x%llx %d/%d/%d/%d %d/%d/%d/%d",
|
||||
fb->width, fb->height,
|
||||
fb->bpp, fb->pitch,
|
||||
(unsigned long long) fb->lfb,
|
||||
fb->red_mask_size, fb->green_mask_size,
|
||||
fb->blue_mask_size, fb->reserved_mask_size,
|
||||
fb->red_field_pos, fb->green_field_pos,
|
||||
fb->blue_field_pos, fb->reserved_field_pos);
|
||||
break;
|
||||
}
|
||||
case GRUB_LINUXBIOS_MEMBER_MAINBOARD:
|
||||
{
|
||||
struct grub_linuxbios_mainboard *mb;
|
||||
mb = (struct grub_linuxbios_mainboard *) (table_item + 1);
|
||||
grub_printf (": vendor=`%s' part_number=`%s'",
|
||||
mb->strings + mb->vendor,
|
||||
mb->strings + mb->part_number);
|
||||
break;
|
||||
}
|
||||
case 0x04 ... 0x0d:
|
||||
grub_printf (": `%s'", (char *) (table_item + 1));
|
||||
break;
|
||||
case GRUB_LINUXBIOS_MEMBER_CONSOLE:
|
||||
{
|
||||
grub_uint16_t *val = (grub_uint16_t *) (table_item + 1);
|
||||
grub_printf (": id=%d", *val);
|
||||
if (*val < ARRAY_SIZE (console_descs)
|
||||
&& console_descs[*val])
|
||||
grub_printf (" %s", console_descs[*val]);
|
||||
}
|
||||
}
|
||||
grub_printf ("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_lscoreboot (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char *argv[] __attribute__ ((unused)))
|
||||
{
|
||||
grub_linuxbios_table_iterate (iterate_linuxbios_table, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(cbls)
|
||||
{
|
||||
cmd =
|
||||
grub_register_command ("lscoreboot", grub_cmd_lscoreboot,
|
||||
0, N_("List coreboot tables."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cbls)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
@@ -29,11 +29,6 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define cpuid(num,a,b,c,d) \
|
||||
asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
|
||||
: "=a" (a), "=r" (b), "=c" (c), "=d" (d) \
|
||||
: "0" (num))
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
/* TRANSLATORS: "(default)" at the end means that this option is used if
|
||||
@@ -78,18 +73,18 @@ GRUB_MOD_INIT(cpuid)
|
||||
goto done;
|
||||
|
||||
/* Check the highest input value for eax. */
|
||||
cpuid (0, eax, ebx, ecx, edx);
|
||||
grub_cpuid (0, eax, ebx, ecx, edx);
|
||||
/* We only look at the first four characters. */
|
||||
max_level = eax;
|
||||
if (max_level == 0)
|
||||
goto done;
|
||||
|
||||
cpuid (0x80000000, eax, ebx, ecx, edx);
|
||||
grub_cpuid (0x80000000, eax, ebx, ecx, edx);
|
||||
ext_level = eax;
|
||||
if (ext_level < 0x80000000)
|
||||
goto done;
|
||||
|
||||
cpuid (0x80000001, eax, ebx, ecx, edx);
|
||||
grub_cpuid (0x80000001, eax, ebx, ecx, edx);
|
||||
grub_cpuid_has_longmode = !!(edx & bit_LM);
|
||||
done:
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@ grub_machine_acpi_get_rsdpv1 (void)
|
||||
if (! ebda_len)
|
||||
return 0;
|
||||
for (ptr = ebda; ptr < ebda + 0x400; ptr += 16)
|
||||
if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0)
|
||||
return (struct grub_acpi_rsdp_v10 *) ptr;
|
||||
@@ -40,7 +40,7 @@ grub_machine_acpi_get_rsdpv1 (void)
|
||||
grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
|
||||
for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000;
|
||||
ptr += 16)
|
||||
if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0)
|
||||
return (struct grub_acpi_rsdp_v10 *) ptr;
|
||||
@@ -59,7 +59,7 @@ grub_machine_acpi_get_rsdpv2 (void)
|
||||
if (! ebda_len)
|
||||
return 0;
|
||||
for (ptr = ebda; ptr < ebda + 0x400; ptr += 16)
|
||||
if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0
|
||||
&& ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024
|
||||
@@ -70,7 +70,7 @@ grub_machine_acpi_get_rsdpv2 (void)
|
||||
grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n");
|
||||
for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000;
|
||||
ptr += 16)
|
||||
if (grub_memcmp (ptr, "RSD PTR ", 8) == 0
|
||||
if (grub_memcmp (ptr, GRUB_RSDP_SIGNATURE, GRUB_RSDP_SIGNATURE_SIZE) == 0
|
||||
&& grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0
|
||||
&& ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0
|
||||
&& ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024
|
||||
|
||||
@@ -28,80 +28,12 @@
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/speaker.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define BASE_TEMPO (60 * 1000)
|
||||
|
||||
/* The speaker port. */
|
||||
#define SPEAKER 0x61
|
||||
|
||||
/* If 0, follow state of SPEAKER_DATA bit, otherwise enable output
|
||||
from timer 2. */
|
||||
#define SPEAKER_TMR2 0x01
|
||||
|
||||
/* If SPEAKER_TMR2 is not set, this provides direct input into the
|
||||
speaker. Otherwise, this enables or disables the output from the
|
||||
timer. */
|
||||
#define SPEAKER_DATA 0x02
|
||||
|
||||
/* The PIT channel value ports. You can write to and read from them.
|
||||
Do not mess with timer 0 or 1. */
|
||||
#define PIT_COUNTER_0 0x40
|
||||
#define PIT_COUNTER_1 0x41
|
||||
#define PIT_COUNTER_2 0x42
|
||||
|
||||
/* The frequency of the PIT clock. */
|
||||
#define PIT_FREQUENCY 0x1234dd
|
||||
|
||||
/* The PIT control port. You can only write to it. Do not mess with
|
||||
timer 0 or 1. */
|
||||
#define PIT_CTRL 0x43
|
||||
#define PIT_CTRL_SELECT_MASK 0xc0
|
||||
#define PIT_CTRL_SELECT_0 0x00
|
||||
#define PIT_CTRL_SELECT_1 0x40
|
||||
#define PIT_CTRL_SELECT_2 0x80
|
||||
|
||||
/* Read and load control. */
|
||||
#define PIT_CTRL_READLOAD_MASK 0x30
|
||||
#define PIT_CTRL_COUNTER_LATCH 0x00 /* Hold timer value until read. */
|
||||
#define PIT_CTRL_READLOAD_LSB 0x10 /* Read/load the LSB. */
|
||||
#define PIT_CTRL_READLOAD_MSB 0x20 /* Read/load the MSB. */
|
||||
#define PIT_CTRL_READLOAD_WORD 0x30 /* Read/load the LSB then the MSB. */
|
||||
|
||||
/* Mode control. */
|
||||
#define PIT_CTRL_MODE_MASK 0x0e
|
||||
|
||||
/* Interrupt on terminal count. Setting the mode sets output to low.
|
||||
When counter is set and terminated, output is set to high. */
|
||||
#define PIT_CTRL_INTR_ON_TERM 0x00
|
||||
|
||||
/* Programmable one-shot. When loading counter, output is set to
|
||||
high. When counter terminated, output is set to low. Can be
|
||||
triggered again from that point on by setting the gate pin to
|
||||
high. */
|
||||
#define PIT_CTRL_PROGR_ONE_SHOT 0x02
|
||||
|
||||
/* Rate generator. Output is low for one period of the counter, and
|
||||
high for the other. */
|
||||
#define PIT_CTRL_RATE_GEN 0x04
|
||||
|
||||
/* Square wave generator. Output is low for one half of the period,
|
||||
and high for the other half. */
|
||||
#define PIT_CTRL_SQUAREWAVE_GEN 0x06
|
||||
|
||||
/* Software triggered strobe. Setting the mode sets output to high.
|
||||
When counter is set and terminated, output is set to low. */
|
||||
#define PIT_CTRL_SOFTSTROBE 0x08
|
||||
|
||||
/* Hardware triggered strobe. Like software triggered strobe, but
|
||||
only starts the counter when the gate pin is set to high. */
|
||||
#define PIT_CTRL_HARDSTROBE 0x0a
|
||||
|
||||
/* Count mode. */
|
||||
#define PIT_CTRL_COUNT_MASK 0x01
|
||||
#define PIT_CTRL_COUNT_BINARY 0x00 /* 16-bit binary counter. */
|
||||
#define PIT_CTRL_COUNT_BCD 0x01 /* 4-decade BCD counter. */
|
||||
|
||||
#define T_REST ((grub_uint16_t) 0)
|
||||
#define T_FINE ((grub_uint16_t) -1)
|
||||
@@ -112,39 +44,6 @@ struct note
|
||||
grub_uint16_t duration;
|
||||
};
|
||||
|
||||
static void
|
||||
beep_off (void)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
status = grub_inb (SPEAKER);
|
||||
grub_outb (status & ~(SPEAKER_TMR2 | SPEAKER_DATA), SPEAKER);
|
||||
}
|
||||
|
||||
static void
|
||||
beep_on (grub_uint16_t pitch)
|
||||
{
|
||||
unsigned char status;
|
||||
unsigned int counter;
|
||||
|
||||
if (pitch < 20)
|
||||
pitch = 20;
|
||||
else if (pitch > 20000)
|
||||
pitch = 20000;
|
||||
|
||||
counter = PIT_FREQUENCY / pitch;
|
||||
|
||||
/* Program timer 2. */
|
||||
grub_outb (PIT_CTRL_SELECT_2 | PIT_CTRL_READLOAD_WORD
|
||||
| PIT_CTRL_SQUAREWAVE_GEN | PIT_CTRL_COUNT_BINARY, PIT_CTRL);
|
||||
grub_outb (counter & 0xff, PIT_COUNTER_2); /* LSB */
|
||||
grub_outb ((counter >> 8) & 0xff, PIT_COUNTER_2); /* MSB */
|
||||
|
||||
/* Start speaker. */
|
||||
status = grub_inb (SPEAKER);
|
||||
grub_outb (status | SPEAKER_TMR2 | SPEAKER_DATA, SPEAKER);
|
||||
}
|
||||
|
||||
/* Returns whether playing should continue. */
|
||||
static int
|
||||
play (unsigned tempo, struct note *note)
|
||||
@@ -160,11 +59,11 @@ play (unsigned tempo, struct note *note)
|
||||
switch (note->pitch)
|
||||
{
|
||||
case T_REST:
|
||||
beep_off ();
|
||||
grub_speaker_beep_off ();
|
||||
break;
|
||||
|
||||
default:
|
||||
beep_on (note->pitch);
|
||||
grub_speaker_beep_on (note->pitch);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -263,7 +162,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)),
|
||||
}
|
||||
}
|
||||
|
||||
beep_off ();
|
||||
grub_speaker_beep_off ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -286,48 +286,49 @@ grub_sendkey_preboot (int noret __attribute__ ((unused)))
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Helper for grub_cmd_sendkey. */
|
||||
static int
|
||||
find_key_code (char *key)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
|
||||
{
|
||||
if (keysym_table[i].unshifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
|
||||
return keysym_table[i].keycode;
|
||||
else if (keysym_table[i].shifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].shifted_name) == 0)
|
||||
return keysym_table[i].keycode;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Helper for grub_cmd_sendkey. */
|
||||
static int
|
||||
find_ascii_code (char *key)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
|
||||
{
|
||||
if (keysym_table[i].unshifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
|
||||
return keysym_table[i].unshifted_ascii;
|
||||
else if (keysym_table[i].shifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].shifted_name) == 0)
|
||||
return keysym_table[i].shifted_ascii;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_sendkey (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
|
||||
auto int find_key_code (char *key);
|
||||
auto int find_ascii_code (char *key);
|
||||
|
||||
int find_key_code (char *key)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
|
||||
{
|
||||
if (keysym_table[i].unshifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
|
||||
return keysym_table[i].keycode;
|
||||
else if (keysym_table[i].shifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].shifted_name) == 0)
|
||||
return keysym_table[i].keycode;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int find_ascii_code (char *key)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < sizeof (keysym_table) / sizeof (keysym_table[0]); i++)
|
||||
{
|
||||
if (keysym_table[i].unshifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].unshifted_name) == 0)
|
||||
return keysym_table[i].unshifted_ascii;
|
||||
else if (keysym_table[i].shifted_name
|
||||
&& grub_strcmp (key, keysym_table[i].shifted_name) == 0)
|
||||
return keysym_table[i].shifted_ascii;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
andmask = 0xffffffff;
|
||||
ormask = 0;
|
||||
|
||||
|
||||
@@ -132,6 +132,9 @@ map_key_core (int code, int status, int *alt_gr_consumed)
|
||||
{
|
||||
*alt_gr_consumed = 0;
|
||||
|
||||
if (code >= GRUB_KEYBOARD_LAYOUTS_ARRAY_SIZE)
|
||||
return 0;
|
||||
|
||||
if (status & GRUB_TERM_STATUS_RALT)
|
||||
{
|
||||
if (status & (GRUB_TERM_STATUS_LSHIFT | GRUB_TERM_STATUS_RSHIFT))
|
||||
@@ -242,7 +245,7 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_le_to_cpu32 (version) != GRUB_KEYBOARD_LAYOUTS_VERSION)
|
||||
if (version != grub_cpu_to_le32_compile_time (GRUB_KEYBOARD_LAYOUTS_VERSION))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid version");
|
||||
goto fail;
|
||||
@@ -290,21 +293,13 @@ grub_cmd_keymap (struct grub_command *cmd __attribute__ ((unused)),
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
void grub_keylayouts_init (void)
|
||||
#else
|
||||
GRUB_MOD_INIT(keylayouts)
|
||||
#endif
|
||||
{
|
||||
cmd = grub_register_command ("keymap", grub_cmd_keymap,
|
||||
0, N_("Load a keyboard layout."));
|
||||
}
|
||||
|
||||
#if defined (GRUB_MACHINE_MIPS_LOONGSON) || defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
void grub_keylayouts_fini (void)
|
||||
#else
|
||||
GRUB_MOD_FINI(keylayouts)
|
||||
#endif
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ grub_getkeystatus (void)
|
||||
grub_term_input_t term;
|
||||
|
||||
if (grub_term_poll_usb)
|
||||
grub_term_poll_usb ();
|
||||
grub_term_poll_usb (0);
|
||||
|
||||
FOR_ACTIVE_TERM_INPUTS(term)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,15 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* Helper for legacy_file. */
|
||||
static grub_err_t
|
||||
legacy_file_getline (char **line, int cont __attribute__ ((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
*line = 0;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
legacy_file (const char *filename)
|
||||
{
|
||||
@@ -43,14 +52,6 @@ legacy_file (const char *filename)
|
||||
grub_menu_t menu;
|
||||
char *suffix = grub_strdup ("");
|
||||
|
||||
auto grub_err_t getline (char **line, int cont);
|
||||
grub_err_t getline (char **line,
|
||||
int cont __attribute__ ((unused)))
|
||||
{
|
||||
*line = 0;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
if (!suffix)
|
||||
return grub_errno;
|
||||
|
||||
@@ -134,7 +135,7 @@ legacy_file (const char *filename)
|
||||
|
||||
if (parsed && !entryname)
|
||||
{
|
||||
grub_normal_parse_line (parsed, getline);
|
||||
grub_normal_parse_line (parsed, legacy_file_getline, NULL);
|
||||
grub_print_error ();
|
||||
grub_free (parsed);
|
||||
parsed = NULL;
|
||||
@@ -180,7 +181,7 @@ legacy_file (const char *filename)
|
||||
grub_free (args);
|
||||
}
|
||||
|
||||
grub_normal_parse_line (suffix, getline);
|
||||
grub_normal_parse_line (suffix, legacy_file_getline, NULL);
|
||||
grub_print_error ();
|
||||
grub_free (suffix);
|
||||
grub_free (entrysrc);
|
||||
|
||||
@@ -35,45 +35,53 @@ static const struct grub_arg_option options[] =
|
||||
/* TRANSLATORS: This option is used to override default filename
|
||||
for loading and storing environment. */
|
||||
{"file", 'f', 0, N_("Specify filename."), 0, ARG_TYPE_PATHNAME},
|
||||
{"skip-sig", 's', 0,
|
||||
N_("Skip signature-checking of the environment file."), 0, ARG_TYPE_NONE},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* Opens 'filename' with compression filters disabled. Optionally disables the
|
||||
PUBKEY filter (that insists upon properly signed files) as well. PUBKEY
|
||||
filter is restored before the function returns. */
|
||||
static grub_file_t
|
||||
open_envblk_file (char *filename)
|
||||
open_envblk_file (char *filename, int untrusted)
|
||||
{
|
||||
grub_file_t file;
|
||||
char *buf = 0;
|
||||
|
||||
if (! filename)
|
||||
{
|
||||
const char *prefix;
|
||||
int len;
|
||||
|
||||
prefix = grub_env_get ("prefix");
|
||||
if (prefix)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = grub_strlen (prefix);
|
||||
filename = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG));
|
||||
if (! filename)
|
||||
return 0;
|
||||
|
||||
grub_strcpy (filename, prefix);
|
||||
filename[len] = '/';
|
||||
grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG);
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (filename);
|
||||
grub_free (filename);
|
||||
return file;
|
||||
}
|
||||
else
|
||||
if (! prefix)
|
||||
{
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix");
|
||||
return 0;
|
||||
}
|
||||
|
||||
len = grub_strlen (prefix);
|
||||
buf = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG));
|
||||
if (! buf)
|
||||
return 0;
|
||||
filename = buf;
|
||||
|
||||
grub_strcpy (filename, prefix);
|
||||
filename[len] = '/';
|
||||
grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG);
|
||||
}
|
||||
|
||||
/* The filters that are disabled will be re-enabled by the call to
|
||||
grub_file_open() after this particular file is opened. */
|
||||
grub_file_filter_disable_compression ();
|
||||
return grub_file_open (filename);
|
||||
if (untrusted)
|
||||
grub_file_filter_disable_pubkey ();
|
||||
|
||||
file = grub_file_open (filename);
|
||||
|
||||
grub_free (buf);
|
||||
return file;
|
||||
}
|
||||
|
||||
static grub_envblk_t
|
||||
@@ -114,23 +122,56 @@ read_envblk_file (grub_file_t file)
|
||||
return envblk;
|
||||
}
|
||||
|
||||
struct grub_env_whitelist
|
||||
{
|
||||
grub_size_t len;
|
||||
char **list;
|
||||
};
|
||||
typedef struct grub_env_whitelist grub_env_whitelist_t;
|
||||
|
||||
static int
|
||||
test_whitelist_membership (const char* name,
|
||||
const grub_env_whitelist_t* whitelist)
|
||||
{
|
||||
grub_size_t i;
|
||||
|
||||
for (i = 0; i < whitelist->len; i++)
|
||||
if (grub_strcmp (name, whitelist->list[i]) == 0)
|
||||
return 1; /* found it */
|
||||
|
||||
return 0; /* not found */
|
||||
}
|
||||
|
||||
/* Helper for grub_cmd_load_env. */
|
||||
static int
|
||||
set_var (const char *name, const char *value, void *whitelist)
|
||||
{
|
||||
if (! whitelist)
|
||||
{
|
||||
grub_env_set (name, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (test_whitelist_membership (name,
|
||||
(const grub_env_whitelist_t *) whitelist))
|
||||
grub_env_set (name, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_load_env (grub_extcmd_context_t ctxt,
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
grub_cmd_load_env (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
grub_file_t file;
|
||||
grub_envblk_t envblk;
|
||||
grub_env_whitelist_t whitelist;
|
||||
|
||||
auto int set_var (const char *name, const char *value);
|
||||
int set_var (const char *name, const char *value)
|
||||
{
|
||||
grub_env_set (name, value);
|
||||
return 0;
|
||||
}
|
||||
whitelist.len = argc;
|
||||
whitelist.list = args;
|
||||
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
|
||||
/* state[0] is the -f flag; state[1] is the --skip-sig flag */
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0, state[1].set);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
@@ -138,7 +179,8 @@ grub_cmd_load_env (grub_extcmd_context_t ctxt,
|
||||
if (! envblk)
|
||||
goto fail;
|
||||
|
||||
grub_envblk_iterate (envblk, set_var);
|
||||
/* argc > 0 indicates caller provided a whitelist of variables to read. */
|
||||
grub_envblk_iterate (envblk, argc > 0 ? &whitelist : 0, set_var);
|
||||
grub_envblk_close (envblk);
|
||||
|
||||
fail:
|
||||
@@ -146,6 +188,15 @@ grub_cmd_load_env (grub_extcmd_context_t ctxt,
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
/* Print all variables in current context. */
|
||||
static int
|
||||
print_var (const char *name, const char *value,
|
||||
void *hook_data __attribute__ ((unused)))
|
||||
{
|
||||
grub_printf ("%s=%s\n", name, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_list_env (grub_extcmd_context_t ctxt,
|
||||
int argc __attribute__ ((unused)),
|
||||
@@ -155,15 +206,7 @@ grub_cmd_list_env (grub_extcmd_context_t ctxt,
|
||||
grub_file_t file;
|
||||
grub_envblk_t envblk;
|
||||
|
||||
/* Print all variables in current context. */
|
||||
auto int print_var (const char *name, const char *value);
|
||||
int print_var (const char *name, const char *value)
|
||||
{
|
||||
grub_printf ("%s=%s\n", name, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0, 0);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
@@ -171,7 +214,7 @@ grub_cmd_list_env (grub_extcmd_context_t ctxt,
|
||||
if (! envblk)
|
||||
goto fail;
|
||||
|
||||
grub_envblk_iterate (envblk, print_var);
|
||||
grub_envblk_iterate (envblk, NULL, print_var);
|
||||
grub_envblk_close (envblk);
|
||||
|
||||
fail:
|
||||
@@ -283,49 +326,57 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Context for grub_cmd_save_env. */
|
||||
struct grub_cmd_save_env_ctx
|
||||
{
|
||||
struct blocklist *head, *tail;
|
||||
};
|
||||
|
||||
/* Store blocklists in a linked list. */
|
||||
static void
|
||||
save_env_read_hook (grub_disk_addr_t sector, unsigned offset, unsigned length,
|
||||
void *data)
|
||||
{
|
||||
struct grub_cmd_save_env_ctx *ctx = data;
|
||||
struct blocklist *block;
|
||||
|
||||
if (offset + length > GRUB_DISK_SECTOR_SIZE)
|
||||
/* Seemingly a bug. */
|
||||
return;
|
||||
|
||||
block = grub_malloc (sizeof (*block));
|
||||
if (! block)
|
||||
return;
|
||||
|
||||
block->sector = sector;
|
||||
block->offset = offset;
|
||||
block->length = length;
|
||||
|
||||
/* Slightly complicated, because the list should be FIFO. */
|
||||
block->next = 0;
|
||||
if (ctx->tail)
|
||||
ctx->tail->next = block;
|
||||
ctx->tail = block;
|
||||
if (! ctx->head)
|
||||
ctx->head = block;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
grub_file_t file;
|
||||
grub_envblk_t envblk;
|
||||
struct blocklist *head = 0;
|
||||
struct blocklist *tail = 0;
|
||||
|
||||
/* Store blocklists in a linked list. */
|
||||
auto void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector,
|
||||
unsigned offset,
|
||||
unsigned length);
|
||||
void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector,
|
||||
unsigned offset, unsigned length)
|
||||
{
|
||||
struct blocklist *block;
|
||||
|
||||
if (offset + length > GRUB_DISK_SECTOR_SIZE)
|
||||
/* Seemingly a bug. */
|
||||
return;
|
||||
|
||||
block = grub_malloc (sizeof (*block));
|
||||
if (! block)
|
||||
return;
|
||||
|
||||
block->sector = sector;
|
||||
block->offset = offset;
|
||||
block->length = length;
|
||||
|
||||
/* Slightly complicated, because the list should be FIFO. */
|
||||
block->next = 0;
|
||||
if (tail)
|
||||
tail->next = block;
|
||||
tail = block;
|
||||
if (! head)
|
||||
head = block;
|
||||
}
|
||||
struct grub_cmd_save_env_ctx ctx = {
|
||||
.head = 0,
|
||||
.tail = 0
|
||||
};
|
||||
|
||||
if (! argc)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no variable is specified");
|
||||
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0);
|
||||
file = open_envblk_file ((state[0].set) ? state[0].arg : 0,
|
||||
1 /* allow untrusted */);
|
||||
if (! file)
|
||||
return grub_errno;
|
||||
|
||||
@@ -335,13 +386,14 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "disk device required");
|
||||
}
|
||||
|
||||
file->read_hook = read_hook;
|
||||
file->read_hook = save_env_read_hook;
|
||||
file->read_hook_data = &ctx;
|
||||
envblk = read_envblk_file (file);
|
||||
file->read_hook = 0;
|
||||
if (! envblk)
|
||||
goto fail;
|
||||
|
||||
if (check_blocklists (envblk, head, file))
|
||||
if (check_blocklists (envblk, ctx.head, file))
|
||||
goto fail;
|
||||
|
||||
while (argc)
|
||||
@@ -362,12 +414,12 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
args++;
|
||||
}
|
||||
|
||||
write_blocklists (envblk, head, file);
|
||||
write_blocklists (envblk, ctx.head, file);
|
||||
|
||||
fail:
|
||||
if (envblk)
|
||||
grub_envblk_close (envblk);
|
||||
free_blocklists (head);
|
||||
free_blocklists (ctx.head);
|
||||
grub_file_close (file);
|
||||
return grub_errno;
|
||||
}
|
||||
@@ -377,7 +429,8 @@ static grub_extcmd_t cmd_load, cmd_list, cmd_save;
|
||||
GRUB_MOD_INIT(loadenv)
|
||||
{
|
||||
cmd_load =
|
||||
grub_register_extcmd ("load_env", grub_cmd_load_env, 0, N_("[-f FILE]"),
|
||||
grub_register_extcmd ("load_env", grub_cmd_load_env, 0,
|
||||
N_("[-f FILE] [-s|--skip-sig] [whitelisted_variable_name] [...]"),
|
||||
N_("Load variables from environment block file."),
|
||||
options);
|
||||
cmd_list =
|
||||
|
||||
@@ -43,23 +43,24 @@ static const struct grub_arg_option options[] =
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static const char grub_human_sizes[] = {' ', 'K', 'M', 'G', 'T'};
|
||||
/* Helper for grub_ls_list_devices. */
|
||||
static int
|
||||
grub_ls_print_devices (const char *name, void *data)
|
||||
{
|
||||
int *longlist = data;
|
||||
|
||||
if (*longlist)
|
||||
grub_normal_print_device_info (name);
|
||||
else
|
||||
grub_printf ("(%s) ", name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ls_list_devices (int longlist)
|
||||
{
|
||||
auto int grub_ls_print_devices (const char *name);
|
||||
int grub_ls_print_devices (const char *name)
|
||||
{
|
||||
if (longlist)
|
||||
grub_normal_print_device_info (name);
|
||||
else
|
||||
grub_printf ("(%s) ", name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_device_iterate (grub_ls_print_devices);
|
||||
grub_device_iterate (grub_ls_print_devices, &longlist);
|
||||
grub_xputs ("\n");
|
||||
|
||||
#if 0
|
||||
@@ -82,6 +83,69 @@ grub_ls_list_devices (int longlist)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Context for grub_ls_list_files. */
|
||||
struct grub_ls_list_files_ctx
|
||||
{
|
||||
char *dirname;
|
||||
int all;
|
||||
int human;
|
||||
};
|
||||
|
||||
/* Helper for grub_ls_list_files. */
|
||||
static int
|
||||
print_files (const char *filename, const struct grub_dirhook_info *info,
|
||||
void *data)
|
||||
{
|
||||
struct grub_ls_list_files_ctx *ctx = data;
|
||||
|
||||
if (ctx->all || filename[0] != '.')
|
||||
grub_printf ("%s%s ", filename, info->dir ? "/" : "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Helper for grub_ls_list_files. */
|
||||
static int
|
||||
print_files_long (const char *filename, const struct grub_dirhook_info *info,
|
||||
void *data)
|
||||
{
|
||||
struct grub_ls_list_files_ctx *ctx = data;
|
||||
|
||||
if ((! ctx->all) && (filename[0] == '.'))
|
||||
return 0;
|
||||
|
||||
if (! info->dir)
|
||||
{
|
||||
if (! ctx->human)
|
||||
grub_printf ("%-12llu", (unsigned long long) info->size);
|
||||
else
|
||||
grub_printf ("%-12s", grub_get_human_size (info->size,
|
||||
GRUB_HUMAN_SIZE_SHORT));
|
||||
}
|
||||
else
|
||||
grub_printf ("%-12s", _("DIR"));
|
||||
|
||||
if (info->mtimeset)
|
||||
{
|
||||
struct grub_datetime datetime;
|
||||
grub_unixtime2datetime (info->mtime, &datetime);
|
||||
if (ctx->human)
|
||||
grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ",
|
||||
datetime.year, datetime.month, datetime.day,
|
||||
datetime.hour, datetime.minute,
|
||||
datetime.second,
|
||||
grub_get_weekday_name (&datetime));
|
||||
else
|
||||
grub_printf (" %04d%02d%02d%02d%02d%02d ",
|
||||
datetime.year, datetime.month,
|
||||
datetime.day, datetime.hour,
|
||||
datetime.minute, datetime.second);
|
||||
}
|
||||
grub_printf ("%s%s\n", filename, info->dir ? "/" : "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||
{
|
||||
@@ -90,107 +154,6 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||
const char *path;
|
||||
grub_device_t dev;
|
||||
|
||||
auto int print_files (const char *filename,
|
||||
const struct grub_dirhook_info *info);
|
||||
auto int print_files_long (const char *filename,
|
||||
const struct grub_dirhook_info *info);
|
||||
|
||||
int print_files (const char *filename, const struct grub_dirhook_info *info)
|
||||
{
|
||||
if (all || filename[0] != '.')
|
||||
grub_printf ("%s%s ", filename, info->dir ? "/" : "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int print_files_long (const char *filename,
|
||||
const struct grub_dirhook_info *info)
|
||||
{
|
||||
if ((! all) && (filename[0] == '.'))
|
||||
return 0;
|
||||
|
||||
if (! info->dir)
|
||||
{
|
||||
grub_file_t file;
|
||||
char *pathname;
|
||||
|
||||
if (dirname[grub_strlen (dirname) - 1] == '/')
|
||||
pathname = grub_xasprintf ("%s%s", dirname, filename);
|
||||
else
|
||||
pathname = grub_xasprintf ("%s/%s", dirname, filename);
|
||||
|
||||
if (!pathname)
|
||||
return 1;
|
||||
|
||||
/* XXX: For ext2fs symlinks are detected as files while they
|
||||
should be reported as directories. */
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (pathname);
|
||||
if (! file)
|
||||
{
|
||||
grub_errno = 0;
|
||||
grub_free (pathname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (! human)
|
||||
grub_printf ("%-12llu", (unsigned long long) file->size);
|
||||
else
|
||||
{
|
||||
grub_uint64_t fsize = file->size * 100ULL;
|
||||
grub_uint64_t fsz = file->size;
|
||||
int units = 0;
|
||||
char buf[20];
|
||||
|
||||
while (fsz / 1024)
|
||||
{
|
||||
fsize = (fsize + 512) / 1024;
|
||||
fsz /= 1024;
|
||||
units++;
|
||||
}
|
||||
|
||||
if (units)
|
||||
{
|
||||
grub_uint64_t whole, fraction;
|
||||
|
||||
whole = grub_divmod64 (fsize, 100, &fraction);
|
||||
grub_snprintf (buf, sizeof (buf),
|
||||
"%" PRIuGRUB_UINT64_T
|
||||
".%02" PRIuGRUB_UINT64_T "%c", whole, fraction,
|
||||
grub_human_sizes[units]);
|
||||
grub_printf ("%-12s", buf);
|
||||
}
|
||||
else
|
||||
grub_printf ("%-12llu", (unsigned long long) file->size);
|
||||
|
||||
}
|
||||
grub_file_close (file);
|
||||
grub_free (pathname);
|
||||
}
|
||||
else
|
||||
grub_printf ("%-12s", _("DIR"));
|
||||
|
||||
if (info->mtimeset)
|
||||
{
|
||||
struct grub_datetime datetime;
|
||||
grub_unixtime2datetime (info->mtime, &datetime);
|
||||
if (human)
|
||||
grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ",
|
||||
datetime.year, datetime.month, datetime.day,
|
||||
datetime.hour, datetime.minute,
|
||||
datetime.second,
|
||||
grub_get_weekday_name (&datetime));
|
||||
else
|
||||
grub_printf (" %04d%02d%02d%02d%02d%02d ",
|
||||
datetime.year, datetime.month,
|
||||
datetime.day, datetime.hour,
|
||||
datetime.minute, datetime.second);
|
||||
}
|
||||
grub_printf ("%s%s\n", filename, info->dir ? "/" : "");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
device_name = grub_file_get_device_name (dirname);
|
||||
dev = grub_device_open (device_name);
|
||||
if (! dev)
|
||||
@@ -218,10 +181,16 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||
}
|
||||
else if (fs)
|
||||
{
|
||||
struct grub_ls_list_files_ctx ctx = {
|
||||
.dirname = dirname,
|
||||
.all = all,
|
||||
.human = human
|
||||
};
|
||||
|
||||
if (longlist)
|
||||
(fs->dir) (dev, path, print_files_long);
|
||||
(fs->dir) (dev, path, print_files_long, &ctx);
|
||||
else
|
||||
(fs->dir) (dev, path, print_files);
|
||||
(fs->dir) (dev, path, print_files, &ctx);
|
||||
|
||||
if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
|
||||
&& path[grub_strlen (path) - 1] != '/')
|
||||
@@ -247,9 +216,9 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
|
||||
all = 1;
|
||||
grub_memset (&info, 0, sizeof (info));
|
||||
if (longlist)
|
||||
print_files_long (p, &info);
|
||||
print_files_long (p, &info, &ctx);
|
||||
else
|
||||
print_files (p, &info);
|
||||
print_files (p, &info, &ctx);
|
||||
|
||||
grub_free (dirname);
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@ static void
|
||||
disp_acpi_table (struct grub_acpi_table_header *t)
|
||||
{
|
||||
print_field (t->signature);
|
||||
grub_printf ("%4" PRIuGRUB_UINT32_T "B rev=%u OEM=", t->length, t->revision);
|
||||
grub_printf ("%4" PRIuGRUB_UINT32_T "B rev=%u chksum=0x%02x (%s) OEM=", t->length, t->revision, t->checksum,
|
||||
grub_byte_checksum (t, t->length) == 0 ? "valid" : "invalid");
|
||||
print_field (t->oemid);
|
||||
print_field (t->oemtable);
|
||||
grub_printf ("OEMrev=%08" PRIxGRUB_UINT32_T " ", t->oemrev);
|
||||
@@ -66,39 +67,87 @@ disp_madt_table (struct grub_acpi_madt *t)
|
||||
d = t->entries;
|
||||
for (;len > 0; len -= d->len, d = (void *) ((grub_uint8_t *) d + d->len))
|
||||
{
|
||||
grub_printf (" type=%x l=%u ", d->type, d->len);
|
||||
|
||||
switch (d->type)
|
||||
{
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC:
|
||||
{
|
||||
struct grub_acpi_madt_entry_lapic *dt = (void *) d;
|
||||
grub_printf (" LAPIC ACPI_ID=%02x APIC_ID=%02x Flags=%08x\n",
|
||||
dt->acpiid, dt->apicid, dt->flags);
|
||||
if (dt->hdr.len != sizeof (*dt))
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
break;
|
||||
}
|
||||
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_IOAPIC:
|
||||
{
|
||||
struct grub_acpi_madt_entry_ioapic *dt = (void *) d;
|
||||
grub_printf (" IOAPIC ID=%02x address=%08x GSI=%08x\n",
|
||||
dt->id, dt->address, dt->global_sys_interrupt);
|
||||
if (dt->hdr.len != sizeof (*dt))
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
if (dt->pad)
|
||||
grub_printf (" non-zero pad: %02x\n", dt->pad);
|
||||
break;
|
||||
}
|
||||
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE:
|
||||
{
|
||||
struct grub_acpi_madt_entry_interrupt_override *dt = (void *) d;
|
||||
grub_printf ("Int Override bus=%x src=%x GSI=%08x Flags=%04x\n",
|
||||
grub_printf (" Int Override bus=%x src=%x GSI=%08x Flags=%04x\n",
|
||||
dt->bus, dt->source, dt->global_sys_interrupt,
|
||||
dt->flags);
|
||||
if (dt->hdr.len != sizeof (*dt))
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
}
|
||||
break;
|
||||
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_LAPIC_NMI:
|
||||
{
|
||||
struct grub_acpi_madt_entry_lapic_nmi *dt = (void *) d;
|
||||
grub_printf (" LAPIC_NMI ACPI_ID=%02x Flags=%04x lint=%02x\n",
|
||||
dt->acpiid, dt->flags, dt->lint);
|
||||
if (dt->hdr.len != sizeof (*dt))
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
break;
|
||||
}
|
||||
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_SAPIC:
|
||||
{
|
||||
struct grub_acpi_madt_entry_sapic *dt = (void *) d;
|
||||
grub_printf ("IOSAPIC Id=%02x GSI=%08x Addr=%016" PRIxGRUB_UINT64_T
|
||||
grub_printf (" IOSAPIC Id=%02x GSI=%08x Addr=%016" PRIxGRUB_UINT64_T
|
||||
"\n",
|
||||
dt->id, dt->global_sys_interrupt_base,
|
||||
dt->addr);
|
||||
if (dt->hdr.len != sizeof (*dt))
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
if (dt->pad)
|
||||
grub_printf (" non-zero pad: %02x\n", dt->pad);
|
||||
|
||||
}
|
||||
break;
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_LSAPIC:
|
||||
{
|
||||
struct grub_acpi_madt_entry_lsapic *dt = (void *) d;
|
||||
grub_printf ("LSAPIC ProcId=%02x ID=%02x EID=%02x Flags=%x",
|
||||
grub_printf (" LSAPIC ProcId=%02x ID=%02x EID=%02x Flags=%x",
|
||||
dt->cpu_id, dt->id, dt->eid, dt->flags);
|
||||
if (dt->flags & GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED)
|
||||
grub_printf (" Enabled\n");
|
||||
else
|
||||
grub_printf (" Disabled\n");
|
||||
if (d->len > sizeof (struct grub_acpi_madt_entry_sapic))
|
||||
grub_printf (" UID val=%08x, Str=%s\n", dt->cpu_uid,
|
||||
grub_printf (" UID val=%08x, Str=%s\n", dt->cpu_uid,
|
||||
dt->cpu_uid_str);
|
||||
if (dt->hdr.len != sizeof (*dt) + grub_strlen ((char *) dt->cpu_uid_str) + 1)
|
||||
grub_printf (" table size mismatch %d != %d\n", dt->hdr.len,
|
||||
(int) sizeof (*dt));
|
||||
if (dt->pad[0] || dt->pad[1] || dt->pad[2])
|
||||
grub_printf (" non-zero pad: %02x%02x%02x\n", dt->pad[0], dt->pad[1], dt->pad[2]);
|
||||
}
|
||||
break;
|
||||
case GRUB_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE:
|
||||
@@ -107,17 +156,18 @@ disp_madt_table (struct grub_acpi_madt *t)
|
||||
static const char * const platint_type[] =
|
||||
{"Nul", "PMI", "INIT", "CPEI"};
|
||||
|
||||
grub_printf ("Platform INT flags=%04x type=%02x (%s)"
|
||||
grub_printf (" Platform INT flags=%04x type=%02x (%s)"
|
||||
" ID=%02x EID=%02x\n",
|
||||
dt->flags, dt->inttype,
|
||||
(dt->inttype < ARRAY_SIZE (platint_type))
|
||||
? platint_type[dt->inttype] : "??", dt->cpu_id,
|
||||
dt->cpu_eid);
|
||||
grub_printf (" IOSAPIC Vec=%02x GSI=%08x source flags=%08x\n",
|
||||
grub_printf (" IOSAPIC Vec=%02x GSI=%08x source flags=%08x\n",
|
||||
dt->sapic_vector, dt->global_sys_int, dt->src_flags);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
grub_printf (" type=%x l=%u ", d->type, d->len);
|
||||
grub_printf (" ??\n");
|
||||
}
|
||||
}
|
||||
@@ -182,7 +232,7 @@ static void
|
||||
disp_acpi_rsdpv1 (struct grub_acpi_rsdp_v10 *rsdp)
|
||||
{
|
||||
print_field (rsdp->signature);
|
||||
grub_printf ("chksum:%02x, OEM-ID: ", rsdp->checksum);
|
||||
grub_printf ("chksum:%02x (%s), OEM-ID: ", rsdp->checksum, grub_byte_checksum (rsdp, sizeof (*rsdp)) == 0 ? "valid" : "invalid");
|
||||
print_field (rsdp->oemid);
|
||||
grub_printf ("rev=%d\n", rsdp->revision);
|
||||
grub_printf ("RSDT=%08" PRIxGRUB_UINT32_T "\n", rsdp->rsdt_addr);
|
||||
@@ -192,8 +242,13 @@ static void
|
||||
disp_acpi_rsdpv2 (struct grub_acpi_rsdp_v20 *rsdp)
|
||||
{
|
||||
disp_acpi_rsdpv1 (&rsdp->rsdpv1);
|
||||
grub_printf ("len=%d XSDT=%016" PRIxGRUB_UINT64_T "\n", rsdp->length,
|
||||
grub_printf ("len=%d chksum=%02x (%s) XSDT=%016" PRIxGRUB_UINT64_T "\n", rsdp->length, rsdp->checksum, grub_byte_checksum (rsdp, rsdp->length) == 0 ? "valid" : "invalid",
|
||||
rsdp->xsdt_addr);
|
||||
if (rsdp->length != sizeof (*rsdp))
|
||||
grub_printf (" length mismatch %d != %d\n", rsdp->length,
|
||||
(int) sizeof (*rsdp));
|
||||
if (rsdp->reserved[0] || rsdp->reserved[1] || rsdp->reserved[2])
|
||||
grub_printf (" non-zero reserved %02x%02x%02x\n", rsdp->reserved[0], rsdp->reserved[1], rsdp->reserved[2]);
|
||||
}
|
||||
|
||||
static const struct grub_arg_option options[] = {
|
||||
|
||||
@@ -21,9 +21,11 @@
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/memory.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
static const char *names[] =
|
||||
{
|
||||
[GRUB_MEMORY_AVAILABLE] = N_("available RAM"),
|
||||
@@ -35,30 +37,33 @@ static const char *names[] =
|
||||
is required to save accross hibernations. */
|
||||
[GRUB_MEMORY_NVS] = N_("ACPI non-volatile storage RAM"),
|
||||
[GRUB_MEMORY_BADRAM] = N_("faulty RAM (BadRAM)"),
|
||||
[GRUB_MEMORY_CODE] = N_("RAM holding firmware code"),
|
||||
[GRUB_MEMORY_HOLE] = N_("Address range not associated with RAM")
|
||||
[GRUB_MEMORY_COREBOOT_TABLES] = N_("RAM holding coreboot tables"),
|
||||
[GRUB_MEMORY_CODE] = N_("RAM holding firmware code")
|
||||
};
|
||||
|
||||
/* Helper for grub_cmd_lsmmap. */
|
||||
static int
|
||||
lsmmap_hook (grub_uint64_t addr, grub_uint64_t size, grub_memory_type_t type,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
if (type < (int) ARRAY_SIZE (names) && type >= 0 && names[type])
|
||||
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"),
|
||||
(long long) addr, (long long) size, _(names[type]));
|
||||
else
|
||||
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"),
|
||||
(long long) addr, (long long) size, type);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
|
||||
{
|
||||
auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_memory_type_t);
|
||||
int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size,
|
||||
grub_memory_type_t type)
|
||||
{
|
||||
if (type < ARRAY_SIZE (names) && names[type])
|
||||
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, %s\n"),
|
||||
(long long) addr, (long long) size, _(names[type]));
|
||||
else
|
||||
grub_printf_ (N_("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n"),
|
||||
(long long) addr, (long long) size, type);
|
||||
return 0;
|
||||
}
|
||||
#ifndef GRUB_MACHINE_EMU
|
||||
grub_machine_mmap_iterate (hook);
|
||||
grub_machine_mmap_iterate (lsmmap_hook, NULL);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/mm.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
@@ -126,8 +127,9 @@ static const struct grub_arg_option options[] =
|
||||
|
||||
static int iospace;
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
static int
|
||||
grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint32_t class;
|
||||
const char *sclass;
|
||||
@@ -218,7 +220,7 @@ grub_cmd_lspci (grub_extcmd_context_t ctxt,
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
iospace = ctxt->state[0].set;
|
||||
grub_pci_iterate (grub_lspci_iter);
|
||||
grub_pci_iterate (grub_lspci_iter, NULL);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
|
||||
316
grub-core/commands/nativedisk.c
Normal file
316
grub-core/commands/nativedisk.c
Normal file
@@ -0,0 +1,316 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/device.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/fs.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/file.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const char *modnames_def[] = {
|
||||
/* FIXME: autogenerate this. */
|
||||
#if defined (__i386__) || defined (__x86_64__) || defined (GRUB_MACHINE_MIPS_LOONGSON)
|
||||
"pata", "ahci", "usbms", "ohci", "uhci", "ehci"
|
||||
#elif defined (GRUB_MACHINE_MIPS_QEMU_MIPS)
|
||||
"pata"
|
||||
#else
|
||||
#error "Fill this"
|
||||
#endif
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
get_uuid (const char *name, char **uuid, int getnative)
|
||||
{
|
||||
grub_device_t dev;
|
||||
grub_fs_t fs = 0;
|
||||
|
||||
*uuid = 0;
|
||||
|
||||
dev = grub_device_open (name);
|
||||
if (!dev)
|
||||
return grub_errno;
|
||||
|
||||
if (!dev->disk)
|
||||
{
|
||||
grub_dprintf ("nativedisk", "Skipping non-disk\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (dev->disk->dev->id)
|
||||
{
|
||||
/* Firmware disks. */
|
||||
case GRUB_DISK_DEVICE_BIOSDISK_ID:
|
||||
case GRUB_DISK_DEVICE_OFDISK_ID:
|
||||
case GRUB_DISK_DEVICE_EFIDISK_ID:
|
||||
case GRUB_DISK_DEVICE_NAND_ID:
|
||||
case GRUB_DISK_DEVICE_ARCDISK_ID:
|
||||
case GRUB_DISK_DEVICE_HOSTDISK_ID:
|
||||
case GRUB_DISK_DEVICE_UBOOTDISK_ID:
|
||||
break;
|
||||
|
||||
/* Native disks. */
|
||||
case GRUB_DISK_DEVICE_ATA_ID:
|
||||
case GRUB_DISK_DEVICE_SCSI_ID:
|
||||
if (getnative)
|
||||
break;
|
||||
|
||||
/* Virtual disks. */
|
||||
/* GRUB dynamically generated files. */
|
||||
case GRUB_DISK_DEVICE_PROCFS_ID:
|
||||
/* To access through host OS routines (grub-emu only). */
|
||||
case GRUB_DISK_DEVICE_HOST_ID:
|
||||
/* To access coreboot roms. */
|
||||
case GRUB_DISK_DEVICE_CBFSDISK_ID:
|
||||
/* GRUB-only memdisk. Can't match any of firmware devices. */
|
||||
case GRUB_DISK_DEVICE_MEMDISK_ID:
|
||||
grub_dprintf ("nativedisk", "Skipping native disk %s\n",
|
||||
dev->disk->name);
|
||||
return 0;
|
||||
|
||||
/* FIXME: those probably need special handling. */
|
||||
case GRUB_DISK_DEVICE_LOOPBACK_ID:
|
||||
case GRUB_DISK_DEVICE_DISKFILTER_ID:
|
||||
case GRUB_DISK_DEVICE_CRYPTODISK_ID:
|
||||
break;
|
||||
}
|
||||
if (dev)
|
||||
fs = grub_fs_probe (dev);
|
||||
if (!fs)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
return grub_errno;
|
||||
}
|
||||
if (!fs->uuid || fs->uuid (dev, uuid) || !*uuid)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
N_("%s does not support UUIDs"), fs->name);
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct search_ctx
|
||||
{
|
||||
char *root_uuid;
|
||||
char *prefix_uuid;
|
||||
const char *prefix_path;
|
||||
int prefix_found, root_found;
|
||||
};
|
||||
|
||||
static int
|
||||
iterate_device (const char *name, void *data)
|
||||
{
|
||||
struct search_ctx *ctx = data;
|
||||
char *cur_uuid;
|
||||
|
||||
if (get_uuid (name, &cur_uuid, 1))
|
||||
{
|
||||
if (grub_errno == GRUB_ERR_UNKNOWN_FS)
|
||||
grub_errno = 0;
|
||||
grub_print_error ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_dprintf ("nativedisk", "checking %s: %s\n", name,
|
||||
cur_uuid);
|
||||
if (ctx->prefix_uuid && grub_strcasecmp (cur_uuid, ctx->prefix_uuid) == 0)
|
||||
{
|
||||
char *prefix;
|
||||
prefix = grub_xasprintf ("(%s)/%s", name, ctx->prefix_path);
|
||||
grub_env_set ("prefix", prefix);
|
||||
grub_free (prefix);
|
||||
ctx->prefix_found = 1;
|
||||
}
|
||||
if (ctx->root_uuid && grub_strcasecmp (cur_uuid, ctx->root_uuid) == 0)
|
||||
{
|
||||
grub_env_set ("root", name);
|
||||
ctx->root_found = 1;
|
||||
}
|
||||
return ctx->prefix_found && ctx->root_found;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_nativedisk (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args_in)
|
||||
{
|
||||
char *uuid_root = 0, *uuid_prefix, *prefdev = 0;
|
||||
const char *prefix = 0;
|
||||
const char *path_prefix = 0;
|
||||
int mods_loaded = 0;
|
||||
grub_dl_t *mods;
|
||||
const char **args;
|
||||
int i;
|
||||
|
||||
if (argc == 0)
|
||||
{
|
||||
argc = ARRAY_SIZE (modnames_def);
|
||||
args = modnames_def;
|
||||
}
|
||||
else
|
||||
args = (const char **) args_in;
|
||||
|
||||
prefix = grub_env_get ("prefix");
|
||||
|
||||
if (! prefix)
|
||||
return grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("variable `%s' isn't set"), "prefix");
|
||||
|
||||
if (prefix)
|
||||
path_prefix = (prefix[0] == '(') ? grub_strchr (prefix, ')') : NULL;
|
||||
if (path_prefix)
|
||||
path_prefix++;
|
||||
else
|
||||
path_prefix = prefix;
|
||||
|
||||
mods = grub_malloc (argc * sizeof (mods[0]));
|
||||
if (!mods)
|
||||
return grub_errno;
|
||||
|
||||
if (get_uuid (NULL, &uuid_root, 0))
|
||||
return grub_errno;
|
||||
|
||||
prefdev = grub_file_get_device_name (prefix);
|
||||
if (grub_errno)
|
||||
{
|
||||
grub_print_error ();
|
||||
prefdev = 0;
|
||||
}
|
||||
|
||||
if (get_uuid (prefdev, &uuid_prefix, 0))
|
||||
{
|
||||
grub_free (uuid_root);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
grub_dprintf ("nativedisk", "uuid_prefix = %s, uuid_root = %s\n",
|
||||
uuid_prefix, uuid_root);
|
||||
|
||||
for (mods_loaded = 0; mods_loaded < argc; mods_loaded++)
|
||||
{
|
||||
char *filename;
|
||||
grub_dl_t mod;
|
||||
grub_file_t file = NULL;
|
||||
grub_ssize_t size;
|
||||
void *core = 0;
|
||||
|
||||
mod = grub_dl_get (args[mods_loaded]);
|
||||
if (mod)
|
||||
{
|
||||
mods[mods_loaded] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
filename = grub_xasprintf ("%s/" GRUB_TARGET_CPU "-" GRUB_PLATFORM "/%s.mod",
|
||||
prefix, args[mods_loaded]);
|
||||
if (! filename)
|
||||
goto fail;
|
||||
|
||||
file = grub_file_open (filename);
|
||||
grub_free (filename);
|
||||
if (! file)
|
||||
goto fail;
|
||||
|
||||
size = grub_file_size (file);
|
||||
core = grub_malloc (size);
|
||||
if (! core)
|
||||
{
|
||||
grub_file_close (file);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_file_read (file, core, size) != (grub_ssize_t) size)
|
||||
{
|
||||
grub_file_close (file);
|
||||
grub_free (core);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_file_close (file);
|
||||
|
||||
mods[mods_loaded] = grub_dl_load_core_noinit (core, size);
|
||||
if (! mods[mods_loaded])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
if (mods[i])
|
||||
grub_dl_init (mods[i]);
|
||||
|
||||
if (uuid_prefix || uuid_root)
|
||||
{
|
||||
struct search_ctx ctx;
|
||||
grub_fs_autoload_hook_t saved_autoload;
|
||||
|
||||
/* No need to autoload FS since obviously we already have the necessary fs modules. */
|
||||
saved_autoload = grub_fs_autoload_hook;
|
||||
grub_fs_autoload_hook = 0;
|
||||
|
||||
ctx.root_uuid = uuid_root;
|
||||
ctx.prefix_uuid = uuid_prefix;
|
||||
ctx.prefix_path = path_prefix;
|
||||
ctx.prefix_found = !uuid_prefix;
|
||||
ctx.root_found = !uuid_root;
|
||||
|
||||
/* FIXME: try to guess the correct values. */
|
||||
grub_device_iterate (iterate_device, &ctx);
|
||||
|
||||
grub_fs_autoload_hook = saved_autoload;
|
||||
}
|
||||
grub_free (uuid_root);
|
||||
grub_free (uuid_prefix);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
fail:
|
||||
grub_free (uuid_root);
|
||||
grub_free (uuid_prefix);
|
||||
|
||||
for (i = 0; i < mods_loaded; i++)
|
||||
if (mods[i])
|
||||
{
|
||||
mods[i]->fini = 0;
|
||||
grub_dl_unload (mods[i]);
|
||||
}
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(nativedisk)
|
||||
{
|
||||
cmd = grub_register_command ("nativedisk", grub_cmd_nativedisk, N_("[MODULE1 MODULE2 ...]"),
|
||||
N_("Switch to native disk drivers. If no modules are specified default set (pata,ahci,usbms,ohci,uhci,ehci) is used"));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(nativedisk)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
@@ -94,6 +94,50 @@ grub_parttool_unregister (int handle)
|
||||
grub_dl_unref (mymod);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
show_help (grub_device_t dev)
|
||||
{
|
||||
int found = 0;
|
||||
struct grub_parttool *cur;
|
||||
|
||||
for (cur = parts; cur; cur = cur->next)
|
||||
if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0)
|
||||
{
|
||||
struct grub_parttool_argdesc *curarg;
|
||||
found = 1;
|
||||
for (curarg = cur->args; curarg->name; curarg++)
|
||||
{
|
||||
int spacing = 20;
|
||||
|
||||
spacing -= grub_strlen (curarg->name);
|
||||
grub_printf ("%s", curarg->name);
|
||||
|
||||
switch (curarg->type)
|
||||
{
|
||||
case GRUB_PARTTOOL_ARG_BOOL:
|
||||
grub_printf ("+/-");
|
||||
spacing -= 3;
|
||||
break;
|
||||
|
||||
case GRUB_PARTTOOL_ARG_VAL:
|
||||
grub_xputs (_("=VAL"));
|
||||
spacing -= 4;
|
||||
break;
|
||||
|
||||
case GRUB_PARTTOOL_ARG_END:
|
||||
break;
|
||||
}
|
||||
while (spacing-- > 0)
|
||||
grub_printf (" ");
|
||||
grub_puts_ (curarg->desc);
|
||||
}
|
||||
}
|
||||
if (! found)
|
||||
grub_printf_ (N_("Sorry no parttool is available for %s\n"),
|
||||
dev->disk->partition->partmap->name);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
@@ -104,48 +148,6 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
int i, j;
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
|
||||
auto grub_err_t show_help (void);
|
||||
grub_err_t show_help (void)
|
||||
{
|
||||
int found = 0;
|
||||
for (cur = parts; cur; cur = cur->next)
|
||||
if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0)
|
||||
{
|
||||
struct grub_parttool_argdesc *curarg;
|
||||
found = 1;
|
||||
for (curarg = cur->args; curarg->name; curarg++)
|
||||
{
|
||||
int spacing = 20;
|
||||
|
||||
spacing -= grub_strlen (curarg->name);
|
||||
grub_printf ("%s", curarg->name);
|
||||
|
||||
switch (curarg->type)
|
||||
{
|
||||
case GRUB_PARTTOOL_ARG_BOOL:
|
||||
grub_printf ("+/-");
|
||||
spacing -= 3;
|
||||
break;
|
||||
|
||||
case GRUB_PARTTOOL_ARG_VAL:
|
||||
grub_xputs (_("=VAL"));
|
||||
spacing -= 4;
|
||||
break;
|
||||
|
||||
case GRUB_PARTTOOL_ARG_END:
|
||||
break;
|
||||
}
|
||||
while (spacing-- > 0)
|
||||
grub_printf (" ");
|
||||
grub_puts_ (curarg->desc);
|
||||
}
|
||||
}
|
||||
if (! found)
|
||||
grub_printf_ (N_("Sorry no parttool is available for %s\n"),
|
||||
dev->disk->partition->partmap->name);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
if (argc < 1)
|
||||
{
|
||||
grub_puts_ (helpmsg);
|
||||
@@ -177,7 +179,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
}
|
||||
|
||||
/* Load modules. */
|
||||
if (! grub_no_autoload)
|
||||
if (! grub_no_modules)
|
||||
{
|
||||
const char *prefix;
|
||||
prefix = grub_env_get ("prefix");
|
||||
@@ -241,11 +243,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)),
|
||||
}
|
||||
|
||||
if (argc == 1)
|
||||
return show_help ();
|
||||
return show_help (dev);
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
if (grub_strcmp (args[i], "help") == 0)
|
||||
return show_help ();
|
||||
return show_help (dev);
|
||||
|
||||
parsed = (int *) grub_zalloc (argc * sizeof (int));
|
||||
|
||||
|
||||
175
grub-core/commands/pcidump.c
Normal file
175
grub-core/commands/pcidump.c
Normal file
@@ -0,0 +1,175 @@
|
||||
/* lspci.c - List PCI devices. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/pci.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
struct iter_cxt
|
||||
{
|
||||
grub_uint32_t pciid_check_mask, pciid_check_value;
|
||||
int bus, device, function;
|
||||
int check_bus, check_device, check_function;
|
||||
};
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{0, 'd', 0, N_("Select device by vendor and device IDs."),
|
||||
N_("[vendor]:[device]"), ARG_TYPE_STRING},
|
||||
{0, 's', 0, N_("Select device by its position on the bus."),
|
||||
N_("[bus]:[slot][.func]"), ARG_TYPE_STRING},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static int
|
||||
grub_pcidump_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data)
|
||||
{
|
||||
struct iter_cxt *ctx = data;
|
||||
grub_pci_address_t addr;
|
||||
int i;
|
||||
|
||||
if ((pciid & ctx->pciid_check_mask) != ctx->pciid_check_value)
|
||||
return 0;
|
||||
|
||||
if (ctx->check_bus && grub_pci_get_bus (dev) != ctx->bus)
|
||||
return 0;
|
||||
|
||||
if (ctx->check_device && grub_pci_get_device (dev) != ctx->device)
|
||||
return 0;
|
||||
|
||||
if (ctx->check_function && grub_pci_get_function (dev) != ctx->function)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < 256; i += 4)
|
||||
{
|
||||
addr = grub_pci_make_address (dev, i);
|
||||
grub_printf ("%08x ", grub_pci_read (addr));
|
||||
if ((i & 0xc) == 0xc)
|
||||
grub_printf ("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_pcidump (grub_extcmd_context_t ctxt,
|
||||
int argc __attribute__ ((unused)),
|
||||
char **argv __attribute__ ((unused)))
|
||||
{
|
||||
const char *ptr;
|
||||
struct iter_cxt ctx =
|
||||
{
|
||||
.pciid_check_value = 0,
|
||||
.pciid_check_mask = 0,
|
||||
.check_bus = 0,
|
||||
.check_device = 0,
|
||||
.check_function = 0,
|
||||
.bus = 0,
|
||||
.function = 0,
|
||||
.device = 0
|
||||
};
|
||||
|
||||
if (ctxt->state[0].set)
|
||||
{
|
||||
ptr = ctxt->state[0].arg;
|
||||
ctx.pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff);
|
||||
if (grub_errno == GRUB_ERR_BAD_NUMBER)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
ptr = ctxt->state[0].arg;
|
||||
}
|
||||
else
|
||||
ctx.pciid_check_mask |= 0xffff;
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr != ':')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':');
|
||||
ptr++;
|
||||
ctx.pciid_check_value |= (grub_strtoul (ptr, (char **) &ptr, 16) & 0xffff)
|
||||
<< 16;
|
||||
if (grub_errno == GRUB_ERR_BAD_NUMBER)
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
else
|
||||
ctx.pciid_check_mask |= 0xffff0000;
|
||||
}
|
||||
|
||||
ctx.pciid_check_value &= ctx.pciid_check_mask;
|
||||
|
||||
if (ctxt->state[1].set)
|
||||
{
|
||||
const char *optr;
|
||||
|
||||
ptr = ctxt->state[1].arg;
|
||||
optr = ptr;
|
||||
ctx.bus = grub_strtoul (ptr, (char **) &ptr, 16);
|
||||
if (grub_errno == GRUB_ERR_BAD_NUMBER)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
ptr = optr;
|
||||
}
|
||||
else
|
||||
ctx.check_bus = 1;
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr != ':')
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("missing `%c' symbol"), ':');
|
||||
ptr++;
|
||||
optr = ptr;
|
||||
ctx.device = grub_strtoul (ptr, (char **) &ptr, 16);
|
||||
if (grub_errno == GRUB_ERR_BAD_NUMBER)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
ptr = optr;
|
||||
}
|
||||
else
|
||||
ctx.check_device = 1;
|
||||
if (*ptr == '.')
|
||||
{
|
||||
ptr++;
|
||||
ctx.function = grub_strtoul (ptr, (char **) &ptr, 16);
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
ctx.check_function = 1;
|
||||
}
|
||||
}
|
||||
|
||||
grub_pci_iterate (grub_pcidump_iter, &ctx);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_extcmd_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(pcidump)
|
||||
{
|
||||
cmd = grub_register_extcmd ("pcidump", grub_cmd_pcidump, 0,
|
||||
N_("[-s POSITION] [-d DEVICE]"),
|
||||
N_("Dump PCI configuration space."), options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(pcidump)
|
||||
{
|
||||
grub_unregister_extcmd (cmd);
|
||||
}
|
||||
@@ -83,6 +83,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_env_set (state[0].arg, val);
|
||||
else
|
||||
grub_printf ("%s", val);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[2].set)
|
||||
@@ -94,6 +95,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_env_set (state[0].arg, val);
|
||||
else
|
||||
grub_printf ("%s", val);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
fs = grub_fs_probe (dev);
|
||||
@@ -105,6 +107,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
grub_env_set (state[0].arg, fs->name);
|
||||
else
|
||||
grub_printf ("%s", fs->name);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[4].set)
|
||||
@@ -125,6 +128,7 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
else
|
||||
grub_printf ("%s", uuid);
|
||||
grub_free (uuid);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
if (state[5].set)
|
||||
@@ -147,8 +151,10 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
else
|
||||
grub_printf ("%s", label);
|
||||
grub_free (label);
|
||||
grub_device_close (dev);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
grub_device_close (dev);
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised target");
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,18 @@ static const struct grub_arg_option options[] =
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
setvar (char *str, char *v, regmatch_t *m)
|
||||
{
|
||||
char ch;
|
||||
grub_err_t err;
|
||||
ch = str[m->rm_eo];
|
||||
str[m->rm_eo] = '\0';
|
||||
err = grub_env_set (v, str + m->rm_so);
|
||||
str[m->rm_eo] = ch;
|
||||
return err;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
set_matches (char **varnames, char *str, grub_size_t nmatches,
|
||||
regmatch_t *matches)
|
||||
@@ -56,18 +68,9 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
||||
grub_err_t err;
|
||||
unsigned long j;
|
||||
|
||||
auto void setvar (char *v, regmatch_t *m);
|
||||
void setvar (char *v, regmatch_t *m)
|
||||
{
|
||||
char ch;
|
||||
ch = str[m->rm_eo];
|
||||
str[m->rm_eo] = '\0';
|
||||
err = grub_env_set (v, str + m->rm_so);
|
||||
str[m->rm_eo] = ch;
|
||||
}
|
||||
|
||||
for (i = 0; varnames && varnames[i]; i++)
|
||||
{
|
||||
err = GRUB_ERR_NONE;
|
||||
p = grub_strchr (varnames[i], ':');
|
||||
if (! p)
|
||||
{
|
||||
@@ -75,7 +78,7 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
||||
if (nmatches < 2 || matches[1].rm_so == -1)
|
||||
grub_env_unset (varnames[i]);
|
||||
else
|
||||
setvar (varnames[i], &matches[1]);
|
||||
err = setvar (str, varnames[i], &matches[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,7 +90,7 @@ set_matches (char **varnames, char *str, grub_size_t nmatches,
|
||||
if (nmatches <= j || matches[j].rm_so == -1)
|
||||
grub_env_unset (p + 1);
|
||||
else
|
||||
setvar (p + 1, &matches[j]);
|
||||
err = setvar (str, p + 1, &matches[j]);
|
||||
}
|
||||
|
||||
if (err != GRUB_ERR_NONE)
|
||||
|
||||
@@ -42,23 +42,29 @@ struct cache_entry
|
||||
|
||||
static struct cache_entry *cache;
|
||||
|
||||
void
|
||||
FUNC_NAME (const char *key, const char *var, int no_floppy,
|
||||
char **hints, unsigned nhints)
|
||||
/* Context for FUNC_NAME. */
|
||||
struct search_ctx
|
||||
{
|
||||
int count = 0;
|
||||
int is_cache = 0;
|
||||
grub_fs_autoload_hook_t saved_autoload;
|
||||
const char *key;
|
||||
const char *var;
|
||||
int no_floppy;
|
||||
char **hints;
|
||||
unsigned nhints;
|
||||
int count;
|
||||
int is_cache;
|
||||
};
|
||||
|
||||
auto int iterate_device (const char *name);
|
||||
int iterate_device (const char *name)
|
||||
{
|
||||
int found = 0;
|
||||
/* Helper for FUNC_NAME. */
|
||||
static int
|
||||
iterate_device (const char *name, void *data)
|
||||
{
|
||||
struct search_ctx *ctx = data;
|
||||
int found = 0;
|
||||
|
||||
/* Skip floppy drives when requested. */
|
||||
if (no_floppy &&
|
||||
name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
|
||||
return 0;
|
||||
/* Skip floppy drives when requested. */
|
||||
if (ctx->no_floppy &&
|
||||
name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9')
|
||||
return 0;
|
||||
|
||||
#ifdef DO_SEARCH_FS_UUID
|
||||
#define compare_fn grub_strcasecmp
|
||||
@@ -67,34 +73,34 @@ FUNC_NAME (const char *key, const char *var, int no_floppy,
|
||||
#endif
|
||||
|
||||
#ifdef DO_SEARCH_FILE
|
||||
{
|
||||
char *buf;
|
||||
grub_file_t file;
|
||||
{
|
||||
char *buf;
|
||||
grub_file_t file;
|
||||
|
||||
buf = grub_xasprintf ("(%s)%s", name, key);
|
||||
if (! buf)
|
||||
return 1;
|
||||
buf = grub_xasprintf ("(%s)%s", name, ctx->key);
|
||||
if (! buf)
|
||||
return 1;
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (buf);
|
||||
if (file)
|
||||
{
|
||||
found = 1;
|
||||
grub_file_close (file);
|
||||
}
|
||||
grub_free (buf);
|
||||
}
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (buf);
|
||||
if (file)
|
||||
{
|
||||
found = 1;
|
||||
grub_file_close (file);
|
||||
}
|
||||
grub_free (buf);
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* SEARCH_FS_UUID or SEARCH_LABEL */
|
||||
grub_device_t dev;
|
||||
grub_fs_t fs;
|
||||
char *quid;
|
||||
{
|
||||
/* SEARCH_FS_UUID or SEARCH_LABEL */
|
||||
grub_device_t dev;
|
||||
grub_fs_t fs;
|
||||
char *quid;
|
||||
|
||||
dev = grub_device_open (name);
|
||||
if (dev)
|
||||
{
|
||||
fs = grub_fs_probe (dev);
|
||||
dev = grub_device_open (name);
|
||||
if (dev)
|
||||
{
|
||||
fs = grub_fs_probe (dev);
|
||||
|
||||
#ifdef DO_SEARCH_FS_UUID
|
||||
#define read_fn uuid
|
||||
@@ -102,173 +108,191 @@ FUNC_NAME (const char *key, const char *var, int no_floppy,
|
||||
#define read_fn label
|
||||
#endif
|
||||
|
||||
if (fs && fs->read_fn)
|
||||
{
|
||||
fs->read_fn (dev, &quid);
|
||||
if (fs && fs->read_fn)
|
||||
{
|
||||
fs->read_fn (dev, &quid);
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE && quid)
|
||||
{
|
||||
if (compare_fn (quid, key) == 0)
|
||||
found = 1;
|
||||
if (grub_errno == GRUB_ERR_NONE && quid)
|
||||
{
|
||||
if (compare_fn (quid, ctx->key) == 0)
|
||||
found = 1;
|
||||
|
||||
grub_free (quid);
|
||||
}
|
||||
}
|
||||
grub_free (quid);
|
||||
}
|
||||
}
|
||||
|
||||
grub_device_close (dev);
|
||||
}
|
||||
}
|
||||
grub_device_close (dev);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!is_cache && found && count == 0)
|
||||
{
|
||||
struct cache_entry *cache_ent;
|
||||
cache_ent = grub_malloc (sizeof (*cache_ent));
|
||||
if (cache_ent)
|
||||
{
|
||||
cache_ent->key = grub_strdup (key);
|
||||
cache_ent->value = grub_strdup (name);
|
||||
if (cache_ent->value && cache_ent->key)
|
||||
{
|
||||
cache_ent->next = cache;
|
||||
cache = cache_ent;
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_free (cache_ent->value);
|
||||
grub_free (cache_ent->key);
|
||||
grub_free (cache_ent);
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
if (!ctx->is_cache && found && ctx->count == 0)
|
||||
{
|
||||
struct cache_entry *cache_ent;
|
||||
cache_ent = grub_malloc (sizeof (*cache_ent));
|
||||
if (cache_ent)
|
||||
{
|
||||
cache_ent->key = grub_strdup (ctx->key);
|
||||
cache_ent->value = grub_strdup (name);
|
||||
if (cache_ent->value && cache_ent->key)
|
||||
{
|
||||
cache_ent->next = cache;
|
||||
cache = cache_ent;
|
||||
}
|
||||
else
|
||||
{
|
||||
grub_free (cache_ent->value);
|
||||
grub_free (cache_ent->key);
|
||||
grub_free (cache_ent);
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
if (found)
|
||||
{
|
||||
count++;
|
||||
if (var)
|
||||
grub_env_set (var, name);
|
||||
else
|
||||
grub_printf (" %s", name);
|
||||
}
|
||||
if (found)
|
||||
{
|
||||
ctx->count++;
|
||||
if (ctx->var)
|
||||
grub_env_set (ctx->var, name);
|
||||
else
|
||||
grub_printf (" %s", name);
|
||||
}
|
||||
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
return (found && var);
|
||||
}
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
return (found && ctx->var);
|
||||
}
|
||||
|
||||
auto int part_hook (grub_disk_t disk, const grub_partition_t partition);
|
||||
int part_hook (grub_disk_t disk, const grub_partition_t partition)
|
||||
{
|
||||
char *partition_name, *devname;
|
||||
int ret;
|
||||
/* Helper for FUNC_NAME. */
|
||||
static int
|
||||
part_hook (grub_disk_t disk, const grub_partition_t partition, void *data)
|
||||
{
|
||||
struct search_ctx *ctx = data;
|
||||
char *partition_name, *devname;
|
||||
int ret;
|
||||
|
||||
partition_name = grub_partition_get_name (partition);
|
||||
if (! partition_name)
|
||||
return 1;
|
||||
partition_name = grub_partition_get_name (partition);
|
||||
if (! partition_name)
|
||||
return 1;
|
||||
|
||||
devname = grub_xasprintf ("%s,%s", disk->name, partition_name);
|
||||
grub_free (partition_name);
|
||||
if (!devname)
|
||||
return 1;
|
||||
ret = iterate_device (devname);
|
||||
grub_free (devname);
|
||||
devname = grub_xasprintf ("%s,%s", disk->name, partition_name);
|
||||
grub_free (partition_name);
|
||||
if (!devname)
|
||||
return 1;
|
||||
ret = iterate_device (devname, ctx);
|
||||
grub_free (devname);
|
||||
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
auto void try (void);
|
||||
void try (void)
|
||||
{
|
||||
unsigned i;
|
||||
struct cache_entry **prev;
|
||||
struct cache_entry *cache_ent;
|
||||
/* Helper for FUNC_NAME. */
|
||||
static void
|
||||
try (struct search_ctx *ctx)
|
||||
{
|
||||
unsigned i;
|
||||
struct cache_entry **prev;
|
||||
struct cache_entry *cache_ent;
|
||||
|
||||
for (prev = &cache, cache_ent = *prev; cache_ent;
|
||||
prev = &cache_ent->next, cache_ent = *prev)
|
||||
if (compare_fn (cache_ent->key, key) == 0)
|
||||
break;
|
||||
if (cache_ent)
|
||||
{
|
||||
is_cache = 1;
|
||||
if (iterate_device (cache_ent->value))
|
||||
{
|
||||
is_cache = 0;
|
||||
for (prev = &cache, cache_ent = *prev; cache_ent;
|
||||
prev = &cache_ent->next, cache_ent = *prev)
|
||||
if (compare_fn (cache_ent->key, ctx->key) == 0)
|
||||
break;
|
||||
if (cache_ent)
|
||||
{
|
||||
ctx->is_cache = 1;
|
||||
if (iterate_device (cache_ent->value, ctx))
|
||||
{
|
||||
ctx->is_cache = 0;
|
||||
return;
|
||||
}
|
||||
ctx->is_cache = 0;
|
||||
/* Cache entry was outdated. Remove it. */
|
||||
if (!ctx->count)
|
||||
{
|
||||
grub_free (cache_ent->key);
|
||||
grub_free (cache_ent->value);
|
||||
grub_free (cache_ent);
|
||||
*prev = cache_ent->next;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ctx->nhints; i++)
|
||||
{
|
||||
char *end;
|
||||
if (!ctx->hints[i][0])
|
||||
continue;
|
||||
end = ctx->hints[i] + grub_strlen (ctx->hints[i]) - 1;
|
||||
if (*end == ',')
|
||||
*end = 0;
|
||||
if (iterate_device (ctx->hints[i], ctx))
|
||||
{
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
return;
|
||||
}
|
||||
if (!*end)
|
||||
{
|
||||
grub_device_t dev;
|
||||
int ret;
|
||||
dev = grub_device_open (ctx->hints[i]);
|
||||
if (!dev)
|
||||
{
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
continue;
|
||||
}
|
||||
if (!dev->disk)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
continue;
|
||||
}
|
||||
ret = grub_partition_iterate (dev->disk, part_hook, ctx);
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
grub_device_close (dev);
|
||||
if (ret)
|
||||
return;
|
||||
}
|
||||
is_cache = 0;
|
||||
/* Cache entry was outdated. Remove it. */
|
||||
if (!count)
|
||||
{
|
||||
grub_free (cache_ent->key);
|
||||
grub_free (cache_ent->value);
|
||||
grub_free (cache_ent);
|
||||
*prev = cache_ent->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
grub_device_iterate (iterate_device, ctx);
|
||||
}
|
||||
|
||||
for (i = 0; i < nhints; i++)
|
||||
{
|
||||
char *end;
|
||||
if (!hints[i][0])
|
||||
continue;
|
||||
end = hints[i] + grub_strlen (hints[i]) - 1;
|
||||
if (*end == ',')
|
||||
*end = 0;
|
||||
if (iterate_device (hints[i]))
|
||||
{
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
return;
|
||||
}
|
||||
if (!*end)
|
||||
{
|
||||
grub_device_t dev;
|
||||
int ret;
|
||||
dev = grub_device_open (hints[i]);
|
||||
if (!dev)
|
||||
{
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
continue;
|
||||
}
|
||||
if (!dev->disk)
|
||||
{
|
||||
grub_device_close (dev);
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
continue;
|
||||
}
|
||||
ret = grub_partition_iterate (dev->disk, part_hook);
|
||||
if (!*end)
|
||||
*end = ',';
|
||||
grub_device_close (dev);
|
||||
if (ret)
|
||||
return;
|
||||
}
|
||||
}
|
||||
grub_device_iterate (iterate_device);
|
||||
}
|
||||
void
|
||||
FUNC_NAME (const char *key, const char *var, int no_floppy,
|
||||
char **hints, unsigned nhints)
|
||||
{
|
||||
struct search_ctx ctx = {
|
||||
.key = key,
|
||||
.var = var,
|
||||
.no_floppy = no_floppy,
|
||||
.hints = hints,
|
||||
.nhints = nhints,
|
||||
.count = 0,
|
||||
.is_cache = 0
|
||||
};
|
||||
grub_fs_autoload_hook_t saved_autoload;
|
||||
|
||||
/* First try without autoloading if we're setting variable. */
|
||||
if (var)
|
||||
{
|
||||
saved_autoload = grub_fs_autoload_hook;
|
||||
grub_fs_autoload_hook = 0;
|
||||
try ();
|
||||
try (&ctx);
|
||||
|
||||
/* Restore autoload hook. */
|
||||
grub_fs_autoload_hook = saved_autoload;
|
||||
|
||||
/* Retry with autoload if nothing found. */
|
||||
if (grub_errno == GRUB_ERR_NONE && count == 0)
|
||||
try ();
|
||||
if (grub_errno == GRUB_ERR_NONE && ctx.count == 0)
|
||||
try (&ctx);
|
||||
}
|
||||
else
|
||||
try ();
|
||||
try (&ctx);
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE && count == 0)
|
||||
if (grub_errno == GRUB_ERR_NONE && ctx.count == 0)
|
||||
grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,8 +83,9 @@ static int regsize;
|
||||
static grub_uint16_t regaddr;
|
||||
static const char *varname;
|
||||
|
||||
static int NESTED_FUNC_ATTR
|
||||
grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
static int
|
||||
grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_uint32_t regval = 0;
|
||||
grub_pci_address_t addr;
|
||||
@@ -128,7 +129,7 @@ grub_setpci_iter (grub_pci_device_t dev, grub_pci_id_t pciid)
|
||||
|
||||
if (!write_mask)
|
||||
{
|
||||
grub_printf (_("Register %x of %d:%d.%d is %x\n"), regaddr,
|
||||
grub_printf (_("Register %x of %x:%02x.%x is %x\n"), regaddr,
|
||||
grub_pci_get_bus (dev),
|
||||
grub_pci_get_device (dev),
|
||||
grub_pci_get_function (dev),
|
||||
@@ -320,7 +321,7 @@ grub_cmd_setpci (grub_extcmd_context_t ctxt, int argc, char **argv)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"option -v isn't valid for writes");
|
||||
|
||||
grub_pci_iterate (grub_setpci_iter);
|
||||
grub_pci_iterate (grub_setpci_iter, NULL);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
@@ -330,7 +331,7 @@ GRUB_MOD_INIT(setpci)
|
||||
{
|
||||
cmd = grub_register_extcmd ("setpci", grub_cmd_setpci, 0,
|
||||
N_("[-s POSITION] [-d DEVICE] [-v VAR] "
|
||||
"[REGISTER][=VALUE[:MASK]]"),
|
||||
"REGISTER[=VALUE[:MASK]]"),
|
||||
N_("Manipulate PCI devices."), options);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ static const struct grub_arg_option options[] =
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static grub_uint16_t *pos;
|
||||
static struct grub_term_coordinate *pos;
|
||||
|
||||
static void
|
||||
do_print (int n)
|
||||
@@ -78,6 +78,8 @@ grub_cmd_sleep (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
grub_refresh ();
|
||||
|
||||
pos = grub_term_save_pos ();
|
||||
|
||||
for (; n; n--)
|
||||
|
||||
@@ -108,9 +108,9 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
||||
if (term)
|
||||
break;
|
||||
if (again)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("terminal `%s' isn't found"),
|
||||
args[i]);
|
||||
args[i]);
|
||||
for (aut = autoloads; aut; aut = aut->next)
|
||||
if (grub_strcmp (args[i], aut->name) == 0
|
||||
|| (grub_strcmp (args[i], "ofconsole") == 0
|
||||
@@ -126,6 +126,14 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
break;
|
||||
}
|
||||
if (grub_memcmp (args[i], "serial_usb",
|
||||
sizeof ("serial_usb") - 1) == 0
|
||||
&& grub_term_poll_usb)
|
||||
{
|
||||
grub_term_poll_usb (1);
|
||||
again = 1;
|
||||
continue;
|
||||
}
|
||||
if (!aut)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
N_("terminal `%s' isn't found"),
|
||||
|
||||
@@ -38,114 +38,125 @@ grub_strtosl (char *arg, char **end, int base)
|
||||
return grub_strtoul (arg, end, base);
|
||||
}
|
||||
|
||||
/* Context for test_parse. */
|
||||
struct test_parse_ctx
|
||||
{
|
||||
int invert;
|
||||
int or, and;
|
||||
int file_exists;
|
||||
struct grub_dirhook_info file_info;
|
||||
char *filename;
|
||||
};
|
||||
|
||||
/* Take care of discarding and inverting. */
|
||||
static void
|
||||
update_val (int val, struct test_parse_ctx *ctx)
|
||||
{
|
||||
ctx->and = ctx->and && (ctx->invert ? ! val : val);
|
||||
ctx->invert = 0;
|
||||
}
|
||||
|
||||
/* A hook for iterating directories. */
|
||||
static int
|
||||
find_file (const char *cur_filename, const struct grub_dirhook_info *info,
|
||||
void *data)
|
||||
{
|
||||
struct test_parse_ctx *ctx = data;
|
||||
|
||||
if ((info->case_insensitive ? grub_strcasecmp (cur_filename, ctx->filename)
|
||||
: grub_strcmp (cur_filename, ctx->filename)) == 0)
|
||||
{
|
||||
ctx->file_info = *info;
|
||||
ctx->file_exists = 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check if file exists and fetch its information. */
|
||||
static void
|
||||
get_fileinfo (char *path, struct test_parse_ctx *ctx)
|
||||
{
|
||||
char *pathname;
|
||||
char *device_name;
|
||||
grub_fs_t fs;
|
||||
grub_device_t dev;
|
||||
|
||||
ctx->file_exists = 0;
|
||||
device_name = grub_file_get_device_name (path);
|
||||
dev = grub_device_open (device_name);
|
||||
if (! dev)
|
||||
{
|
||||
grub_free (device_name);
|
||||
return;
|
||||
}
|
||||
|
||||
fs = grub_fs_probe (dev);
|
||||
if (! fs)
|
||||
{
|
||||
grub_free (device_name);
|
||||
grub_device_close (dev);
|
||||
return;
|
||||
}
|
||||
|
||||
pathname = grub_strchr (path, ')');
|
||||
if (! pathname)
|
||||
pathname = path;
|
||||
else
|
||||
pathname++;
|
||||
|
||||
/* Remove trailing '/'. */
|
||||
while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')
|
||||
pathname[grub_strlen (pathname) - 1] = 0;
|
||||
|
||||
/* Split into path and filename. */
|
||||
ctx->filename = grub_strrchr (pathname, '/');
|
||||
if (! ctx->filename)
|
||||
{
|
||||
path = grub_strdup ("/");
|
||||
ctx->filename = pathname;
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx->filename++;
|
||||
path = grub_strdup (pathname);
|
||||
path[ctx->filename - pathname] = 0;
|
||||
}
|
||||
|
||||
/* It's the whole device. */
|
||||
if (! *pathname)
|
||||
{
|
||||
ctx->file_exists = 1;
|
||||
grub_memset (&ctx->file_info, 0, sizeof (ctx->file_info));
|
||||
/* Root is always a directory. */
|
||||
ctx->file_info.dir = 1;
|
||||
|
||||
/* Fetch writing time. */
|
||||
ctx->file_info.mtimeset = 0;
|
||||
if (fs->mtime)
|
||||
{
|
||||
if (! fs->mtime (dev, &ctx->file_info.mtime))
|
||||
ctx->file_info.mtimeset = 1;
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
(fs->dir) (dev, path, find_file, ctx);
|
||||
|
||||
grub_device_close (dev);
|
||||
grub_free (path);
|
||||
grub_free (device_name);
|
||||
}
|
||||
|
||||
/* Parse a test expression starting from *argn. */
|
||||
static int
|
||||
test_parse (char **args, int *argn, int argc)
|
||||
{
|
||||
int ret = 0, discard = 0, invert = 0;
|
||||
int file_exists;
|
||||
struct grub_dirhook_info file_info;
|
||||
|
||||
auto void update_val (int val);
|
||||
auto void get_fileinfo (char *pathname);
|
||||
|
||||
/* Take care of discarding and inverting. */
|
||||
void update_val (int val)
|
||||
{
|
||||
if (! discard)
|
||||
ret = invert ? ! val : val;
|
||||
invert = discard = 0;
|
||||
}
|
||||
|
||||
/* Check if file exists and fetch its information. */
|
||||
void get_fileinfo (char *path)
|
||||
{
|
||||
char *filename, *pathname;
|
||||
char *device_name;
|
||||
grub_fs_t fs;
|
||||
grub_device_t dev;
|
||||
|
||||
/* A hook for iterating directories. */
|
||||
auto int find_file (const char *cur_filename,
|
||||
const struct grub_dirhook_info *info);
|
||||
int find_file (const char *cur_filename,
|
||||
const struct grub_dirhook_info *info)
|
||||
{
|
||||
if ((info->case_insensitive ? grub_strcasecmp (cur_filename, filename)
|
||||
: grub_strcmp (cur_filename, filename)) == 0)
|
||||
{
|
||||
file_info = *info;
|
||||
file_exists = 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
file_exists = 0;
|
||||
device_name = grub_file_get_device_name (path);
|
||||
dev = grub_device_open (device_name);
|
||||
if (! dev)
|
||||
{
|
||||
grub_free (device_name);
|
||||
return;
|
||||
}
|
||||
|
||||
fs = grub_fs_probe (dev);
|
||||
if (! fs)
|
||||
{
|
||||
grub_free (device_name);
|
||||
grub_device_close (dev);
|
||||
return;
|
||||
}
|
||||
|
||||
pathname = grub_strchr (path, ')');
|
||||
if (! pathname)
|
||||
pathname = path;
|
||||
else
|
||||
pathname++;
|
||||
|
||||
/* Remove trailing '/'. */
|
||||
while (*pathname && pathname[grub_strlen (pathname) - 1] == '/')
|
||||
pathname[grub_strlen (pathname) - 1] = 0;
|
||||
|
||||
/* Split into path and filename. */
|
||||
filename = grub_strrchr (pathname, '/');
|
||||
if (! filename)
|
||||
{
|
||||
path = grub_strdup ("/");
|
||||
filename = pathname;
|
||||
}
|
||||
else
|
||||
{
|
||||
filename++;
|
||||
path = grub_strdup (pathname);
|
||||
path[filename - pathname] = 0;
|
||||
}
|
||||
|
||||
/* It's the whole device. */
|
||||
if (! *pathname)
|
||||
{
|
||||
file_exists = 1;
|
||||
grub_memset (&file_info, 0, sizeof (file_info));
|
||||
/* Root is always a directory. */
|
||||
file_info.dir = 1;
|
||||
|
||||
/* Fetch writing time. */
|
||||
file_info.mtimeset = 0;
|
||||
if (fs->mtime)
|
||||
{
|
||||
if (! fs->mtime (dev, &file_info.mtime))
|
||||
file_info.mtimeset = 1;
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
(fs->dir) (dev, path, find_file);
|
||||
|
||||
grub_device_close (dev);
|
||||
grub_free (path);
|
||||
grub_free (device_name);
|
||||
}
|
||||
struct test_parse_ctx ctx = {
|
||||
.and = 1,
|
||||
.or = 0,
|
||||
.invert = 0
|
||||
};
|
||||
|
||||
/* Here we have the real parsing. */
|
||||
while (*argn < argc)
|
||||
@@ -157,14 +168,16 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "=") == 0
|
||||
|| grub_strcmp (args[*argn + 1], "==") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn + 1], "!=") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) != 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) != 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -172,28 +185,32 @@ test_parse (char **args, int *argn, int argc)
|
||||
/* GRUB extension: lexicographical sorting. */
|
||||
if (grub_strcmp (args[*argn + 1], "<") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) < 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) < 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn + 1], "<=") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn + 1], ">") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn + 1], ">=") == 0)
|
||||
{
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0);
|
||||
update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0,
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -202,7 +219,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-eq") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
== grub_strtosl (args[*argn + 2], 0, 0));
|
||||
== grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -210,7 +227,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-ge") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
>= grub_strtosl (args[*argn + 2], 0, 0));
|
||||
>= grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -218,7 +235,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-gt") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
> grub_strtosl (args[*argn + 2], 0, 0));
|
||||
> grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -226,7 +243,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-le") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
<= grub_strtosl (args[*argn + 2], 0, 0));
|
||||
<= grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -234,7 +251,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-lt") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
< grub_strtosl (args[*argn + 2], 0, 0));
|
||||
< grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -242,7 +259,7 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn + 1], "-ne") == 0)
|
||||
{
|
||||
update_val (grub_strtosl (args[*argn], 0, 0)
|
||||
!= grub_strtosl (args[*argn + 2], 0, 0));
|
||||
!= grub_strtosl (args[*argn + 2], 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -265,10 +282,10 @@ test_parse (char **args, int *argn, int argc)
|
||||
|
||||
if (grub_strcmp (args[*argn + 1], "-pgt") == 0)
|
||||
update_val (grub_strtoul (args[*argn] + i, 0, 0)
|
||||
> grub_strtoul (args[*argn + 2] + i, 0, 0));
|
||||
> grub_strtoul (args[*argn + 2] + i, 0, 0), &ctx);
|
||||
else
|
||||
update_val (grub_strtoul (args[*argn] + i, 0, 0)
|
||||
< grub_strtoul (args[*argn + 2] + i, 0, 0));
|
||||
< grub_strtoul (args[*argn + 2] + i, 0, 0), &ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -283,22 +300,24 @@ test_parse (char **args, int *argn, int argc)
|
||||
int bias = 0;
|
||||
|
||||
/* Fetch fileinfo. */
|
||||
get_fileinfo (args[*argn]);
|
||||
file1 = file_info;
|
||||
file1exists = file_exists;
|
||||
get_fileinfo (args[*argn + 2]);
|
||||
get_fileinfo (args[*argn], &ctx);
|
||||
file1 = ctx.file_info;
|
||||
file1exists = ctx.file_exists;
|
||||
get_fileinfo (args[*argn + 2], &ctx);
|
||||
|
||||
if (args[*argn + 1][3])
|
||||
bias = grub_strtosl (args[*argn + 1] + 3, 0, 0);
|
||||
|
||||
if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0)
|
||||
update_val ((file1exists && ! file_exists)
|
||||
|| (file1.mtimeset && file_info.mtimeset
|
||||
&& file1.mtime + bias > file_info.mtime));
|
||||
update_val ((file1exists && ! ctx.file_exists)
|
||||
|| (file1.mtimeset && ctx.file_info.mtimeset
|
||||
&& file1.mtime + bias > ctx.file_info.mtime),
|
||||
&ctx);
|
||||
else
|
||||
update_val ((! file1exists && file_exists)
|
||||
|| (file1.mtimeset && file_info.mtimeset
|
||||
&& file1.mtime + bias < file_info.mtime));
|
||||
update_val ((! file1exists && ctx.file_exists)
|
||||
|| (file1.mtimeset && ctx.file_info.mtimeset
|
||||
&& file1.mtime + bias < ctx.file_info.mtime),
|
||||
&ctx);
|
||||
(*argn) += 3;
|
||||
continue;
|
||||
}
|
||||
@@ -310,27 +329,27 @@ test_parse (char **args, int *argn, int argc)
|
||||
/* File tests. */
|
||||
if (grub_strcmp (args[*argn], "-d") == 0)
|
||||
{
|
||||
get_fileinfo (args[*argn + 1]);
|
||||
update_val (file_exists && file_info.dir);
|
||||
get_fileinfo (args[*argn + 1], &ctx);
|
||||
update_val (ctx.file_exists && ctx.file_info.dir, &ctx);
|
||||
(*argn) += 2;
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-e") == 0)
|
||||
{
|
||||
get_fileinfo (args[*argn + 1]);
|
||||
update_val (file_exists);
|
||||
get_fileinfo (args[*argn + 1], &ctx);
|
||||
update_val (ctx.file_exists, &ctx);
|
||||
(*argn) += 2;
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-f") == 0)
|
||||
{
|
||||
get_fileinfo (args[*argn + 1]);
|
||||
get_fileinfo (args[*argn + 1], &ctx);
|
||||
/* FIXME: check for other types. */
|
||||
update_val (file_exists && ! file_info.dir);
|
||||
update_val (ctx.file_exists && ! ctx.file_info.dir, &ctx);
|
||||
(*argn) += 2;
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "-s") == 0)
|
||||
@@ -338,25 +357,25 @@ test_parse (char **args, int *argn, int argc)
|
||||
grub_file_t file;
|
||||
grub_file_filter_disable_compression ();
|
||||
file = grub_file_open (args[*argn + 1]);
|
||||
update_val (file && (grub_file_size (file) != 0));
|
||||
update_val (file && (grub_file_size (file) != 0), &ctx);
|
||||
if (file)
|
||||
grub_file_close (file);
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
(*argn) += 2;
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
/* String tests. */
|
||||
if (grub_strcmp (args[*argn], "-n") == 0)
|
||||
{
|
||||
update_val (args[*argn + 1][0]);
|
||||
update_val (args[*argn + 1][0], &ctx);
|
||||
|
||||
(*argn) += 2;
|
||||
continue;
|
||||
}
|
||||
if (grub_strcmp (args[*argn], "-z") == 0)
|
||||
{
|
||||
update_val (! args[*argn + 1][0]);
|
||||
update_val (! args[*argn + 1][0], &ctx);
|
||||
(*argn) += 2;
|
||||
continue;
|
||||
}
|
||||
@@ -368,42 +387,40 @@ test_parse (char **args, int *argn, int argc)
|
||||
if (grub_strcmp (args[*argn], ")") == 0)
|
||||
{
|
||||
(*argn)++;
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
/* Recursively invoke if parenthesis. */
|
||||
if (grub_strcmp (args[*argn], "(") == 0)
|
||||
{
|
||||
(*argn)++;
|
||||
update_val (test_parse (args, argn, argc));
|
||||
update_val (test_parse (args, argn, argc), &ctx);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_strcmp (args[*argn], "!") == 0)
|
||||
{
|
||||
invert = ! invert;
|
||||
ctx.invert = ! ctx.invert;
|
||||
(*argn)++;
|
||||
continue;
|
||||
}
|
||||
if (grub_strcmp (args[*argn], "-a") == 0)
|
||||
{
|
||||
/* If current value is 0 second value is to be discarded. */
|
||||
discard = ! ret;
|
||||
(*argn)++;
|
||||
continue;
|
||||
}
|
||||
if (grub_strcmp (args[*argn], "-o") == 0)
|
||||
{
|
||||
/* If current value is 1 second value is to be discarded. */
|
||||
discard = ret;
|
||||
ctx.or = ctx.or || ctx.and;
|
||||
ctx.and = 1;
|
||||
(*argn)++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* No test found. Interpret if as just a string. */
|
||||
update_val (args[*argn][0]);
|
||||
update_val (args[*argn][0], &ctx);
|
||||
(*argn)++;
|
||||
}
|
||||
return ret;
|
||||
return ctx.or || ctx.and;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
|
||||
@@ -31,6 +31,17 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
/* Helper for grub_cmd_testload. */
|
||||
static void
|
||||
read_progress (grub_disk_addr_t sector __attribute__ ((unused)),
|
||||
unsigned offset __attribute__ ((unused)),
|
||||
unsigned len __attribute__ ((unused)),
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
grub_xputs (".");
|
||||
grub_refresh ();
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc, char *argv[])
|
||||
@@ -39,15 +50,6 @@ grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
|
||||
char *buf;
|
||||
grub_size_t size;
|
||||
grub_off_t pos;
|
||||
auto void NESTED_FUNC_ATTR read_func (grub_disk_addr_t sector, unsigned offset, unsigned len);
|
||||
|
||||
void NESTED_FUNC_ATTR read_func (grub_disk_addr_t sector __attribute__ ((unused)),
|
||||
unsigned offset __attribute__ ((unused)),
|
||||
unsigned len __attribute__ ((unused)))
|
||||
{
|
||||
grub_xputs (".");
|
||||
grub_refresh ();
|
||||
}
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
@@ -68,7 +70,7 @@ grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
|
||||
goto fail;
|
||||
|
||||
grub_printf ("Reading %s sequentially", argv[0]);
|
||||
file->read_hook = read_func;
|
||||
file->read_hook = read_progress;
|
||||
if (grub_file_read (file, buf, size) != (grub_ssize_t) size)
|
||||
goto fail;
|
||||
grub_printf (" Done.\n");
|
||||
|
||||
115
grub-core/commands/testspeed.c
Normal file
115
grub-core/commands/testspeed.c
Normal file
@@ -0,0 +1,115 @@
|
||||
/* testspeed.c - Command to test file read speed */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/mm.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/extcmd.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/normal.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
#define DEFAULT_BLOCK_SIZE 65536
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"size", 's', 0, N_("Specify size for each read operation"), 0, ARG_TYPE_INT},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_testspeed (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
struct grub_arg_list *state = ctxt->state;
|
||||
grub_uint64_t start;
|
||||
grub_uint64_t end;
|
||||
grub_ssize_t block_size;
|
||||
grub_disk_addr_t total_size;
|
||||
char *buffer;
|
||||
grub_file_t file;
|
||||
grub_uint64_t whole, fraction;
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
block_size = (state[0].set) ?
|
||||
grub_strtoul (state[0].arg, 0, 0) : DEFAULT_BLOCK_SIZE;
|
||||
|
||||
if (block_size <= 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid block size"));
|
||||
|
||||
buffer = grub_malloc (block_size);
|
||||
if (buffer == NULL)
|
||||
return grub_errno;
|
||||
|
||||
file = grub_file_open (args[0]);
|
||||
if (file == NULL)
|
||||
goto quit;
|
||||
|
||||
total_size = 0;
|
||||
start = grub_get_time_ms ();
|
||||
while (1)
|
||||
{
|
||||
grub_ssize_t size = grub_file_read (file, buffer, block_size);
|
||||
if (size <= 0)
|
||||
break;
|
||||
total_size += size;
|
||||
}
|
||||
end = grub_get_time_ms ();
|
||||
grub_file_close (file);
|
||||
|
||||
grub_printf_ (N_("File size: %s\n"),
|
||||
grub_get_human_size (total_size, GRUB_HUMAN_SIZE_NORMAL));
|
||||
whole = grub_divmod64 (end - start, 1000, &fraction);
|
||||
grub_printf_ (N_("Elapsed time: %d.%03d s \n"),
|
||||
(unsigned) whole,
|
||||
(unsigned) fraction);
|
||||
|
||||
if (end != start)
|
||||
{
|
||||
grub_uint64_t speed =
|
||||
grub_divmod64 (total_size * 100ULL * 1000ULL, end - start, 0);
|
||||
|
||||
grub_printf_ (N_("Speed: %s \n"),
|
||||
grub_get_human_size (speed,
|
||||
GRUB_HUMAN_SIZE_SPEED));
|
||||
}
|
||||
|
||||
quit:
|
||||
grub_free (buffer);
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_extcmd_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(testspeed)
|
||||
{
|
||||
cmd = grub_register_extcmd ("testspeed", grub_cmd_testspeed, 0, N_("[-s SIZE] FILENAME"),
|
||||
N_("Test file read speed."),
|
||||
options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(testspeed)
|
||||
{
|
||||
grub_unregister_extcmd (cmd);
|
||||
}
|
||||
126
grub-core/commands/tr.c
Normal file
126
grub-core/commands/tr.c
Normal file
@@ -0,0 +1,126 @@
|
||||
/* tr.c -- The tr command. */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2010,2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/dl.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/extcmd.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{ "set", 's', 0, N_("Variable name to update."), N_("VARNAME"), ARG_TYPE_STRING },
|
||||
{ "upcase", 'U', 0, N_("Translate to upper case."), 0, 0 },
|
||||
{ "downcase", 'D', 0, N_("Translate to lower case."), 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const char *letters_lowercase = "abcdefghijklmnopqrstuvwxyz";
|
||||
static const char *letters_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_tr (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
{
|
||||
char *var = 0;
|
||||
const char *input = 0;
|
||||
char *output = 0, *optr;
|
||||
const char *s1 = 0;
|
||||
const char *s2 = 0;
|
||||
const char *iptr;
|
||||
|
||||
/* Select the defaults from options. */
|
||||
if (ctxt->state[0].set) {
|
||||
var = ctxt->state[0].arg;
|
||||
input = grub_env_get (var);
|
||||
}
|
||||
|
||||
if (ctxt->state[1].set) {
|
||||
s1 = letters_lowercase;
|
||||
s2 = letters_uppercase;
|
||||
}
|
||||
|
||||
if (ctxt->state[2].set) {
|
||||
s1 = letters_uppercase;
|
||||
s2 = letters_lowercase;
|
||||
}
|
||||
|
||||
/* Check for arguments and update the defaults. */
|
||||
if (argc == 1)
|
||||
input = args[0];
|
||||
|
||||
else if (argc == 2) {
|
||||
s1 = args[0];
|
||||
s2 = args[1];
|
||||
|
||||
} else if (argc == 3) {
|
||||
s1 = args[0];
|
||||
s2 = args[1];
|
||||
input = args[2];
|
||||
|
||||
} else if (argc > 3)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many parameters");
|
||||
|
||||
if (argc <= 0 && (!s1 || !s2 || !input))
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing parameters");
|
||||
|
||||
if (grub_strlen (s1) != grub_strlen (s2))
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "set sizes did not match");
|
||||
|
||||
/* Translate input into output buffer. */
|
||||
|
||||
output = grub_malloc (grub_strlen (input) + 1);
|
||||
if (! output)
|
||||
return grub_errno;
|
||||
|
||||
optr = output;
|
||||
for (iptr = input; *iptr; iptr++)
|
||||
{
|
||||
char *p = grub_strchr (s1, *iptr);
|
||||
if (p)
|
||||
*optr++ = s2[p - s1];
|
||||
else
|
||||
*optr++ = *iptr;
|
||||
}
|
||||
*optr = '\0';
|
||||
|
||||
if (ctxt->state[0].set)
|
||||
grub_env_set (var, output);
|
||||
else
|
||||
grub_printf ("%s\n", output);
|
||||
|
||||
grub_free (output);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_extcmd_t cmd;
|
||||
|
||||
GRUB_MOD_INIT(tr)
|
||||
{
|
||||
cmd = grub_register_extcmd ("tr", grub_cmd_tr, 0, N_("[OPTIONS] [SET1] [SET2] [STRING]"),
|
||||
N_("Translate SET1 characters to SET2 in STRING."), options);
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(tr)
|
||||
{
|
||||
grub_unregister_extcmd (cmd);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ usb_print_str (const char *description, grub_usb_device_t dev, int idx)
|
||||
}
|
||||
|
||||
static int
|
||||
usb_iterate (grub_usb_device_t dev)
|
||||
usb_iterate (grub_usb_device_t dev, void *data __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_usb_desc_device *descdev;
|
||||
int i;
|
||||
@@ -196,10 +196,10 @@ grub_cmd_usbtest (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
grub_usb_poll_devices ();
|
||||
grub_usb_poll_devices (1);
|
||||
|
||||
grub_printf ("USB devices:\n\n");
|
||||
grub_usb_iterate (usb_iterate);
|
||||
grub_usb_iterate (usb_iterate, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
879
grub-core/commands/verify.c
Normal file
879
grub-core/commands/verify.c
Normal file
@@ -0,0 +1,879 @@
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB 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 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <grub/types.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/crypto.h>
|
||||
#include <grub/i18n.h>
|
||||
#include <grub/gcrypt/gcrypt.h>
|
||||
#include <grub/pubkey.h>
|
||||
#include <grub/env.h>
|
||||
#include <grub/kernel.h>
|
||||
#include <grub/extcmd.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
enum
|
||||
{
|
||||
OPTION_SKIP_SIG = 0
|
||||
};
|
||||
|
||||
static const struct grub_arg_option options[] =
|
||||
{
|
||||
{"skip-sig", 's', 0,
|
||||
N_("Skip signature-checking of the signature file."), 0, ARG_TYPE_NONE},
|
||||
{0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
static grub_err_t
|
||||
read_packet_header (grub_file_t sig, grub_uint8_t *out_type, grub_size_t *len)
|
||||
{
|
||||
grub_uint8_t type;
|
||||
grub_uint8_t l;
|
||||
grub_uint16_t l16;
|
||||
grub_uint32_t l32;
|
||||
|
||||
/* New format. */
|
||||
switch (grub_file_read (sig, &type, sizeof (type)))
|
||||
{
|
||||
case 1:
|
||||
break;
|
||||
case 0:
|
||||
{
|
||||
*out_type = 0xff;
|
||||
return 0;
|
||||
}
|
||||
default:
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
/* TRANSLATORS: it's about GNUPG signatures. */
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
}
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
*out_type = 0xfe;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(type & 0x80))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
if (type & 0x40)
|
||||
{
|
||||
*out_type = (type & 0x3f);
|
||||
if (grub_file_read (sig, &l, sizeof (l)) != 1)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
if (l < 192)
|
||||
{
|
||||
*len = l;
|
||||
return 0;
|
||||
}
|
||||
if (l < 224)
|
||||
{
|
||||
*len = (l - 192) << GRUB_CHAR_BIT;
|
||||
if (grub_file_read (sig, &l, sizeof (l)) != 1)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
*len |= l;
|
||||
return 0;
|
||||
}
|
||||
if (l == 255)
|
||||
{
|
||||
if (grub_file_read (sig, &l32, sizeof (l32)) != sizeof (l32))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
*len = grub_be_to_cpu32 (l32);
|
||||
return 0;
|
||||
}
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
}
|
||||
*out_type = ((type >> 2) & 0xf);
|
||||
switch (type & 0x3)
|
||||
{
|
||||
case 0:
|
||||
if (grub_file_read (sig, &l, sizeof (l)) != sizeof (l))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
*len = l;
|
||||
return 0;
|
||||
case 1:
|
||||
if (grub_file_read (sig, &l16, sizeof (l16)) != sizeof (l16))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
*len = grub_be_to_cpu16 (l16);
|
||||
return 0;
|
||||
case 2:
|
||||
if (grub_file_read (sig, &l32, sizeof (l32)) != sizeof (l32))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
*len = grub_be_to_cpu32 (l32);
|
||||
return 0;
|
||||
}
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
}
|
||||
|
||||
struct signature_v4_header
|
||||
{
|
||||
grub_uint8_t type;
|
||||
grub_uint8_t pkeyalgo;
|
||||
grub_uint8_t hash;
|
||||
grub_uint16_t hashed_sub;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
const char *hashes[] = {
|
||||
[0x01] = "md5",
|
||||
[0x02] = "sha1",
|
||||
[0x03] = "ripemd160",
|
||||
[0x08] = "sha256",
|
||||
[0x09] = "sha384",
|
||||
[0x0a] = "sha512",
|
||||
[0x0b] = "sha224"
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
const char *name;
|
||||
grub_size_t nmpisig;
|
||||
grub_size_t nmpipub;
|
||||
} pkalgos[] =
|
||||
{
|
||||
[1] = { "rsa", 1, 2 },
|
||||
[3] = { "rsa", 1, 2 },
|
||||
[17] = { "dsa", 2, 4 },
|
||||
};
|
||||
|
||||
struct grub_public_key
|
||||
{
|
||||
struct grub_public_key *next;
|
||||
struct grub_public_subkey *subkeys;
|
||||
};
|
||||
|
||||
struct grub_public_subkey
|
||||
{
|
||||
struct grub_public_subkey *next;
|
||||
grub_uint8_t type;
|
||||
grub_uint32_t fingerprint[5];
|
||||
gcry_mpi_t mpis[10];
|
||||
};
|
||||
|
||||
static void
|
||||
free_pk (struct grub_public_key *pk)
|
||||
{
|
||||
struct grub_public_subkey *nsk, *sk;
|
||||
for (sk = pk->subkeys; sk; sk = nsk)
|
||||
{
|
||||
nsk = sk->next;
|
||||
grub_free (sk);
|
||||
}
|
||||
grub_free (pk);
|
||||
}
|
||||
|
||||
struct grub_public_key *
|
||||
grub_load_public_key (grub_file_t f)
|
||||
{
|
||||
grub_err_t err;
|
||||
struct grub_public_key *ret;
|
||||
struct grub_public_subkey **last = 0;
|
||||
|
||||
ret = grub_zalloc (sizeof (*ret));
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
last = &ret->subkeys;
|
||||
|
||||
while (1)
|
||||
{
|
||||
grub_uint8_t type;
|
||||
grub_size_t len;
|
||||
grub_uint8_t v, pk;
|
||||
grub_uint32_t creation_time;
|
||||
grub_off_t pend;
|
||||
struct grub_public_subkey *sk;
|
||||
grub_size_t i;
|
||||
grub_uint16_t len_be;
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (fingerprint_context, GRUB_MD_SHA1->contextsize);
|
||||
|
||||
err = read_packet_header (f, &type, &len);
|
||||
|
||||
if (err)
|
||||
goto fail;
|
||||
if (type == 0xfe)
|
||||
continue;
|
||||
if (type == 0xff)
|
||||
return ret;
|
||||
|
||||
grub_dprintf ("crypt", "len = %x\n", (int) len);
|
||||
|
||||
pend = grub_file_tell (f) + len;
|
||||
if (type != 6 && type != 14
|
||||
&& type != 5 && type != 7)
|
||||
{
|
||||
grub_file_seek (f, pend);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (grub_file_read (f, &v, sizeof (v)) != sizeof (v))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_dprintf ("crypt", "v = %x\n", v);
|
||||
|
||||
if (v != 4)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
if (grub_file_read (f, &creation_time, sizeof (creation_time)) != sizeof (creation_time))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_dprintf ("crypt", "time = %x\n", creation_time);
|
||||
|
||||
if (grub_file_read (f, &pk, sizeof (pk)) != sizeof (pk))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
grub_dprintf ("crypt", "pk = %x\n", pk);
|
||||
|
||||
if (pk >= ARRAY_SIZE (pkalgos) || pkalgos[pk].name == NULL)
|
||||
{
|
||||
grub_file_seek (f, pend);
|
||||
continue;
|
||||
}
|
||||
|
||||
sk = grub_zalloc (sizeof (struct grub_public_subkey));
|
||||
if (!sk)
|
||||
goto fail;
|
||||
|
||||
grub_memset (fingerprint_context, 0, sizeof (fingerprint_context));
|
||||
GRUB_MD_SHA1->init (fingerprint_context);
|
||||
GRUB_MD_SHA1->write (fingerprint_context, "\x99", 1);
|
||||
len_be = grub_cpu_to_be16 (len);
|
||||
GRUB_MD_SHA1->write (fingerprint_context, &len_be, sizeof (len_be));
|
||||
GRUB_MD_SHA1->write (fingerprint_context, &v, sizeof (v));
|
||||
GRUB_MD_SHA1->write (fingerprint_context, &creation_time, sizeof (creation_time));
|
||||
GRUB_MD_SHA1->write (fingerprint_context, &pk, sizeof (pk));
|
||||
|
||||
for (i = 0; i < pkalgos[pk].nmpipub; i++)
|
||||
{
|
||||
grub_uint16_t l;
|
||||
grub_size_t lb;
|
||||
grub_uint8_t buffer[4096];
|
||||
if (grub_file_read (f, &l, sizeof (l)) != sizeof (l))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
lb = (grub_be_to_cpu16 (l) + GRUB_CHAR_BIT - 1) / GRUB_CHAR_BIT;
|
||||
if (lb > sizeof (buffer) - sizeof (grub_uint16_t))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
if (grub_file_read (f, buffer + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
grub_memcpy (buffer, &l, sizeof (l));
|
||||
|
||||
GRUB_MD_SHA1->write (fingerprint_context, buffer, lb + sizeof (grub_uint16_t));
|
||||
|
||||
if (gcry_mpi_scan (&sk->mpis[i], GCRYMPI_FMT_PGP,
|
||||
buffer, lb + sizeof (grub_uint16_t), 0))
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
GRUB_MD_SHA1->final (fingerprint_context);
|
||||
|
||||
grub_memcpy (sk->fingerprint, GRUB_MD_SHA1->read (fingerprint_context), 20);
|
||||
|
||||
*last = sk;
|
||||
last = &sk->next;
|
||||
|
||||
grub_dprintf ("crypt", "actual pos: %x, expected: %x\n", (int)grub_file_tell (f), (int)pend);
|
||||
|
||||
grub_file_seek (f, pend);
|
||||
}
|
||||
fail:
|
||||
free_pk (ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct grub_public_key *grub_pk_trusted;
|
||||
|
||||
struct grub_public_subkey *
|
||||
grub_crypto_pk_locate_subkey (grub_uint64_t keyid, struct grub_public_key *pkey)
|
||||
{
|
||||
struct grub_public_subkey *sk;
|
||||
for (sk = pkey->subkeys; sk; sk = sk->next)
|
||||
if (grub_memcmp (sk->fingerprint + 3, &keyid, 8) == 0)
|
||||
return sk;
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct grub_public_subkey *
|
||||
grub_crypto_pk_locate_subkey_in_trustdb (grub_uint64_t keyid)
|
||||
{
|
||||
struct grub_public_key *pkey;
|
||||
struct grub_public_subkey *sk;
|
||||
for (pkey = grub_pk_trusted; pkey; pkey = pkey->next)
|
||||
{
|
||||
sk = grub_crypto_pk_locate_subkey (keyid, pkey);
|
||||
if (sk)
|
||||
return sk;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_verify_signature_real (char *buf, grub_size_t size,
|
||||
grub_file_t f, grub_file_t sig,
|
||||
struct grub_public_key *pkey)
|
||||
{
|
||||
grub_size_t len;
|
||||
grub_uint8_t v;
|
||||
grub_uint8_t h;
|
||||
grub_uint8_t t;
|
||||
grub_uint8_t pk;
|
||||
const gcry_md_spec_t *hash;
|
||||
struct signature_v4_header v4;
|
||||
grub_err_t err;
|
||||
grub_size_t i;
|
||||
gcry_mpi_t mpis[10];
|
||||
grub_uint8_t type;
|
||||
|
||||
err = read_packet_header (sig, &type, &len);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (type != 0x2)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
if (grub_file_read (sig, &v, sizeof (v)) != sizeof (v))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
if (v != 4)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
if (grub_file_read (sig, &v4, sizeof (v4)) != sizeof (v4))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
h = v4.hash;
|
||||
t = v4.type;
|
||||
pk = v4.pkeyalgo;
|
||||
|
||||
if (t != 0)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
if (h >= ARRAY_SIZE (hashes) || hashes[h] == NULL)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, "unknown hash");
|
||||
|
||||
if (pk >= ARRAY_SIZE (pkalgos) || pkalgos[pk].name == NULL)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
hash = grub_crypto_lookup_md_by_name (hashes[h]);
|
||||
if (!hash)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, "hash `%s' not loaded", hashes[h]);
|
||||
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
|
||||
{
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (context, hash->contextsize);
|
||||
unsigned char *hval;
|
||||
grub_ssize_t rem = grub_be_to_cpu16 (v4.hashed_sub);
|
||||
grub_uint32_t headlen = grub_cpu_to_be32 (rem + 6);
|
||||
grub_uint8_t s;
|
||||
grub_uint16_t unhashed_sub;
|
||||
grub_ssize_t r;
|
||||
grub_uint8_t hash_start[2];
|
||||
gcry_mpi_t hmpi;
|
||||
grub_uint64_t keyid = 0;
|
||||
struct grub_public_subkey *sk;
|
||||
|
||||
grub_memset (context, 0, sizeof (context));
|
||||
hash->init (context);
|
||||
if (buf)
|
||||
hash->write (context, buf, size);
|
||||
else
|
||||
while (1)
|
||||
{
|
||||
grub_uint8_t readbuf[4096];
|
||||
r = grub_file_read (f, readbuf, sizeof (readbuf));
|
||||
if (r < 0)
|
||||
return grub_errno;
|
||||
if (r == 0)
|
||||
break;
|
||||
hash->write (context, readbuf, r);
|
||||
}
|
||||
|
||||
hash->write (context, &v, sizeof (v));
|
||||
hash->write (context, &v4, sizeof (v4));
|
||||
while (rem)
|
||||
{
|
||||
grub_uint8_t readbuf[4096];
|
||||
r = grub_file_read (sig, readbuf, rem < (grub_ssize_t) sizeof (readbuf) ? rem : (grub_ssize_t) sizeof (readbuf));
|
||||
if (r < 0)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
if (r == 0)
|
||||
break;
|
||||
hash->write (context, readbuf, r);
|
||||
rem -= r;
|
||||
}
|
||||
hash->write (context, &v, sizeof (v));
|
||||
s = 0xff;
|
||||
hash->write (context, &s, sizeof (s));
|
||||
hash->write (context, &headlen, sizeof (headlen));
|
||||
r = grub_file_read (sig, &unhashed_sub, sizeof (unhashed_sub));
|
||||
if (r != sizeof (unhashed_sub))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
{
|
||||
grub_uint8_t readbuf[4096];
|
||||
grub_uint8_t *ptr;
|
||||
grub_uint32_t l;
|
||||
rem = grub_be_to_cpu16 (unhashed_sub);
|
||||
if (rem > (int) sizeof (readbuf))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
r = grub_file_read (sig, readbuf, rem);
|
||||
if (r != rem)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
for (ptr = readbuf; ptr < readbuf + rem; ptr += l)
|
||||
{
|
||||
if (*ptr < 192)
|
||||
l = *ptr++;
|
||||
else if (*ptr < 255)
|
||||
{
|
||||
if (ptr + 1 >= readbuf + rem)
|
||||
break;
|
||||
l = (((ptr[0] & ~192) << GRUB_CHAR_BIT) | ptr[1]) + 192;
|
||||
ptr += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ptr + 5 >= readbuf + rem)
|
||||
break;
|
||||
l = grub_be_to_cpu32 (grub_get_unaligned32 (ptr + 1));
|
||||
ptr += 5;
|
||||
}
|
||||
if (*ptr == 0x10 && l >= 8)
|
||||
keyid = grub_get_unaligned64 (ptr + 1);
|
||||
}
|
||||
}
|
||||
|
||||
hash->final (context);
|
||||
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
|
||||
hval = hash->read (context);
|
||||
|
||||
if (grub_file_read (sig, hash_start, sizeof (hash_start)) != sizeof (hash_start))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
if (grub_memcmp (hval, hash_start, sizeof (hash_start)) != 0)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
|
||||
grub_dprintf ("crypt", "@ %x\n", (int)grub_file_tell (sig));
|
||||
|
||||
for (i = 0; i < pkalgos[pk].nmpisig; i++)
|
||||
{
|
||||
grub_uint16_t l;
|
||||
grub_size_t lb;
|
||||
grub_uint8_t buffer[4096];
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
if (grub_file_read (sig, &l, sizeof (l)) != sizeof (l))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
lb = (grub_be_to_cpu16 (l) + 7) / 8;
|
||||
grub_dprintf ("crypt", "l = 0x%04x\n", grub_be_to_cpu16 (l));
|
||||
if (lb > sizeof (buffer) - sizeof (grub_uint16_t))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
if (grub_file_read (sig, buffer + sizeof (grub_uint16_t), lb) != (grub_ssize_t) lb)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
grub_memcpy (buffer, &l, sizeof (l));
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
|
||||
if (gcry_mpi_scan (&mpis[i], GCRYMPI_FMT_PGP,
|
||||
buffer, lb + sizeof (grub_uint16_t), 0))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
}
|
||||
|
||||
if (pkey)
|
||||
sk = grub_crypto_pk_locate_subkey (keyid, pkey);
|
||||
else
|
||||
sk = grub_crypto_pk_locate_subkey_in_trustdb (keyid);
|
||||
if (!sk)
|
||||
/* TRANSLATORS: %08x is 32-bit key id. */
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("public key %08x not found"), keyid);
|
||||
|
||||
unsigned nbits = gcry_mpi_get_nbits (sk->mpis[1]);
|
||||
grub_dprintf ("crypt", "must be %u bits got %d bits\n", nbits,
|
||||
(int)(8 * hash->mdlen));
|
||||
|
||||
if (gcry_mpi_scan (&hmpi, GCRYMPI_FMT_USG, hval,
|
||||
nbits / 8 < (unsigned) hash->mdlen ? nbits / 8
|
||||
: (unsigned) hash->mdlen, 0))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
if (!grub_crypto_pk_dsa)
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("module `%s' isn't loaded"), "gcry_dsa");
|
||||
if (grub_crypto_pk_dsa->verify (0, hmpi, mpis, sk->mpis, 0, 0))
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("bad signature"));
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
grub_verify_signature (grub_file_t f, grub_file_t sig,
|
||||
struct grub_public_key *pkey)
|
||||
{
|
||||
return grub_verify_signature_real (0, 0, f, sig, pkey);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_trust (grub_extcmd_context_t ctxt,
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_file_t pkf;
|
||||
struct grub_public_key *pk = NULL;
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
grub_file_filter_disable_compression ();
|
||||
if (ctxt->state[OPTION_SKIP_SIG].set)
|
||||
grub_file_filter_disable_pubkey ();
|
||||
pkf = grub_file_open (args[0]);
|
||||
if (!pkf)
|
||||
return grub_errno;
|
||||
pk = grub_load_public_key (pkf);
|
||||
if (!pk)
|
||||
{
|
||||
grub_file_close (pkf);
|
||||
return grub_errno;
|
||||
}
|
||||
grub_file_close (pkf);
|
||||
|
||||
pk->next = grub_pk_trusted;
|
||||
grub_pk_trusted = pk;
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_list (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc __attribute__ ((unused)),
|
||||
char **args __attribute__ ((unused)))
|
||||
{
|
||||
struct grub_public_key *pk = NULL;
|
||||
struct grub_public_subkey *sk = NULL;
|
||||
|
||||
for (pk = grub_pk_trusted; pk; pk = pk->next)
|
||||
for (sk = pk->subkeys; sk; sk = sk->next)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < 20; i += 2)
|
||||
grub_printf ("%02x%02x ", ((grub_uint8_t *) sk->fingerprint)[i],
|
||||
((grub_uint8_t *) sk->fingerprint)[i + 1]);
|
||||
grub_printf ("\n");
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_distrust (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_uint32_t keyid, keyid_be;
|
||||
struct grub_public_key **pkey;
|
||||
struct grub_public_subkey *sk;
|
||||
|
||||
if (argc < 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
keyid = grub_strtoull (args[0], 0, 16);
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
keyid_be = grub_cpu_to_be32 (keyid);
|
||||
|
||||
for (pkey = &grub_pk_trusted; *pkey; pkey = &((*pkey)->next))
|
||||
{
|
||||
struct grub_public_key *next;
|
||||
for (sk = (*pkey)->subkeys; sk; sk = sk->next)
|
||||
if (grub_memcmp (sk->fingerprint + 4, &keyid_be, 4) == 0)
|
||||
break;
|
||||
if (!sk)
|
||||
continue;
|
||||
next = (*pkey)->next;
|
||||
free_pk (*pkey);
|
||||
*pkey = next;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
/* TRANSLATORS: %08x is 32-bit key id. */
|
||||
return grub_error (GRUB_ERR_BAD_SIGNATURE, N_("public key %08x not found"), keyid);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_verify_signature (grub_extcmd_context_t ctxt,
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_file_t f, sig;
|
||||
grub_err_t err;
|
||||
struct grub_public_key *pk = NULL;
|
||||
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
|
||||
if (argc < 2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("two arguments expected"));
|
||||
|
||||
grub_dprintf ("crypt", "alive\n");
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
grub_file_t pkf;
|
||||
grub_file_filter_disable_compression ();
|
||||
if (ctxt->state[OPTION_SKIP_SIG].set)
|
||||
grub_file_filter_disable_pubkey ();
|
||||
pkf = grub_file_open (args[2]);
|
||||
if (!pkf)
|
||||
return grub_errno;
|
||||
pk = grub_load_public_key (pkf);
|
||||
if (!pk)
|
||||
{
|
||||
grub_file_close (pkf);
|
||||
return grub_errno;
|
||||
}
|
||||
grub_file_close (pkf);
|
||||
}
|
||||
|
||||
grub_file_filter_disable_all ();
|
||||
f = grub_file_open (args[0]);
|
||||
if (!f)
|
||||
return grub_errno;
|
||||
|
||||
grub_file_filter_disable_all ();
|
||||
sig = grub_file_open (args[1]);
|
||||
if (!sig)
|
||||
{
|
||||
grub_file_close (f);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
err = grub_verify_signature (f, sig, pk);
|
||||
grub_file_close (f);
|
||||
grub_file_close (sig);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int sec = 0;
|
||||
|
||||
static grub_ssize_t
|
||||
verified_read (struct grub_file *file, char *buf, grub_size_t len)
|
||||
{
|
||||
grub_memcpy (buf, (char *) file->data + file->offset, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
verified_close (struct grub_file *file)
|
||||
{
|
||||
grub_free (file->data);
|
||||
file->data = 0;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
struct grub_fs verified_fs =
|
||||
{
|
||||
.name = "verified_read",
|
||||
.read = verified_read,
|
||||
.close = verified_close
|
||||
};
|
||||
|
||||
static grub_file_t
|
||||
grub_pubkey_open (grub_file_t io, const char *filename)
|
||||
{
|
||||
grub_file_t sig;
|
||||
char *fsuf, *ptr;
|
||||
grub_err_t err;
|
||||
grub_file_filter_t curfilt[GRUB_FILE_FILTER_MAX];
|
||||
grub_file_t ret;
|
||||
|
||||
if (!sec)
|
||||
return io;
|
||||
if (io->device->disk && io->device->disk->id == GRUB_DISK_DEVICE_MEMDISK_ID)
|
||||
return io;
|
||||
fsuf = grub_malloc (grub_strlen (filename) + sizeof (".sig"));
|
||||
if (!fsuf)
|
||||
return NULL;
|
||||
ptr = grub_stpcpy (fsuf, filename);
|
||||
grub_memcpy (ptr, ".sig", sizeof (".sig"));
|
||||
|
||||
grub_memcpy (curfilt, grub_file_filters_enabled,
|
||||
sizeof (curfilt));
|
||||
grub_file_filter_disable_all ();
|
||||
sig = grub_file_open (fsuf);
|
||||
grub_memcpy (grub_file_filters_enabled, curfilt,
|
||||
sizeof (curfilt));
|
||||
grub_free (fsuf);
|
||||
if (!sig)
|
||||
return NULL;
|
||||
|
||||
ret = grub_malloc (sizeof (*ret));
|
||||
if (!ret)
|
||||
return NULL;
|
||||
*ret = *io;
|
||||
|
||||
ret->fs = &verified_fs;
|
||||
ret->not_easily_seekable = 0;
|
||||
if (ret->size >> (sizeof (grub_size_t) * GRUB_CHAR_BIT - 1))
|
||||
{
|
||||
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
"big file signature isn't implemented yet");
|
||||
return NULL;
|
||||
}
|
||||
ret->data = grub_malloc (ret->size);
|
||||
if (!ret->data)
|
||||
{
|
||||
grub_free (ret);
|
||||
return NULL;
|
||||
}
|
||||
if (grub_file_read (io, ret->data, ret->size) != (grub_ssize_t) ret->size)
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_FILE_READ_ERROR, N_("premature end of file %s"),
|
||||
filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err = grub_verify_signature_real (ret->data, ret->size, 0, sig, NULL);
|
||||
grub_file_close (sig);
|
||||
if (err)
|
||||
return NULL;
|
||||
io->device = 0;
|
||||
grub_file_close (io);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *
|
||||
grub_env_write_sec (struct grub_env_var *var __attribute__ ((unused)),
|
||||
const char *val)
|
||||
{
|
||||
sec = (*val == '1') || (*val == 'e');
|
||||
return grub_strdup (sec ? "enforce" : "no");
|
||||
}
|
||||
|
||||
static grub_ssize_t
|
||||
pseudo_read (struct grub_file *file, char *buf, grub_size_t len)
|
||||
{
|
||||
grub_memcpy (buf, (grub_uint8_t *) file->data + file->offset, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/* Filesystem descriptor. */
|
||||
struct grub_fs pseudo_fs =
|
||||
{
|
||||
.name = "pseudo",
|
||||
.read = pseudo_read
|
||||
};
|
||||
|
||||
struct gcry_pk_spec *grub_crypto_pk_dsa;
|
||||
struct gcry_pk_spec *grub_crypto_pk_ecdsa;
|
||||
struct gcry_pk_spec *grub_crypto_pk_rsa;
|
||||
|
||||
static grub_extcmd_t cmd, cmd_trust;
|
||||
static grub_command_t cmd_distrust, cmd_list;
|
||||
|
||||
GRUB_MOD_INIT(verify)
|
||||
{
|
||||
const char *val;
|
||||
struct grub_module_header *header;
|
||||
|
||||
val = grub_env_get ("check_signatures");
|
||||
if (val && (val[0] == '1' || val[0] == 'e'))
|
||||
sec = 1;
|
||||
else
|
||||
sec = 0;
|
||||
|
||||
grub_file_filter_register (GRUB_FILE_FILTER_PUBKEY, grub_pubkey_open);
|
||||
|
||||
grub_register_variable_hook ("check_signatures", 0, grub_env_write_sec);
|
||||
grub_env_export ("check_signatures");
|
||||
|
||||
grub_pk_trusted = 0;
|
||||
FOR_MODULES (header)
|
||||
{
|
||||
struct grub_file pseudo_file;
|
||||
struct grub_public_key *pk = NULL;
|
||||
|
||||
grub_memset (&pseudo_file, 0, sizeof (pseudo_file));
|
||||
|
||||
/* Not an ELF module, skip. */
|
||||
if (header->type != OBJ_TYPE_PUBKEY)
|
||||
continue;
|
||||
|
||||
pseudo_file.fs = &pseudo_fs;
|
||||
pseudo_file.size = (header->size - sizeof (struct grub_module_header));
|
||||
pseudo_file.data = (char *) header + sizeof (struct grub_module_header);
|
||||
|
||||
pk = grub_load_public_key (&pseudo_file);
|
||||
if (!pk)
|
||||
grub_fatal ("error loading initial key: %s\n", grub_errmsg);
|
||||
|
||||
pk->next = grub_pk_trusted;
|
||||
grub_pk_trusted = pk;
|
||||
}
|
||||
|
||||
if (!val)
|
||||
grub_env_set ("check_signatures", grub_pk_trusted ? "enforce" : "no");
|
||||
|
||||
cmd = grub_register_extcmd ("verify_detached", grub_cmd_verify_signature, 0,
|
||||
N_("[-s|--skip-sig] FILE SIGNATURE_FILE [PUBKEY_FILE]"),
|
||||
N_("Verify detached signature."),
|
||||
options);
|
||||
cmd_trust = grub_register_extcmd ("trust", grub_cmd_trust, 0,
|
||||
N_("[-s|--skip-sig] PUBKEY_FILE"),
|
||||
N_("Add PKFILE to trusted keys."),
|
||||
options);
|
||||
cmd_list = grub_register_command ("list_trusted", grub_cmd_list,
|
||||
0,
|
||||
N_("List trusted keys."));
|
||||
cmd_distrust = grub_register_command ("distrust", grub_cmd_distrust,
|
||||
N_("PUBKEY_ID"),
|
||||
N_("Remove KEYID from trusted keys."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(verify)
|
||||
{
|
||||
grub_file_filter_unregister (GRUB_FILE_FILTER_PUBKEY);
|
||||
grub_unregister_extcmd (cmd);
|
||||
grub_unregister_extcmd (cmd_trust);
|
||||
grub_unregister_command (cmd_list);
|
||||
grub_unregister_command (cmd_distrust);
|
||||
}
|
||||
@@ -27,23 +27,28 @@
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static unsigned height, width, depth;
|
||||
static struct grub_video_mode_info *current_mode;
|
||||
struct hook_ctx
|
||||
{
|
||||
unsigned height, width, depth;
|
||||
struct grub_video_mode_info *current_mode;
|
||||
};
|
||||
|
||||
static int
|
||||
hook (const struct grub_video_mode_info *info)
|
||||
hook (const struct grub_video_mode_info *info, void *hook_arg)
|
||||
{
|
||||
if (height && width && (info->width != width || info->height != height))
|
||||
struct hook_ctx *ctx = hook_arg;
|
||||
|
||||
if (ctx->height && ctx->width && (info->width != ctx->width || info->height != ctx->height))
|
||||
return 0;
|
||||
|
||||
if (depth && info->bpp != depth)
|
||||
if (ctx->depth && info->bpp != ctx->depth)
|
||||
return 0;
|
||||
|
||||
if (info->mode_number == GRUB_VIDEO_MODE_NUMBER_INVALID)
|
||||
grub_printf (" ");
|
||||
else
|
||||
{
|
||||
if (current_mode && info->mode_number == current_mode->mode_number)
|
||||
if (ctx->current_mode && info->mode_number == ctx->current_mode->mode_number)
|
||||
grub_printf ("*");
|
||||
else
|
||||
grub_printf (" ");
|
||||
@@ -68,9 +73,9 @@ hook (const struct grub_video_mode_info *info)
|
||||
info->blue_field_pos,
|
||||
info->reserved_field_pos);
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)
|
||||
/* TRANSLATORS: In "packed pixel" mode you write the index of the color
|
||||
in the palette. Synonyms include "paletted color". */
|
||||
grub_xputs (_("Packed pixel "));
|
||||
/* TRANSLATORS: In "paletted color" mode you write the index of the color
|
||||
in the palette. Synonyms include "packed pixel". */
|
||||
grub_xputs (_("Paletted "));
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_YUV)
|
||||
grub_xputs (_("YUV "));
|
||||
if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PLANAR)
|
||||
@@ -126,13 +131,14 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)),
|
||||
{
|
||||
grub_video_adapter_t adapter;
|
||||
grub_video_driver_id_t id;
|
||||
struct hook_ctx ctx;
|
||||
|
||||
height = width = depth = 0;
|
||||
ctx.height = ctx.width = ctx.depth = 0;
|
||||
if (argc)
|
||||
{
|
||||
char *ptr;
|
||||
ptr = args[0];
|
||||
width = grub_strtoul (ptr, &ptr, 0);
|
||||
ctx.width = grub_strtoul (ptr, &ptr, 0);
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr != 'x')
|
||||
@@ -140,13 +146,13 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)),
|
||||
N_("invalid video mode specification `%s'"),
|
||||
args[0]);
|
||||
ptr++;
|
||||
height = grub_strtoul (ptr, &ptr, 0);
|
||||
ctx.height = grub_strtoul (ptr, &ptr, 0);
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
if (*ptr == 'x')
|
||||
{
|
||||
ptr++;
|
||||
depth = grub_strtoul (ptr, &ptr, 0);
|
||||
ctx.depth = grub_strtoul (ptr, &ptr, 0);
|
||||
if (grub_errno)
|
||||
return grub_errno;
|
||||
}
|
||||
@@ -175,12 +181,12 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)),
|
||||
continue;
|
||||
}
|
||||
|
||||
current_mode = NULL;
|
||||
ctx.current_mode = NULL;
|
||||
|
||||
if (adapter->id == id)
|
||||
{
|
||||
if (grub_video_get_info (&info) == GRUB_ERR_NONE)
|
||||
current_mode = &info;
|
||||
ctx.current_mode = &info;
|
||||
else
|
||||
/* Don't worry about errors. */
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
@@ -198,14 +204,14 @@ grub_cmd_videoinfo (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (adapter->print_adapter_specific_info)
|
||||
adapter->print_adapter_specific_info ();
|
||||
|
||||
adapter->iterate (hook);
|
||||
adapter->iterate (hook, &ctx);
|
||||
|
||||
if (adapter->get_edid && adapter->get_edid (&edid_info) == GRUB_ERR_NONE)
|
||||
print_edid (&edid_info);
|
||||
else
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
||||
current_mode = NULL;
|
||||
ctx.current_mode = NULL;
|
||||
|
||||
if (adapter->id != id)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user