summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2013-07-26 13:47:44 -0700
committerDarren Hart <dvhart@linux.intel.com>2013-07-30 12:58:26 -0700
commitce8f48d28c8d6d99b860e3f6480d9d3a6fc0b301 (patch)
tree407035197189d71195319f695d7bd9c2415beae2
parent8834d8376838487bfc3ff04a16cffb064cb765cf (diff)
downloadmeta-intel-ce8f48d28c8d6d99b860e3f6480d9d3a6fc0b301.tar.gz
gummiboot: Add gummiboot recipe1.5_M3.final1.5_M3
gummiboot is a simple UEFI boot manager. It uses configuration files to setup the default boot entry or presents an on-screen menu. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
-rw-r--r--common/recipes-bsp/gummiboot/files/0001-configure.ac-Add-option-to-disable-configuring-the-B.patch39
-rw-r--r--common/recipes-bsp/gummiboot/files/0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch48
-rw-r--r--common/recipes-bsp/gummiboot/files/0003-Makefile.am-Allow-for-user-override-of-EFI-include-d.patch39
-rw-r--r--common/recipes-bsp/gummiboot/files/0004-configure.ac-Allow-for-more-than-just-i686-for-ia32.patch40
-rw-r--r--common/recipes-bsp/gummiboot/files/0005-Auto-detect-both-x64-and-ia32-boot-.efi-payloads.patch33
-rw-r--r--common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch52
-rw-r--r--common/recipes-bsp/gummiboot/gummiboot_git.bb32
7 files changed, 283 insertions, 0 deletions
diff --git a/common/recipes-bsp/gummiboot/files/0001-configure.ac-Add-option-to-disable-configuring-the-B.patch b/common/recipes-bsp/gummiboot/files/0001-configure.ac-Add-option-to-disable-configuring-the-B.patch
new file mode 100644
index 00000000..9ed0a5e0
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0001-configure.ac-Add-option-to-disable-configuring-the-B.patch
@@ -0,0 +1,39 @@
1From c72599a7bd46c22d296c59dbd13f138503350d2f Mon Sep 17 00:00:00 2001
2Message-Id: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
3From: Darren Hart <dvhart@linux.intel.com>
4Date: Tue, 30 Apr 2013 21:11:17 -0700
5Subject: [PATCH 1/4] configure.ac: Add option to disable configuring the BIOS
6 test
7
8When cross-compiling, AC_CHECK_FILE aborts configure. Provide a means to
9avoid even attempting to configure the BIOS test.
10
11Signed-off-by: Darren Hart <dvhart@linux.intel.com>
12---
13 configure.ac | 10 +++++++---
14 1 files changed, 7 insertions(+), 3 deletions(-)
15
16diff --git a/configure.ac b/configure.ac
17index efa0e54..524060c 100644
18--- a/configure.ac
19+++ b/configure.ac
20@@ -66,9 +66,13 @@ AC_SUBST([ARCH])
21 AC_SUBST([MACHINE_TYPE_NAME])
22
23 # test bios
24-AC_CHECK_FILE([/usr/lib/qemu-bios], [BIOS=/usr/lib/qemu-bios])
25-AC_CHECK_FILE([/usr/share/qemu-ovmf/bios], [BIOS=/usr/share/qemu-ovmf/bios])
26-AC_SUBST([BIOS])
27+AC_ARG_ENABLE(biostest, AS_HELP_STRING([--disable-biostest], [disable building BIOS test]))
28+if test "x$enable_biostest" != "xno"; then
29+ AC_CHECK_FILE([/usr/lib/qemu-bios], [BIOS=/usr/lib/qemu-bios])
30+ AC_CHECK_FILE([/usr/share/qemu-ovmf/bios], [BIOS=/usr/share/qemu-ovmf/bios])
31+ AC_SUBST([BIOS])
32+fi
33+AM_CONDITIONAL(ENABLE_BIOSTEST, [test "x$enable_biostest" = "xyes"])
34
35 # ------------------------------------------------------------------------------
36 dnl Compile EFI stuff is so tricky that it's probably better to check for the
37--
381.7.5.4
39
diff --git a/common/recipes-bsp/gummiboot/files/0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch b/common/recipes-bsp/gummiboot/files/0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch
new file mode 100644
index 00000000..478eab82
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch
@@ -0,0 +1,48 @@
1From b4ad8b65a79e2cf8857439271c88bd44f5e9cd05 Mon Sep 17 00:00:00 2001
2Message-Id: <b4ad8b65a79e2cf8857439271c88bd44f5e9cd05.1367382591.git.dvhart@linux.intel.com>
3In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
4References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
5From: Darren Hart <dvhart@linux.intel.com>
6Date: Tue, 30 Apr 2013 21:13:39 -0700
7Subject: [PATCH 2/4] configure.ac: Use AC_CHECK_HEADER to detect the efi
8 includes
9
10While cross-compiling, AC_CHECK_FILE will abort the configure.
11
12The gnu-efi sources don't use relative paths and require the user to
13explicitly include -I/usr/include/efi/${ARCH}. I haven't found a way to
14do this with AC_CHECK_HEADER. However, since the existing test was not
15testing for usability (conftest.c compilation), we don't lose much by
16just not looking for efi.h and assume it exists if we can find and use
17efibind.h.
18
19Signed-off-by: Darren Hart <dvhart@linux.intel.com>
20---
21 configure.ac | 11 ++++++-----
22 1 files changed, 6 insertions(+), 5 deletions(-)
23
24diff --git a/configure.ac b/configure.ac
25index 524060c..f7c62ea 100644
26--- a/configure.ac
27+++ b/configure.ac
28@@ -75,11 +75,12 @@ fi
29 AM_CONDITIONAL(ENABLE_BIOSTEST, [test "x$enable_biostest" = "xyes"])
30
31 # ------------------------------------------------------------------------------
32-dnl Compile EFI stuff is so tricky that it's probably better to check for the
33-dnl include files that try to use AC_CHECK_HEADERS to compile any conftest.c
34-AC_CHECK_FILES([/usr/include/efi/efi.h
35- /usr/include/efi/${ARCH}/efibind.h], [],
36- [AC_MSG_ERROR([*** GNU Efi headers not found])])
37+dnl GNU EFI doesn't use relative paths: efi.h includes efibind.h which is in
38+dnl ${ARCH} relative to efi.h. I can't find a way to get AC_CHECK_HEADERS to
39+dnl add -I/usr/include/efi/${ARCH} to the conftest.c build. So, just test for
40+dnl efibind.h as the chances of efi.h not existing if it does are very low.
41+AC_CHECK_HEADER(efi/${ARCH}/efibind.h, [],
42+ [AC_MSG_ERROR([*** GNU EFI header efibind.h not found])])
43
44 efiroot=$(echo $(cd /usr/lib/$(gcc -print-multi-os-directory); pwd))
45 GNUEFI_LIBS="-L $efiroot"
46--
471.7.5.4
48
diff --git a/common/recipes-bsp/gummiboot/files/0003-Makefile.am-Allow-for-user-override-of-EFI-include-d.patch b/common/recipes-bsp/gummiboot/files/0003-Makefile.am-Allow-for-user-override-of-EFI-include-d.patch
new file mode 100644
index 00000000..7a51490c
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0003-Makefile.am-Allow-for-user-override-of-EFI-include-d.patch
@@ -0,0 +1,39 @@
1From 8d1e561ef06889c7dd5943c5be2045c6cf98b14c Mon Sep 17 00:00:00 2001
2Message-Id: <8d1e561ef06889c7dd5943c5be2045c6cf98b14c.1367382591.git.dvhart@linux.intel.com>
3In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
4References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
5From: Darren Hart <dvhart@linux.intel.com>
6Date: Tue, 30 Apr 2013 21:18:51 -0700
7Subject: [PATCH 3/4] Makefile.am: Allow for user override of EFI include dir
8
9Enable cross-compiling by allowing the user to specify an alternative to
10the /usr/include directory for the EFI includes. Add a variable INCDIR
11defaulting to /usr/include, but still allowing the user to provide their
12own value.
13
14Signed-off-by: Darren Hart <dvhart@linux.intel.com>
15---
16 Makefile.am | 5 +++--
17 1 files changed, 3 insertions(+), 2 deletions(-)
18
19diff --git a/Makefile.am b/Makefile.am
20index 22e314d..2611971 100644
21--- a/Makefile.am
22+++ b/Makefile.am
23@@ -72,10 +72,11 @@ CLEANFILES += man/gummiboot.8
24 efi_loadername = gummiboot$(MACHINE_TYPE_NAME).efi
25 efi_sources = src/efi/gummiboot.c
26
27+INCDIR := /usr/include
28 efi_cppflags = \
29 -I$(top_builddir) -include config.h \
30- -I/usr/include/efi \
31- -I/usr/include/efi/$(ARCH)
32+ -I$(INCDIR)/efi \
33+ -I$(INCDIR)/efi/$(ARCH)
34
35 efi_cflags = \
36 -Wall \
37--
381.7.5.4
39
diff --git a/common/recipes-bsp/gummiboot/files/0004-configure.ac-Allow-for-more-than-just-i686-for-ia32.patch b/common/recipes-bsp/gummiboot/files/0004-configure.ac-Allow-for-more-than-just-i686-for-ia32.patch
new file mode 100644
index 00000000..2f7e0d70
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0004-configure.ac-Allow-for-more-than-just-i686-for-ia32.patch
@@ -0,0 +1,40 @@
1From 981895439eb0713fa787b4aaf80df98530eb7ea6 Mon Sep 17 00:00:00 2001
2Message-Id: <981895439eb0713fa787b4aaf80df98530eb7ea6.1367382591.git.dvhart@linux.intel.com>
3In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
4References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com>
5From: Darren Hart <dvhart@linux.intel.com>
6Date: Tue, 30 Apr 2013 21:20:59 -0700
7Subject: [PATCH 4/4] configure.ac: Allow for more than just i686 for ia32
8
9Expand the ARCH_I686 to include i*86* (specifically to catch i586).
10Rename ARCH_I686 to ARCH_IA32 as that is more accurately what we are
11testing for.
12
13Signed-off-by: Darren Hart <dvhart@linux.intel.com>
14---
15 configure.ac | 4 ++--
16 1 files changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index f7c62ea..5d3d6ae 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -49,13 +49,13 @@ AC_PATH_PROG([XSLTPROC], [xsltproc])
23 AC_PATH_PROG([QEMU_KVM], [qemu-kvm])
24
25 dnl Define ARCH_<NAME> conditionals
26-SET_ARCH(I686, i686*)
27+SET_ARCH(IA32, i*86*)
28 SET_ARCH(X86_64, x86_64*)
29 SET_ARCH(IA64, ia64*)
30
31 ARCH=`echo $host | sed "s/\(-\).*$//"`
32
33-AM_COND_IF(ARCH_I686, [
34+AM_COND_IF(ARCH_IA32, [
35 ARCH=ia32
36 MACHINE_TYPE_NAME=ia32])
37
38--
391.7.5.4
40
diff --git a/common/recipes-bsp/gummiboot/files/0005-Auto-detect-both-x64-and-ia32-boot-.efi-payloads.patch b/common/recipes-bsp/gummiboot/files/0005-Auto-detect-both-x64-and-ia32-boot-.efi-payloads.patch
new file mode 100644
index 00000000..049218d3
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0005-Auto-detect-both-x64-and-ia32-boot-.efi-payloads.patch
@@ -0,0 +1,33 @@
1From 58204c946ec8f626d1b5997188b17978fcba5c9b Mon Sep 17 00:00:00 2001
2Message-Id: <58204c946ec8f626d1b5997188b17978fcba5c9b.1367616193.git.dvhart@linux.intel.com>
3From: Darren Hart <dvhart@linux.intel.com>
4Date: Fri, 3 May 2013 14:21:25 -0700
5Subject: [PATCH] Auto detect both x64 and ia32 boot*.efi payloads
6
7The EFI specification documents /EFI/BOOT/bootx64.efi for x86_64
8machines and /EFI/BOOT/bootia32.efi for ia32 machines. Update the auto
9detection to allow for both.
10
11Signed-off-by: Darren Hart <dvhart@linux.intel.com>
12---
13 src/efi/gummiboot.c | 4 +++-
14 1 files changed, 3 insertions(+), 1 deletions(-)
15
16diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c
17index 3013873..ed68934 100644
18--- a/src/efi/gummiboot.c
19+++ b/src/efi/gummiboot.c
20@@ -1941,7 +1941,9 @@ EFI_STATUS EFIAPI efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *sys_table) {
21 config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
22 L"auto-efi-shell", L"EFI Shell", L"\\shellx64.efi");
23 config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
24- L"auto-efi-default", L"EFI Default Loader", L"\\EFI\\BOOT\\BOOTX64.EFI");
25+ L"auto-efi-default-64", L"EFI Default Loader (x64)", L"\\EFI\\BOOT\\BOOTX64.EFI");
26+ config_entry_add_loader_auto(&config, loaded_image->DeviceHandle, root_dir, loaded_image_path,
27+ L"auto-efi-default-32", L"EFI Default Loader (ia32)", L"\\EFI\\BOOT\\BOOTIA32.EFI");
28 config_entry_add_osx(&config);
29 efivar_set(L"LoaderEntriesAuto", config.entries_auto, FALSE);
30
31--
321.7.5.4
33
diff --git a/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch b/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch
new file mode 100644
index 00000000..e170b695
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/files/0006-Add-32-bit-compatible-rdtsc-asm.patch
@@ -0,0 +1,52 @@
1From e4711180646eb1fd701c4e5b124e5dc5372d446d Mon Sep 17 00:00:00 2001
2Message-Id: <e4711180646eb1fd701c4e5b124e5dc5372d446d.1367620002.git.dvhart@linux.intel.com>
3From: Darren Hart <dvhart@linux.intel.com>
4Date: Fri, 3 May 2013 15:10:43 -0700
5Subject: [PATCH] Add 32 bit compatible rdtsc asm
6
7Gcc's inline asm constraints have different meanings on x86_64 and ia32.
8Include a 32 bit version for the rdtsc function. Drop the empty 32 bit
9version of time_usec as it and the cpuid function both function properly
10when compiled for 32 bit systems.
11
12Tested on the following CPU:
13Intel(R) Atom(TM) CPU E640 @ 1.00GHz
14
15A value of 1000000000 was detected.
16
17Signed-off-by: Darren Hart <dvhart@linux.intel.com>
18---
19 src/efi/gummiboot.c | 10 +++++++---
20 1 files changed, 7 insertions(+), 3 deletions(-)
21
22diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c
23index 9be8f8e..971e05c 100644
24--- a/src/efi/gummiboot.c
25+++ b/src/efi/gummiboot.c
26@@ -89,6 +89,13 @@ static UINT64 ticks_read(void) {
27 __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
28 return (d << 32) | a;
29 }
30+#else
31+static UINT64 ticks_read(void) {
32+ UINT64 val;
33+ __asm__ volatile ("rdtsc" : "=A" (val));
34+ return val;
35+}
36+#endif
37
38 static void cpuid_read(UINT32 info, UINT32 *eax, UINT32 *ebx, UINT32 *ecx, UINT32 *edx) {
39 *eax = info;
40@@ -186,9 +193,6 @@ static UINT64 time_usec(void) {
41
42 return 1000 * 1000 * ticks / cpufreq;
43 }
44-#else
45-static UINT64 time_usec(void) { return 0; }
46-#endif
47
48 static EFI_STATUS efivar_set_raw(const EFI_GUID *vendor, CHAR16 *name, CHAR8 *buf, UINTN size, BOOLEAN persistent) {
49 UINT32 flags;
50--
511.7.5.4
52
diff --git a/common/recipes-bsp/gummiboot/gummiboot_git.bb b/common/recipes-bsp/gummiboot/gummiboot_git.bb
new file mode 100644
index 00000000..871a9500
--- /dev/null
+++ b/common/recipes-bsp/gummiboot/gummiboot_git.bb
@@ -0,0 +1,32 @@
1SUMMARY = "Gummiboot is a simple UEFI boot manager which executes configured EFI images."
2HOMEPAGE = "http://freedesktop.org/wiki/Software/gummiboot"
3
4LICENSE = "LGPLv2.1"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
6
7DEPENDS = "gnu-efi util-linux"
8
9inherit autotools
10inherit deploy
11
12PV = "33"
13PR = "r0"
14SRCREV = "cbc63ae9d6161fe6412f0457e72a276f5acb6e2a"
15SRC_URI = "git://anongit.freedesktop.org/gummiboot \
16 file://0001-configure.ac-Add-option-to-disable-configuring-the-B.patch \
17 file://0002-configure.ac-Use-AC_CHECK_HEADER-to-detect-the-efi-i.patch \
18 file://0003-Makefile.am-Allow-for-user-override-of-EFI-include-d.patch \
19 file://0004-configure.ac-Allow-for-more-than-just-i686-for-ia32.patch \
20 file://0005-Auto-detect-both-x64-and-ia32-boot-.efi-payloads.patch \
21 file://0006-Add-32-bit-compatible-rdtsc-asm.patch"
22
23S = "${WORKDIR}/git"
24
25EXTRA_OECONF = "--disable-biostest"
26EXTRA_OEMAKE = "INCDIR=${STAGING_INCDIR} GNUEFI_LDS_DIR=${STAGING_LIBDIR} \
27 GNUEFI_LIBS='-L ${STAGING_LIBDIR}'"
28
29do_deploy () {
30 install ${S}/gummiboot*.efi ${DEPLOYDIR}/
31}
32addtask deploy before do_build after do_compile