diff options
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 @@ | |||
1 | From c72599a7bd46c22d296c59dbd13f138503350d2f Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
3 | From: Darren Hart <dvhart@linux.intel.com> | ||
4 | Date: Tue, 30 Apr 2013 21:11:17 -0700 | ||
5 | Subject: [PATCH 1/4] configure.ac: Add option to disable configuring the BIOS | ||
6 | test | ||
7 | |||
8 | When cross-compiling, AC_CHECK_FILE aborts configure. Provide a means to | ||
9 | avoid even attempting to configure the BIOS test. | ||
10 | |||
11 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
12 | --- | ||
13 | configure.ac | 10 +++++++--- | ||
14 | 1 files changed, 7 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/configure.ac b/configure.ac | ||
17 | index 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 | -- | ||
38 | 1.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 @@ | |||
1 | From b4ad8b65a79e2cf8857439271c88bd44f5e9cd05 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <b4ad8b65a79e2cf8857439271c88bd44f5e9cd05.1367382591.git.dvhart@linux.intel.com> | ||
3 | In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
4 | References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
5 | From: Darren Hart <dvhart@linux.intel.com> | ||
6 | Date: Tue, 30 Apr 2013 21:13:39 -0700 | ||
7 | Subject: [PATCH 2/4] configure.ac: Use AC_CHECK_HEADER to detect the efi | ||
8 | includes | ||
9 | |||
10 | While cross-compiling, AC_CHECK_FILE will abort the configure. | ||
11 | |||
12 | The gnu-efi sources don't use relative paths and require the user to | ||
13 | explicitly include -I/usr/include/efi/${ARCH}. I haven't found a way to | ||
14 | do this with AC_CHECK_HEADER. However, since the existing test was not | ||
15 | testing for usability (conftest.c compilation), we don't lose much by | ||
16 | just not looking for efi.h and assume it exists if we can find and use | ||
17 | efibind.h. | ||
18 | |||
19 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
20 | --- | ||
21 | configure.ac | 11 ++++++----- | ||
22 | 1 files changed, 6 insertions(+), 5 deletions(-) | ||
23 | |||
24 | diff --git a/configure.ac b/configure.ac | ||
25 | index 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 | -- | ||
47 | 1.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 @@ | |||
1 | From 8d1e561ef06889c7dd5943c5be2045c6cf98b14c Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <8d1e561ef06889c7dd5943c5be2045c6cf98b14c.1367382591.git.dvhart@linux.intel.com> | ||
3 | In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
4 | References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
5 | From: Darren Hart <dvhart@linux.intel.com> | ||
6 | Date: Tue, 30 Apr 2013 21:18:51 -0700 | ||
7 | Subject: [PATCH 3/4] Makefile.am: Allow for user override of EFI include dir | ||
8 | |||
9 | Enable cross-compiling by allowing the user to specify an alternative to | ||
10 | the /usr/include directory for the EFI includes. Add a variable INCDIR | ||
11 | defaulting to /usr/include, but still allowing the user to provide their | ||
12 | own value. | ||
13 | |||
14 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
15 | --- | ||
16 | Makefile.am | 5 +++-- | ||
17 | 1 files changed, 3 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/Makefile.am b/Makefile.am | ||
20 | index 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 | -- | ||
38 | 1.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 @@ | |||
1 | From 981895439eb0713fa787b4aaf80df98530eb7ea6 Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <981895439eb0713fa787b4aaf80df98530eb7ea6.1367382591.git.dvhart@linux.intel.com> | ||
3 | In-Reply-To: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
4 | References: <c72599a7bd46c22d296c59dbd13f138503350d2f.1367382591.git.dvhart@linux.intel.com> | ||
5 | From: Darren Hart <dvhart@linux.intel.com> | ||
6 | Date: Tue, 30 Apr 2013 21:20:59 -0700 | ||
7 | Subject: [PATCH 4/4] configure.ac: Allow for more than just i686 for ia32 | ||
8 | |||
9 | Expand the ARCH_I686 to include i*86* (specifically to catch i586). | ||
10 | Rename ARCH_I686 to ARCH_IA32 as that is more accurately what we are | ||
11 | testing for. | ||
12 | |||
13 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
14 | --- | ||
15 | configure.ac | 4 ++-- | ||
16 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index 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 | -- | ||
39 | 1.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 @@ | |||
1 | From 58204c946ec8f626d1b5997188b17978fcba5c9b Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <58204c946ec8f626d1b5997188b17978fcba5c9b.1367616193.git.dvhart@linux.intel.com> | ||
3 | From: Darren Hart <dvhart@linux.intel.com> | ||
4 | Date: Fri, 3 May 2013 14:21:25 -0700 | ||
5 | Subject: [PATCH] Auto detect both x64 and ia32 boot*.efi payloads | ||
6 | |||
7 | The EFI specification documents /EFI/BOOT/bootx64.efi for x86_64 | ||
8 | machines and /EFI/BOOT/bootia32.efi for ia32 machines. Update the auto | ||
9 | detection to allow for both. | ||
10 | |||
11 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
12 | --- | ||
13 | src/efi/gummiboot.c | 4 +++- | ||
14 | 1 files changed, 3 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c | ||
17 | index 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 | -- | ||
32 | 1.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 @@ | |||
1 | From e4711180646eb1fd701c4e5b124e5dc5372d446d Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <e4711180646eb1fd701c4e5b124e5dc5372d446d.1367620002.git.dvhart@linux.intel.com> | ||
3 | From: Darren Hart <dvhart@linux.intel.com> | ||
4 | Date: Fri, 3 May 2013 15:10:43 -0700 | ||
5 | Subject: [PATCH] Add 32 bit compatible rdtsc asm | ||
6 | |||
7 | Gcc's inline asm constraints have different meanings on x86_64 and ia32. | ||
8 | Include a 32 bit version for the rdtsc function. Drop the empty 32 bit | ||
9 | version of time_usec as it and the cpuid function both function properly | ||
10 | when compiled for 32 bit systems. | ||
11 | |||
12 | Tested on the following CPU: | ||
13 | Intel(R) Atom(TM) CPU E640 @ 1.00GHz | ||
14 | |||
15 | A value of 1000000000 was detected. | ||
16 | |||
17 | Signed-off-by: Darren Hart <dvhart@linux.intel.com> | ||
18 | --- | ||
19 | src/efi/gummiboot.c | 10 +++++++--- | ||
20 | 1 files changed, 7 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/src/efi/gummiboot.c b/src/efi/gummiboot.c | ||
23 | index 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 | -- | ||
51 | 1.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 @@ | |||
1 | SUMMARY = "Gummiboot is a simple UEFI boot manager which executes configured EFI images." | ||
2 | HOMEPAGE = "http://freedesktop.org/wiki/Software/gummiboot" | ||
3 | |||
4 | LICENSE = "LGPLv2.1" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c" | ||
6 | |||
7 | DEPENDS = "gnu-efi util-linux" | ||
8 | |||
9 | inherit autotools | ||
10 | inherit deploy | ||
11 | |||
12 | PV = "33" | ||
13 | PR = "r0" | ||
14 | SRCREV = "cbc63ae9d6161fe6412f0457e72a276f5acb6e2a" | ||
15 | SRC_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 | |||
23 | S = "${WORKDIR}/git" | ||
24 | |||
25 | EXTRA_OECONF = "--disable-biostest" | ||
26 | EXTRA_OEMAKE = "INCDIR=${STAGING_INCDIR} GNUEFI_LDS_DIR=${STAGING_LIBDIR} \ | ||
27 | GNUEFI_LIBS='-L ${STAGING_LIBDIR}'" | ||
28 | |||
29 | do_deploy () { | ||
30 | install ${S}/gummiboot*.efi ${DEPLOYDIR}/ | ||
31 | } | ||
32 | addtask deploy before do_build after do_compile | ||