mirror of
http://cgit.git.savannah.gnu.org/git/grub.git
synced 2026-04-28 14:33:34 +00:00
Compare commits
1384 Commits
2.00
...
phcoder/ar
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67a51e8e15 | ||
|
|
5ff249072d | ||
|
|
0277eab701 | ||
|
|
4861b6c851 | ||
|
|
3100cdc7f9 | ||
|
|
ad73cc3312 | ||
|
|
4182262560 | ||
|
|
896f483d49 | ||
|
|
8c534b85f1 | ||
|
|
a846dd4b3a | ||
|
|
aa437b5890 | ||
|
|
b0f311f412 | ||
|
|
59b38922a1 | ||
|
|
0480665b9d | ||
|
|
bbeee1c4a3 | ||
|
|
e5ed2f6947 | ||
|
|
4a73746a04 | ||
|
|
382b500ebe | ||
|
|
3a82f8bb48 | ||
|
|
e3046431da | ||
|
|
bdb6090d83 | ||
|
|
b73b70ebca | ||
|
|
8a3f0a24b5 | ||
|
|
6f07c4e407 | ||
|
|
60d5e9cbd9 | ||
|
|
cd15c394cc | ||
|
|
bb6e299ccb | ||
|
|
85eb579ad9 | ||
|
|
47f88cc94e | ||
|
|
40b5739ff9 | ||
|
|
234d93464a | ||
|
|
0c0eab527f | ||
|
|
44d4884779 | ||
|
|
10955cda06 | ||
|
|
f315b508ae | ||
|
|
9e4e6ddfbf | ||
|
|
5037aa9a7b | ||
|
|
8a952d20d1 | ||
|
|
b29b77fee2 | ||
|
|
be0d45555e | ||
|
|
d74b9a1d1a | ||
|
|
35de6d4bac | ||
|
|
ce55ed0389 | ||
|
|
f70ab525f9 | ||
|
|
9b70860ecc | ||
|
|
095588ef34 | ||
|
|
2dbda2215c | ||
|
|
53cc63bf85 | ||
|
|
471b2683e7 | ||
|
|
8ddf84bfb8 | ||
|
|
fd0df6d098 | ||
|
|
69ca97c820 | ||
|
|
eec893ae49 | ||
|
|
621e167fd6 | ||
|
|
d54f647a4a | ||
|
|
c8a0f1b229 | ||
|
|
726409a513 | ||
|
|
422e6e886c | ||
|
|
af1faca3f8 | ||
|
|
469021b4b3 | ||
|
|
83c256ba42 | ||
|
|
b67422d33d | ||
|
|
827d87e9d6 | ||
|
|
8f236c1419 | ||
|
|
2d76b4d81e | ||
|
|
4f9541226c | ||
|
|
b1f742c103 | ||
|
|
16ef26fd3a | ||
|
|
cf8c80ff77 | ||
|
|
5c7206e45e | ||
|
|
fc3f2b72cd | ||
|
|
34b2003def | ||
|
|
7e90f5ad25 | ||
|
|
ab4f15013a | ||
|
|
1e4b358720 | ||
|
|
9208367d3f | ||
|
|
67b9b7afd7 | ||
|
|
c2b70d0981 | ||
|
|
bee1b5ce3f | ||
|
|
07e3b04742 | ||
|
|
ebd289335a | ||
|
|
d2f7902af0 | ||
|
|
1005bed722 | ||
|
|
d6c92cdc34 | ||
|
|
61e1b9a49d | ||
|
|
c98dd165b0 | ||
|
|
ff1c277ef8 | ||
|
|
c8f7614b98 | ||
|
|
246a434f61 | ||
|
|
5c066a81c2 | ||
|
|
78f961efe9 | ||
|
|
09bc0a577d | ||
|
|
b700a427d2 | ||
|
|
4480b95dcd | ||
|
|
e77c81f6f8 | ||
|
|
971dbee521 | ||
|
|
6f2e82be3a | ||
|
|
9eec9699b9 | ||
|
|
5ae5c54c7e | ||
|
|
7b04fe6c9e | ||
|
|
e67566ce0a | ||
|
|
f93ddcfd1c | ||
|
|
1bba40f578 | ||
|
|
f65e14dc3a | ||
|
|
14a94bba6f | ||
|
|
8109c5d4e2 | ||
|
|
a92b5cb8d8 | ||
|
|
4a23e2fe29 | ||
|
|
a3ba74104e | ||
|
|
e1c22419ac | ||
|
|
189090cee9 | ||
|
|
1a5b7b404f | ||
|
|
9cf12b20af | ||
|
|
63a45330cb | ||
|
|
4a0aaad022 | ||
|
|
095bb1bfa5 | ||
|
|
3937bd962b | ||
|
|
ddb3efc906 | ||
|
|
4e42521d8c | ||
|
|
054efe541f | ||
|
|
a0e1befb57 | ||
|
|
c36c73f681 | ||
|
|
6f4a19f59f | ||
|
|
0d8f04cd83 | ||
|
|
4906052019 | ||
|
|
c6a823e267 | ||
|
|
b7f9aedfac | ||
|
|
7dd0a30361 | ||
|
|
ca120e31f2 | ||
|
|
48eb35cd78 | ||
|
|
7f20dbbcd2 | ||
|
|
55e706c918 | ||
|
|
4e7d433dfb | ||
|
|
7d44ff7de6 | ||
|
|
a8c3e5e3c7 | ||
|
|
4402db3ecc | ||
|
|
7960d3e182 | ||
|
|
8a07b55a04 | ||
|
|
d53f4900d7 | ||
|
|
d3def58c52 | ||
|
|
96fa2d9d02 | ||
|
|
2d6a38fbf7 | ||
|
|
bb2b275b7d | ||
|
|
45bf8b3a75 | ||
|
|
60870be86c | ||
|
|
39ff43c579 | ||
|
|
1bbb796799 | ||
|
|
74e632fea8 | ||
|
|
efb8de492a | ||
|
|
a1f00cc557 | ||
|
|
421db3da06 | ||
|
|
b7526e7806 | ||
|
|
b40ce65180 | ||
|
|
1e8e2e78a5 | ||
|
|
4d5b72cdb4 | ||
|
|
35c2851cc1 | ||
|
|
ea7c1a7d90 | ||
|
|
96adefdb12 | ||
|
|
5e3cb8a747 | ||
|
|
3bf4088b8b | ||
|
|
256ee7ac6a | ||
|
|
f8b4c3b6b3 | ||
|
|
4bf703206d | ||
|
|
a284320e1e | ||
|
|
2df8f43d3e | ||
|
|
6f1bc8bc0f | ||
|
|
04f39f6df8 | ||
|
|
35d4761ce2 | ||
|
|
33d02a42d6 | ||
|
|
7bbb60cfbd | ||
|
|
da93d6753b | ||
|
|
59c943ecf6 | ||
|
|
4336b5d85e | ||
|
|
44ce3a93b6 | ||
|
|
7d400406a7 | ||
|
|
77dae919b6 | ||
|
|
0ab8e025c1 | ||
|
|
b80c2d6d4b | ||
|
|
6aa6077bcc | ||
|
|
66c00cb159 | ||
|
|
3a129dba59 | ||
|
|
8df6eff6da | ||
|
|
889ebe922b | ||
|
|
d4d55b29e0 | ||
|
|
55e2c84fe3 | ||
|
|
15a463d742 | ||
|
|
cd46aa6cef | ||
|
|
9ef81064a3 | ||
|
|
11a7793221 | ||
|
|
080603f0b0 | ||
|
|
4f84ae0ec8 | ||
|
|
ab4366fd49 | ||
|
|
e6a6182d95 | ||
|
|
1a454efe89 | ||
|
|
deaa7052c5 | ||
|
|
7b5d51d837 | ||
|
|
593865b907 | ||
|
|
31c0cd4362 | ||
|
|
c2fdb33116 | ||
|
|
9e18dfe277 | ||
|
|
59ba9d147f | ||
|
|
23012db921 | ||
|
|
6fcec43954 | ||
|
|
a9f25a0819 | ||
|
|
c7995256e4 | ||
|
|
e1aa5b6620 | ||
|
|
da5ed5cf6b | ||
|
|
5757a93e01 | ||
|
|
deca601915 | ||
|
|
a5986276ec | ||
|
|
da45f43ce3 | ||
|
|
0de172a0c0 | ||
|
|
20aea9492f | ||
|
|
1326b9ae2a | ||
|
|
1fe26ab4a0 | ||
|
|
83e9c273e5 | ||
|
|
ec525c18e1 | ||
|
|
93fcc7ad73 | ||
|
|
1d912bd3c9 | ||
|
|
57ffe93485 | ||
|
|
5da5517288 | ||
|
|
2312f06c30 | ||
|
|
2416415c53 | ||
|
|
e6050a683c | ||
|
|
da7703286a | ||
|
|
f02e6b5675 | ||
|
|
035a26c16a | ||
|
|
bc8a6137b2 | ||
|
|
6fe506b04b | ||
|
|
81a2e438dc | ||
|
|
9b45c0733e | ||
|
|
11b2a9b70b | ||
|
|
d743d22de6 | ||
|
|
11da14b548 | ||
|
|
2bdd07195c | ||
|
|
5e77d9cfc1 | ||
|
|
7d5116251d | ||
|
|
81023dbdbd | ||
|
|
b2e9294fb9 | ||
|
|
16a22c3851 | ||
|
|
c9cd02c965 | ||
|
|
8149861554 | ||
|
|
ea57de18f8 | ||
|
|
d0d1e3dacb | ||
|
|
3809f0163b | ||
|
|
46d8a2033b | ||
|
|
c773faf05e | ||
|
|
513eeb61dd | ||
|
|
bc379c1aa1 | ||
|
|
286551b4eb | ||
|
|
16057d6bbb | ||
|
|
f649a6a8fd | ||
|
|
ef28ee8bc1 | ||
|
|
300f48c532 | ||
|
|
2d357558fb | ||
|
|
0c62a5b28e | ||
|
|
b0720b4988 | ||
|
|
d5bab2c0e1 | ||
|
|
3ea0ccb319 | ||
|
|
08772054e9 | ||
|
|
1dcb27157d | ||
|
|
61c22fdf36 | ||
|
|
431e57a797 | ||
|
|
b521bb816d | ||
|
|
7d06b24eac | ||
|
|
3bbeade41d | ||
|
|
ba82db7a0d | ||
|
|
801564c804 | ||
|
|
ac8cac1dac | ||
|
|
4b85f1228a | ||
|
|
c35fcdc0b7 | ||
|
|
15decd26cc | ||
|
|
9c6482b8d6 | ||
|
|
41f26e0ebc | ||
|
|
2def66169e | ||
|
|
9e34a34e44 | ||
|
|
5ccaf90415 | ||
|
|
44a387e0ea | ||
|
|
a388e25576 | ||
|
|
a1ef7718c9 | ||
|
|
65ddb30016 | ||
|
|
31747dd521 | ||
|
|
6a74c4dfff | ||
|
|
394c3e0ac2 | ||
|
|
60d31116c2 | ||
|
|
8445b0115f | ||
|
|
8506a64149 | ||
|
|
66acd9d64c | ||
|
|
348d05359c | ||
|
|
0d2d30bb39 | ||
|
|
631187be8c | ||
|
|
e756ec8284 | ||
|
|
87d62d7d29 | ||
|
|
5460cfeba8 | ||
|
|
8997730612 | ||
|
|
3617c59bab | ||
|
|
881c6a1049 | ||
|
|
2024ade285 | ||
|
|
674ad4f6bc | ||
|
|
5b99970eb7 | ||
|
|
80cfd940cc | ||
|
|
3c2304d55f | ||
|
|
5645cc7995 | ||
|
|
33690255c5 | ||
|
|
c61471fc8b | ||
|
|
54da019fdb | ||
|
|
28668d808e | ||
|
|
9612ebc00e | ||
|
|
1a46a3a4b3 | ||
|
|
2df1255117 | ||
|
|
3c98038174 | ||
|
|
800f63d38f | ||
|
|
5620eb5332 | ||
|
|
9f8acdaa5d | ||
|
|
2dc1eb6cbf | ||
|
|
b9563c9451 | ||
|
|
d6d8e9a93e | ||
|
|
d06de6c871 | ||
|
|
6af7d49b92 | ||
|
|
bcfa6d72e3 | ||
|
|
dd7f792c85 | ||
|
|
d061fda7e9 | ||
|
|
4db2250000 | ||
|
|
c6b755df45 | ||
|
|
e2a6810069 | ||
|
|
c4f11a2a99 | ||
|
|
e0a7bffa1e | ||
|
|
38b864eaa1 | ||
|
|
12359faff0 | ||
|
|
9fdc64a927 | ||
|
|
665c575b2a | ||
|
|
47dcf7b176 | ||
|
|
d59849b2e7 | ||
|
|
7a3f4a18d1 | ||
|
|
7f084087b2 | ||
|
|
d5524ca87b | ||
|
|
390cd7ca90 | ||
|
|
60375a88fe | ||
|
|
dd07e0c4cf | ||
|
|
9d3ae8ecbb | ||
|
|
d1307d873a | ||
|
|
c12936c5d1 | ||
|
|
cdc17f60dc | ||
|
|
b35ec29927 | ||
|
|
05f3a0d754 | ||
|
|
c966a489cf | ||
|
|
bb0c57ecd2 | ||
|
|
24f4e57c46 | ||
|
|
ac319fbc90 | ||
|
|
4bfe934cd1 | ||
|
|
40a5bfde36 | ||
|
|
a67c755ef1 | ||
|
|
87a04a2df6 | ||
|
|
c03995d297 | ||
|
|
ec0ebb3fc2 | ||
|
|
6ab537e324 | ||
|
|
e6c368d468 | ||
|
|
4f1cfd22d3 | ||
|
|
6d5a4ceefe | ||
|
|
f06c2172c0 | ||
|
|
7cb24eb5ff | ||
|
|
f30c692c1f | ||
|
|
8b66bb5d8d | ||
|
|
5d17fd0fec | ||
|
|
ac35a0f792 | ||
|
|
3ee0869734 | ||
|
|
70bb6c855e | ||
|
|
c7f34744c6 | ||
|
|
3f63b4d89f | ||
|
|
dac6ce73be | ||
|
|
5701750c2c | ||
|
|
9e236169e9 | ||
|
|
339eacce1b | ||
|
|
810f991b9e | ||
|
|
386571a24b | ||
|
|
3fe63754d2 | ||
|
|
76681e714e | ||
|
|
46522fb7bd | ||
|
|
e7d09ac4f7 | ||
|
|
67508925d0 | ||
|
|
0c62124eb5 | ||
|
|
9b5d4eed31 | ||
|
|
79054c1d1e | ||
|
|
44d47bbe6f | ||
|
|
323de05ba2 | ||
|
|
5a01722ebc | ||
|
|
1106c3f072 | ||
|
|
bed78ef4e6 | ||
|
|
0ee5cdfe9f | ||
|
|
a1dcc2cb98 | ||
|
|
ee7fb780c8 | ||
|
|
5ade4a4248 | ||
|
|
6cd660435e | ||
|
|
090d7c81cf | ||
|
|
48145ea358 | ||
|
|
dd614590c9 | ||
|
|
a86865891a | ||
|
|
fb9f12a02d | ||
|
|
e25f8e1f37 | ||
|
|
4685200fa9 | ||
|
|
1397f0b520 | ||
|
|
8b3e6eb6b6 | ||
|
|
a0c9d5c6d9 | ||
|
|
5cf9459c08 | ||
|
|
e7b66a28de | ||
|
|
203f53fbbe | ||
|
|
02663ee9d9 | ||
|
|
f169f65e75 | ||
|
|
2855a0fcce | ||
|
|
bf0f3a8c3e | ||
|
|
cb72aa1809 | ||
|
|
896f913571 | ||
|
|
89295a0628 | ||
|
|
eb03ede014 | ||
|
|
8fbe5c7df7 | ||
|
|
e54b8f536b | ||
|
|
fa9b3dcae2 | ||
|
|
9a021c5580 | ||
|
|
80e8b13ac4 | ||
|
|
b61599aca4 | ||
|
|
a602dc5425 | ||
|
|
93c120754a | ||
|
|
1ca4b75ec2 | ||
|
|
329550c4a9 | ||
|
|
00bfa988fc | ||
|
|
81afc5cce6 | ||
|
|
cb3c4a4722 | ||
|
|
954f7bf5ec | ||
|
|
526d3d25e2 | ||
|
|
74124c344c | ||
|
|
5177391ebe | ||
|
|
64db14b0cb | ||
|
|
effe203677 | ||
|
|
82591fa6e7 | ||
|
|
11d81fc6d1 | ||
|
|
30fd7198fe | ||
|
|
8d179dae4e | ||
|
|
e11cb7268e | ||
|
|
3bc9c8cfc8 | ||
|
|
c430e00b80 | ||
|
|
cf8d6bbd9e | ||
|
|
8b46b0ea36 | ||
|
|
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 |
67
.bzrignore → .gitignore
vendored
67
.bzrignore → .gitignore
vendored
@@ -7,11 +7,16 @@
|
||||
*.1
|
||||
*.8
|
||||
aclocal.m4
|
||||
ahci_test
|
||||
ascii.bitmaps
|
||||
ascii.h
|
||||
autom4te.cache
|
||||
build_env.mk
|
||||
.bzrignore
|
||||
build-grub-gen-asciih
|
||||
build-grub-gen-widthspec
|
||||
build-grub-mkfont
|
||||
cdboot_test
|
||||
cmp_test
|
||||
config.cache
|
||||
config.guess
|
||||
config.h
|
||||
@@ -21,34 +26,45 @@ 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-lite
|
||||
grub_emu_init.c
|
||||
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-mk*
|
||||
grub-mount
|
||||
grub-ofpathname
|
||||
grub-pe2elf
|
||||
grub-probe
|
||||
grub_probe_init.c
|
||||
@@ -65,15 +81,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 +109,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,44 +120,57 @@ 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
|
||||
*.a
|
||||
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
|
||||
GSYMS
|
||||
GTAGS
|
||||
Makefile.tpl
|
||||
compile
|
||||
depcomp
|
||||
mdate-sh
|
||||
texinfo.tex
|
||||
grub-core/lib/libgcrypt-grub
|
||||
**/.deps
|
||||
**/.deps-util
|
||||
**/.deps-core
|
||||
**/.dirstamp
|
||||
.deps
|
||||
.deps-util
|
||||
.deps-core
|
||||
.dirstamp
|
||||
Makefile.util.am
|
||||
contrib
|
||||
grub-core/bootinfo.txt
|
||||
grub-core/Makefile.core.am
|
||||
grub-core/Makefile.gcry.def
|
||||
grub-core/contrib
|
||||
@@ -138,6 +178,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 +188,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 +211,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
|
||||
127
INSTALL
127
INSTALL
@@ -12,6 +12,23 @@ you don't have any of them, please obtain and install them before
|
||||
configuring the GRUB.
|
||||
|
||||
* GCC 4.1.3 or later
|
||||
Note: older versions may work but support is limited
|
||||
Note: clang 3.2 or later works for i386 and x86_64 targets but results in
|
||||
much bigger binaries.
|
||||
earlier versions not tested
|
||||
Note: clang 3.2 or later works for arm
|
||||
earlier versions not tested
|
||||
Note: clang 3.3 or later works for arm64
|
||||
earlier versions have no arm64 support
|
||||
Note: clang 3.3 or later works for mips(el)
|
||||
earlier versions fail to generate .reginfo and hence gprel relocations
|
||||
fail.
|
||||
Note: clang 3.2 or later works for powerpc
|
||||
earlier versions not tested
|
||||
Note: clang has no support for generating 64-bit sparc code and hence you
|
||||
can't compile GRUB for sparc64 with clang
|
||||
Note: clang has no support for ia64 and hence you can't compile GRUB
|
||||
for ia64 with clang
|
||||
* GNU Make
|
||||
* GNU Bison 2.3 or later
|
||||
* GNU gettext 0.17 or later
|
||||
@@ -23,11 +40,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:
|
||||
|
||||
@@ -37,14 +54,14 @@ To build GRUB's graphical terminal (gfxterm), you need:
|
||||
If you use a development snapshot or want to hack on GRUB you may
|
||||
need the following.
|
||||
|
||||
* Python 2.5.2 or later
|
||||
* Python 2.6 or later
|
||||
* Autoconf 2.60 or later
|
||||
* Automake 1.10.1 or later
|
||||
* Autogen 5.10 or later
|
||||
|
||||
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 +92,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 +107,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 +124,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
|
||||
====================================
|
||||
|
||||
187
Makefile.am
187
Makefile.am
@@ -60,63 +60,70 @@ 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)
|
||||
CLEANFILES += build-grub-mkfont
|
||||
|
||||
garbage-gen: util/garbage-gen.c
|
||||
$(BUILD_CC) -o $@ $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $^
|
||||
CLEANFILES += garbage-gen
|
||||
EXTRA_DIST += util/garbage-gen.c
|
||||
|
||||
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
|
||||
CLEANFILES += build-grub-gen-asciih
|
||||
|
||||
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
|
||||
CLEANFILES += build-grub-gen-widthspec
|
||||
|
||||
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 =
|
||||
starfield_DATA =
|
||||
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) || (rm -f $@; exit 1)
|
||||
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) || (rm -f $@; exit 1)
|
||||
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) || (rm -f $@; exit 1)
|
||||
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) $@ || (rm -f $@; exit 1)
|
||||
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) $@ || (rm -f $@; exit 1)
|
||||
CLEANFILES += widthspec.h
|
||||
|
||||
# Install config.h into platformdir
|
||||
@@ -153,10 +160,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 +178,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 +251,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 +260,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 +268,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 +342,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 +383,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 +396,34 @@ SUCCESSFUL_BOOT_STRING=3e49994fd5d82b7c9298d672d774080d
|
||||
BOOTCHECK_TIMEOUT=180
|
||||
|
||||
bootcheck: $(BOOTCHECKS)
|
||||
|
||||
if COND_i386_coreboot
|
||||
default_payload.elf: grub-mkstandalone grub-mkimage
|
||||
pkgdatadir=. ./grub-mkstandalone --grub-mkimage=./grub-mkimage -O i386-coreboot -o $@ --modules='ahci pata ehci uhci ohci usb_keyboard usbms part_msdos xfs ext2 fat at_keyboard part_gpt usbserial_usbdebug cbfs' --install-modules='ls linux search configfile normal cbtime cbls memrw iorw minicmd lsmmap lspci halt reboot hexdump pcidump regexp setpci lsacpi chain test' --fonts= --themes= --locales= -d grub-core/ /boot/grub/grub.cfg=$(srcdir)/coreboot.cfg
|
||||
endif
|
||||
|
||||
windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows
|
||||
windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA)
|
||||
test -d $(windowsdir) && rm -rf $(windowsdir) || true
|
||||
test -d $(windowsdir) || mkdir $(windowsdir)
|
||||
$(MAKE) -C po $(AM_MAKEFLAGS) windowsdir
|
||||
$(MAKE) -C grub-core $(AM_MAKEFLAGS) windowsdir
|
||||
test -d $(windowsdir)/themes || mkdir $(windowsdir)/themes
|
||||
test -d $(windowsdir)/themes/starfield || mkdir $(windowsdir)/themes/starfield
|
||||
for x in $(PROGRAMS); do \
|
||||
if [ x$(STRIP) != x ]; then $(STRIP) $$x -o $(windowsdir)/$$x; \
|
||||
else cp -fp $$x $(windowsdir)/$$x; fi; \
|
||||
done
|
||||
for x in $(pkgdata_DATA); do \
|
||||
cp -fp $$x $(windowsdir)/$$x; \
|
||||
done
|
||||
for x in $(starfield_DATA); do \
|
||||
cp -fp $$x $(windowsdir)/themes/starfield/$$(basename $$x); \
|
||||
done
|
||||
|
||||
windowszip=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows.zip
|
||||
windowszip: windowsdir
|
||||
test -f $(windowszip) && rm $(windowszip) || true
|
||||
zip -r $(windowszip) $(windowsdir)
|
||||
|
||||
EXTRA_DIST += linguas.sh
|
||||
|
||||
@@ -9,9 +9,23 @@ 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/kern/disk_common.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 +46,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 +73,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 +101,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 +121,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 +142,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;
|
||||
@@ -123,30 +156,28 @@ library = {
|
||||
common = grub-core/io/gzio.c;
|
||||
common = grub-core/io/lzopio.c;
|
||||
common = grub-core/kern/ia64/dl_helper.c;
|
||||
common = grub-core/kern/arm/dl_helper.c;
|
||||
common = grub-core/kern/arm64/dl_helper.c;
|
||||
common = grub-core/lib/minilzo/minilzo.c;
|
||||
common = grub-core/lib/xzembed/xz_dec_bcj.c;
|
||||
common = grub-core/lib/xzembed/xz_dec_lzma2.c;
|
||||
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/osdep/config.c;
|
||||
extra_dist = grub-core/osdep/aros/config.c;
|
||||
extra_dist = grub-core/osdep/windows/config.c;
|
||||
extra_dist = grub-core/osdep/unix/config.c;
|
||||
common = util/config.c;
|
||||
|
||||
extra_dist = util/grub-mkimagexx.c;
|
||||
|
||||
@@ -165,6 +196,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 +211,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 +225,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,34 +241,21 @@ 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 = {
|
||||
name = grub-macho2img;
|
||||
mansection = 1;
|
||||
common = util/grub-macho2img.c;
|
||||
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;
|
||||
condition = COND_APPLE_LINKER;
|
||||
};
|
||||
|
||||
program = {
|
||||
@@ -243,9 +265,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 +281,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 +295,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 +315,10 @@ program = {
|
||||
installdir = sbin;
|
||||
mansection = 8;
|
||||
common = util/grub-probe.c;
|
||||
common = util/ieee1275/ofpath.c;
|
||||
common = util/probe.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 +332,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 +355,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 +375,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 +391,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;
|
||||
@@ -451,47 +485,157 @@ script = {
|
||||
installdir = grubconf;
|
||||
};
|
||||
|
||||
script = {
|
||||
program = {
|
||||
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-mkrescue.c;
|
||||
common = util/render-label.c;
|
||||
common = util/glue-efi.c;
|
||||
common = util/mkimage.c;
|
||||
common = util/grub-install-common.c;
|
||||
common = util/setup_bios.c;
|
||||
common = util/setup_sparc.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = grub-core/osdep/random.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/platform.c;
|
||||
common = grub-core/osdep/platform_unix.c;
|
||||
common = grub-core/osdep/compress.c;
|
||||
extra_dist = grub-core/osdep/unix/compress.c;
|
||||
extra_dist = grub-core/osdep/basic/compress.c;
|
||||
common = util/editenv.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
common = grub-core/osdep/config.c;
|
||||
common = util/config.c;
|
||||
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
|
||||
common = util/resolve.c;
|
||||
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = '$(LIBLZMA)';
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
|
||||
condition = COND_HAVE_EXEC;
|
||||
};
|
||||
|
||||
script = {
|
||||
program = {
|
||||
mansection = 1;
|
||||
name = grub-mkstandalone;
|
||||
common = util/grub-mkstandalone.in;
|
||||
common = util/grub-mkstandalone.c;
|
||||
|
||||
common = util/render-label.c;
|
||||
common = util/glue-efi.c;
|
||||
common = util/mkimage.c;
|
||||
common = util/grub-install-common.c;
|
||||
common = util/setup_bios.c;
|
||||
common = util/setup_sparc.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = grub-core/osdep/random.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/platform.c;
|
||||
common = grub-core/osdep/platform_unix.c;
|
||||
extra_dist = grub-core/osdep/linux/platform.c;
|
||||
extra_dist = grub-core/osdep/basic/platform.c;
|
||||
extra_dist = grub-core/osdep/basic/no_platform.c;
|
||||
extra_dist = grub-core/osdep/unix/platform.c;
|
||||
common = grub-core/osdep/compress.c;
|
||||
common = util/editenv.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
common = grub-core/osdep/config.c;
|
||||
common = util/config.c;
|
||||
|
||||
common = grub-core/kern/emu/hostfs.c;
|
||||
common = grub-core/disk/host.c;
|
||||
|
||||
common = util/resolve.c;
|
||||
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = '$(LIBLZMA)';
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
script = {
|
||||
program = {
|
||||
mansection = 8;
|
||||
installdir = sbin;
|
||||
name = grub-install;
|
||||
|
||||
common = util/grub-install.in;
|
||||
common = util/grub-install.c;
|
||||
common = util/probe.c;
|
||||
common = util/mkimage.c;
|
||||
common = util/grub-install-common.c;
|
||||
common = util/setup_bios.c;
|
||||
common = util/setup_sparc.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = grub-core/osdep/random.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/platform.c;
|
||||
common = grub-core/osdep/platform_unix.c;
|
||||
common = grub-core/osdep/compress.c;
|
||||
common = util/editenv.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
common = grub-core/osdep/config.c;
|
||||
common = util/config.c;
|
||||
|
||||
common = util/resolve.c;
|
||||
enable = noemu;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = '$(LIBLZMA)';
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
script = {
|
||||
mansection = 8;
|
||||
installdir = sbin;
|
||||
program = {
|
||||
mansection = 1;
|
||||
installdir = bin;
|
||||
name = grub-mknetdir;
|
||||
|
||||
common = util/grub-mknetdir.in;
|
||||
common = util/grub-mknetdir.c;
|
||||
|
||||
common = util/mkimage.c;
|
||||
common = util/grub-install-common.c;
|
||||
common = util/setup_bios.c;
|
||||
common = util/setup_sparc.c;
|
||||
common = grub-core/lib/reed_solomon.c;
|
||||
common = grub-core/osdep/random.c;
|
||||
common = grub-core/osdep/ofpath.c;
|
||||
common = grub-core/osdep/platform.c;
|
||||
common = grub-core/osdep/platform_unix.c;
|
||||
common = grub-core/osdep/compress.c;
|
||||
common = util/editenv.c;
|
||||
common = grub-core/osdep/blocklist.c;
|
||||
common = grub-core/osdep/config.c;
|
||||
common = util/config.c;
|
||||
|
||||
common = util/resolve.c;
|
||||
common = grub-core/kern/emu/argp_common.c;
|
||||
common = grub-core/osdep/init.c;
|
||||
|
||||
ldadd = '$(LIBLZMA)';
|
||||
ldadd = libgrubmods.a;
|
||||
ldadd = libgrubgcry.a;
|
||||
ldadd = libgrubkern.a;
|
||||
ldadd = grub-core/gnulib/libgnu.a;
|
||||
ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
|
||||
};
|
||||
|
||||
script = {
|
||||
@@ -539,18 +683,188 @@ script = {
|
||||
installdir = noinst;
|
||||
};
|
||||
|
||||
script = {
|
||||
name = grub-fs-tester;
|
||||
common = tests/util/grub-fs-tester.in;
|
||||
installdir = noinst;
|
||||
dependencies = garbage-gen;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ext234_test;
|
||||
common = tests/ext234_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = squashfs_test;
|
||||
common = tests/squashfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = iso9660_test;
|
||||
common = tests/iso9660_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = hfsplus_test;
|
||||
common = tests/hfsplus_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = ntfs_test;
|
||||
common = tests/ntfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = reiserfs_test;
|
||||
common = tests/reiserfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = fat_test;
|
||||
common = tests/fat_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = minixfs_test;
|
||||
common = tests/minixfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = xfs_test;
|
||||
common = tests/xfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = nilfs2_test;
|
||||
common = tests/nilfs2_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = romfs_test;
|
||||
common = tests/romfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = exfat_test;
|
||||
common = tests/exfat_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = tar_test;
|
||||
common = tests/tar_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = udf_test;
|
||||
common = tests/udf_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = hfs_test;
|
||||
common = tests/hfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = jfs_test;
|
||||
common = tests/jfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = btrfs_test;
|
||||
common = tests/btrfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = zfs_test;
|
||||
common = tests/zfs_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = cpio_test;
|
||||
common = tests/cpio_test.in;
|
||||
};
|
||||
|
||||
script = {
|
||||
testcase;
|
||||
name = example_scripted_test;
|
||||
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 +979,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 +1009,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 +1159,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 +1212,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.
|
||||
|
||||
148
acinclude.m4
148
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,79 @@ if test "x$grub_cv_prog_ld_build_id_none" = xyes; then
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Check nm
|
||||
AC_DEFUN([grub_PROG_NM_WORKS],
|
||||
[AC_MSG_CHECKING([whether nm works])
|
||||
AC_CACHE_VAL(grub_cv_prog_nm_works,
|
||||
[
|
||||
nm_works_tmp_dir="$(mktemp -d "./confXXXXXX")"
|
||||
AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]], [[]])])
|
||||
$TARGET_CC $TARGET_CFLAGS -c conftest.c -o "$nm_works_tmp_dir/ef"
|
||||
if $TARGET_NM "$nm_works_tmp_dir/ef" > /dev/null; then
|
||||
grub_cv_prog_nm_works=yes
|
||||
else
|
||||
grub_cv_prog_nm_minus_p=no
|
||||
fi
|
||||
rm "$nm_works_tmp_dir/ef"
|
||||
rmdir "$nm_works_tmp_dir"
|
||||
])
|
||||
AC_MSG_RESULT([$grub_cv_prog_nm_works])
|
||||
|
||||
if test "x$grub_cv_prog_nm_works" != xyes; then
|
||||
AC_MSG_ERROR([nm does not work])
|
||||
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 $TARGET_CFLAGS -c 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"
|
||||
rmdir "$nm_minus_p_tmp_dir"
|
||||
])
|
||||
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 $TARGET_CFLAGS -c 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"
|
||||
rmdir "$nm_defined_only_tmp_dir"
|
||||
])
|
||||
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
|
||||
@@ -164,7 +237,7 @@ else
|
||||
sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s
|
||||
fi
|
||||
|
||||
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
|
||||
if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
|
||||
grub_cv_i386_asm_addr32=yes
|
||||
else
|
||||
grub_cv_i386_asm_addr32=no
|
||||
@@ -174,37 +247,6 @@ rm -f conftest*])
|
||||
|
||||
AC_MSG_RESULT([$grub_cv_i386_asm_addr32])])
|
||||
|
||||
dnl check if our compiler is apple cc
|
||||
dnl because it requires numerous workarounds
|
||||
AC_DEFUN([grub_apple_cc],
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_MSG_CHECKING([whether our compiler is apple cc])
|
||||
AC_CACHE_VAL(grub_cv_apple_cc,
|
||||
[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then
|
||||
grub_cv_apple_cc=yes
|
||||
else
|
||||
grub_cv_apple_cc=no
|
||||
fi
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$grub_cv_apple_cc])])
|
||||
|
||||
dnl check if our target compiler is apple cc
|
||||
dnl because it requires numerous workarounds
|
||||
AC_DEFUN([grub_apple_target_cc],
|
||||
[AC_REQUIRE([AC_PROG_CC])
|
||||
AC_MSG_CHECKING([whether our target compiler is apple cc])
|
||||
AC_CACHE_VAL(grub_cv_apple_target_cc,
|
||||
[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then
|
||||
grub_cv_apple_target_cc=yes
|
||||
else
|
||||
grub_cv_apple_target_cc=no
|
||||
fi
|
||||
])
|
||||
|
||||
AC_MSG_RESULT([$grub_cv_apple_target_cc])])
|
||||
|
||||
|
||||
dnl Later versions of GAS requires that addr32 and data32 prefixes
|
||||
dnl appear in the same lines as the instructions they modify, while
|
||||
dnl earlier versions requires that they appear in separate lines.
|
||||
@@ -218,7 +260,7 @@ AC_CACHE_VAL(grub_cv_i386_asm_prefix_requirement,
|
||||
l1: addr32 movb %al, l1
|
||||
EOF
|
||||
|
||||
if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
|
||||
if AC_TRY_COMMAND([${CC-cc} ${TARGET_CCASFLAGS} ${CFLAGS} -c conftest.s]) && test -s conftest.o; then
|
||||
grub_cv_i386_asm_prefix_requirement=yes
|
||||
else
|
||||
grub_cv_i386_asm_prefix_requirement=no
|
||||
@@ -313,32 +355,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],[
|
||||
@@ -369,7 +385,7 @@ AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe'])
|
||||
AC_LANG_CONFTEST([AC_LANG_SOURCE([[
|
||||
void foo (void) { volatile char a[8]; a[3]; }
|
||||
]])])
|
||||
[if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then]
|
||||
[if eval "$ac_compile -S -mstack-arg-probe -Werror -o conftest.s" 2> /dev/null; then]
|
||||
AC_MSG_RESULT([yes])
|
||||
[# Should we clear up other files as well, having called `AC_LANG_CONFTEST'?
|
||||
rm -f conftest.s
|
||||
@@ -452,3 +468,9 @@ 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
|
||||
])
|
||||
|
||||
27
autogen.sh
27
autogen.sh
@@ -2,22 +2,35 @@
|
||||
|
||||
set -e
|
||||
|
||||
export LC_CTYPE=C
|
||||
export LC_COLLATE=C
|
||||
unset LC_ALL
|
||||
|
||||
autogen --version >/dev/null || exit 1
|
||||
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
|
||||
|
||||
echo "Importing unicode..."
|
||||
python util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
|
||||
|
||||
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
|
||||
|
||||
echo "Creating Makefile.tpl..."
|
||||
python gentpl.py | sed -e '/^$/{N;/^\n$/D;}' > Makefile.tpl
|
||||
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 "Running autogen..."
|
||||
echo "Generating Automake input..."
|
||||
|
||||
# Automake doesn't like including files from a path outside the project.
|
||||
rm -f contrib grub-core/contrib
|
||||
@@ -41,8 +54,8 @@ for extra in contrib/*/Makefile.core.def; do
|
||||
fi
|
||||
done
|
||||
|
||||
cat $UTIL_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > Makefile.util.am
|
||||
cat $CORE_DEFS | autogen -T Makefile.tpl | sed -e '/^$/{N;/^\n$/D;}' > grub-core/Makefile.core.am
|
||||
python gentpl.py $UTIL_DEFS > Makefile.util.am
|
||||
python gentpl.py $CORE_DEFS > grub-core/Makefile.core.am
|
||||
|
||||
for extra in contrib/*/Makefile.common; do
|
||||
if test -e "$extra"; then
|
||||
|
||||
@@ -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,40 +3,24 @@
|
||||
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
|
||||
endif
|
||||
if COND_i386_qemu
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
endif
|
||||
if COND_i386_coreboot
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
endif
|
||||
if COND_i386_ieee1275
|
||||
CFLAGS_PLATFORM += -mrtd -mregparm=3
|
||||
endif
|
||||
if COND_mips_loongson
|
||||
CFLAGS_PLATFORM += -mexplicit-relocs
|
||||
CPPFLAGS_PLATFORM = -DUSE_ASCII_FAILBACK
|
||||
endif
|
||||
if COND_mips
|
||||
CFLAGS_PLATFORM += -mflush-func=grub_cpu_flush_cache
|
||||
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
|
||||
CCASFLAGS_PLATFORM = -mthumb-interwork
|
||||
LDFLAGS_PLATFORM = -Wl,--wrap=__clear_cache
|
||||
endif
|
||||
if COND_arm64
|
||||
CFLAGS_PLATFORM += -mcmodel=large
|
||||
endif
|
||||
|
||||
#FIXME: discover and check XEN headers
|
||||
CPPFLAGS_XEN = -I/usr/include
|
||||
|
||||
# Other options
|
||||
|
||||
@@ -47,29 +31,16 @@ 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 =
|
||||
|
||||
if ! COND_i386_pc
|
||||
if ! COND_i386_efi
|
||||
if ! COND_i386_qemu
|
||||
if ! COND_i386_coreboot
|
||||
if ! COND_i386_multiboot
|
||||
if ! COND_i386_ieee1275
|
||||
if ! COND_x86_64_efi
|
||||
LDADD_KERNEL += -lgcc
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
LDADD_KERNEL = $(TARGET_LIBGCC)
|
||||
|
||||
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)
|
||||
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC)
|
||||
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 +73,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
|
||||
CFLAGS_GNULIB = -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion
|
||||
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 -Wno-undef $(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 +115,7 @@ bin_PROGRAMS =
|
||||
platform_DATA =
|
||||
sbin_PROGRAMS =
|
||||
check_SCRIPTS =
|
||||
grubconf_DATA =
|
||||
dist_grubconf_DATA =
|
||||
check_PROGRAMS =
|
||||
noinst_SCRIPTS =
|
||||
noinst_PROGRAMS =
|
||||
@@ -159,20 +130,15 @@ EXTRA_DIST =
|
||||
CLEANFILES =
|
||||
BUILT_SOURCES =
|
||||
|
||||
# Rules for autogen definition files
|
||||
|
||||
.PRECIOUS: $(top_srcdir)/Makefile.tpl
|
||||
$(top_srcdir)/Makefile.tpl: $(top_srcdir)/gentpl.py
|
||||
python $< | sed -e '/^$$/{N;/^\\n$$/D;}' > $@.new || (rm -f $@.new; exit 1)
|
||||
mv $@.new $@
|
||||
# Rules for Automake input
|
||||
|
||||
.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)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
|
||||
python $^ > $@.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
|
||||
$(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
|
||||
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)
|
||||
python $^ > $@.new || (rm -f $@.new; exit 1)
|
||||
mv $@.new $@
|
||||
|
||||
@@ -2,7 +2,6 @@ EXTRA_DIST += autogen.sh
|
||||
EXTRA_DIST += geninit.sh
|
||||
|
||||
EXTRA_DIST += gentpl.py
|
||||
EXTRA_DIST += Makefile.tpl
|
||||
EXTRA_DIST += Makefile.util.def
|
||||
EXTRA_DIST += Makefile.utilgcry.def
|
||||
|
||||
@@ -12,7 +11,9 @@ EXTRA_DIST += util/import_gcry.py
|
||||
EXTRA_DIST += util/import_unicode.py
|
||||
|
||||
EXTRA_DIST += docs/man
|
||||
EXTRA_DIST += docs/autoiso.cfg
|
||||
EXTRA_DIST += docs/grub.cfg
|
||||
EXTRA_DIST += docs/osdetect.cfg
|
||||
|
||||
EXTRA_DIST += conf/i386-pc-cygwin-img-ld.sc
|
||||
|
||||
@@ -26,7 +27,13 @@ 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/gnulib-fix-null-deref.diff
|
||||
EXTRA_DIST += grub-core/gnulib-fix-width.diff
|
||||
EXTRA_DIST += grub-core/gnulib-no-abort.diff
|
||||
EXTRA_DIST += grub-core/gnulib-no-gets.diff
|
||||
|
||||
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 +41,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 +66,47 @@ 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
|
||||
|
||||
EXTRA_DIST += coreboot.cfg
|
||||
|
||||
36
config.h.in
36
config.h.in
@@ -5,10 +5,30 @@
|
||||
#if defined(__PPC__) && !defined(__powerpc__)
|
||||
#define __powerpc__ 1
|
||||
#endif
|
||||
#if defined (GRUB_UTIL) || !defined (GRUB_MACHINE)
|
||||
#include <config-util.h>
|
||||
#define NESTED_FUNC_ATTR
|
||||
|
||||
#define GCRYPT_NO_DEPRECATED 1
|
||||
|
||||
/* 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>
|
||||
#else
|
||||
#define HAVE_FONT_SOURCE @HAVE_FONT_SOURCE@
|
||||
/* Define if C symbols get an underscore after compilation. */
|
||||
#define HAVE_ASM_USCORE @HAVE_ASM_USCORE@
|
||||
/* Define it to \"addr32\" or \"addr32;\" to make GAS happy. */
|
||||
@@ -35,22 +55,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
|
||||
|
||||
1080
configure.ac
1080
configure.ac
File diff suppressed because it is too large
Load Diff
3
coreboot.cfg
Normal file
3
coreboot.cfg
Normal file
@@ -0,0 +1,3 @@
|
||||
if test -f (cbfsdisk)/etc/grub.cfg; then
|
||||
source (cbfsdisk)/etc/grub.cfg
|
||||
fi
|
||||
244
docs/autoiso.cfg
Normal file
244
docs/autoiso.cfg
Normal file
@@ -0,0 +1,244 @@
|
||||
# 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/>.
|
||||
|
||||
function pathname { regexp -s 2:"$2" '^(\(.*\))?(/.*)$' "$1"; }
|
||||
function devname { regexp -s "$2" '^(\(.*\)).*$' "$1"; }
|
||||
|
||||
function loopback_iso_entry {
|
||||
realdev="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
if test -f /boot/grub/loopback.cfg; then
|
||||
cfgpath=/boot/grub/loopback.cfg
|
||||
elif test -f /grub/loopback.cfg; then
|
||||
cfgpath=/grub/loopback.cfg
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
|
||||
echo loopback.cfg $isopath: yes
|
||||
menuentry "Boot GRUB Loopback Config from ${realdev}${isopath}" "$realdev" "$isopath" "$cfgpath" {
|
||||
set device="$2"
|
||||
set iso_path="$3"
|
||||
set cfg_path="$4"
|
||||
|
||||
export iso_path
|
||||
loopback loopdev_cfg "${device}${iso_path}"
|
||||
set root=(loopdev_cfg)
|
||||
configfile $cfg_path
|
||||
loopback -d loopdev_cfg
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function grml_iso_entry {
|
||||
realdev="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
result=1
|
||||
for dir in /boot/grml /boot/grmlsmall /boot/grmlmedium; do
|
||||
if ! test -f ${dir}/linux26 -a -f ${dir}/initrd.gz; then continue; fi
|
||||
|
||||
echo grml $isopath: yes
|
||||
result=0
|
||||
menuentry "GRML Linux from ${realdev}${isopath}" \
|
||||
"$realdev" "$isopath" "$dir" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
set grmldir="$4"
|
||||
|
||||
loopback loopdev_grml "${device}${isopath}"
|
||||
set root=(loopdev_grml)
|
||||
linux $grmldir/linux26 findiso="$isopath" apm=power-off quiet \
|
||||
boot=live nomce
|
||||
initrd $grmldir/initrd.gz
|
||||
loopback -d loopdev_grml
|
||||
}
|
||||
done
|
||||
return $result
|
||||
}
|
||||
|
||||
function pmagic_iso_entry {
|
||||
realdev="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
if ! test -f /pmagic/bzImage -a -f /pmagic/initramfs; then return 1; fi
|
||||
|
||||
echo pmagic $isopath: yes
|
||||
menuentry "Parted Magic from ${realdev}${isopath}" "$realdev" "$isopath" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
|
||||
loopback loopdev_pmagic "${device}${isopath}"
|
||||
set root=(loopdev_pmagic)
|
||||
linux /pmagic/bzImage iso_filename="$isopath" edd=off noapic \
|
||||
load_ramdisk=1 prompt_ramdisk=0 rw sleep=10 loglevel=0 \
|
||||
keymap=$langcode
|
||||
initrd /pmagic/initramfs
|
||||
loopback -d loopdev_pmagic
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function sidux_iso_entry {
|
||||
realdev="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
result=1
|
||||
for kernel in /boot/vmlinuz-*-sidux-*; do
|
||||
if ! test -f "$kernel"; then continue; fi
|
||||
regexp -s 1:v1 -s 2:v2 '/boot/vmlinuz-(.*)-sidux-(.*)' "$kernel"
|
||||
|
||||
initrd="/boot/initrd.img-$v1-sidux-$v2"
|
||||
if ! test -f "$initrd"; then continue; fi
|
||||
|
||||
result=0
|
||||
echo sidux $isopath: yes
|
||||
menuentry "Sidux vmlinux-$v1-sidux-$v2 from ${realdev}${isopath}" "$realdev" "$isopath" "$kernel" "$initrd" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
set kernel="$4"
|
||||
set initrd="$5"
|
||||
|
||||
loopback loopdev_sidux "${device}${isopath}"
|
||||
set root=(loopdev_sidux)
|
||||
linux $kernel fromiso=$isopath boot=fll quiet
|
||||
initrd $initrd
|
||||
loopback -d loopdev_sidux
|
||||
}
|
||||
done
|
||||
return $result
|
||||
}
|
||||
|
||||
function slax_iso_entry {
|
||||
realdev="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
if ! test -f /boot/vmlinuz -a -f /boot/initrd.gz; then return 1; fi
|
||||
|
||||
echo slax $isopath: yes
|
||||
menuentry "Slax Linux from ${realdev}${isopath}" "$realdev" "$isopath" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
|
||||
loopback loopdev_slax "${device}${isopath}"
|
||||
set root=(loopdev_slax)
|
||||
linux /boot/vmlinuz from=$isopath ramdisk_size=6666 root=/dev/ram0 rw
|
||||
initrd /boot/initrd.gz
|
||||
loopback -d loopdev_slax
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function tinycore_iso_entry {
|
||||
realpath="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
if ! test -f /boot/bzImage -a -f /boot/tinycore.gz; then return 1; fi
|
||||
|
||||
echo tinycore $isopath: yes
|
||||
menuentry "Tinycore Linux from ${realdev}${isopath}" "$realdev" "$isopath" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
|
||||
loopback loopdev_tiny "${device}${isopath}"
|
||||
set root=(loopdev_tiny)
|
||||
linux /boot/bzImage
|
||||
initrd /boot/tinycore.gz
|
||||
loopback -d loopdev_tiny
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function casper_iso_entry {
|
||||
realpath="$1"
|
||||
isopath="$2"
|
||||
loopdev="$3"
|
||||
|
||||
if ! test -f /casper/vmlinuz; then return 1; fi
|
||||
initrd=
|
||||
for f in /casper/initrd.*z; do
|
||||
if ! test -f "$f"; then continue; fi
|
||||
pathname "$f" initrd
|
||||
done
|
||||
if test -z "$initrd"; then return 1; fi
|
||||
|
||||
echo casper $isopath: yes
|
||||
menuentry "Casper based Linux from ${realdev}${isopath}" "$realdev" "$isopath" "$initrd" {
|
||||
set device="$2"
|
||||
set isopath="$3"
|
||||
set initrd="$4"
|
||||
|
||||
loopback loopdev_casper "${device}${isopath}"
|
||||
set root=(loopdev_casper)
|
||||
linux /casper/vmlinuz boot=casper iso-scan/filename="$isopath" quiet splash noprompt keyb="$langcode" \
|
||||
debian-installer/language="$langcode" console-setup/layoutcode?="$langcode" --
|
||||
initrd $initrd
|
||||
loopback -d loopdev_casper
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
function scan_isos {
|
||||
isodirs="$1"
|
||||
|
||||
for dev in (*); do
|
||||
for dir in $isodirs; do
|
||||
for file in ${dev}${dir}/*.iso ${dev}${dir}/*.ISO; do
|
||||
if ! test -f "$file"; then continue; fi
|
||||
|
||||
pathname $file isopath
|
||||
if test -z "$dev" -o -z "$isopath"; then continue; fi
|
||||
|
||||
if ! loopback loopdev_scan "$file"; then continue; fi
|
||||
saved_root=$root
|
||||
set root=(loopdev_scan)
|
||||
|
||||
if loopback_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif grml_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif pmagic_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif sidux_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif slax_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif tinycore_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
elif casper_iso_entry $dev $isopath (loopdev_scan); then true;
|
||||
else true; fi
|
||||
|
||||
set root=$saved_root
|
||||
loopback -d loopdev_scan
|
||||
done
|
||||
done
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# XXX Remove later
|
||||
insmod serial
|
||||
serial
|
||||
terminal_output --append serial
|
||||
# terminal_input --append serial
|
||||
|
||||
langcode="$lang"
|
||||
|
||||
insmod regexp
|
||||
scan_isos /iso /boot/iso
|
||||
|
||||
@@ -74,12 +74,12 @@ 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::
|
||||
* CIA::
|
||||
* Stack and heap size::
|
||||
* BIOS port memory map::
|
||||
* Video Subsystem::
|
||||
* PFF2 Font File Format::
|
||||
@@ -92,24 +92,36 @@ This edition documents version @value{VERSION}.
|
||||
@node Getting the source code
|
||||
@chapter Getting the source code
|
||||
|
||||
GRUB is maintained using the @uref{http://bazaar-vcs.org/, Bazaar revision
|
||||
control system}. To fetch the primary development branch:
|
||||
GRUB is maintained using the @uref{GIT revision
|
||||
control system}. To fetch:
|
||||
|
||||
@example
|
||||
bzr get http://bzr.savannah.gnu.org/r/grub/trunk/grub
|
||||
git clone git://git.sv.gnu.org/grub.git
|
||||
@end example
|
||||
|
||||
The GRUB developers maintain several other branches with work in progress.
|
||||
Of these, the most interesting is the experimental branch, which is a
|
||||
staging area for new code which we expect to eventually merge into trunk but
|
||||
which is not yet ready:
|
||||
|
||||
Web access is available under
|
||||
@example
|
||||
bzr get http://bzr.savannah.gnu.org/r/grub/branches/experimental
|
||||
http://git.savannah.gnu.org/cgit/grub.git/
|
||||
@end example
|
||||
|
||||
Once you have used @kbd{bzr get} to fetch an initial copy of a branch, you
|
||||
can use @kbd{bzr pull} to keep it up to date. If you have modified your
|
||||
The branches available are:
|
||||
|
||||
@table @samp
|
||||
@item master
|
||||
Main developpement branch.
|
||||
@item grub-legacy
|
||||
GRUB 0.97 codebase. Kept for reference and legal reasons
|
||||
@item multiboot
|
||||
Multiboot specfication
|
||||
@item multiboot2
|
||||
Multiboot2 specfication
|
||||
@item developper branches
|
||||
Prefixed with developper name. Every developper of a team manages his own branches.
|
||||
Developper branches do not need changelog entries.
|
||||
@end table
|
||||
|
||||
Once you have used @kbd{git clone} to fetch an initial copy of a branch, you
|
||||
can use @kbd{git pull} to keep it up to date. If you have modified your
|
||||
local version, you may need to resolve conflicts when pulling.
|
||||
|
||||
@node Coding style
|
||||
@@ -286,14 +298,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
|
||||
@@ -329,10 +346,10 @@ anymore.
|
||||
@itemize
|
||||
@item Always use latest GRUB 2 source code. So get that first.
|
||||
|
||||
For developers it is recommended always to use the newest development version of GRUB 2. If development takes a long period of time, please remember to keep in sync with newest developments regularly so it is much easier to integrate your change in the future. GRUB 2 is being developed in a Bazaar (bzr) repository.
|
||||
For developers it is recommended always to use the newest development version of GRUB 2. If development takes a long period of time, please remember to keep in sync with newest developments regularly so it is much easier to integrate your change in the future. GRUB 2 is being developed in a GIT repository.
|
||||
|
||||
Please check Savannah's GRUB project page for details how to get newest bzr:
|
||||
@uref{http://savannah.gnu.org/bzr/?group=grub, GRUB 2 bzr Repository}
|
||||
Please check Savannah's GRUB project page for details how to get newest git:
|
||||
@uref{https://savannah.gnu.org/git/?group=grub, GRUB 2 git Repository}
|
||||
|
||||
@item Compile it and try it out.
|
||||
|
||||
@@ -890,33 +907,68 @@ if (grub_errno != GRUB_ERR_NONE)
|
||||
grub_error_pop ();
|
||||
@end example
|
||||
|
||||
@node CIA
|
||||
@chapter CIA
|
||||
@c By Robert Millan and Carles Pina
|
||||
If you have commit access, please setup CIA in your Bazaar
|
||||
config so those in IRC receive notification of your commits.
|
||||
@node Stack and heap size
|
||||
@chapter Stack and heap size
|
||||
|
||||
In @file{~/.bazaar/bazaar.conf}, add "cia_send_revno = true".
|
||||
Optionally, you can also add "cia_user = myusername" if you'd
|
||||
like CIA service to use a specific account (for statistical purpose).
|
||||
On emu stack and heap are just normal host OS stack and heap. Stack is typically
|
||||
8 MiB although it's OS-dependent.
|
||||
|
||||
In the @file{.bzr/branch/branch.conf} of your checkout branch,
|
||||
"set nickname = /path_to_this_branch" and "cia_project = GNU GRUB".
|
||||
On i386-pc, i386-coreboot, i386-qemu and i386-multiboot the stack is 60KiB.
|
||||
All available space between 1MiB and 4GiB marks is part of heap.
|
||||
|
||||
Additionally, please set cia_send_revno in the [DEFAULT] section
|
||||
of your @file{~/.bazaar/bazaar.conf}. E.g.:
|
||||
On *-xen stack is 4MiB. If compiled for x86-64 with GCC 4.4 or later adressable
|
||||
space is unlimited. When compiled for x86-64 with older GCC version adressable
|
||||
space is limited to 2GiB. When compiling for i386 adressable space is limited
|
||||
to 4GiB. All adressable pages except the ones for stack, GRUB binary, special
|
||||
pages and page table are in the heap.
|
||||
|
||||
@example
|
||||
[DEFAULT]
|
||||
cia_send_revno = true
|
||||
@end example
|
||||
On *-efi GRUB uses same stack as EFI. If compiled for x86-64 with GCC 4.4 or
|
||||
later adressable space is unlimited. When compiled for x86-64 with older GCC
|
||||
version adressable space is limited to 2GiB. For all other platforms adressable
|
||||
space is limited to 4GiB. GRUB allocates pages from EFI for its heap, at most
|
||||
1.6 GiB.
|
||||
|
||||
Remember to install cia-clients (Debian/Ubuntu package) to be able to use CIA.
|
||||
On i386-ieee1275 and powerpc-ieee1275 GRUB uses same stack as IEEE1275.
|
||||
It allocates at most 32MiB for its heap.
|
||||
|
||||
On sparc64-ieee1275 stack is 256KiB and heap is 2MiB.
|
||||
|
||||
On mips(el)-qemu_mips and mipsel-loongson stack is 2MiB (everything below
|
||||
GRUB image) and everything above GRUB image (from 2MiB + kernel size)
|
||||
until 256MiB is part of heap.
|
||||
|
||||
On mips-arc stack is 2MiB (everything below GRUB image) and everything above
|
||||
GRUB image(from 2MiB + kernel size) until 128MiB is part of heap.
|
||||
|
||||
On mipsel-arc stack is 2MiB (everything below GRUB image which is not part
|
||||
of ARC) and everything above GRUB image (from 7MiB + kernel size)
|
||||
until 256MiB is part of heap.
|
||||
|
||||
On arm-uboot stack is 256KiB and heap is 2MiB.
|
||||
|
||||
In short:
|
||||
|
||||
@multitable @columnfractions .15 .25 .5
|
||||
@headitem Platform @tab Stack @tab Heap
|
||||
@item emu @tab 8 MiB @tab ?
|
||||
@item i386-pc @tab 60 KiB @tab < 4 GiB
|
||||
@item i386-coreboot @tab 60 KiB @tab < 4 GiB
|
||||
@item i386-multiboot @tab 60 KiB @tab < 4 GiB
|
||||
@item i386-qemu @tab 60 KiB @tab < 4 GiB
|
||||
@item *-efi @tab ? @tab < 1.6 GiB
|
||||
@item i386-ieee1275 @tab ? @tab < 32 MiB
|
||||
@item powerpc-ieee1275 @tab ? @tab < 32 MiB
|
||||
@item sparc64-ieee1275 @tab 256KiB @tab 2 MiB
|
||||
@item arm-uboot @tab 256KiB @tab 2 MiB
|
||||
@item mips(el)-qemu_mips @tab 2MiB @tab 253 MiB
|
||||
@item mipsel-loongson @tab 2MiB @tab 253 MiB
|
||||
@item mips-arc @tab 2MiB @tab 125 MiB
|
||||
@item mipsel-arc @tab 2MiB @tab 248 MiB
|
||||
@item x86_64-xen (GCC >= 4.4) @tab 4MiB @tab unlimited
|
||||
@item x86_64-xen (GCC < 4.4) @tab 4MiB @tab < 2GiB
|
||||
@item i386-xen @tab 4MiB @tab < 4GiB
|
||||
@end multitable
|
||||
|
||||
Keep in mind Bazaar sends notifications for all commits to branches that have
|
||||
this setting, regardless of whether they're bound branches (checkouts) or not.
|
||||
So if you make local commits in a non-bound branch and it bothers you that
|
||||
others can read them, do not use this setting.
|
||||
|
||||
@node BIOS port memory map
|
||||
@chapter BIOS port memory map
|
||||
@@ -929,9 +981,8 @@ others can read them, do not use this setting.
|
||||
@item ? @tab 0x2000 - 1 @tab Real mode stack
|
||||
@item 0x7C00 @tab 0x7D00 - 1 @tab Boot sector
|
||||
@item 0x8000 @tab ? @tab GRUB kernel
|
||||
@item 0x68000 @tab 0x78000 - 1 @tab Disk buffer
|
||||
@item 0x68000 @tab 0x71000 - 1 @tab Disk buffer
|
||||
@item ? @tab 0x80000 - 1 @tab Protected mode stack
|
||||
@item 0x80000 @tab ? @tab Heap
|
||||
@item ? @tab 0xA0000 - 1 @tab Extended BIOS Data Area
|
||||
@item 0xA0000 @tab 0xC0000 - 1 @tab Video RAM
|
||||
@item 0xC0000 @tab 0x100000 - 1 @tab BIOS
|
||||
@@ -948,8 +999,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
|
||||
@@ -1108,6 +1159,47 @@ struct grub_video_palette_data
|
||||
Used to query indexed color palettes. If mode is RGB mode, colors will be copied from emulated palette data. In Indexed Color modes, palettes will be read from hardware. Color values will be converted to suit structure format. @code{start} will tell what hardware color index (or emulated color index) will be used as a source for first indice of @code{palette_data}, after that both hardware color index and @code{palette_data} index will be incremented until @code{count} number of colors have been read.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_set_area_status
|
||||
@itemize
|
||||
|
||||
@item Prototype:
|
||||
@example
|
||||
grub_err_t
|
||||
grub_video_set_area_status (grub_video_area_status_t area_status);
|
||||
@end example
|
||||
@example
|
||||
enum grub_video_area_status_t
|
||||
@{
|
||||
GRUB_VIDEO_AREA_DISABLED,
|
||||
GRUB_VIDEO_AREA_ENABLED
|
||||
@};
|
||||
@end example
|
||||
|
||||
@item Description:
|
||||
|
||||
Used to set area drawing mode for redrawing the specified region. Draw commands
|
||||
are performed in the intersection of the viewport and the region called area.
|
||||
Coordinates remain related to the viewport. If draw commands try to draw over
|
||||
the area, they are clipped.
|
||||
Set status to DISABLED if you need to draw everything.
|
||||
Set status to ENABLED and region to the desired rectangle to redraw everything
|
||||
inside the region leaving everything else intact.
|
||||
Should be used for redrawing of active elements.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_get_area_status
|
||||
@itemize
|
||||
|
||||
@item Prototype:
|
||||
@example
|
||||
grub_err_r
|
||||
grub_video_get_area_status (grub_video_area_status_t *area_status);
|
||||
@end example
|
||||
|
||||
@item Description:
|
||||
Used to query the area status.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_set_viewport
|
||||
@itemize
|
||||
@item Prototype:
|
||||
@@ -1134,6 +1226,37 @@ grub_video_get_viewport (unsigned int *x, unsigned int *y, unsigned int *width,
|
||||
Used to query current viewport dimensions. Software developer can use this to choose best way to render contents of the viewport.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_set_region
|
||||
@itemize
|
||||
@item Prototype:
|
||||
|
||||
@example
|
||||
grub_err_t
|
||||
grub_video_set_region (unsigned int x, unsigned int y, unsigned int width, unsigned int height);
|
||||
@end example
|
||||
@item Description:
|
||||
|
||||
Used to specify the region of the screen which should be redrawn. Use absolute
|
||||
values. When the region is set and area status is ENABLE all draw commands will
|
||||
be performed inside the interseption of region and viewport named area.
|
||||
If draw commands try to draw over viewport, they are clipped. If developer
|
||||
requests larger than possible region, width and height will be clamped to fit
|
||||
screen. Should be used for redrawing of active elements.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_get_region
|
||||
@itemize
|
||||
@item Prototype:
|
||||
|
||||
@example
|
||||
grub_err_t
|
||||
grub_video_get_region (unsigned int *x, unsigned int *y, unsigned int *width, unsigned int *height);
|
||||
@end example
|
||||
@item Description:
|
||||
|
||||
Used to query current region dimensions.
|
||||
@end itemize
|
||||
|
||||
@subsection grub_video_map_color
|
||||
@itemize
|
||||
@item Prototype:
|
||||
@@ -1394,8 +1517,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)
|
||||
@@ -1689,7 +1812,9 @@ right edges of two adjacent glyphs. The @strong{device width} field determines
|
||||
the effective leading value that is used to render the font.
|
||||
|
||||
@end itemize
|
||||
@image{font_char_metrics,,,,png}
|
||||
@ifnottex
|
||||
@image{font_char_metrics,,,,.png}
|
||||
@end ifnottex
|
||||
|
||||
An illustration of how the various font metrics apply to characters.
|
||||
|
||||
|
||||
1979
docs/grub.texi
1979
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
|
||||
@@ -7,12 +7,8 @@ include $(top_srcdir)/conf/Makefile.common
|
||||
CC=$(TARGET_CC)
|
||||
CPP=$(TARGET_CC)
|
||||
CCAS=$(TARGET_CC)
|
||||
|
||||
if COND_GRUB_MKFONT
|
||||
if COND_HAVE_FONT_SOURCE
|
||||
TARGET_CFLAGS += -DUSE_ASCII_FAILBACK=1 -DHAVE_UNIFONT_WIDTHSPEC=1
|
||||
endif
|
||||
endif
|
||||
RANLIB=$(TARGET_RANLIB)
|
||||
STRIP=$(TARGET_STRIP)
|
||||
|
||||
MACHO2IMG=$(top_builddir)/grub-macho2img
|
||||
|
||||
@@ -30,25 +26,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 +50,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
|
||||
@@ -91,36 +78,44 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/term.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h
|
||||
if !COND_clang
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
|
||||
endif
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h
|
||||
|
||||
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 +123,31 @@ 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_i386_xen
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/xen/hypercall.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/loader.h
|
||||
endif
|
||||
|
||||
if COND_x86_64_xen
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h
|
||||
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/x86_64/xen/hypercall.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/loader.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 +163,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 +182,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 +217,31 @@ 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_arm64_efi
|
||||
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 +292,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 +377,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
|
||||
|
||||
@@ -361,43 +389,44 @@ CLEANFILES += $(MOD_FILES)
|
||||
|
||||
if COND_ENABLE_EFIEMU
|
||||
efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF)
|
||||
-rm -f $@; \
|
||||
if test "x$(TARGET_APPLE_CC)" = x1; then \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF32 -DAPPLE_CC -m32 -Wall -Werror -nostdlib -O2 -c -o $@.bin $< || exit 1; \
|
||||
$(OBJCONV) -felf32 -nu -nd $@.bin $@ || exit 1; \
|
||||
rm -f $@.bin; \
|
||||
-rm -f $@
|
||||
-rm -f $@.bin
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -static -O2 -c -o $@.bin $<
|
||||
if test "x$(TARGET_APPLE_LINKER)" = x1; then \
|
||||
$(TARGET_OBJCONV) -felf32 -nu -nd $@.bin $@ || exit 1; \
|
||||
rm -f $@.bin ; \
|
||||
elif test ! -z "$(TARGET_OBJ2ELF)"; then \
|
||||
$(TARGET_OBJ2ELF) $@.bin || (rm -f $@.bin; exit 1); \
|
||||
mv $@.bin $@ ; \
|
||||
else \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF32 -m32 -Wall -Werror -nostdlib -O2 -c -o $@ $< || exit 1; \
|
||||
if test ! -z "$(TARGET_OBJ2ELF)"; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \
|
||||
mv $@.bin $@ ; \
|
||||
fi
|
||||
|
||||
# Link format -arch,x86_64 means Apple linker
|
||||
efiemu64_c.o: efiemu/runtime/efiemu.c
|
||||
if test "x$(TARGET_APPLE_CC)" = x1; then \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -DAPPLE_CC=1 -m64 -nostdlib -Wall -Werror -mno-red-zone -c -o $@ $< || exit 1; \
|
||||
else \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \
|
||||
fi
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $<
|
||||
|
||||
efiemu64_s.o: efiemu/runtime/efiemu.S
|
||||
-rm -f $@
|
||||
if test "x$(TARGET_APPLE_CC)" = x1; then \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -DAPPLE_CC=1 -m64 -Wall -Werror -nostdlib -O2 -mno-red-zone -c -o $@ $< || exit 1; \
|
||||
else \
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \
|
||||
fi
|
||||
$(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $<
|
||||
|
||||
efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF)
|
||||
-rm -f $@; \
|
||||
if test "x$(TARGET_APPLE_CC)" = x1; then \
|
||||
rm -f $@.bin; \
|
||||
$(TARGET_CC) -m64 -Wl,-r -nostdlib -o $@.bin $^ || exit 1; \
|
||||
$(OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \
|
||||
-rm -f $@
|
||||
-rm -f $@.bin
|
||||
$(TARGET_CC) -m64 $(EFIEMU64_LINK_FORMAT) -nostdlib -static -Wl,-r -o $@.bin $^
|
||||
if test "x$(EFIEMU64_LINK_FORMAT)" = x-arch,x86_64; then \
|
||||
$(TARGET_OBJCONV) -felf64 -nu -nd $@.bin $@ || exit 1; \
|
||||
rm -f $@.bin; \
|
||||
else \
|
||||
$(TARGET_CC) -m64 -nostdlib -Wl,-r -o $@ $^ || exit 1; \
|
||||
if test ! -z "$(TARGET_OBJ2ELF)"; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \
|
||||
mv $@.bin $@ ; \
|
||||
fi
|
||||
|
||||
platform_DATA += efiemu32.o efiemu64.o
|
||||
CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o
|
||||
endif
|
||||
|
||||
windowsdir=$(top_builddir)/$(PACKAGE)-$(VERSION)-for-windows
|
||||
windowsdir: $(PROGRAMS) $(starfield_DATA) $(platform_DATA)
|
||||
test -d $(windowsdir)/$(target_cpu)-$(platform) || mkdir $(windowsdir)/$(target_cpu)-$(platform)
|
||||
for x in $(platform_DATA); do \
|
||||
cp -fp $$x $(windowsdir)/$(target_cpu)-$(platform)/$$x; \
|
||||
done
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,86 @@
|
||||
#define MSG(x) movw $x, %si; call LOCAL(message)
|
||||
#define ERR(x) movw $x, %si; jmp LOCAL(error_message)
|
||||
|
||||
.macro floppy
|
||||
part_start:
|
||||
|
||||
LOCAL(probe_values):
|
||||
.byte 36, 18, 15, 9, 0
|
||||
|
||||
LOCAL(floppy_probe):
|
||||
pushw %dx
|
||||
/*
|
||||
* Perform floppy probe.
|
||||
*/
|
||||
#ifdef __APPLE__
|
||||
LOCAL(probe_values_minus_one) = LOCAL(probe_values) - 1
|
||||
movw MACRO_DOLLAR(LOCAL(probe_values_minus_one)), %si
|
||||
#else
|
||||
movw MACRO_DOLLAR(LOCAL(probe_values)) - 1, %si
|
||||
#endif
|
||||
|
||||
LOCAL(probe_loop):
|
||||
/* reset floppy controller INT 13h AH=0 */
|
||||
xorw %ax, %ax
|
||||
int MACRO_DOLLAR(0x13)
|
||||
|
||||
incw %si
|
||||
movb (%si), %cl
|
||||
|
||||
/* if number of sectors is 0, display error and die */
|
||||
testb %cl, %cl
|
||||
jnz 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 MACRO_DOLLAR(GRUB_BOOT_MACHINE_BUFFER_SEG), %bx
|
||||
movw %bx, %es
|
||||
xorw %bx, %bx
|
||||
movw MACRO_DOLLAR(0x201), %ax
|
||||
movb MACRO_DOLLAR(0), %ch
|
||||
movb MACRO_DOLLAR(0), %dh
|
||||
int MACRO_DOLLAR(0x13)
|
||||
|
||||
/* if error, jump to "LOCAL(probe_loop)" */
|
||||
jc LOCAL(probe_loop)
|
||||
|
||||
/* %cl is already the correct value! */
|
||||
movb MACRO_DOLLAR(1), %dh
|
||||
movb MACRO_DOLLAR(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 +131,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 +167,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 +182,13 @@ cylinder_start:
|
||||
kernel_address:
|
||||
.word GRUB_BOOT_MACHINE_KERNEL_ADDR
|
||||
|
||||
#ifndef HYBRID_BOOT
|
||||
. = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR
|
||||
kernel_sector:
|
||||
.long 1, 0
|
||||
.long 1
|
||||
kernel_sector_high:
|
||||
.long 0
|
||||
#endif
|
||||
|
||||
. = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE
|
||||
boot_drive:
|
||||
@@ -193,7 +292,7 @@ lba_mode:
|
||||
/* the absolute address */
|
||||
movl kernel_sector, %ebx
|
||||
movl %ebx, 8(%si)
|
||||
movl kernel_sector + 4, %ebx
|
||||
movl kernel_sector_high, %ebx
|
||||
movl %ebx, 12(%si)
|
||||
|
||||
/* the segment of buffer address */
|
||||
@@ -226,11 +325,12 @@ LOCAL(chs_mode):
|
||||
int $0x13
|
||||
jnc LOCAL(final_init)
|
||||
|
||||
popw %dx
|
||||
/*
|
||||
* The call failed, so maybe use the floppy probe instead.
|
||||
*/
|
||||
testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl
|
||||
jz LOCAL(floppy_probe)
|
||||
testb %dl, %dl
|
||||
jnb LOCAL(floppy_probe)
|
||||
|
||||
/* Nope, we definitely have a hard disk, and we're screwed. */
|
||||
ERR(hd_probe_error_string)
|
||||
@@ -261,7 +361,7 @@ LOCAL(final_init):
|
||||
|
||||
setup_sectors:
|
||||
/* load logical sector start (top half) */
|
||||
movl kernel_sector + 4, %eax
|
||||
movl kernel_sector_high, %eax
|
||||
|
||||
orl %eax, %eax
|
||||
jnz LOCAL(geometry_error)
|
||||
@@ -410,6 +510,13 @@ LOCAL(message):
|
||||
* number here.
|
||||
*/
|
||||
|
||||
#ifdef HYBRID_BOOT
|
||||
. = _start + 0x1b0
|
||||
kernel_sector:
|
||||
.long 1
|
||||
kernel_sector_high:
|
||||
.long 0
|
||||
#endif
|
||||
. = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC
|
||||
nt_magic:
|
||||
.long 0
|
||||
@@ -419,62 +526,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)
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <config.h>
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/i386/pc/memory.h>
|
||||
#include <grub/machine/memory.h>
|
||||
#include <grub/machine/boot.h>
|
||||
#include <grub/machine/kernel.h>
|
||||
@@ -51,6 +50,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
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
.extern __bss_start
|
||||
.extern _end
|
||||
.extern _edata
|
||||
|
||||
.globl __start, _start, start
|
||||
.set noreorder
|
||||
@@ -196,6 +197,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)
|
||||
@@ -233,8 +249,9 @@ cmdlinedone:
|
||||
#include "../../kern/mips/cache_flush.S"
|
||||
|
||||
/* Decompress the payload. */
|
||||
lui $a0, %hi(__bss_start)
|
||||
addiu $a0, $a0, %lo(__bss_start)
|
||||
lui $a0, %hi(_edata)
|
||||
addiu $a0, $a0, %lo(_edata)
|
||||
|
||||
lui $t0, %hi(base)
|
||||
addiu $t0, $t0, %lo(base)
|
||||
subu $a0, $a0, $t0
|
||||
@@ -250,13 +267,18 @@ cmdlinedone:
|
||||
*/
|
||||
move $s6, $a3
|
||||
|
||||
lui $t0, %hi(EXT_C(grub_decompress_core))
|
||||
addiu $t0, $t0, %lo(EXT_C(grub_decompress_core))
|
||||
lui $t9, %hi(EXT_C(grub_decompress_core))
|
||||
addiu $t9, $t9, %lo(EXT_C(grub_decompress_core))
|
||||
|
||||
#ifdef GRUB_MACHINE_ARC
|
||||
lui $sp, %hi(_start - 512)
|
||||
jalr $t9
|
||||
addiu $sp, $sp, %lo(_start - 512)
|
||||
#else
|
||||
lui $sp, %hi(_start - 256)
|
||||
jalr $t0
|
||||
jalr $t9
|
||||
addiu $sp, $sp, %lo(_start - 256)
|
||||
|
||||
#endif
|
||||
move $a0, $s1
|
||||
move $a1, $s6
|
||||
|
||||
@@ -267,3 +289,11 @@ cmdlinedone:
|
||||
|
||||
jr $t1
|
||||
nop
|
||||
/* Ensure that .data section is created. In code we suppose that _edata
|
||||
is first location not in decompressor image. Strictly speaking it's
|
||||
_edata only when .data is present and _etext otherwise. But checking
|
||||
for .data presence would cost more in code than it is to ensure that
|
||||
.data is created.
|
||||
*/
|
||||
.data
|
||||
.long 0
|
||||
|
||||
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 + SCRATCH_PAD_BOOT_SIZE)
|
||||
#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"
|
||||
@@ -129,7 +140,11 @@ prom_call:
|
||||
|
||||
boot_continue:
|
||||
mov %o7, PIC_REG /* PIC base */
|
||||
#ifndef CDBOOT
|
||||
sethi %hi(SCRATCH_PAD_BOOT), %l1 /* OF argument slots */
|
||||
#else
|
||||
GET_ABS(_start + 512, %l1) /* OF argument slots */
|
||||
#endif
|
||||
|
||||
/* Find the /chosen node so we can fetch the stdout handle,
|
||||
* and thus perform console output.
|
||||
@@ -158,8 +173,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 +211,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);
|
||||
}
|
||||
|
||||
|
||||
42
grub-core/bus/i386/ieee1275/pci.c
Normal file
42
grub-core/bus/i386/ieee1275/pci.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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/pci.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/ieee1275/ieee1275.h>
|
||||
|
||||
volatile void *
|
||||
grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)),
|
||||
grub_addr_t base,
|
||||
grub_size_t size)
|
||||
{
|
||||
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE))
|
||||
return (volatile void *) base;
|
||||
if (grub_ieee1275_map (base, base, size, 7))
|
||||
grub_fatal ("couldn't map 0x%lx", base);
|
||||
return (volatile void *) base;
|
||||
}
|
||||
|
||||
void
|
||||
grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)),
|
||||
volatile void *mem __attribute__ ((unused)),
|
||||
grub_size_t size __attribute__ ((unused)))
|
||||
{
|
||||
}
|
||||
@@ -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,20 @@ grub_ehci_pci_iter (grub_pci_device_t dev,
|
||||
"EHCI grub_ehci_pci_iter: registers above 4G are not supported\n");
|
||||
return 0;
|
||||
}
|
||||
base &= GRUB_PCI_ADDR_MEM_MASK;
|
||||
if (!base)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI: EHCI is not mapped\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_MEM_ENABLED
|
||||
| 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 +679,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 +725,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 +746,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 +761,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 +804,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 +878,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 +886,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 +948,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 +982,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 +993,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 +1059,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 +1300,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 +1576,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 +1599,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 +1660,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);
|
||||
|
||||
@@ -1658,7 +1686,7 @@ grub_ehci_hubports (grub_usb_controller_t dev)
|
||||
return portinfo;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
static grub_usb_err_t
|
||||
grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
{
|
||||
@@ -1680,18 +1708,20 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (grub_ehci_port_read (e, port) & GRUB_EHCI_PORT_ENABLED)
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "portstatus: EHCI Timed out - disable");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
if (!enable) /* We don't need reset port */
|
||||
{
|
||||
grub_dprintf ("ehci", "portstatus: Disabled.\n");
|
||||
grub_dprintf ("ehci", "portstatus: end, status=0x%02x\n",
|
||||
grub_ehci_port_read (e, port));
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
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 */
|
||||
@@ -1703,8 +1733,8 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (grub_ehci_port_read (e, port) & GRUB_EHCI_PORT_RESET)
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO,
|
||||
"portstatus: EHCI Timed out - reset port");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
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 */
|
||||
@@ -1731,7 +1761,7 @@ grub_ehci_portstatus (grub_usb_controller_t dev,
|
||||
grub_dprintf ("ehci", "portstatus: end, status=0x%02x\n",
|
||||
grub_ehci_port_read (e, port));
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_usb_speed_t
|
||||
@@ -1810,7 +1840,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
|
||||
@@ -1866,7 +1896,7 @@ grub_ehci_restore_hw (void)
|
||||
}
|
||||
}
|
||||
|
||||
return GRUB_USB_ERR_NONE;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -1877,16 +1907,19 @@ 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;
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
static struct grub_usb_controller_dev usb_controller = {
|
||||
@@ -1897,15 +1930,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;
|
||||
@@ -264,11 +265,20 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
|
||||
addr = grub_pci_make_address (dev, GRUB_PCI_REG_ADDRESS_REG0);
|
||||
base = grub_pci_read (addr);
|
||||
|
||||
#if 0
|
||||
/* Stop if there is no IO space base address defined. */
|
||||
if (! (base & 1))
|
||||
return 0;
|
||||
#endif
|
||||
base &= GRUB_PCI_ADDR_MEM_MASK;
|
||||
if (!base)
|
||||
{
|
||||
grub_dprintf ("ehci",
|
||||
"EHCI: EHCI is not mapper\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_MEM_ENABLED
|
||||
| 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 +482,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 +496,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;
|
||||
}
|
||||
|
||||
@@ -1210,7 +1220,7 @@ grub_ohci_cancel_transfer (grub_usb_controller_t dev,
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
static grub_usb_err_t
|
||||
grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
{
|
||||
@@ -1230,11 +1240,11 @@ grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
while ((grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)
|
||||
& (1 << 1)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "OHCI Timed out - disable");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
grub_dprintf ("ohci", "end of portstatus=0x%02x\n",
|
||||
grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port));
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* OHCI does one reset signal 10ms long but USB spec.
|
||||
@@ -1251,7 +1261,7 @@ grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
while (! (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)
|
||||
& GRUB_OHCI_SET_PORT_RESET_STATUS_CHANGE))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "OHCI Timed out - reset");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
/* End the reset signaling - reset the reset status change */
|
||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port,
|
||||
@@ -1269,7 +1279,7 @@ grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
while (! (grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port)
|
||||
& (1 << 1)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "OHCI Timed out - enable");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
/* Reset bit Connect Status Change */
|
||||
grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port,
|
||||
@@ -1281,7 +1291,7 @@ grub_ohci_portstatus (grub_usb_controller_t dev,
|
||||
grub_dprintf ("ohci", "end of portstatus=0x%02x\n",
|
||||
grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port));
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_usb_speed_t
|
||||
@@ -1426,7 +1436,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 +1447,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)
|
||||
|
||||
@@ -91,11 +91,13 @@ real_config (struct grub_serial_port *port)
|
||||
|
||||
grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT,
|
||||
GRUB_FTDI_MODEM_CTRL,
|
||||
GRUB_FTDI_MODEM_CTRL_DTRRTS, 0, 0, 0);
|
||||
port->config.rtscts ? GRUB_FTDI_MODEM_CTRL_DTRRTS : 0,
|
||||
0, 0, 0);
|
||||
|
||||
grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT,
|
||||
GRUB_FTDI_FLOW_CTRL,
|
||||
GRUB_FTDI_FLOW_CTRL_DTRRTS, 0, 0, 0);
|
||||
port->config.rtscts ? GRUB_FTDI_FLOW_CTRL_DTRRTS : 0,
|
||||
0, 0, 0);
|
||||
|
||||
divisor = get_divisor (port->config.speed);
|
||||
grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT,
|
||||
@@ -128,7 +130,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 +195,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 =
|
||||
|
||||
@@ -125,7 +125,7 @@ real_config (struct grub_serial_port *port)
|
||||
0x22, 3, 0, 0, 0);
|
||||
|
||||
grub_usb_control_msg (port->usbdev, GRUB_USB_REQTYPE_VENDOR_OUT,
|
||||
1, 0, 0x61, 0, 0);
|
||||
1, 0, port->config.rtscts ? 0x61 : 0, 0, 0);
|
||||
port->configured = 1;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -178,16 +189,12 @@ grub_uhci_writereg32 (struct grub_uhci *u,
|
||||
grub_outl (val, u->iobase + reg);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable);
|
||||
|
||||
|
||||
/* 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;
|
||||
@@ -210,24 +217,31 @@ grub_uhci_pci_iter (grub_pci_device_t dev,
|
||||
if (class != 0x0c || subclass != 0x03 || interf != 0x00)
|
||||
return 0;
|
||||
|
||||
/* 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));
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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_IO_ENABLED
|
||||
| GRUB_PCI_COMMAND_BUS_MASTER
|
||||
| GRUB_PCI_COMMAND_MEM_ENABLED
|
||||
| grub_pci_read_word (addr));
|
||||
|
||||
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 +365,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 +405,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 +414,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 +600,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 +696,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,14 +704,14 @@ 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;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
static grub_usb_err_t
|
||||
grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
unsigned int port, unsigned int enable)
|
||||
{
|
||||
@@ -704,8 +729,7 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
else if (port == 1)
|
||||
reg = GRUB_UHCI_REG_PORTSC2;
|
||||
else
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE,
|
||||
"UHCI Root Hub port does not exist");
|
||||
return GRUB_USB_ERR_INTERNAL;
|
||||
|
||||
status = grub_uhci_readreg16 (u, reg);
|
||||
grub_dprintf ("uhci", "detect=0x%02x\n", status);
|
||||
@@ -718,11 +742,11 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while ((grub_uhci_readreg16 (u, reg) & (1 << 2)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "UHCI Timed out - disable");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
status = grub_uhci_readreg16 (u, reg);
|
||||
grub_dprintf ("uhci", ">3detect=0x%02x\n", status);
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
/* Reset the port. */
|
||||
@@ -753,7 +777,7 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
endtime = grub_get_time_ms () + 1000;
|
||||
while (! ((status = grub_uhci_readreg16 (u, reg)) & (1 << 2)))
|
||||
if (grub_get_time_ms () > endtime)
|
||||
return grub_error (GRUB_ERR_IO, "UHCI Timed out - enable");
|
||||
return GRUB_USB_ERR_TIMEOUT;
|
||||
|
||||
/* Reset recovery time */
|
||||
grub_millisleep (10);
|
||||
@@ -763,7 +787,7 @@ grub_uhci_portstatus (grub_usb_controller_t dev,
|
||||
grub_dprintf ("uhci", ">3detect=0x%02x\n", status);
|
||||
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
static grub_usb_speed_t
|
||||
@@ -787,7 +811,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 +821,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 +846,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;
|
||||
}
|
||||
@@ -181,7 +195,7 @@ grub_usb_add_hub (grub_usb_device_t dev)
|
||||
|
||||
rescan = 1;
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
return GRUB_USB_ERR_NONE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -189,48 +203,30 @@ attach_root_port (struct grub_usb_hub *hub, int portno,
|
||||
grub_usb_speed_t speed)
|
||||
{
|
||||
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;
|
||||
grub_usb_err_t err;
|
||||
|
||||
#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,95 @@
|
||||
|
||||
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 += length >> GRUB_DISK_SECTOR_BITS;
|
||||
sector += length >> GRUB_DISK_SECTOR_BITS;
|
||||
length &= (GRUB_DISK_SECTOR_SIZE - 1);
|
||||
}
|
||||
|
||||
if (!length)
|
||||
return;
|
||||
print_blocklist (ctx->start_sector, ctx->num_sectors, 0, 0, ctx);
|
||||
ctx->num_sectors = 0;
|
||||
}
|
||||
|
||||
if (offset)
|
||||
{
|
||||
unsigned l = length + offset;
|
||||
l &= (GRUB_DISK_SECTOR_SIZE - 1);
|
||||
l -= offset;
|
||||
print_blocklist (sector, 0, offset, l, ctx);
|
||||
length -= l;
|
||||
sector++;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
if (!length)
|
||||
return;
|
||||
|
||||
if (length & (GRUB_DISK_SECTOR_SIZE - 1))
|
||||
{
|
||||
if (length >> GRUB_DISK_SECTOR_BITS)
|
||||
{
|
||||
print_blocklist (sector, length >> GRUB_DISK_SECTOR_BITS, 0, 0, ctx);
|
||||
sector += length >> GRUB_DISK_SECTOR_BITS;
|
||||
}
|
||||
print_blocklist (sector, 0, 0, length & (GRUB_DISK_SECTOR_SIZE - 1), ctx);
|
||||
}
|
||||
else
|
||||
{
|
||||
ctx->start_sector = sector;
|
||||
ctx->num_sectors = length >> GRUB_DISK_SECTOR_BITS;
|
||||
}
|
||||
}
|
||||
|
||||
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 +130,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);
|
||||
|
||||
|
||||
@@ -146,8 +146,7 @@ grub_loader_boot (void)
|
||||
return grub_error (GRUB_ERR_NO_KERNEL,
|
||||
N_("you need to load the kernel first"));
|
||||
|
||||
if (grub_loader_flags & GRUB_LOADER_FLAG_NORETURN)
|
||||
grub_machine_fini ();
|
||||
grub_machine_fini (grub_loader_flags);
|
||||
|
||||
for (cur = preboots_head; cur; cur = cur->next)
|
||||
{
|
||||
@@ -183,22 +182,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,17 +63,23 @@ 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_uint8_t readbuf[4096];
|
||||
void *context;
|
||||
grub_uint8_t *readbuf;
|
||||
#define BUF_SIZE 4096
|
||||
readbuf = grub_malloc (BUF_SIZE);
|
||||
if (!readbuf)
|
||||
return grub_errno;
|
||||
context = grub_zalloc (hash->contextsize);
|
||||
if (!readbuf || !context)
|
||||
goto fail;
|
||||
|
||||
grub_memset (context, 0, sizeof (context));
|
||||
hash->init (context);
|
||||
while (1)
|
||||
{
|
||||
grub_ssize_t r;
|
||||
r = grub_file_read (file, readbuf, sizeof (readbuf));
|
||||
r = grub_file_read (file, readbuf, BUF_SIZE);
|
||||
if (r < 0)
|
||||
return grub_errno;
|
||||
goto fail;
|
||||
if (r == 0)
|
||||
break;
|
||||
hash->write (context, readbuf, r);
|
||||
@@ -81,7 +87,15 @@ hash_file (grub_file_t file, const gcry_md_spec_t *hash, void *result)
|
||||
hash->final (context);
|
||||
grub_memcpy (result, hash->read (context), hash->mdlen);
|
||||
|
||||
grub_free (readbuf);
|
||||
grub_free (context);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
fail:
|
||||
grub_free (readbuf);
|
||||
grub_free (context);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -90,12 +104,15 @@ check_list (const gcry_md_spec_t *hash, const char *hashfilename,
|
||||
{
|
||||
grub_file_t hashlist, file;
|
||||
char *buf = NULL;
|
||||
grub_uint8_t expected[hash->mdlen];
|
||||
grub_uint8_t actual[hash->mdlen];
|
||||
grub_uint8_t expected[GRUB_CRYPTO_MAX_MDLEN];
|
||||
grub_uint8_t actual[GRUB_CRYPTO_MAX_MDLEN];
|
||||
grub_err_t err;
|
||||
unsigned i;
|
||||
unsigned unread = 0, mismatch = 0;
|
||||
|
||||
if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN)
|
||||
return grub_error (GRUB_ERR_BUG, "mdlen is too long");
|
||||
|
||||
hashlist = grub_file_open (hashfilename);
|
||||
if (!hashlist)
|
||||
return grub_errno;
|
||||
@@ -205,6 +222,9 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
||||
if (!hash)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown hash");
|
||||
|
||||
if (hash->mdlen > GRUB_CRYPTO_MAX_MDLEN)
|
||||
return grub_error (GRUB_ERR_BUG, "mdlen is too long");
|
||||
|
||||
if (state[2].set)
|
||||
prefix = state[2].arg;
|
||||
|
||||
@@ -218,7 +238,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
|
||||
|
||||
for (i = 0; i < (unsigned) argc; i++)
|
||||
{
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (result, hash->mdlen);
|
||||
GRUB_PROPERLY_ALIGNED_ARRAY (result, GRUB_CRYPTO_MAX_MDLEN);
|
||||
grub_file_t file;
|
||||
grub_err_t err;
|
||||
unsigned j;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -81,7 +81,25 @@ grub_cmd_cmosclean (struct grub_command *cmd __attribute__ ((unused)),
|
||||
return grub_cmos_write (byte, value & (~(1 << bit)));
|
||||
}
|
||||
|
||||
static grub_command_t cmd, cmd_clean;
|
||||
static grub_err_t
|
||||
grub_cmd_cmosset (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc, char *argv[])
|
||||
{
|
||||
int byte, bit;
|
||||
grub_err_t err;
|
||||
grub_uint8_t value;
|
||||
|
||||
err = parse_args (argc, argv, &byte, &bit);
|
||||
if (err)
|
||||
return err;
|
||||
err = grub_cmos_read (byte, &value);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return grub_cmos_write (byte, value | (1 << bit));
|
||||
}
|
||||
|
||||
static grub_command_t cmd, cmd_clean, cmd_set;
|
||||
|
||||
|
||||
GRUB_MOD_INIT(cmostest)
|
||||
@@ -92,10 +110,14 @@ GRUB_MOD_INIT(cmostest)
|
||||
cmd_clean = grub_register_command ("cmosclean", grub_cmd_cmosclean,
|
||||
N_("BYTE:BIT"),
|
||||
N_("Clean bit at BYTE:BIT in CMOS."));
|
||||
cmd_set = grub_register_command ("cmosset", grub_cmd_cmosset,
|
||||
N_("BYTE:BIT"),
|
||||
N_("Set bit at BYTE:BIT in CMOS."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(cmostest)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
grub_unregister_command (cmd_clean);
|
||||
grub_unregister_command (cmd_set);
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
79
grub-core/commands/i386/nthibr.c
Normal file
79
grub-core/commands/i386/nthibr.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* nthibr.c - tests whether an MS Windows system partition is hibernated */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2013 Peter Lustig
|
||||
* 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/mm.h>
|
||||
#include <grub/file.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/err.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
GRUB_MOD_LICENSE ("GPLv3+");
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_nthibr (grub_command_t cmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
{
|
||||
grub_uint8_t hibr_file_magic[4];
|
||||
grub_file_t hibr_file = 0;
|
||||
|
||||
if (argc != 1)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
|
||||
hibr_file = grub_file_open (args[0]);
|
||||
if (!hibr_file)
|
||||
return grub_errno;
|
||||
|
||||
/* Try to read magic number of 'hiberfil.sys' */
|
||||
if (grub_file_read (hibr_file, hibr_file_magic,
|
||||
sizeof (hibr_file_magic))
|
||||
!= (grub_ssize_t) sizeof (hibr_file_magic))
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_TEST_FAILURE, "false");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!(grub_memcmp ("hibr", hibr_file_magic, sizeof (hibr_file_magic)) == 0
|
||||
|| grub_memcmp ("HIBR", hibr_file_magic, sizeof (hibr_file_magic)) == 0))
|
||||
grub_error (GRUB_ERR_TEST_FAILURE, "false");
|
||||
|
||||
exit:
|
||||
grub_file_close (hibr_file);
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
static grub_command_t cmd;
|
||||
|
||||
GRUB_MOD_INIT (check_nt_hiberfil)
|
||||
{
|
||||
cmd = grub_register_command ("check_nt_hiberfil", grub_cmd_nthibr,
|
||||
N_("FILE"),
|
||||
N_("Test whether a hiberfil.sys is "
|
||||
"in hibernated state."));
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI (check_nt_hiberfil)
|
||||
{
|
||||
grub_unregister_command (cmd);
|
||||
}
|
||||
@@ -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);
|
||||
@@ -357,7 +358,7 @@ grub_cmd_legacy_kernel (struct grub_command *mycmd __attribute__ ((unused)),
|
||||
dev = grub_device_open (0);
|
||||
if (dev && dev->disk
|
||||
&& dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID
|
||||
&& dev->disk->dev->id >= 0x80 && dev->disk->dev->id <= 0x90)
|
||||
&& dev->disk->id >= 0x80 && dev->disk->id <= 0x90)
|
||||
{
|
||||
struct grub_partition *part = dev->disk->partition;
|
||||
bsd_device = dev->disk->id - 0x80 - hdbias;
|
||||
@@ -545,8 +546,6 @@ struct legacy_md5_password
|
||||
grub_uint8_t hash[MD5_HASHLEN];
|
||||
};
|
||||
|
||||
#pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
|
||||
|
||||
static int
|
||||
check_password_md5_real (const char *entered,
|
||||
struct legacy_md5_password *pw)
|
||||
@@ -554,8 +553,13 @@ check_password_md5_real (const char *entered,
|
||||
grub_size_t enteredlen = grub_strlen (entered);
|
||||
unsigned char alt_result[MD5_HASHLEN];
|
||||
unsigned char *digest;
|
||||
grub_uint8_t ctx[GRUB_MD_MD5->contextsize];
|
||||
grub_uint8_t *ctx;
|
||||
grub_size_t i;
|
||||
int ret;
|
||||
|
||||
ctx = grub_zalloc (GRUB_MD_MD5->contextsize);
|
||||
if (!ctx)
|
||||
return 0;
|
||||
|
||||
GRUB_MD_MD5->init (ctx);
|
||||
GRUB_MD_MD5->write (ctx, entered, enteredlen);
|
||||
@@ -601,7 +605,9 @@ check_password_md5_real (const char *entered,
|
||||
GRUB_MD_MD5->final (ctx);
|
||||
}
|
||||
|
||||
return (grub_crypto_memcmp (digest, pw->hash, MD5_HASHLEN) == 0);
|
||||
ret = (grub_crypto_memcmp (digest, pw->hash, MD5_HASHLEN) == 0);
|
||||
grub_free (ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
@@ -724,18 +730,12 @@ grub_cmd_legacy_password (struct grub_command *mycmd __attribute__ ((unused)),
|
||||
NULL);
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_legacy_check_password (struct grub_command *mycmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
int
|
||||
grub_legacy_check_md5_password (int argc, char **args,
|
||||
char *entered)
|
||||
{
|
||||
struct legacy_md5_password *pw = NULL;
|
||||
char entered[GRUB_AUTH_MAX_PASSLEN];
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
grub_puts_ (N_("Enter password: "));
|
||||
if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN))
|
||||
return GRUB_ACCESS_DENIED;
|
||||
int ret;
|
||||
|
||||
if (args[0][0] != '-' || args[0][1] != '-')
|
||||
{
|
||||
@@ -744,17 +744,33 @@ grub_cmd_legacy_check_password (struct grub_command *mycmd __attribute__ ((unuse
|
||||
grub_memset (correct, 0, sizeof (correct));
|
||||
grub_strncpy (correct, args[0], sizeof (correct));
|
||||
|
||||
if (grub_crypto_memcmp (entered, correct, GRUB_AUTH_MAX_PASSLEN) != 0)
|
||||
return GRUB_ACCESS_DENIED;
|
||||
return GRUB_ERR_NONE;
|
||||
return grub_crypto_memcmp (entered, correct, GRUB_AUTH_MAX_PASSLEN) == 0;
|
||||
}
|
||||
|
||||
pw = parse_legacy_md5 (argc, args);
|
||||
|
||||
if (!pw)
|
||||
return 0;
|
||||
|
||||
ret = check_password_md5_real (entered, pw);
|
||||
grub_free (pw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_legacy_check_password (struct grub_command *mycmd __attribute__ ((unused)),
|
||||
int argc, char **args)
|
||||
{
|
||||
char entered[GRUB_AUTH_MAX_PASSLEN];
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("one argument expected"));
|
||||
grub_puts_ (N_("Enter password: "));
|
||||
if (!grub_password_get (entered, GRUB_AUTH_MAX_PASSLEN))
|
||||
return GRUB_ACCESS_DENIED;
|
||||
|
||||
if (!check_password_md5_real (entered, pw))
|
||||
if (!grub_legacy_check_md5_password (argc, args,
|
||||
entered))
|
||||
return GRUB_ACCESS_DENIED;
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
||||
@@ -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:
|
||||
@@ -216,10 +259,28 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
|
||||
for (p = blocklists; p; p = p->next)
|
||||
{
|
||||
struct blocklist *q;
|
||||
/* Check if any pair of blocks overlap. */
|
||||
for (q = p->next; q; q = q->next)
|
||||
{
|
||||
/* Check if any pair of blocks overlap. */
|
||||
if (p->sector == q->sector)
|
||||
grub_disk_addr_t s1, s2;
|
||||
grub_disk_addr_t e1, e2, t;
|
||||
|
||||
s1 = p->sector;
|
||||
e1 = s1 + ((p->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
|
||||
|
||||
s2 = q->sector;
|
||||
e2 = s2 + ((q->length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS);
|
||||
|
||||
if (s2 > s1)
|
||||
{
|
||||
t = s2;
|
||||
s2 = s1;
|
||||
s1 = t;
|
||||
t = e2;
|
||||
e2 = e1;
|
||||
e1 = t;
|
||||
}
|
||||
if (e1 > s2)
|
||||
{
|
||||
/* This might be actually valid, but it is unbelievable that
|
||||
any filesystem makes such a silly allocation. */
|
||||
@@ -243,9 +304,18 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists,
|
||||
part_start = grub_partition_get_start (disk->partition);
|
||||
|
||||
buf = grub_envblk_buffer (envblk);
|
||||
char *blockbuf = NULL;
|
||||
grub_size_t blockbuf_len = 0;
|
||||
for (p = blocklists, index = 0; p; index += p->length, p = p->next)
|
||||
{
|
||||
char blockbuf[GRUB_DISK_SECTOR_SIZE];
|
||||
if (p->length > blockbuf_len)
|
||||
{
|
||||
grub_free (blockbuf);
|
||||
blockbuf_len = 2 * p->length;
|
||||
blockbuf = grub_malloc (blockbuf_len);
|
||||
if (!blockbuf)
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
if (grub_disk_read (disk, p->sector - part_start,
|
||||
p->offset, p->length, blockbuf))
|
||||
@@ -283,49 +353,53 @@ 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;
|
||||
|
||||
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 +409,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)
|
||||
@@ -357,17 +432,19 @@ grub_cmd_save_env (grub_extcmd_context_t ctxt, int argc, char **args)
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
else
|
||||
grub_envblk_delete (envblk, args[0]);
|
||||
|
||||
argc--;
|
||||
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 +454,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,93 @@ 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)
|
||||
{
|
||||
grub_file_t file;
|
||||
char *pathname;
|
||||
|
||||
if (ctx->dirname[grub_strlen (ctx->dirname) - 1] == '/')
|
||||
pathname = grub_xasprintf ("%s%s", ctx->dirname, filename);
|
||||
else
|
||||
pathname = grub_xasprintf ("%s/%s", ctx->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 (! ctx->human)
|
||||
grub_printf ("%-12llu", (unsigned long long) file->size);
|
||||
else
|
||||
grub_printf ("%-12s", grub_get_human_size (file->size,
|
||||
GRUB_HUMAN_SIZE_SHORT));
|
||||
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 (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 +178,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 +205,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 +240,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;
|
||||
}
|
||||
|
||||
|
||||
317
grub-core/commands/nativedisk.c
Normal file
317
grub-core/commands/nativedisk.c
Normal file
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* 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:
|
||||
case GRUB_DISK_DEVICE_XEN:
|
||||
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,20 @@
|
||||
|
||||
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,
|
||||
void *data __attribute__ ((unused)))
|
||||
{
|
||||
for (; len >= GRUB_DISK_SECTOR_SIZE; len -= GRUB_DISK_SECTOR_SIZE)
|
||||
grub_xputs (".");
|
||||
if (len)
|
||||
grub_xputs (".");
|
||||
grub_refresh ();
|
||||
}
|
||||
|
||||
static grub_err_t
|
||||
grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
|
||||
int argc, char *argv[])
|
||||
@@ -39,15 +53,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 +73,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");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user