Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Kang Kai <Kai.Kang@windriver.com>
To: <openembedded-devel@lists.openembedded.org>, <martin.jansa@gmail.com>
Subject: Re: [PATCH 1/2] efivar: 0.7 -> 0.21
Date: Mon, 12 Oct 2015 14:20:53 +0800	[thread overview]
Message-ID: <561B5145.2040609@windriver.com> (raw)
In-Reply-To: <1444447891-13579-2-git-send-email-kai.kang@windriver.com>

On 2015年10月10日 11:31, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
>
> Upgrade efivar from 0.7 to 0.21.
>
> * update HOMEPAGE and git repo.
> * update license file checksum. It made FSF addresses in COPYING be URLs.
>    Ref: https://github.com/rhinstaller/efivar/commit/ca88012
> * add -native recipe to provide command makeguids
>    and add patch for target package to use this native makeguids command
> * add patch to build efivar-native with lower version gcc which doesn't
>    support options '-Wmaybe-uninitialized' and '-std=gnu11'
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>   .../efivar/0001-efivar-fix-for-cross-compile.patch | 31 ++++++++++
>   ...ptions-not-supported-by-lower-version-gcc.patch | 71 ++++++++++++++++++++++
>   .../efivar/{efivar_git.bb => efivar_0.21.bb}       | 23 +++++--
>   3 files changed, 119 insertions(+), 6 deletions(-)
>   create mode 100644 meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch
>   create mode 100644 meta-oe/recipes-extended/efivar/efivar/efivar-drop-options-not-supported-by-lower-version-gcc.patch
>   rename meta-oe/recipes-extended/efivar/{efivar_git.bb => efivar_0.21.bb} (27%)
>
> 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 0000000..4bd7d95
> --- /dev/null
> +++ b/meta-oe/recipes-extended/efivar/efivar/0001-efivar-fix-for-cross-compile.patch
> @@ -0,0 +1,31 @@
> +From 7036e8b0dca61432970789e5397b6fb02b362c2b Mon Sep 17 00:00:00 2001
> +From: Kai Kang <kai.kang@windriver.com>
> +Date: Fri, 25 Sep 2015 18:14:31 +0800
> +Subject: [PATCH] efivar: fix for cross compile
> +
> +It builds and calls elf file makeguids to generate a header file which
> +doesn't work for cross compile. Fix it.
> +
> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +---
> + src/Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/src/Makefile b/src/Makefile
> +index 6eac858..ef4eb1d 100644
> +--- a/src/Makefile
> ++++ b/src/Makefile
> +@@ -65,8 +65,8 @@ makeguids.o : makeguids.c
> + makeguids : makeguids.o fakeguid.o
> + 	$(CC) $(cflags) -o $@ $^ -ldl
> +
> +-include/efivar/efivar-guids.h : makeguids guids.txt
> +-	./makeguids guids.txt guids.bin names.bin guid-symbols.S $@
> ++include/efivar/efivar-guids.h : guids.txt
> ++	makeguids guids.txt guids.bin names.bin guid-symbols.S $@
> +
> + guidlist.o : guids.S include/efivar/efivar-guids.h
> + 	$(CC) $(cflags) -c -o guidlist.o guids.S
> +--
> +2.6.0.rc2.10.gf4d9753
> +
> 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 0000000..7f04b19
> --- /dev/null
> +++ b/meta-oe/recipes-extended/efivar/efivar/efivar-drop-options-not-supported-by-lower-version-gcc.patch
> @@ -0,0 +1,71 @@
> +gcc options '-Wmaybe-uninitialized' and '-std=gnu11' are not recognized by gcc
> +whose version is lower than 4.6, such as on Ubuntu 12.04. Drop them for backward
> +compatible.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Kai Kang <kai.kang@windriver.com>
> +---
> +diff --git a/Make.defaults b/Make.defaults
> +index cc2baa9..118ae56 100644
> +--- a/Make.defaults
> ++++ b/Make.defaults
> +@@ -10,10 +10,9 @@ CFLAGS	?= -O2 -g
> +
> + ARCH = $(shell uname -m)
> + clang_cflags =
> +-gcc_cflags = -Wmaybe-uninitialized
> + cflags	:= $(CFLAGS) \
> + 	-Werror -Wall -Wsign-compare -Wstrict-aliasing \
> +-	-std=gnu11 -fshort-wchar -fPIC \
> ++	-fshort-wchar -fPIC \
> + 	-fvisibility=hidden \
> + 	-D_GNU_SOURCE -I${TOPDIR}/src/include/efivar/ \
> + 	$(if $(filter $(CC),clang),$(clang_cflags),) \
> +diff --git a/src/guid.h b/src/guid.h
> +index 9542ee1..0817991 100644
> +--- a/src/guid.h
> ++++ b/src/guid.h
> +@@ -31,7 +31,8 @@ static inline int
> + real_isspace(char c)
> + {
> + 	char spaces[] = " \f\n\r\t\v";
> +-	for (int i = 0; spaces[i] != '\0'; i++)
> ++	int i;
> ++	for (i = 0; spaces[i] != '\0'; i++)
> + 		if (c == spaces[i])
> + 			return 1;
> + 	return 0;
> +@@ -59,7 +60,8 @@ check_sanity(const char *text, size_t len)
> + static inline int
> + check_segment_sanity(const char *text, size_t len)
> + {
> +-	for(unsigned int i = 0; i < len; i++) {
> ++	unsigned int i;
> ++	for(i = 0; i < len; i++) {
> + 		if (text[i] >= '0' && text[i] <= '9')
> + 			continue;
> + 		/* "| 0x20" is tolower() without having to worry about
> +diff --git a/src/makeguids.c b/src/makeguids.c
> +index e9acf15..7e16cb2 100644
> +--- a/src/makeguids.c
> ++++ b/src/makeguids.c
> +@@ -150,7 +150,8 @@ main(int argc, char *argv[])
> +
> + 	fprintf(header, "#ifndef EFIVAR_GUIDS_H\n#define EFIVAR_GUIDS_H 1\n\n");
> +
> +-	for (unsigned int i = 0; i < line-1; i++) {
> ++	unsigned int i, j;
> ++	for (i = 0; i < line-1; i++) {
> + 		if (!strcmp(outbuf[i].symbol, "efi_guid_zero"))
> + 			fprintf(symout, "\t.globl %s\n"
> + 					"\t.data\n"
> +@@ -176,7 +177,7 @@ main(int argc, char *argv[])
> + 			fprintf(symout, "efi_guid_empty:\n");
> +
> + 		uint8_t *guid_data = (uint8_t *) &outbuf[i].guid;
> +-		for (unsigned int j = 0; j < sizeof (efi_guid_t); j++)
> ++		for (j = 0; j < sizeof (efi_guid_t); j++)
> + 			fprintf(symout,"\t.byte 0x%02x\n", guid_data[j]);
> +
> + 		fprintf(symout, "%s_end:\n", outbuf[i].symbol);
> diff --git a/meta-oe/recipes-extended/efivar/efivar_git.bb b/meta-oe/recipes-extended/efivar/efivar_0.21.bb
> similarity index 27%
> rename from meta-oe/recipes-extended/efivar/efivar_git.bb
> rename to meta-oe/recipes-extended/efivar/efivar_0.21.bb
> index 18446a0..c1b649f 100644
> --- a/meta-oe/recipes-extended/efivar/efivar_git.bb
> +++ b/meta-oe/recipes-extended/efivar/efivar_0.21.bb
> @@ -1,18 +1,29 @@
>   SUMMARY = "Tools to manipulate UEFI variables"
>   DESCRIPTION = "efivar provides a simple command line interface to the UEFI variable facility"
> -HOMEPAGE = "https://github.com/vathpela/efivar"
> +HOMEPAGE = "https://github.com/rhinstaller/efivar"
>   
>   LICENSE = "LGPLv2.1"
> -LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=6626bb1e20189cfa95f2c508ba286393"
>   
> -DEPENDS = "popt"
> +DEPENDS_class-target = "popt efivar-native"
>   
> -SRCREV = "c9e1f24a81b5374408bca5616402276e47171cf7"
> -PV = "0.7+git${SRCPV}"
> -SRC_URI = "git://github.com/vathpela/efivar.git"
> +SRCREV = "aab6c2a64d90b6e5a63661fb5bd6be8d878b0784"
> +SRC_URI = "git://github.com/rhinstaller/efivar.git"
> +SRC_URI_append_class-target = " file://0001-efivar-fix-for-cross-compile.patch"
> +SRC_URI_append_class-native = " file://efivar-drop-options-not-supported-by-lower-version-gcc.patch"
>   
>   S = "${WORKDIR}/git"
>   
>   do_install() {
>       oe_runmake install DESTDIR=${D}
>   }
> +
> +do_compile_class-native() {
> +    oe_runmake -C src makeguids
> +}
> +
> +do_install_class-native() {
> +    install -D ${B}/src/makeguids ${D}${bindir}/makeguids

I am suggested to add option '-m xxx' here. So please ignore this thread 
and I'll fix it and send a new version.


--Kai

> +}
> +
> +BBCLASSEXTEND = "native"


-- 
Regards,
Neil | Kai Kang



  reply	other threads:[~2015-10-12  6:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10  3:31 [PATCH 0/2] V3: Upgrade efivar and efibootmgr kai.kang
2015-10-10  3:31 ` [PATCH 1/2] efivar: 0.7 -> 0.21 kai.kang
2015-10-12  6:20   ` Kang Kai [this message]
2015-10-10  3:31 ` [PATCH 2/2] efibootmgr: 0.6.0 -> 0.12 kai.kang
  -- strict thread matches above, loose matches on Subject: below --
2015-10-12  6:26 [meta-oe][PATCH 0/2] V4: Upgrade efivar and efibootmgr kai.kang
2015-10-12  6:26 ` [PATCH 1/2] efivar: 0.7 -> 0.21 kai.kang
2015-09-30  6:21 [meta-oe][PATCH 0/2] V3: Upgrade efivar and efibootmgr kai.kang
2015-09-30  6:21 ` [PATCH 1/2] efivar: 0.7 -> 0.21 kai.kang
2015-09-29  7:04 [meta-oe][PATCH 0/2] V2: Upgrade efivar and efibootmgr kai.kang
2015-09-29  7:04 ` [PATCH 1/2] efivar: 0.7 -> 0.21 kai.kang
2015-10-08  9:59   ` Martin Jansa
2015-10-09  7:20     ` Khem Raj
2015-10-09  8:50       ` Martin Jansa
2015-10-09  9:24         ` Kang Kai
2015-10-09 15:18         ` Khem Raj
2015-10-09 15:26           ` Martin Jansa
2015-10-09 15:53             ` Khem Raj
2015-09-08  9:31 [meta-oe][PATCH 0/2] Upgrade efivar and efibootmgr kai.kang
2015-09-08  9:31 ` [PATCH 1/2] efivar: 0.7 -> 0.21 kai.kang
2015-09-23 14:08   ` Martin Jansa
2015-09-24  1:58     ` Kang Kai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=561B5145.2040609@windriver.com \
    --to=kai.kang@windriver.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox