summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r--meta/recipes-bsp/grub/files/cfg2
-rw-r--r--meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch33
-rw-r--r--meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch21
-rw-r--r--meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch53
-rw-r--r--meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch27
-rw-r--r--meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch24
-rw-r--r--meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch28
-rw-r--r--meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch131
-rw-r--r--meta/recipes-bsp/grub/files/grub-no-unused-result.patch19
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/autohell.patch21
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch101
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch74
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch31
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch40
-rw-r--r--meta/recipes-bsp/grub/grub-2.00/grub-install.in.patch20
-rw-r--r--meta/recipes-bsp/grub/grub-2.00/remove-gets.patch20
-rw-r--r--meta/recipes-bsp/grub/grub-efi_2.00.bb91
-rwxr-xr-xmeta/recipes-bsp/grub/grub/40_custom9
-rw-r--r--meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch34
-rw-r--r--meta/recipes-bsp/grub/grub_0.97.bb35
-rw-r--r--meta/recipes-bsp/grub/grub_2.00.bb52
-rw-r--r--meta/recipes-bsp/grub/grub_git.bb62
22 files changed, 928 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg
new file mode 100644
index 0000000000..ffffe47638
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/cfg
@@ -0,0 +1,2 @@
1search.file /EFI/BOOT/grub.cfg root
2set prefix=($root)/EFI/BOOT
diff --git a/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
new file mode 100644
index 0000000000..0eece082f8
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
@@ -0,0 +1,33 @@
1Disable liblzma if --enable-liblzma=no
2
3Upstream-Status: Inappropriate [configuration]
4
5Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
6
7--- a/configure.ac
8+++ b/configure.ac
9@@ -1029,10 +1029,20 @@ fi
10
11 AC_SUBST([LIBGEOM])
12
13-AC_CHECK_LIB([lzma], [lzma_code],
14- [LIBLZMA="-llzma"
15- AC_DEFINE([HAVE_LIBLZMA], [1],
16- [Define to 1 if you have the LZMA library.])],)
17+AC_ARG_ENABLE([liblzma],
18+ [AS_HELP_STRING([--enable-liblzma],
19+ [enable liblzma integration (default=guessed)])])
20+if test x"$enable_liblzma" = xno ; then
21+ liblzma_excuse="explicitly disabled"
22+fi
23+
24+if test x"$liblzma_excuse" = x ; then
25+ AC_CHECK_LIB([lzma], [lzma_code],
26+ [LIBLZMA="-llzma"
27+ AC_DEFINE([HAVE_LIBLZMA], [1],
28+ [Define to 1 if you have the LZMA library.])],)
29+fi
30+
31 AC_SUBST([LIBLZMA])
32
33 AC_ARG_ENABLE([libzfs],
diff --git a/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
new file mode 100644
index 0000000000..61ae2f5372
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Backport
2
3This fixes compilation issues when using flex-2.5.37. It was taken from upstream.
4
5Original author is: Vladimir Serbinenko <phcoder@gmail.com>
6
7Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
8
9Index: grub-2.00/grub-core/script/yylex.l
10===================================================================
11--- grub-2.00.orig/grub-core/script/yylex.l 2012-06-08 23:24:15.000000000 +0300
12+++ grub-2.00/grub-core/script/yylex.l 2013-07-31 14:34:40.708100982 +0300
13@@ -29,6 +29,8 @@
14 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
15 #pragma GCC diagnostic ignored "-Wmissing-declarations"
16 #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
17+#pragma GCC diagnostic ignored "-Wunused-function"
18+#pragma GCC diagnostic ignored "-Wsign-compare"
19
20 #define yyfree grub_lexer_yyfree
21 #define yyalloc grub_lexer_yyalloc
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
new file mode 100644
index 0000000000..eb8916cb72
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
@@ -0,0 +1,53 @@
1From 7ab576a7c61406b7e63739d1b11017ae336b9008 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Mon, 3 Mar 2014 03:34:48 -0500
4Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name
5
6Our kernel's name is bzImage, we need add it to grub.d/10_linux.in so
7that the grub-mkconfig and grub-install can work correctly.
8
9We only need add the bzImage to util/grub.d/10_linux.in, but also add it
10to util/grub.d/20_linux_xen.in to keep compatibility.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15---
16 util/grub.d/10_linux.in | 4 ++--
17 util/grub.d/20_linux_xen.in | 2 +-
18 2 files changed, 3 insertions(+), 3 deletions(-)
19
20diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
21index 14402e8..c58f417 100644
22--- a/util/grub.d/10_linux.in
23+++ b/util/grub.d/10_linux.in
24@@ -153,11 +153,11 @@ EOF
25 machine=`uname -m`
26 case "x$machine" in
27 xi?86 | xx86_64)
28- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
29+ list=`for i in /boot/bzImage-* /bzImage-* /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
30 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
31 done` ;;
32 *)
33- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
34+ list=`for i in /boot/bzImage-* /boot/vmlinuz-* /boot/vmlinux-* /bzImage-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
35 if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
36 done` ;;
37 esac
38diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
39index 1d94502..b2decf3 100644
40--- a/util/grub.d/20_linux_xen.in
41+++ b/util/grub.d/20_linux_xen.in
42@@ -138,7 +138,7 @@ EOF
43 EOF
44 }
45
46-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
47+linux_list=`for i in /boot/bzImage[xz]-* /bzImage[xz]-* /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
48 if grub_file_is_not_garbage "$i"; then
49 basename=$(basename $i)
50 version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
51--
521.7.10.4
53
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
new file mode 100644
index 0000000000..09ef4dbff9
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
@@ -0,0 +1,27 @@
1Upstream-Status: Pending
2
3
4This patch avoids this configure failure
5
6configure:20306: checking whether `ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow' generates calls to `__enable_execute_stack()'
7configure:20320: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387 -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines -falign-loops=1 -S conftest.c
8conftest.c:308:6: error: no previous prototype for 'g' [-Werror=missing-prototypes]
9cc1: all warnings being treated as errors
10configure:20323: $? = 1
11configure:20327: error: ccache i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow failed to produce assembly code
12
13Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
142012/04/13
15
16Index: grub-2.00/acinclude.m4
17===================================================================
18--- grub-2.00.orig/acinclude.m4
19+++ grub-2.00/acinclude.m4
20@@ -317,6 +317,7 @@ dnl Check if the C compiler generates ca
21 AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
22 AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
23 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
24+void g (int);
25 void f (int (*p) (void));
26 void g (int i)
27 {
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
new file mode 100644
index 0000000000..c557f13e23
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
@@ -0,0 +1,24 @@
1Upstream-Status: pending
2
3This patch fixes this configure issue for grub when -mfpmath=sse is in the gcc parameters.
4
5configure:20574: i586-poky-linux-gcc -m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100 -Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5
6conftest.c:1:0: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
7cc1: all warnings being treated as errors
8
9Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
102012/04/13
11
12Index: grub-1.99/configure.ac
13===================================================================
14--- grub-1.99.orig/configure.ac
15+++ grub-1.99/configure.ac
16@@ -378,7 +378,7 @@ if test "x$target_cpu" = xi386; then
17
18 # Some toolchains enable these features by default, but they need
19 # registers that aren't set up properly in GRUB.
20- TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
21+ TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387"
22 fi
23
24 # By default, GCC 4.4 generates .eh_frame sections containing unwind
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch b/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch
new file mode 100644
index 0000000000..70f60015c2
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-ignore-gnulib-gets-stupidity.patch
@@ -0,0 +1,28 @@
1From f66d54b934710f54999debb72e8b7c620edece1d Mon Sep 17 00:00:00 2001
2From: Peter Jones <pjones@redhat.com>
3Date: Fri, 25 May 2012 15:28:19 -0400
4Subject: [PATCH] gnulib accused in build breaking shocker.
5
6Upstream-Status: pending [Fedora will push this]
7
8---
9 grub-core/gnulib/stdio.in.h | 2 ++
10 1 file changed, 2 insertions(+)
11
12diff --git a/grub-core/gnulib/stdio.in.h b/grub-core/gnulib/stdio.in.h
13index 80b9dbf..69932d9 100644
14--- a/grub-core/gnulib/stdio.in.h
15+++ b/grub-core/gnulib/stdio.in.h
16@@ -141,7 +141,9 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
17 so any use of gets warrants an unconditional warning. Assume it is
18 always declared, since it is required by C89. */
19 #undef gets
20+#if 0
21 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
22+#endif
23
24 #if @GNULIB_FOPEN@
25 # if @REPLACE_FOPEN@
26--
271.7.10.1
28
diff --git a/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
new file mode 100644
index 0000000000..4588fca4ba
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
@@ -0,0 +1,131 @@
1Allow a compilation without -mcmodel=large
2
3It's provided by Vladimir Serbinenko, and he will commit
4it upstream so it should be backport patch.
5
6Upstream-Status: Backport
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9
10--
11diff --git a/configure.ac b/configure.ac
12index 9f8fb8a..2c5e6ed 100644
13--- a/configure.ac
14+++ b/configure.ac
15@@ -723,9 +723,7 @@ if test "$target_cpu" = x86_64; then
16 [grub_cv_cc_mcmodel=yes],
17 [grub_cv_cc_mcmodel=no])
18 ])
19- if test "x$grub_cv_cc_mcmodel" = xno; then
20- AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
21- else
22+ if test "x$grub_cv_cc_mcmodel" = xyes; then
23 TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
24 fi
25 fi
26diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
27index 1409b5d..6e9dace 100644
28--- a/grub-core/kern/efi/mm.c
29+++ b/grub-core/kern/efi/mm.c
30@@ -32,6 +32,12 @@
31 #define BYTES_TO_PAGES(bytes) (((bytes) + 0xfff) >> 12)
32 #define PAGES_TO_BYTES(pages) ((pages) << 12)
33
34+#if defined (__code_model_large__) || !defined (__x86_64__)
35+#define MAX_USABLE_ADDRESS 0xffffffff
36+#else
37+#define MAX_USABLE_ADDRESS 0x7fffffff
38+#endif
39+
40 /* The size of a memory map obtained from the firmware. This must be
41 a multiplier of 4KB. */
42 #define MEMORY_MAP_SIZE 0x3000
43@@ -58,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
44
45 #if 1
46 /* Limit the memory access to less than 4GB for 32-bit platforms. */
47- if (address > 0xffffffff)
48+ if (address > MAX_USABLE_ADDRESS)
49 return 0;
50 #endif
51
52@@ -66,7 +72,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
53 if (address == 0)
54 {
55 type = GRUB_EFI_ALLOCATE_MAX_ADDRESS;
56- address = 0xffffffff;
57+ address = MAX_USABLE_ADDRESS;
58 }
59 else
60 type = GRUB_EFI_ALLOCATE_ADDRESS;
61@@ -86,7 +92,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
62 {
63 /* Uggh, the address 0 was allocated... This is too annoying,
64 so reallocate another one. */
65- address = 0xffffffff;
66+ address = MAX_USABLE_ADDRESS;
67 status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address);
68 grub_efi_free_pages (0, pages);
69 if (status != GRUB_EFI_SUCCESS)
70@@ -319,7 +325,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
71 {
72 if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
73 #if 1
74- && desc->physical_start <= 0xffffffff
75+ && desc->physical_start <= MAX_USABLE_ADDRESS
76 #endif
77 && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
78 && desc->num_pages != 0)
79@@ -337,9 +343,9 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
80 #if 1
81 if (BYTES_TO_PAGES (filtered_desc->physical_start)
82 + filtered_desc->num_pages
83- > BYTES_TO_PAGES (0x100000000LL))
84+ > BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL))
85 filtered_desc->num_pages
86- = (BYTES_TO_PAGES (0x100000000LL)
87+ = (BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL)
88 - BYTES_TO_PAGES (filtered_desc->physical_start));
89 #endif
90
91diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
92index 65f09ef..17c1215 100644
93--- a/grub-core/kern/x86_64/dl.c
94+++ b/grub-core/kern/x86_64/dl.c
95@@ -100,14 +100,32 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
96 break;
97
98 case R_X86_64_PC32:
99- *addr32 += rel->r_addend + sym->st_value -
100- (Elf64_Xword) seg->addr - rel->r_offset;
101+ {
102+ grub_int64_t value;
103+ value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
104+ (Elf64_Xword) seg->addr - rel->r_offset;
105+ if (value != (grub_int32_t) value)
106+ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
107+ *addr32 = value;
108+ }
109 break;
110
111 case R_X86_64_32:
112+ {
113+ grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value;
114+ if (value != (grub_uint32_t) value)
115+ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
116+ *addr32 = value;
117+ }
118+ break;
119 case R_X86_64_32S:
120- *addr32 += rel->r_addend + sym->st_value;
121- break;
122+ {
123+ grub_int64_t value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value;
124+ if (value != (grub_int32_t) value)
125+ return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
126+ *addr32 = value;
127+ }
128+ break;
129
130 default:
131 return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
diff --git a/meta/recipes-bsp/grub/files/grub-no-unused-result.patch b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
new file mode 100644
index 0000000000..4cbd0838d1
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
@@ -0,0 +1,19 @@
1Signed-off-by: Radu Moisan <radu.moisan@intel.com>
2Upstream-Status: Pending
3
4I had an error because of an unused return value for read().
5I added -Wno-unused-result.
6
7Index: grub-2.00/configure.ac
8===================================================================
9--- grub-2.00.orig/configure.ac 2012-08-13 16:32:33.000000000 +0300
10+++ grub-2.00/configure.ac 2012-08-13 16:38:22.000000000 +0300
11@@ -394,7 +394,7 @@
12 LIBS=""
13
14 # debug flags.
15-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
16+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wno-unused-result -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
17 HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
18 TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
19 TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
diff --git a/meta/recipes-bsp/grub/grub-0.97/autohell.patch b/meta/recipes-bsp/grub/grub-0.97/autohell.patch
new file mode 100644
index 0000000000..d66207ae6c
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/autohell.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Inappropriate [configuration]
2
3---
4 configure.ac | 4 ++--
5 1 file changed, 2 insertions(+), 2 deletions(-)
6
7Index: grub-0.97/configure.ac
8===================================================================
9--- grub-0.97.orig/configure.ac 2008-09-12 17:39:52.000000000 +0200
10+++ grub-0.97/configure.ac 2008-09-12 17:40:21.000000000 +0200
11@@ -60,8 +60,8 @@ AC_PROG_CC
12 _AM_DEPENDENCIES(CC)
13
14 dnl Because recent automake complains about AS, set it here.
15-CCAS="$CC"
16-AC_SUBST(CCAS)
17+AM_PROG_AS
18+AC_SUBST(AS)
19
20 AC_ARG_WITH(binutils,
21 [ --with-binutils=DIR search the directory DIR to find binutils])
diff --git a/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
new file mode 100644
index 0000000000..d225d13dce
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
@@ -0,0 +1,101 @@
1Upstream-Status: Inappropriate [No Longer Maintained]
2
3diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
4--- grub-0.97-800/stage2/fsys_ext2fs.c 2008-07-21 00:40:21.668879475 -0600
5+++ grub-0.97-810/stage2/fsys_ext2fs.c 2008-07-21 01:01:11.063953773 -0600
6@@ -79,7 +79,52 @@
7 __u32 s_rev_level; /* Revision level */
8 __u16 s_def_resuid; /* Default uid for reserved blocks */
9 __u16 s_def_resgid; /* Default gid for reserved blocks */
10- __u32 s_reserved[235]; /* Padding to the end of the block */
11+ /*
12+ * These fields are for EXT2_DYNAMIC_REV superblocks only.
13+ *
14+ * Note: the difference between the compatible feature set and
15+ * the incompatible feature set is that if there is a bit set
16+ * in the incompatible feature set that the kernel doesn't
17+ * know about, it should refuse to mount the filesystem.
18+ *
19+ * e2fsck's requirements are more strict; if it doesn't know
20+ * about a feature in either the compatible or incompatible
21+ * feature set, it must abort and not try to meddle with
22+ * things it doesn't understand...
23+ */
24+ __u32 s_first_ino; /* First non-reserved inode */
25+ __u16 s_inode_size; /* size of inode structure */
26+ __u16 s_block_group_nr; /* block group # of this superblock */
27+ __u32 s_feature_compat; /* compatible feature set */
28+ __u32 s_feature_incompat; /* incompatible feature set */
29+ __u32 s_feature_ro_compat; /* readonly-compatible feature set */
30+ __u8 s_uuid[16]; /* 128-bit uuid for volume */
31+ char s_volume_name[16]; /* volume name */
32+ char s_last_mounted[64]; /* directory where last mounted */
33+ __u32 s_algorithm_usage_bitmap; /* For compression */
34+ /*
35+ * Performance hints. Directory preallocation should only
36+ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
37+ */
38+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
39+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
40+ __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
41+ /*
42+ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
43+ */
44+ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
45+ __u32 s_journal_inum; /* inode number of journal file */
46+ __u32 s_journal_dev; /* device number of journal file */
47+ __u32 s_last_orphan; /* start of list of inodes to delete */
48+ __u32 s_hash_seed[4]; /* HTREE hash seed */
49+ __u8 s_def_hash_version; /* Default hash version to use */
50+ __u8 s_jnl_backup_type; /* Default type of journal backup */
51+ __u16 s_reserved_word_pad;
52+ __u32 s_default_mount_opts;
53+ __u32 s_first_meta_bg; /* First metablock group */
54+ __u32 s_mkfs_time; /* When the filesystem was created */
55+ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */
56+ __u32 s_reserved[172]; /* Padding to the end of the block */
57 };
58
59 struct ext2_group_desc
60@@ -218,6 +263,14 @@
61 #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
62 #define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s)))
63
64+#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */
65+#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
66+#define EXT2_GOOD_OLD_INODE_SIZE 128
67+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
68+ EXT2_GOOD_OLD_INODE_SIZE : \
69+ (s)->s_inode_size)
70+#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
71+
72 /* linux/ext2_fs.h */
73 #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
74 /* kind of from ext2/super.c */
75@@ -553,7 +606,7 @@
76 gdp = GROUP_DESC;
77 ino_blk = gdp[desc].bg_inode_table +
78 (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
79- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
80+ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
81 #ifdef E2DEBUG
82 printf ("inode table fsblock=%d\n", ino_blk);
83 #endif /* E2DEBUG */
84@@ -565,13 +618,12 @@
85 /* reset indirect blocks! */
86 mapblock2 = mapblock1 = -1;
87
88- raw_inode = INODE +
89- ((current_ino - 1)
90- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
91+ raw_inode = (struct ext2_inode *)((char *)INODE +
92+ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
93+ EXT2_INODE_SIZE (SUPERBLOCK));
94 #ifdef E2DEBUG
95 printf ("ipb=%d, sizeof(inode)=%d\n",
96- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
97- sizeof (struct ext2_inode));
98+ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
99 printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
100 printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
101 for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch b/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
new file mode 100644
index 0000000000..0cf7dc96d7
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
@@ -0,0 +1,74 @@
1Upstream-Status: Inappropriate
2
3Subject: [PATCH] grub: fix for automake-1.12
4
5automake 1.12 has depricated automatic de-ANSI-fication support
6
7this patch avoids these kinds of errors:
8
9| stage1/Makefile.am:2: error: 'pkglibdir' is not a legitimate directory for 'DATA'
10| stage2/Makefile.am:35: error: 'pkglibdir' is not a legitimate directory for 'DATA'
11| stage2/Makefile.am:46: error: 'pkglibdir' is not a legitimate directory for 'DATA'
12| autoreconf: automake failed with exit status: 1
13| ERROR: autoreconf execution failed.
14
15The upstream status is marked as 'Inappropriate' because this problem is not uncommon,
16it has been there for a long time and no change in upstream.
17
18Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
19
20Index: grub-0.97/stage1/Makefile.am
21===================================================================
22--- a/stage1/Makefile.am
23+++ b/stage1/Makefile.am
24@@ -1,7 +1,7 @@
25-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
26-nodist_pkglib_DATA = stage1
27+pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
28+nodist_pkgdata_DATA = stage1
29
30-CLEANFILES = $(nodist_pkglib_DATA)
31+CLEANFILES = $(nodist_pkgdata_DATA)
32
33 # We can't use builtins or standard includes.
34 AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
35Index: grub-0.97/stage2/Makefile.am
36===================================================================
37--- a/stage2/Makefile.am
38+++ b/stage2/Makefile.am
39@@ -27,12 +27,12 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
40 -DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
41
42 # Stage 2 and Stage 1.5's.
43-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
44+pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
45
46 EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec
47
48 if DISKLESS_SUPPORT
49-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
50+pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
51 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
52 reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
53 nbgrub pxegrub
54@@ -43,7 +43,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
55 reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
56 xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
57 else
58-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
59+pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
60 ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
61 reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
62 noinst_DATA = pre_stage2 start start_eltorito
63@@ -105,7 +105,7 @@ else
64 BUILT_SOURCES = stage2_size.h
65 endif
66
67-CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES)
68+CLEANFILES = $(pkgdata_DATA) $(noinst_DATA) $(BUILT_SOURCES)
69
70 stage2_size.h: pre_stage2
71 -rm -f stage2_size.h
72--
731.7.9.5
74
diff --git a/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
new file mode 100644
index 0000000000..70037e47c7
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
@@ -0,0 +1,31 @@
1Upstream-Status: Inappropriate [disable feature]
2
3After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
4we got bug 1099 (http://bugzilla.yoctoproject.org/show_bug.cgi?id=1099):
5
6Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0)
7 /boot/grub/stage2 p /boot/grub/menu list" failed
8Error 6: Mismatched or corrupt version of stage1/stage2
9
10This turned out to be a gcc's bug. See
11https://bugs.gentoo.org/show_bug.cgi?id=360513
12http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
13
14Upstream gcc seems uninterested in the bug, so at present we can disable the
15option as a workaround. Thanks Ryan Hill for the investigation and the
16workaround patch.
17
18Dexuan Cui <dexuan.cui@intel.com>
19Wed Jun 29 20:21:39 CST 2011
20
21--- grub-0.97/stage2/Makefile.am.orig
22+++ grub-0.97/stage2/Makefile.am
23@@ -79,7 +79,7 @@
24 HERCULES_FLAGS =
25 endif
26
27-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
28+STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
29 $(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
30
31 STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
diff --git a/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch b/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
new file mode 100644
index 0000000000..bd8e0a89fc
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
@@ -0,0 +1,40 @@
1
2This patch is from ubuntu:
3 * objcopy-absolute.diff (update): Remove .note, .comment, and
4 .note.gnu.build-id sections from images (LP: #444703).
5
6Upstream-Status: Inappropriate [no longer maintained]
7
8Index: b/acinclude.m4
9===================================================================
10--- a/acinclude.m4
11+++ b/acinclude.m4
12@@ -61,7 +61,7 @@
13 else
14 AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
15 fi
16- if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
17+ if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
18 else
19 AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
20 fi
21Index: b/stage1/Makefile.am
22===================================================================
23--- a/stage1/Makefile.am
24+++ b/stage1/Makefile.am
25@@ -12,4 +12,4 @@
26
27 SUFFIXES = .exec
28 .exec:
29- $(OBJCOPY) -O binary $< $@
30+ $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
31Index: b/stage2/Makefile.am
32===================================================================
33--- a/stage2/Makefile.am
34+++ b/stage2/Makefile.am
35@@ -293,4 +293,4 @@
36 # General rule for making a raw binary.
37 SUFFIXES = .exec
38 .exec:
39- $(OBJCOPY) -O binary $< $@
40+ $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
diff --git a/meta/recipes-bsp/grub/grub-2.00/grub-install.in.patch b/meta/recipes-bsp/grub/grub-2.00/grub-install.in.patch
new file mode 100644
index 0000000000..326951df44
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-2.00/grub-install.in.patch
@@ -0,0 +1,20 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Our use of grub-install doesn't require the -x option, so we should be
4be able make use of grep versions that don't support it.
5
6Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
7
8Index: grub-1.99/util/grub-install.in
9===================================================================
10--- grub-1.99.orig/util/grub-install.in 2011-09-09 22:37:20.093906679 -0500
11+++ grub-1.99/util/grub-install.in 2011-09-09 22:37:30.854737882 -0500
12@@ -510,7 +510,7 @@
13
14 if [ "x${devabstraction_module}" = "x" ] ; then
15 if [ x"${install_device}" != x ]; then
16- if echo "${install_device}" | grep -qx "(.*)" ; then
17+ if echo "${install_device}" | grep -q "(.*)" ; then
18 install_drive="${install_device}"
19 else
20 install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
diff --git a/meta/recipes-bsp/grub/grub-2.00/remove-gets.patch b/meta/recipes-bsp/grub/grub-2.00/remove-gets.patch
new file mode 100644
index 0000000000..463f7847ad
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-2.00/remove-gets.patch
@@ -0,0 +1,20 @@
1ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4
5Upstream-Status: Pending
6Index: grub-1.99/grub-core/gnulib/stdio.in.h
7===================================================================
8--- grub-1.99.orig/grub-core/gnulib/stdio.in.h 2010-12-01 06:45:43.000000000 -0800
9+++ grub-1.99/grub-core/gnulib/stdio.in.h 2012-07-04 12:25:02.057099107 -0700
10@@ -140,8 +140,10 @@
11 /* It is very rare that the developer ever has full control of stdin,
12 so any use of gets warrants an unconditional warning. Assume it is
13 always declared, since it is required by C89. */
14+#if defined gets
15 #undef gets
16 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
17+#endif
18
19 #if @GNULIB_FOPEN@
20 # if @REPLACE_FOPEN@
diff --git a/meta/recipes-bsp/grub/grub-efi_2.00.bb b/meta/recipes-bsp/grub/grub-efi_2.00.bb
new file mode 100644
index 0000000000..6944cb280e
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-efi_2.00.bb
@@ -0,0 +1,91 @@
1SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
2
3DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
4intended to unify bootloading across x86 operating systems. In \
5addition to loading the Linux kernel, it implements the Multiboot \
6standard, which allows for flexible loading of multiple boot images. \
7This recipe builds an EFI binary for the target. It does not install \
8or package anything, it only deploys a target-arch GRUB EFI image."
9
10HOMEPAGE = "http://www.gnu.org/software/grub/"
11SECTION = "bootloaders"
12
13LICENSE = "GPLv3"
14LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
15
16# FIXME: We should be able to optionally drop freetype as a dependency
17DEPENDS = "autogen-native flex-native bison-native"
18DEPENDS_class-target = "grub-efi-native"
19PR = "r2"
20
21SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
22 file://cfg \
23 file://grub-2.00-fpmath-sse-387-fix.patch \
24 file://grub-2.00-fix-enable_execute_stack-check.patch \
25 file://check-if-liblzma-is-disabled.patch \
26 file://grub-no-unused-result.patch \
27 file://grub-2.00-ignore-gnulib-gets-stupidity.patch \
28 file://fix-issue-with-flex-2.5.37.patch \
29 file://grub-efi-allow-a-compilation-without-mcmodel-large.patch \
30 file://grub-2.00-add-oe-kernel.patch \
31 "
32SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
33SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
34
35COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
36
37S = "${WORKDIR}/grub-${PV}"
38
39# Determine the target arch for the grub modules
40python __anonymous () {
41 import re
42 target = d.getVar('TARGET_ARCH', True)
43 if target == "x86_64":
44 grubtarget = 'x86_64'
45 grubimage = "bootx64.efi"
46 elif re.match('i.86', target):
47 grubtarget = 'i386'
48 grubimage = "bootia32.efi"
49 else:
50 raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
51 d.setVar("GRUB_TARGET", grubtarget)
52 d.setVar("GRUB_IMAGE", grubimage)
53}
54
55inherit autotools-brokensep
56inherit gettext
57inherit deploy
58
59CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
60EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
61 --enable-efiemu=no --program-prefix='' \
62 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
63
64do_install_class-target() {
65 :
66}
67
68do_install_class-native() {
69 install -d ${D}${bindir}
70 install -m 755 grub-mkimage ${D}${bindir}
71}
72
73do_deploy() {
74 # Search for the grub.cfg on the local boot media by using the
75 # built in cfg file provided via this recipe
76 grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
77 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
78 boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search
79 install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
80}
81
82do_deploy_class-native() {
83 :
84}
85
86addtask deploy after do_install before do_build
87
88FILES_${PN}-dbg += "${libdir}/${BPN}/${GRUB_TARGET}-efi/.debug"
89
90BBCLASSEXTEND = "native"
91ALLOW_EMPTY_${PN} = "1"
diff --git a/meta/recipes-bsp/grub/grub/40_custom b/meta/recipes-bsp/grub/grub/40_custom
new file mode 100755
index 0000000000..f891b02779
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub/40_custom
@@ -0,0 +1,9 @@
1#!/bin/sh
2exec tail -n +3 $0
3# This file provides an easy way to add custom menu entries. Simply type the
4# menu entries you want to add after this comment. Be careful not to change
5# the 'exec tail' line above.
6menuentry "Linux" {
7 set root=(hd0,1)
8 linux /vmlinuz root=__ROOTFS__ rw __CONSOLE__ __VIDEO_MODE__ __VGA_MODE__ quiet
9}
diff --git a/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch b/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch
new file mode 100644
index 0000000000..fc5aa4e313
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch
@@ -0,0 +1,34 @@
1From ff8f68cc48fd3c30d55e1d570d51f2e0952c968e Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Sat, 25 Jan 2014 23:49:44 -0500
4Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in
5
6Exclude the .pc from po/POTFILES.in since quilt uses "patch --backup",
7which will create the backup file under .pc, this may cause unexpected
8errors, for example, on CentOS 5.x, if the backup file is null
9(newfile), it's mode will be 000, then we will get errors when xgettext
10try to read it.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15---
16 autogen.sh | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/autogen.sh b/autogen.sh
20index 7424428..843619e 100755
21--- a/autogen.sh
22+++ b/autogen.sh
23@@ -5,7 +5,7 @@ set -e
24 export LC_COLLATE=C
25 unset LC_ALL
26
27-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
28+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' ! -path './.pc/*' | sort > po/POTFILES.in
29 find util -iname '*.in' ! -name Makefile.in |sort > po/POTFILES-shell.in
30
31 echo "Importing unicode..."
32--
331.7.10.4
34
diff --git a/meta/recipes-bsp/grub/grub_0.97.bb b/meta/recipes-bsp/grub/grub_0.97.bb
new file mode 100644
index 0000000000..376244e331
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_0.97.bb
@@ -0,0 +1,35 @@
1SUMMARY = "GRUB is the GRand Unified Bootloader"
2DESCRIPTION = "GRUB is a GPLed bootloader intended to unify bootloading across x86 \
3operating systems. In addition to loading the Linux kernel, it implements the Multiboot \
4standard, which allows for flexible loading of multiple boot images."
5HOMEPAGE = "http://www.gnu.org/software/grub/"
6SECTION = "bootloaders"
7
8LICENSE = "GPLv2+"
9LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
10 file://grub/main.c;beginline=3;endline=9;md5=22a5f28d2130fff9f2a17ed54be90ed6"
11
12RDEPENDS_${PN} = "diffutils"
13PR = "r6"
14
15SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
16 file://no-reorder-functions.patch \
17 file://autohell.patch \
18 file://grub_fix_for_automake-1.12.patch \
19 file://objcopy-absolute.patch \
20 file://grub-support-256byte-inode.patch \
21"
22
23SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
24SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"
25
26inherit autotools
27
28COMPATIBLE_HOST = "i.86.*-linux"
29
30EXTRA_OECONF = "--without-curses"
31
32do_install_append_vmware() {
33 mkdir -p ${D}/boot/
34 ln -sf ../usr/lib/grub/{$TARGET_ARCH}{$TARGET_VENDOR}/ ${D}/boot/grub
35}
diff --git a/meta/recipes-bsp/grub/grub_2.00.bb b/meta/recipes-bsp/grub/grub_2.00.bb
new file mode 100644
index 0000000000..c21031bde1
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -0,0 +1,52 @@
1SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
2
3DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
4intended to unify bootloading across x86 operating systems. In \
5addition to loading the Linux kernel, it implements the Multiboot \
6standard, which allows for flexible loading of multiple boot images."
7
8HOMEPAGE = "http://www.gnu.org/software/grub/"
9SECTION = "bootloaders"
10
11LICENSE = "GPLv3"
12LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
13
14DEPENDS = "autogen-native flex-native bison-native xz"
15RDEPENDS_${PN} = "diffutils freetype"
16PR = "r1"
17
18SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
19 file://grub-install.in.patch \
20 file://grub-2.00-fpmath-sse-387-fix.patch \
21 file://remove-gets.patch \
22 file://check-if-liblzma-is-disabled.patch \
23 file://40_custom \
24 file://fix-issue-with-flex-2.5.37.patch \
25 file://grub-2.00-add-oe-kernel.patch \
26 "
27
28SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
29SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
30
31COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
32
33FILES_${PN}-dbg += "${libdir}/${BPN}/i386-pc/.debug"
34
35
36inherit autotools
37inherit gettext
38
39PACKAGECONFIG ??= ""
40PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
41PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
42
43EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
44 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
45
46do_install_append () {
47 install -d ${D}${sysconfdir}/grub.d
48 install -m 0755 ${WORKDIR}/40_custom ${D}${sysconfdir}/grub.d/40_custom
49}
50
51INSANE_SKIP_${PN} = "arch"
52INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
new file mode 100644
index 0000000000..9b5d9bbd7d
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -0,0 +1,62 @@
1SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
2
3DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
4intended to unify bootloading across x86 operating systems. In \
5addition to loading the Linux kernel, it implements the Multiboot \
6standard, which allows for flexible loading of multiple boot images."
7
8HOMEPAGE = "http://www.gnu.org/software/grub/"
9SECTION = "bootloaders"
10
11LICENSE = "GPLv3"
12LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
13
14DEPENDS = "autogen-native flex-native bison-native xz freetype"
15
16DEFAULT_PREFERENCE = "-1"
17DEFAULT_PREFERENCE_arm = "1"
18
19PV = "2.00+${SRCPV}"
20SRCREV = "0776112c5311196889a15058a3b1be4c81ba5e05"
21SRC_URI = "git://git.savannah.gnu.org/grub.git \
22 file://40_custom \
23 file://autogen.sh-exclude-pc.patch \
24 file://grub-2.00-add-oe-kernel.patch \
25 "
26
27S = "${WORKDIR}/git"
28
29COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
30
31inherit autotools
32inherit gettext
33
34PACKAGECONFIG ??= ""
35PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
36PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
37
38# configure.ac has code to set this automagically from the target tuple
39# but the OE freeform one (core2-foo-bar-linux) don't work with that.
40
41GRUBPLATFORM_arm = "uboot"
42GRUBPLATFORM_aarch64 = "efi"
43GRUBPLATFORM ??= "pc"
44
45EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
46 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
47
48do_configure_prepend() {
49 ( cd ${S}
50 ${S}/autogen.sh )
51}
52
53do_install_append () {
54 install -d ${D}${sysconfdir}/grub.d
55 install -m 0755 ${WORKDIR}/40_custom ${D}${sysconfdir}/grub.d/40_custom
56}
57
58RDEPENDS_${PN} = "diffutils freetype"
59FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
60
61INSANE_SKIP_${PN} = "arch"
62INSANE_SKIP_${PN}-dbg = "arch"