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-disable-help2man.patch148
-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-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_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
-rwxr-xr-xmeta/recipes-bsp/grub/grub-2.00/40_custom9
-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-native_2.00.bb84
-rw-r--r--meta/recipes-bsp/grub/grub_0.97.bb34
-rw-r--r--meta/recipes-bsp/grub/grub_2.00.bb50
18 files changed, 685 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-disable-help2man.patch b/meta/recipes-bsp/grub/files/grub-2.00-disable-help2man.patch
new file mode 100644
index 0000000000..a2e42c2b7f
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-disable-help2man.patch
@@ -0,0 +1,148 @@
1Upstream-Status: Inappropriate (Bitbake build environment)
2
3We do not need the man pages when building just the EFI payload for the target,
4all the tools are built for the host. This does not trigger GRUB's built-in
5cross-compilation check, so force it. After the change to configure.ac,
6autogen.sh was run in devshell and the resulting configure was used to generate
7the configure diff. The configure diff was included to avoid having to add
8autogen.sh to a do_configure_prepend() routine which would slow down the build
9unnecessarily.
10
11Signed-off-by: Darren Hart <dvhart@linux.intel.com>
12
13Index: grub-2.00/configure.ac
14===================================================================
15--- grub-2.00.orig/configure.ac
16+++ grub-2.00/configure.ac
17@@ -310,11 +310,12 @@ if test x$USE_NLS = xno; then
18 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
19 fi
20
21-if test "x$cross_compiling" = xyes; then
22- AC_MSG_WARN([cannot generate manual pages while cross compiling])
23-else
24- AC_PATH_PROG(HELP2MAN, help2man)
25-fi
26+# Force behaving as though we are cross-compiling with respect to HELP2MAN
27+#if test "x$cross_compiling" = xyes; then
28+AC_MSG_WARN([cannot generate manual pages while cross compiling])
29+#else
30+# AC_PATH_PROG(HELP2MAN, help2man)
31+#fi
32
33 # Check for functions and headers.
34 AC_CHECK_FUNCS(posix_memalign memalign asprintf vasprintf getextmntent)
35Index: grub-2.00/configure
36===================================================================
37--- grub-2.00.orig/configure
38+++ grub-2.00/configure
39@@ -1215,7 +1215,6 @@ GL_COND_LIBTOOL_FALSE
40 GL_COND_LIBTOOL_TRUE
41 BUILD_CC
42 LIBUTIL
43-HELP2MAN
44 POSUB
45 LTLIBINTL
46 LIBINTL
47@@ -3069,7 +3068,6 @@ _ACEOF
48 # Let the site file select an alternate cache file if it wants to.
49 # Prefer an explicitly selected file to automatically selected ones.
50 ac_site_file1=NONE
51-ac_site_file2=NONE
52 if test -n "$CONFIG_SITE"; then
53 # We do not want a PATH search for config.site.
54 case $CONFIG_SITE in #((
55@@ -3077,14 +3075,8 @@ if test -n "$CONFIG_SITE"; then
56 */*) ac_site_file1=$CONFIG_SITE;;
57 *) ac_site_file1=./$CONFIG_SITE;;
58 esac
59-elif test "x$prefix" != xNONE; then
60- ac_site_file1=$prefix/share/config.site
61- ac_site_file2=$prefix/etc/config.site
62-else
63- ac_site_file1=$ac_default_prefix/share/config.site
64- ac_site_file2=$ac_default_prefix/etc/config.site
65 fi
66-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
67+for ac_site_file in $ac_site_file1
68 do
69 test "x$ac_site_file" = xNONE && continue
70 if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
71@@ -3371,8 +3363,9 @@ case $target_os in *\ *) target_os=`echo
72 # The aliases save the names the user supplied, while $host etc.
73 # will get canonicalized.
74 test -n "$target_alias" &&
75- test "$program_prefix$program_suffix$program_transform_name" = \
76- NONENONEs,x,x, &&
77+ test "$target_alias" != "$host_alias" &&
78+ test "$program_prefix$program_suffix$program_transform_name" = \
79+ NONENONEs,x,x, &&
80 program_prefix=${target_alias}-
81
82 am__api_version='1.11'
83@@ -9633,51 +9626,13 @@ if test x$USE_NLS = xno; then
84 HOST_CFLAGS="$HOST_CFLAGS -fno-builtin-gettext"
85 fi
86
87-if test "x$cross_compiling" = xyes; then
88- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot generate manual pages while cross compiling" >&5
89+# Force behaving as though we are cross-compiling with respect to HELP2MAN
90+#if test "x$cross_compiling" = xyes; then
91+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot generate manual pages while cross compiling" >&5
92 $as_echo "$as_me: WARNING: cannot generate manual pages while cross compiling" >&2;}
93-else
94- # Extract the first word of "help2man", so it can be a program name with args.
95-set dummy help2man; ac_word=$2
96-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
97-$as_echo_n "checking for $ac_word... " >&6; }
98-if ${ac_cv_path_HELP2MAN+:} false; then :
99- $as_echo_n "(cached) " >&6
100-else
101- case $HELP2MAN in
102- [\\/]* | ?:[\\/]*)
103- ac_cv_path_HELP2MAN="$HELP2MAN" # Let the user override the test with a path.
104- ;;
105- *)
106- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
107-for as_dir in $PATH
108-do
109- IFS=$as_save_IFS
110- test -z "$as_dir" && as_dir=.
111- for ac_exec_ext in '' $ac_executable_extensions; do
112- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
113- ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext"
114- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
115- break 2
116- fi
117-done
118- done
119-IFS=$as_save_IFS
120-
121- ;;
122-esac
123-fi
124-HELP2MAN=$ac_cv_path_HELP2MAN
125-if test -n "$HELP2MAN"; then
126- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HELP2MAN" >&5
127-$as_echo "$HELP2MAN" >&6; }
128-else
129- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
130-$as_echo "no" >&6; }
131-fi
132-
133-
134-fi
135+#else
136+# AC_PATH_PROG(HELP2MAN, help2man)
137+#fi
138
139 # Check for functions and headers.
140 for ac_func in posix_memalign memalign asprintf vasprintf getextmntent
141@@ -20477,6 +20432,7 @@ $as_echo_n "checking whether \`$CC' gene
142 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
143 /* end confdefs.h. */
144
145+void g (int);
146 void f (int (*p) (void));
147 void g (int i)
148 {
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-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_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/40_custom b/meta/recipes-bsp/grub/grub-2.00/40_custom
new file mode 100755
index 0000000000..f891b02779
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-2.00/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-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-native_2.00.bb b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
new file mode 100644
index 0000000000..04973b524f
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb
@@ -0,0 +1,84 @@
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"
18RDEPENDS_${PN} = "diffutils freetype"
19PR = "r2"
20
21# Native packages do not normally rebuild when the target changes.
22# Ensure this is built once per HOST-TARGET pair.
23PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
24
25SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
26 file://cfg \
27 file://grub-2.00-fpmath-sse-387-fix.patch \
28 file://grub-2.00-fix-enable_execute_stack-check.patch \
29 file://grub-2.00-disable-help2man.patch \
30 file://check-if-liblzma-is-disabled.patch \
31 file://grub-no-unused-result.patch \
32 file://grub-2.00-ignore-gnulib-gets-stupidity.patch \
33 file://fix-issue-with-flex-2.5.37.patch \
34 "
35SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
36SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
37
38COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
39
40S = "${WORKDIR}/grub-${PV}"
41
42# Determine the target arch for the grub modules before the native class
43# clobbers TARGET_ARCH.
44ORIG_TARGET_ARCH := "${TARGET_ARCH}"
45python __anonymous () {
46 import re
47 target = d.getVar('ORIG_TARGET_ARCH', True)
48 if target == "x86_64":
49 grubtarget = 'x86_64'
50 grubimage = "bootx64.efi"
51 elif re.match('i.86', target):
52 grubtarget = 'i386'
53 grubimage = "bootia32.efi"
54 else:
55 raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
56 d.setVar("GRUB_TARGET", grubtarget)
57 d.setVar("GRUB_IMAGE", grubimage)
58}
59
60inherit autotools
61inherit gettext
62inherit native
63inherit deploy
64
65EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
66 --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix='' \
67 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
68
69do_mkimage() {
70 # Search for the grub.cfg on the local boot media by using the
71 # built in cfg file provided via this recipe
72 ./grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
73 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
74 boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search
75}
76addtask mkimage after do_compile before do_install
77
78do_deploy() {
79 install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
80}
81addtask deploy after do_install before do_build
82
83do_install[noexec] = "1"
84do_populate_sysroot[noexec] = "1"
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..38f39121d6
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_0.97.bb
@@ -0,0 +1,34 @@
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 "
21
22SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
23SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"
24
25inherit autotools
26
27COMPATIBLE_HOST = "i.86.*-linux"
28
29EXTRA_OECONF = "--without-curses"
30
31do_install_append_vmware() {
32 mkdir -p ${D}/boot/
33 ln -sf ../usr/lib/grub/{$TARGET_ARCH}{$TARGET_VENDOR}/ ${D}/boot/grub
34}
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..e82996d466
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -0,0 +1,50 @@
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"
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 "
26
27SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
28SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
29
30COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
31
32FILES_${PN}-dbg += "${libdir}/${BPN}/i386-pc/.debug"
33
34
35inherit autotools
36inherit gettext
37
38PACKAGECONFIG ??= ""
39PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
40
41EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
42 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
43
44do_install_append () {
45 install -d ${D}${sysconfdir}/grub.d
46 install -m 0755 ${WORKDIR}/40_custom ${D}${sysconfdir}/grub.d/40_custom
47}
48
49INSANE_SKIP_${PN} = "arch"
50INSANE_SKIP_${PN}-dbg = "arch"