forked from rhboot/shim-review
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrub2_2.02~beta3-4-igel-r120.diff
3685 lines (3680 loc) · 123 KB
/
grub2_2.02~beta3-4-igel-r120.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff -Naurp grub2_2.02~beta3-4.ori/debian/control grub2_2.02~beta3-4/debian/control
--- grub2_2.02~beta3-4.ori/debian/control 2017-04-27 14:10:50.025831000 +0200
+++ grub2_2.02~beta3-4/debian/control 2017-04-27 14:10:50.025831000 +0200
@@ -14,13 +14,15 @@ Build-Depends: debhelper (>= 7.4.2~),
po-debconf,
help2man,
texinfo,
- gcc-6,
- gcc-6-multilib [i386 kopensolaris-i386 any-amd64 any-ppc64 any-sparc],
+# gcc-6,
+# gcc-6-multilib [i386 kopensolaris-i386 any-amd64 any-ppc64 any-sparc],
+ gcc,
+ gcc-multilib,
xfonts-unifont,
libfreetype6-dev,
gettext,
libdevmapper-dev [linux-any],
- libgeom-dev (>= 8.2+ds1-1~) [kfreebsd-any] | libgeom-dev (<< 8.2) [kfreebsd-any],
+# libgeom-dev (>= 8.2+ds1-1~) [kfreebsd-any] | libgeom-dev (<< 8.2) [kfreebsd-any],
libsdl1.2-dev [!hurd-any],
xorriso,
qemu-system [i386 kfreebsd-i386 kopensolaris-i386 any-amd64],
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-cdboot-fix.patch grub2_2.02~beta3-4/debian/patches/IGEL-cdboot-fix.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-cdboot-fix.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-cdboot-fix.patch 2016-10-21 14:01:55.988908000 +0200
@@ -0,0 +1,55 @@
+Index: igelworkdir/grub-core/disk/i386/pc/biosdisk.c
+===================================================================
+--- igelworkdir.orig/grub-core/disk/i386/pc/biosdisk.c
++++ igelworkdir/grub-core/disk/i386/pc/biosdisk.c
+@@ -28,6 +28,7 @@
+ #include <grub/err.h>
+ #include <grub/term.h>
+ #include <grub/i18n.h>
++#include <grub/env.h>
+
+ GRUB_MOD_LICENSE ("GPLv3+");
+
+@@ -291,6 +292,7 @@ grub_biosdisk_iterate (grub_disk_dev_ite
+ {
+ int num_floppies;
+ int drive;
++ const char *probe_cd_drives_env = NULL;
+
+ /* For hard disks, attempt to read the MBR. */
+ switch (pull)
+@@ -311,11 +313,34 @@ grub_biosdisk_iterate (grub_disk_dev_ite
+ return 0;
+
+ case GRUB_DISK_PULL_REMOVABLE:
++ probe_cd_drives_env = grub_env_get("PROBE_CD_DRIVES");
+ if (cd_drive)
+ {
+ if (grub_biosdisk_call_hook (hook, hook_data, cd_drive))
+ return 1;
+ }
++ else if (probe_cd_drives_env)
++ {
++ /* probe cd drive */
++ for (drive = 0x9f; drive < 0xf0; drive++)
++ {
++ struct grub_biosdisk_cdrp *cdrp
++ = (struct grub_biosdisk_cdrp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
++
++ cd_drive = drive;
++ grub_memset (cdrp, 0, sizeof (*cdrp));
++ cdrp->size = sizeof (*cdrp);
++ cdrp->media_type = 0xFF;
++ if ((! grub_biosdisk_get_cdinfo_int13_extensions (cd_drive, cdrp))
++ && ((cdrp->media_type & GRUB_BIOSDISK_CDTYPE_MASK)
++ == GRUB_BIOSDISK_CDTYPE_NO_EMUL))
++ {
++ if (grub_biosdisk_call_hook (hook, hook_data, cd_drive))
++ return 1;
++ }
++ cd_drive = 0;
++ }
++ }
+
+ /* For floppy disks, we can get the number safely. */
+ num_floppies = grub_biosdisk_get_num_floppies ();
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-change-menu-text.patch grub2_2.02~beta3-4/debian/patches/IGEL-change-menu-text.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-change-menu-text.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-change-menu-text.patch 2016-06-15 09:13:37.153548000 +0200
@@ -0,0 +1,102 @@
+--- a/grub-core/normal/main.c
++++ b/grub-core/normal/main.c
+@@ -200,7 +200,7 @@ grub_normal_init_page (struct grub_term_
+
+ grub_term_cls (term);
+
+- msg_formatted = grub_xasprintf (_("GNU GRUB version %s"), PACKAGE_VERSION);
++ msg_formatted = grub_xasprintf ("IGEL Technology GmbH");
+ if (!msg_formatted)
+ return;
+
+@@ -349,31 +349,17 @@ static grub_err_t
+ grub_normal_reader_init (int nested)
+ {
+ struct grub_term_output *term;
+- const char *msg_esc = _("ESC at any time exits.");
+- char *msg_formatted;
+-
+- msg_formatted = grub_xasprintf (_("Minimal BASH-like line editing is supported. For "
+- "the first word, TAB lists possible command completions. Anywhere "
+- "else TAB lists possible device or file completions. %s"),
+- nested ? msg_esc : "");
+- if (!msg_formatted)
+- return grub_errno;
+
+ FOR_ACTIVE_TERM_OUTPUTS(term)
+ {
+ grub_normal_init_page (term, 1);
+ grub_term_setcursor (term, 1);
+-
+- if (grub_term_width (term) > 3 + STANDARD_MARGIN + 20)
+- grub_print_message_indented (msg_formatted, 3, STANDARD_MARGIN, term);
+- else
+- grub_print_message_indented (msg_formatted, 0, 0, term);
+- grub_putcode ('\n', term);
+- grub_putcode ('\n', term);
+- grub_putcode ('\n', term);
++ if (nested) {
++ grub_putcode ('\n', term);
++ grub_putcode ('\n', term);
++ }
+ }
+- grub_free (msg_formatted);
+-
++
+ return 0;
+ }
+
+--- a/grub-core/normal/menu_text.c
++++ b/grub-core/normal/menu_text.c
+@@ -157,14 +157,13 @@ print_message (int nested, int edit, str
+
+ if (edit)
+ {
+- ret += grub_print_message_indented_real (_("Minimum Emacs-like screen editing is \
+-supported. TAB lists completions. Press Ctrl-x or F10 to boot, Ctrl-c or F2 for a \
+-command-line or ESC to discard edits and return to the GRUB menu."),
++ ret += grub_print_message_indented_real ("",
+ STANDARD_MARGIN, STANDARD_MARGIN,
+ term, dry_run);
+ }
+ else
+ {
++#if 0
+ char *msg_translated;
+
+ msg_translated = grub_xasprintf (_("Use the %C and %C keys to select which "
+@@ -173,27 +172,22 @@ command-line or ESC to discard edits and
+ GRUB_UNICODE_DOWNARROW);
+ if (!msg_translated)
+ return 0;
+- ret += grub_print_message_indented_real (msg_translated, STANDARD_MARGIN,
++#endif
++ ret += grub_print_message_indented_real ("", STANDARD_MARGIN,
+ STANDARD_MARGIN, term, dry_run);
+-
++#if 0
+ grub_free (msg_translated);
+-
++#endif
+ if (nested)
+ {
+ ret += grub_print_message_indented_real
+- (_("Press enter to boot the selected OS, "
+- "`e' to edit the commands before booting "
+- "or `c' for a command-line. ESC to return previous menu."),
+- STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
++ ("", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
+ }
+ else
+ {
+ ret += grub_print_message_indented_real
+- (_("Press enter to boot the selected OS, "
+- "`e' to edit the commands before booting "
+- "or `c' for a command-line."),
+- STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
+- }
++ ("", STANDARD_MARGIN, STANDARD_MARGIN, term, dry_run);
++ }
+ }
+ return ret;
+ }
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-efi-fix.patch grub2_2.02~beta3-4/debian/patches/IGEL-efi-fix.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-efi-fix.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-efi-fix.patch 2016-10-13 16:41:16.025316000 +0200
@@ -0,0 +1,31 @@
+Index: igelworkdir/grub-core/video/efi_gop.c
+===================================================================
+--- igelworkdir.orig/grub-core/video/efi_gop.c
++++ igelworkdir/grub-core/video/efi_gop.c
+@@ -370,8 +370,9 @@ grub_video_gop_setup (unsigned int width
+ err = grub_gop_get_preferred_mode (&preferred_width, &preferred_height);
+ if (err || preferred_width >= 4096 || preferred_height >= 4096)
+ {
+- preferred_width = 800;
+- preferred_height = 600;
++ /* lang@igel: instead of 800x600 use 1024x768 for fall back */
++ preferred_width = 1024;
++ preferred_height = 768;
+ grub_errno = GRUB_ERR_NONE;
+ }
+ }
+Index: igelworkdir/grub-core/video/efi_uga.c
+===================================================================
+--- igelworkdir.orig/grub-core/video/efi_uga.c
++++ igelworkdir/grub-core/video/efi_uga.c
+@@ -226,8 +226,9 @@ grub_video_uga_setup (unsigned int width
+ grub_uint32_t d;
+ grub_uint32_t r;
+
++ /* with gfxmode=auto use only modes with width > 800 */
+ if ((! efi_call_5 (uga->get_mode, uga, &w, &h, &d, &r)) &&
+- ((! width) || (width == w)) &&
++ ((! width && w > 800) || (width == w)) &&
+ ((! height) || (height == h)) &&
+ ((! depth) || (depth == d)))
+ {
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-fix-INTEL_HDMI_STICK-MMC-size.diff grub2_2.02~beta3-4/debian/patches/IGEL-fix-INTEL_HDMI_STICK-MMC-size.diff
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-fix-INTEL_HDMI_STICK-MMC-size.diff 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-fix-INTEL_HDMI_STICK-MMC-size.diff 2017-04-27 14:10:50.025831000 +0200
@@ -0,0 +1,69 @@
+--- a/grub-core/disk/i386/pc/biosdisk.c
++++ b/grub-core/disk/i386/pc/biosdisk.c
+@@ -334,6 +334,7 @@ grub_biosdisk_open (const char *name, gr
+ {
+ grub_uint64_t total_sectors = 0;
+ int drive;
++ int workaround = 0;
+ struct grub_biosdisk_data *data;
+
+ drive = grub_biosdisk_get_drive (name);
+@@ -376,13 +377,23 @@ grub_biosdisk_open (const char *name, gr
+ {
+ data->flags = GRUB_BIOSDISK_FLAG_LBA;
+
+- if (drp->total_sectors)
+- total_sectors = drp->total_sectors;
+- else
++ if (drp->total_sectors) {
++ /* [email protected] INTEL Compute Stick MMC wrong size workaround */
++ if (version == 0x30 && drp->total_sectors == 0xa000) {
++ workaround = 1;
++ data->sectors = 63;
++ data->heads = 255;
++ data->cylinders = 0;
++ total_sectors = GRUB_DISK_SIZE_UNKNOWN;
++ } else {
++ total_sectors = drp->total_sectors;
++ }
++ } else {
+ /* Some buggy BIOSes doesn't return the total sectors
+ correctly but returns zero. So if it is zero, compute
+ it by C/H/S returned by the LBA BIOS call. */
+ total_sectors = ((grub_uint64_t) drp->cylinders)
+ * drp->heads * drp->sectors;
++ }
+ if (drp->bytes_per_sector
+ && !(drp->bytes_per_sector & (drp->bytes_per_sector - 1))
+ && drp->bytes_per_sector >= 512
+@@ -396,7 +407,7 @@ grub_biosdisk_open (const char *name, gr
+ }
+ }
+
+- if (! (data->flags & GRUB_BIOSDISK_FLAG_CDROM))
++ if (! (data->flags & GRUB_BIOSDISK_FLAG_CDROM) && workaround == 0)
+ {
+ if (grub_biosdisk_get_diskinfo_standard (drive,
+ &data->cylinders,
+@@ -506,8 +517,8 @@ grub_biosdisk_rw (int cmd, grub_disk_t d
+ 256 /* heads */ *
+ 63 /* spt */)
+ return grub_error (GRUB_ERR_OUT_OF_RANGE,
+- N_("attempt to read or write outside of disk `%s'"),
+- disk->name);
++ N_("attempt to read or write outside of disk `%s' to sector 0x%llx"),
++ disk->name, (unsigned long long) sector);
+
+ soff = ((grub_uint32_t) sector) % data->sectors + 1;
+ head = ((grub_uint32_t) sector) / data->sectors;
+@@ -516,8 +527,8 @@ grub_biosdisk_rw (int cmd, grub_disk_t d
+
+ if (coff >= data->cylinders)
+ return grub_error (GRUB_ERR_OUT_OF_RANGE,
+- N_("attempt to read or write outside of disk `%s'"),
+- disk->name);
++ N_("attempt to read or write outside of disk `%s' to sector 0x%llx"),
++ disk->name, (unsigned long long) sector);
+
+ if (grub_biosdisk_rw_standard (cmd + 0x02, data->drive,
+ coff, hoff, soff, size, segment))
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-fix-secure-boot-loading-of-unsigned-kernel.diff grub2_2.02~beta3-4/debian/patches/IGEL-fix-secure-boot-loading-of-unsigned-kernel.diff
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-fix-secure-boot-loading-of-unsigned-kernel.diff 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-fix-secure-boot-loading-of-unsigned-kernel.diff 2017-11-27 12:56:08.846762000 +0100
@@ -0,0 +1,13 @@
+--- a/grub-core/loader/i386/linux.c
++++ b/grub-core/loader/i386/linux.c
+@@ -720,8 +720,8 @@ grub_cmd_linux (grub_command_t cmd __att
+ using_linuxefi = 1;
+ return GRUB_ERR_NONE;
+ }
+- grub_dprintf ("linux", "linuxefi failed (%d)\n", grub_errno);
+- grub_errno = GRUB_ERR_NONE;
++ grub_error(GRUB_ERR_BAD_OS, "unsigned or wrong signed kernel image");
++ goto fail;
+ }
+ }
+ }
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-hide-terminal-box.patch grub2_2.02~beta3-4/debian/patches/IGEL-hide-terminal-box.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-hide-terminal-box.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-hide-terminal-box.patch 2016-03-11 14:17:10.746516000 +0100
@@ -0,0 +1,29 @@
+Description: grub2 terminal-box patch by IGEL
+This patch stretches the terminal-box to the size of the screen. This allows us
+to 'hide' the terminal box by setting the boot menu background and terminal background
+identical.
+Author: Eduard Göbl, IGEL Technology GmbH
+Origin: vendor, www.igel.com
+Last-Update: 2016-11-03
+Index: igelworkdir/grub-core/gfxmenu/view.c
+===================================================================
+--- igelworkdir.orig/grub-core/gfxmenu/view.c
++++ igelworkdir/grub-core/gfxmenu/view.c
+@@ -72,10 +72,13 @@ grub_gfxmenu_view_new (const char *theme
+ view->screen.width = width;
+ view->screen.height = height;
+
+- view->need_to_check_sanity = 1;
+- view->terminal_border = 3;
+- view->terminal_rect.width = view->screen.width * 7 / 10;
+- view->terminal_rect.height = view->screen.height * 7 / 10;
++ /* [email protected]: Don't place the big black terminal box on top of the grub2 boot menu
++ * We simply hide it by making it as big as the screen and setting the wallpaper as the
++ * terminal background */
++ view->need_to_check_sanity = 0;
++ view->terminal_border = 0;
++ view->terminal_rect.width = view->screen.width;
++ view->terminal_rect.height = view->screen.height;
+ view->terminal_rect.x = view->screen.x + (view->screen.width
+ - view->terminal_rect.width) / 2;
+ view->terminal_rect.y = view->screen.y + (view->screen.height
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-integrate-igel-system-handling.diff grub2_2.02~beta3-4/debian/patches/IGEL-integrate-igel-system-handling.diff
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-integrate-igel-system-handling.diff 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-integrate-igel-system-handling.diff 2017-04-27 14:10:50.025831000 +0200
@@ -0,0 +1,27 @@
+--- a/grub-core/Makefile.core.def
++++ b/grub-core/Makefile.core.def
+@@ -1425,6 +1425,11 @@ module = {
+ };
+
+ module = {
++ name = igelfs;
++ common = fs/igelfs.c;
++};
++
++module = {
+ name = zfs;
+ common = fs/zfs/zfs.c;
+ common = fs/zfs/zfs_lzjb.c;
+@@ -1824,6 +1829,12 @@ module = {
+ };
+
+ module = {
++ name = part_igel;
++ common = partmap/igel.c;
++ common = partmap/directory.c;
++};
++
++module = {
+ name = part_sunpc;
+ common = partmap/sunpc.c;
+ };
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-remove-unwanted-hotkeys.patch grub2_2.02~beta3-4/debian/patches/IGEL-remove-unwanted-hotkeys.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-remove-unwanted-hotkeys.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-remove-unwanted-hotkeys.patch 2016-05-04 11:07:35.032742000 +0200
@@ -0,0 +1,28 @@
+--- a/grub-core/normal/menu.c
++++ b/grub-core/normal/menu.c
+@@ -703,7 +703,9 @@ run_menu (grub_menu_t menu, int nested,
+
+ current_entry = default_entry;
+
++#ifdef IGEL_DEBUG
+ refresh:
++#endif
+ menu_init (current_entry, menu, nested);
+
+ /* Initialize the time. */
+@@ -806,6 +808,7 @@ run_menu (grub_menu_t menu, int nested,
+ *auto_boot = 0;
+ return current_entry;
+
++#ifdef IGEL_DEBUG
+ case '\e':
+ if (nested)
+ {
+@@ -827,6 +830,7 @@ run_menu (grub_menu_t menu, int nested,
+ grub_menu_entry_run (e);
+ }
+ goto refresh;
++#endif
+
+ default:
+ {
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/IGEL-vbe-fix.patch grub2_2.02~beta3-4/debian/patches/IGEL-vbe-fix.patch
--- grub2_2.02~beta3-4.ori/debian/patches/IGEL-vbe-fix.patch 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/debian/patches/IGEL-vbe-fix.patch 2016-10-13 14:07:55.642286000 +0200
@@ -0,0 +1,36 @@
+Index: igelworkdir/grub-core/video/i386/pc/vbe.c
+===================================================================
+--- igelworkdir.orig/grub-core/video/i386/pc/vbe.c
++++ igelworkdir/grub-core/video/i386/pc/vbe.c
+@@ -963,7 +963,8 @@ grub_video_vbe_iterate (int (*hook) (con
+ {
+ /* Could not retrieve mode info, retreat. */
+ grub_errno = GRUB_ERR_NONE;
+- break;
++ /* lang@igel: fix for buggy vbe: ignore wrong entries */
++ continue;
+ }
+
+ vbe2videoinfo (*p, &vbe_mode_info, &mode_info);
+@@ -1000,8 +1001,9 @@ grub_video_vbe_setup (unsigned int width
+ mode supported by the graphics card may not be safe for the
+ display device. */
+ grub_errno = GRUB_ERR_NONE;
+- width = 640;
+- height = 480;
++ /* lang@igel: instead of 640x480 use 1024x768 for fall back */
++ width = 1024;
++ height = 768;
+ }
+ }
+
+@@ -1015,7 +1017,8 @@ grub_video_vbe_setup (unsigned int width
+ {
+ /* Could not retrieve mode info, retreat. */
+ grub_errno = GRUB_ERR_NONE;
+- break;
++ /* lang@igel: fix for buggy vbe: ignore wrong entries */
++ continue;
+ }
+
+ if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_SUPPORTED) == 0)
diff -Naurp grub2_2.02~beta3-4.ori/debian/patches/series grub2_2.02~beta3-4/debian/patches/series
--- grub2_2.02~beta3-4.ori/debian/patches/series 2017-10-20 10:40:24.478232000 +0200
+++ grub2_2.02~beta3-4/debian/patches/series 2017-11-27 12:56:08.846762000 +0100
@@ -67,3 +67,12 @@ support_initrd-less_boot.patch
mount-ext4-fs-with-crypto-enabled.patch
headers_for_device_macros.patch
fix_check_for_sys_macros.patch
+IGEL-integrate-igel-system-handling.diff
+IGEL-fix-INTEL_HDMI_STICK-MMC-size.diff
+IGEL-hide-terminal-box.patch
+IGEL-remove-unwanted-hotkeys.patch
+IGEL-change-menu-text.patch
+IGEL-vbe-fix.patch
+IGEL-efi-fix.patch
+IGEL-cdboot-fix.patch
+IGEL-fix-secure-boot-loading-of-unsigned-kernel.diff
diff -Naurp grub2_2.02~beta3-4.ori/debian/rules grub2_2.02~beta3-4/debian/rules
--- grub2_2.02~beta3-4.ori/debian/rules 2017-07-27 11:32:23.913260000 +0200
+++ grub2_2.02~beta3-4/debian/rules 2017-07-27 11:32:23.913260000 +0200
@@ -29,7 +29,7 @@ else
with_check := yes
endif
-CC := gcc-6
+CC := gcc
confflags = \
PACKAGE_VERSION="$(deb_version)" PACKAGE_STRING="GRUB $(deb_version)" \
@@ -114,7 +114,7 @@ endif
endif
%:
- dh $@ --parallel
+ dh $@ --parallel --with=quilt
override_dh_auto_configure: $(patsubst %,configure/%,$(BUILD_PACKAGES))
diff -Naurp grub2_2.02~beta3-4.ori/grub-core/fs/igelfs.c grub2_2.02~beta3-4/grub-core/fs/igelfs.c
--- grub2_2.02~beta3-4.ori/grub-core/fs/igelfs.c 1970-01-01 01:00:00.000000000 +0100
+++ grub2_2.02~beta3-4/grub-core/fs/igelfs.c 2017-11-27 12:56:08.846762000 +0100
@@ -0,0 +1,902 @@
+/* igelfs.c - igelfs (kernel, splash and config) pseudo filesystem. */
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2007,2008,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 by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/misc.h>
+#include <grub/disk.h>
+#include <grub/archelp.h>
+#include <grub/env.h>
+#include <grub/file.h>
+#include <grub/mm.h>
+#include <grub/dl.h>
+#include <grub/i18n.h>
+#include <grub/partition.h>
+#include <grub/igel_partition.h>
+
+#define BOOTVERSION 1028
+
+GRUB_MOD_LICENSE ("GPLv3+");
+
+static struct igf_sect_hdr sh;
+static const grub_uint64_t end_section = 0xffffffffffffffff >> ((8 - sizeof(sh.next_section)) * 8);
+extern grub_uint32_t sys_first_section; /* Defined and set in partmap/igel.c */
+extern grub_uint32_t bspl_first_section; /* Defined and set in partmap/igel.c */
+extern grub_uint32_t cbspl_first_section; /* Defined and set in partmap/igel.c */
+
+enum { NONE, KERNEL, SPLASH, CONFIG };
+
+static grub_err_t igelfs_disk_read (grub_disk_t disk, grub_uint64_t offset, grub_size_t size, void *buf)
+{
+ grub_size_t len, read;
+ grub_err_t ret = 0;
+ grub_uint8_t *buffer;
+ grub_partition_t part = NULL;
+
+ /* Need to access the whole disk (IGEL DOS partition) */
+ /* Therefore we null out the partition infos here from the given disk. */
+ /* Otherwise the grub_disk_read() function might detect an access beyond the end of the device, */
+ /* if the IGEL system partition is fragmented across the IGELs DOS partition. */
+ if(disk->partition) {
+ offset += disk->partition->start << GRUB_DISK_SECTOR_BITS; /* Convert the offset to be disk-relative */
+ part = disk->partition; /* Save the current partition info */
+ disk->partition = NULL; /* Clear the disks partition info temporarily */
+ }
+
+ buffer = (grub_uint8_t *)buf;
+ read = 0;
+ len = size & ~(((grub_size_t)1<<GRUB_DISK_SECTOR_BITS)-1);
+ if (len > 0) {
+ /* it is ridiculus but efidisk seems to have problems if one reads bigger blocks as 32k */
+ while (read < len)
+ {
+ if (len - read > 0x8000) {
+ ret = grub_disk_read (disk, (offset + read) >> GRUB_DISK_SECTOR_BITS, (offset + read) & ((1<<GRUB_DISK_SECTOR_BITS)-1), 0x8000, &buffer[read]);
+ read += 0x8000;
+ } else {
+ ret = grub_disk_read (disk, (offset + read) >> GRUB_DISK_SECTOR_BITS, (offset + read) & ((1<<GRUB_DISK_SECTOR_BITS)-1), len - read, &buffer[read]);
+ read += len - read;
+ }
+ if (ret < 0) {
+ disk->partition = part; /* Restore the partition info */
+ return ret;
+ }
+ }
+ }
+
+ if (len < size) {
+ offset += len;
+ len = size - len;
+ ret = grub_disk_read (disk, offset >> GRUB_DISK_SECTOR_BITS, offset & ((1<<GRUB_DISK_SECTOR_BITS)-1), len, &buffer[read]);
+ }
+
+ disk->partition = part; /* Restore the partition info */
+
+ return ret;
+}
+
+static grub_uint32_t * get_igelfs_section_offset (grub_disk_t disk, grub_off_t data_size, grub_int32_t type)
+{
+ grub_uint32_t sect;
+ grub_uint32_t first_sect;
+ grub_uint32_t i = 1;
+ static grub_uint32_t sect_kernel_offset[MAX_KERNEL_SYS_SECTIONS+1];
+ static grub_uint32_t sect_splash_offset[MAX_KERNEL_SYS_SECTIONS+1];
+ static grub_uint16_t sect_kernel_offset_valid = 0;
+ static grub_uint16_t sect_splash_offset_valid = 0;
+ grub_uint32_t *sect_offset;
+ grub_uint16_t *sect_offset_valid;
+
+ if (type == KERNEL) {
+ grub_dprintf ("igelfs", "kernel: grub_section_offset start\n");
+ sect_offset = (grub_uint32_t *) sect_kernel_offset;
+ if (sect_kernel_offset_valid != 0)
+ return sect_offset;
+ sect_offset_valid = (grub_uint16_t *) §_kernel_offset_valid;
+ } else if (type == SPLASH) {
+ grub_dprintf ("igelfs", "splash: grub_section_offset start\n");
+ sect_offset = (grub_uint32_t *) sect_splash_offset;
+ if (sect_splash_offset_valid != 0)
+ return sect_offset;
+ sect_offset_valid = (grub_uint16_t *) §_splash_offset_valid;
+ } else {
+ return NULL;
+ }
+
+ igelfs_disk_read (disk, 0, sizeof(struct igf_sect_hdr), &sh);
+
+ sect_offset[0]=0;
+
+ switch(sh.partition_minor) {
+ case 1: first_sect = sys_first_section; break;
+ case 23: first_sect = bspl_first_section; break;
+ case 252: first_sect = cbspl_first_section; break;
+ default: first_sect = end_section; break;
+ }
+
+ if (first_sect == end_section)
+ return NULL;
+
+ grub_dprintf ("igelfs", "sect_hdr: magic: 0x%x crc: 0x%x partition_minor: %d sect_in_minor: %d generation: %d next: 0x%x\n", sh.magic, sh.crc, sh.partition_minor, sh.section_in_minor, sh.generation, sh.next_section - first_sect);
+
+ while((sect = sh.next_section) != end_section &&
+ i <= (grub_uint32_t) (data_size / IGF_SECTION_SIZE) + 1 &&
+ i <= (grub_uint32_t) MAX_KERNEL_SYS_SECTIONS)
+ {
+ sect_offset[i] = sect - first_sect;
+ igelfs_disk_read (disk, START_OF_SECTION(sect - first_sect), sizeof(struct igf_sect_hdr), &sh);
+
+ grub_dprintf ("igelfs", "sect_hdr: magic: 0x%x crc: 0x%x partition_minor: %d sect_in_minor: %d generation: %d next: 0x%x\n", sh.magic, sh.crc, sh.partition_minor, sh.section_in_minor, sh.generation, sh.next_section - first_sect);
+
+ i++;
+ }
+
+ sect_offset[i] = end_section;
+ *sect_offset_valid = 1;
+
+ grub_dprintf ("igelfs", "grub_section_offset end\n");
+
+ return sect_offset;
+}
+
+/*
+ * Lookup a string "key=value" in the boot registry.
+ * The boot registry is the 32K region 0x0000-0x7fff in section #0
+ *
+ * Return a pointer to the string "value"
+ */
+
+static char *
+bootreg_get(const char *key, unsigned char *buffer)
+{
+ unsigned int key_length = grub_strlen(key);
+ unsigned int i, j, k;
+ const char *eof = "EOF\n";
+
+ i = 0; j = 0; k = 0;
+ while ((i < IGEL_BOOTREG_SIZE) && (j < key_length) && (k < 4))
+ {
+ if (buffer[i] != key[j++])
+ j = 0;
+ if (buffer[i++] != eof[k++])
+ k = 0;
+ }
+ if ((k >= 4) || (i >= IGEL_BOOTREG_SIZE) || (buffer[i] != '='))
+ return NULL; /* no match */
+
+ /* Match: Return the string after the '=' until newline */
+ i++; /* i points to the value string */
+ j = i;
+ while ((j < IGEL_BOOTREG_SIZE) && (buffer[j] != '\n'))
+ j++;
+
+ if (buffer[j] != '\n')
+ return NULL;
+
+ buffer[j] = '\0'; /* replace '\n' by a terminating '\0' */
+ return (char *) buffer + i;
+}
+
+
+static grub_err_t
+grub_igelconfig_bootreg_to_config(unsigned char *buf, unsigned char **content)
+{
+ int size_params = 0;
+ char cmdline[2049];
+ char splash[100];
+ char *val, empty[1];
+ const char *custom_splash;
+
+ empty[0]='\0';
+ splash[0]='\0';
+
+ val = bootreg_get("boot_id", buf);
+ if (val != NULL)
+ grub_snprintf(cmdline, 2048, " boot_id=%s", val);
+
+ if (grub_strncmp(val,"IGEL_UDC_TO", 11) == 0) {
+ grub_env_set ("splash_ident", "udc");
+ } else {
+ val = bootreg_get("product", buf);
+ if (val != NULL)
+ grub_env_set ("splash_ident", val);
+ else
+ grub_env_set ("splash_ident", "ud");
+ }
+
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " bootversion=%d", BOOTVERSION);
+
+ val = bootreg_get("noapic", buf);
+ if (val[0] == '1')
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " noapic");
+
+ val = bootreg_get("nomodeset", buf);
+ if (val[0] == '1') {
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " nomodeset");
+ val = bootreg_get("rotation", buf);
+ if (val[0] == '1' && val[1] == '8' && val[2] == '0')
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " fbcon=rotate:2");
+ else if (val[0] == '2' && val[1] == '7' && val[2] == '0')
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " fbcon=rotate:3");
+ else if (val[0] == '9' && val[1] == '0')
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " fbcon=rotate:1");
+ }
+ val = bootreg_get("use_gma500", buf);
+ if (val[0] == '1')
+ grub_snprintf(&cmdline[grub_strlen(cmdline)], 2048 - grub_strlen(cmdline), " igel_use_gma500");
+
+ val = bootreg_get("splash", buf);
+ if (val[0] == '1')
+ grub_snprintf(splash, 100, "splash=277");
+
+ custom_splash = grub_env_get ("custom_splash");
+ if (custom_splash[0] == 't' && custom_splash[1] == 'r' && custom_splash[2] == 'u' && custom_splash[3] == 'e')
+ grub_snprintf(&splash[grub_strlen(splash)], 100 - grub_strlen(splash), " custom_splash=true");
+
+ val = bootreg_get("boot_cmd", buf);
+ if (val == NULL) {
+ val = empty;
+ }
+
+ size_params = grub_strlen(cmdline) + grub_strlen(val) + 2;
+
+ *content = (unsigned char *) grub_zalloc (1600 + (5 * size_params));
+ if (!content) {
+ return 1;
+ }
+
+ grub_snprintf((char *) *content, 1600 + (5 * size_params), "set timeout=1\n\
+set timeout_style=hidden\n\
+set default=0\n\
+\n\
+insmod regexp\n\
+\n\
+regexp --set=0:dev '(\\(hd[0-9]{1,},)' $cmdpath\n\
+set device=\"${dev}igel1)\"\n\
+set igel_part_check=false\n\
+\n\
+menuentry \"Quiet boot\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz igel_syslog=quiet quiet %s %s\n\
+}\n\
+\n\
+menuentry \"Verbose boot\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz systemd.unit=igel-verbose-boot.target igel_syslog=verbose %s\n\
+}\n\
+\n\
+menuentry \"VESA only boot\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz nomodeset igel_syslog=quiet %s %s\n\
+}\n\
+\n\
+menuentry \"Emergency boot (setup only)\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz systemd.unit=igel-emergency-boot.target igel_syslog=emergency quiet %s %s\n\
+}\n\
+\n\
+menuentry \"Failsafe boot with CRC check\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ set igel_part_check=true\n\
+ linux $device/vmlinuz igel_syslog=quiet failsafe %s\n\
+}\n\
+\n\
+menuentry \"Reset to factory defaults\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz systemd.unit=igel-reset-to-factory-defaults.target igel_syslog=resetdefaults quiet %s %s\n\
+}\n\
+\n\
+menuentry \"Custom boot command\" {\n\
+ set gfxpayload=keep\n\
+ insmod part_igel\n\
+ linux $device/vmlinuz igel_syslog=quiet quiet %s %s %s\n\
+}\n", cmdline, splash, cmdline, cmdline, splash, cmdline, splash, cmdline, cmdline, splash, cmdline, splash, val);
+
+ return 0;
+}
+
+struct grub_igelfs_data
+{
+ grub_uint64_t offset_kernel;
+ grub_uint64_t offset_ramdisk;
+ grub_uint64_t offset_blocks;
+ grub_uint64_t offset_splash;
+ grub_off_t size_kernel;
+ grub_off_t size_ramdisk;
+ grub_uint8_t end;
+ unsigned char *content;
+ grub_int32_t type;
+};
+
+struct grub_archelp_data
+{
+ grub_disk_t disk;
+ grub_off_t size;
+ grub_off_t dofs;
+ struct grub_igelfs_data *igelfs;
+};
+
+static grub_err_t
+grub_igelfs_find_file (struct grub_archelp_data *data, char **name,
+ grub_int32_t *mtime,
+ grub_uint32_t *mode)
+{
+ grub_dprintf ("igelfs", "grub_igelfs_find_file called\n");
+
+ *mode = GRUB_ARCHELP_ATTR_END;
+
+ if (data == NULL || data->igelfs == NULL)
+ return GRUB_ERR_NONE;
+
+ if (data->igelfs->type == KERNEL) {
+ if (data->igelfs->end == 1 && (data->igelfs->offset_ramdisk == 0
+ || data->igelfs->offset_ramdisk == data->igelfs->offset_blocks
+ || data->igelfs->offset_ramdisk == data->igelfs->offset_kernel) ) {
+ return GRUB_ERR_NONE;
+ } else if (data->igelfs->end >= 2) {
+ return GRUB_ERR_NONE;
+ }
+
+ if (data->igelfs->end == 1) {
+ *name = grub_strdup("initramfs.img");
+ data->dofs = data->igelfs->offset_ramdisk;
+ data->size = data->igelfs->size_ramdisk;
+ } else {
+ *name = grub_strdup("vmlinuz");
+ data->dofs = data->igelfs->offset_kernel;
+ data->size = data->igelfs->size_kernel;
+ }
+
+
+ } else if (data->igelfs->type == SPLASH || data->igelfs->type == CONFIG) {
+ if (data->igelfs->end) {
+ return GRUB_ERR_NONE;
+ }
+
+ if (data->igelfs->type == SPLASH) {
+ *name = grub_strdup("splash.png");
+ } else {
+ *name = grub_strdup("igel.conf");
+ }
+ }
+ (void) mtime;
+
+ if (mode)
+ *mode = GRUB_ARCHELP_ATTR_FILE | GRUB_ARCHELP_ATTR_NOTIME;
+
+ data->igelfs->end = data->igelfs->end + 1;
+
+ return GRUB_ERR_NONE;
+}
+
+static void
+grub_igelfs_rewind (struct grub_archelp_data *data)
+{
+ grub_dprintf ("igelfs", "grub_igelfs_rewind called\n");
+ data->igelfs->end = 0;
+}
+
+static struct grub_archelp_ops igelops =
+{
+ .find_file = grub_igelfs_find_file,
+ .rewind = grub_igelfs_rewind
+};
+
+static struct grub_archelp_data *
+grub_igelfs_mount (grub_disk_t disk)
+{
+ struct igf_sect_hdr sect_hdr;
+ struct igf_part_hdr part_hdr;
+ struct grub_archelp_data *data = NULL;
+ struct igf_partition_extent *extent = NULL;
+ struct igel_bootsplash_hdr splash_hdr;
+ struct igel_splash *splash_extent = NULL;
+ const char *splash_ident;
+ grub_uint8_t buf[9];
+ grub_uint8_t ext, sp_ext, i = 0;
+ grub_uint64_t offset_kernel, offset_ramdisk;
+ grub_uint64_t size_kernel = 0, size_ramdisk = 0;
+ unsigned char *bootreg_buf = NULL;
+ grub_int32_t type = NONE;
+
+ grub_dprintf ("igelfs", "grub_igelfs_mount was called\n");
+
+ /* check for msdos and gpt partitions only */
+
+ if (disk == NULL || disk->partition == NULL || disk->partition->partmap == NULL)
+ goto fail;
+
+ if (! grub_strcmp (disk->partition->partmap->name, "msdos")
+ || ! grub_strcmp (disk->partition->partmap->name, "gpt")) {
+ grub_dprintf ("igelfs", "search for igelconfig partition\n");
+
+ bootreg_buf = (unsigned char *) grub_zalloc(IGEL_BOOTREG_SIZE);
+ if (! bootreg_buf)
+ goto fail;
+
+ if (igelfs_disk_read (disk, IGEL_BOOTREG_OFFSET, IGEL_BOOTREG_SIZE, bootreg_buf)) {
+ goto fail;
+ }
+
+ if (grub_strncmp ((char *) bootreg_buf, "IGEL BOOTREGISTRY", 17) != 0) {
+ goto fail;
+ }
+
+ data = (struct grub_archelp_data *) grub_zalloc (sizeof (struct grub_archelp_data));
+ if (!data) {
+ goto fail;
+ }
+
+ data->igelfs = (struct grub_igelfs_data *) grub_zalloc (sizeof (struct grub_igelfs_data));
+ if (!data->igelfs) {
+ goto fail;
+ }
+
+ if (grub_igelconfig_bootreg_to_config(bootreg_buf, &data->igelfs->content) != 0) {
+ goto fail;
+ }
+
+ grub_free(bootreg_buf);
+
+ data->size = grub_strlen((char *) data->igelfs->content);
+
+ data->igelfs->end = 0;
+
+ data->igelfs->type = CONFIG;
+
+ return data;
+ }
+
+ /* check for igel partitions only */
+
+ if (grub_strcmp (disk->partition->partmap->name, "igel"))
+ goto fail;
+
+ grub_dprintf ("igelfs", "search for igel splash/kernel partition\n");
+
+ /* kernel is only present in partition number 0 */
+
+ if (disk->partition->number == 0) {
+ type = KERNEL;
+ /* splash is only present in partition number 22 (igf23) or number 251 (igf252) */
+ } else if (disk->partition->number == 22 || disk->partition->number == 251 ) {
+ type = SPLASH;
+ } else {
+ goto fail;
+ }
+
+ /* read section header and check if partition number match */
+
+ if (igelfs_disk_read (disk, 0, sizeof (sect_hdr), §_hdr))
+ goto fail;
+
+ if (sect_hdr.partition_minor != (grub_uint32_t)disk->partition->number + 1)
+ goto fail;
+
+ if (igelfs_disk_read (disk, IGF_SECT_HDR_LEN, sizeof (part_hdr), &part_hdr))
+ goto fail;
+
+ /* if there are no extents then there is also no kernel extent */
+
+ if (part_hdr.n_extents < 1)
+ goto fail;
+
+ /* allocate extent struct an read it from disk */
+
+ extent = (struct igf_partition_extent *) grub_zalloc (part_hdr.n_extents * sizeof (struct igf_partition_extent));
+ if (!extent)
+ goto fail;
+
+ if (igelfs_disk_read (disk, IGF_SECT_HDR_LEN + sizeof (part_hdr), part_hdr.n_extents * sizeof (struct igf_partition_extent), extent))
+ goto fail;