diff options
Diffstat (limited to 'meta-oe/recipes-extended/efivar')
4 files changed, 131 insertions, 18 deletions
diff --git a/meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch b/meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch new file mode 100644 index 000000000..4bd7d958a --- /dev/null +++ b/meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 7036e8b0dca61432970789e5397b6fb02b362c2b Mon Sep 17 00:00:00 2001 | ||
2 | From: Kai Kang <kai.kang@windriver.com> | ||
3 | Date: Fri, 25 Sep 2015 18:14:31 +0800 | ||
4 | Subject: [PATCH] efivar: fix for cross compile | ||
5 | |||
6 | It builds and calls elf file makeguids to generate a header file which | ||
7 | doesn't work for cross compile. Fix it. | ||
8 | |||
9 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | --- | ||
11 | src/Makefile | 4 ++-- | ||
12 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
13 | |||
14 | diff --git a/src/Makefile b/src/Makefile | ||
15 | index 6eac858..ef4eb1d 100644 | ||
16 | --- a/src/Makefile | ||
17 | +++ b/src/Makefile | ||
18 | @@ -65,8 +65,8 @@ makeguids.o : makeguids.c | ||
19 | makeguids : makeguids.o fakeguid.o | ||
20 | $(CC) $(cflags) -o $@ $^ -ldl | ||
21 | |||
22 | -include/efivar/efivar-guids.h : makeguids guids.txt | ||
23 | - ./makeguids guids.txt guids.bin names.bin guid-symbols.S $@ | ||
24 | +include/efivar/efivar-guids.h : guids.txt | ||
25 | + makeguids guids.txt guids.bin names.bin guid-symbols.S $@ | ||
26 | |||
27 | guidlist.o : guids.S include/efivar/efivar-guids.h | ||
28 | $(CC) $(cflags) -c -o guidlist.o guids.S | ||
29 | -- | ||
30 | 2.6.0.rc2.10.gf4d9753 | ||
31 | |||
diff --git a/meta-oe/recipes-extended/efivar/efivar/efivar-drop-options-not-supported-by-lower-version-gcc.patch b/meta-oe/recipes-extended/efivar/efivar/efivar-drop-options-not-supported-by-lower-version-gcc.patch new file mode 100644 index 000000000..7f04b1937 --- /dev/null +++ b/meta-oe/recipes-extended/efivar/efivar/efivar-drop-options-not-supported-by-lower-version-gcc.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | gcc options '-Wmaybe-uninitialized' and '-std=gnu11' are not recognized by gcc | ||
2 | whose version is lower than 4.6, such as on Ubuntu 12.04. Drop them for backward | ||
3 | compatible. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
8 | --- | ||
9 | diff --git a/Make.defaults b/Make.defaults | ||
10 | index cc2baa9..118ae56 100644 | ||
11 | --- a/Make.defaults | ||
12 | +++ b/Make.defaults | ||
13 | @@ -10,10 +10,9 @@ CFLAGS ?= -O2 -g | ||
14 | |||
15 | ARCH = $(shell uname -m) | ||
16 | clang_cflags = | ||
17 | -gcc_cflags = -Wmaybe-uninitialized | ||
18 | cflags := $(CFLAGS) \ | ||
19 | -Werror -Wall -Wsign-compare -Wstrict-aliasing \ | ||
20 | - -std=gnu11 -fshort-wchar -fPIC \ | ||
21 | + -fshort-wchar -fPIC \ | ||
22 | -fvisibility=hidden \ | ||
23 | -D_GNU_SOURCE -I${TOPDIR}/src/include/efivar/ \ | ||
24 | $(if $(filter $(CC),clang),$(clang_cflags),) \ | ||
25 | diff --git a/src/guid.h b/src/guid.h | ||
26 | index 9542ee1..0817991 100644 | ||
27 | --- a/src/guid.h | ||
28 | +++ b/src/guid.h | ||
29 | @@ -31,7 +31,8 @@ static inline int | ||
30 | real_isspace(char c) | ||
31 | { | ||
32 | char spaces[] = " \f\n\r\t\v"; | ||
33 | - for (int i = 0; spaces[i] != '\0'; i++) | ||
34 | + int i; | ||
35 | + for (i = 0; spaces[i] != '\0'; i++) | ||
36 | if (c == spaces[i]) | ||
37 | return 1; | ||
38 | return 0; | ||
39 | @@ -59,7 +60,8 @@ check_sanity(const char *text, size_t len) | ||
40 | static inline int | ||
41 | check_segment_sanity(const char *text, size_t len) | ||
42 | { | ||
43 | - for(unsigned int i = 0; i < len; i++) { | ||
44 | + unsigned int i; | ||
45 | + for(i = 0; i < len; i++) { | ||
46 | if (text[i] >= '0' && text[i] <= '9') | ||
47 | continue; | ||
48 | /* "| 0x20" is tolower() without having to worry about | ||
49 | diff --git a/src/makeguids.c b/src/makeguids.c | ||
50 | index e9acf15..7e16cb2 100644 | ||
51 | --- a/src/makeguids.c | ||
52 | +++ b/src/makeguids.c | ||
53 | @@ -150,7 +150,8 @@ main(int argc, char *argv[]) | ||
54 | |||
55 | fprintf(header, "#ifndef EFIVAR_GUIDS_H\n#define EFIVAR_GUIDS_H 1\n\n"); | ||
56 | |||
57 | - for (unsigned int i = 0; i < line-1; i++) { | ||
58 | + unsigned int i, j; | ||
59 | + for (i = 0; i < line-1; i++) { | ||
60 | if (!strcmp(outbuf[i].symbol, "efi_guid_zero")) | ||
61 | fprintf(symout, "\t.globl %s\n" | ||
62 | "\t.data\n" | ||
63 | @@ -176,7 +177,7 @@ main(int argc, char *argv[]) | ||
64 | fprintf(symout, "efi_guid_empty:\n"); | ||
65 | |||
66 | uint8_t *guid_data = (uint8_t *) &outbuf[i].guid; | ||
67 | - for (unsigned int j = 0; j < sizeof (efi_guid_t); j++) | ||
68 | + for (j = 0; j < sizeof (efi_guid_t); j++) | ||
69 | fprintf(symout,"\t.byte 0x%02x\n", guid_data[j]); | ||
70 | |||
71 | fprintf(symout, "%s_end:\n", outbuf[i].symbol); | ||
diff --git a/meta-oe/recipes-extended/efivar/efivar_0.21.bb b/meta-oe/recipes-extended/efivar/efivar_0.21.bb new file mode 100644 index 000000000..b5ef90a19 --- /dev/null +++ b/meta-oe/recipes-extended/efivar/efivar_0.21.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | SUMMARY = "Tools to manipulate UEFI variables" | ||
2 | DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility" | ||
3 | HOMEPAGE = "https://github.com/rhinstaller/efivar" | ||
4 | |||
5 | LICENSE = "LGPLv2.1" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393" | ||
7 | |||
8 | DEPENDS_class-target = "popt efivar-native" | ||
9 | |||
10 | SRCREV = "aab6c2a64d90b6e5a63661fb5bd6be8d878b0784" | ||
11 | SRC_URI = "git://github.com/rhinstaller/efivar.git" | ||
12 | SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch" | ||
13 | SRC_URI_append_class-native = " file://efivar-drop-options-not-supported-by-lower-version-gcc.patch" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | do_install() { | ||
18 | oe_runmake install DESTDIR=${D} | ||
19 | } | ||
20 | |||
21 | do_compile_class-native() { | ||
22 | oe_runmake -C src makeguids | ||
23 | } | ||
24 | |||
25 | do_install_class-native() { | ||
26 | install -D -m 0755 ${B}/src/makeguids ${D}${bindir}/makeguids | ||
27 | } | ||
28 | |||
29 | BBCLASSEXTEND = "native" | ||
diff --git a/meta-oe/recipes-extended/efivar/efivar_git.bb b/meta-oe/recipes-extended/efivar/efivar_git.bb deleted file mode 100644 index 18446a08a..000000000 --- a/meta-oe/recipes-extended/efivar/efivar_git.bb +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | SUMMARY = "Tools to manipulate UEFI variables" | ||
2 | DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility" | ||
3 | HOMEPAGE = "https://github.com/vathpela/efivar" | ||
4 | |||
5 | LICENSE = "LGPLv2.1" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" | ||
7 | |||
8 | DEPENDS = "popt" | ||
9 | |||
10 | SRCREV = "c9e1f24a81b5374408bca5616402276e47171cf7" | ||
11 | PV = "0.7+git${SRCPV}" | ||
12 | SRC_URI = "git://github.com/vathpela/efivar.git" | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | do_install() { | ||
17 | oe_runmake install DESTDIR=${D} | ||
18 | } | ||