[PATCH] README.md: Add compilation instruction

26 views
Skip to first unread message

Reichel Andreas

unread,
Jun 27, 2017, 7:03:18 AM6/27/17
to efibootg...@googlegroups.com, Reichel Andreas
Add compilation instructions to README.md

Signed-off-by: Andreas Reichel <andreas.r...@siemens.com>
---
README.md | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/README.md b/README.md
index 9286d2b..aaa3d63 100644
--- a/README.md
+++ b/README.md
@@ -225,6 +225,30 @@ pacman -S gnu-efi-libs pciutils
apt-get install gnu-efi libparted-dev libpci-dev
```

+## Compilation ##
+
+To compile `efibootguard`, checkout the sources and run
+
+```
+autoreconf -i
+./configure
+make
+```
+
+To cross-compile, the environment variables must be set accordingly, i.e. `CCXX=<compiler-to-use>`. The cross-compiler prefix `CROSS_COMPILE=` does *NOT* work. The following example shows how to specify needed paths for an out-of-tree build, where cross-compilation environment variables have already been set before:
+
+```
+mkdir build
+cd build
+autoreconf --install ..
+../configure --host=i586
+--with-gnuefi-sys-dir=/home/ch/Work/sdk/iot2000/sysroots/i586-nlp-32-poky-linux
+--with-gnuefi-include-dir=/home/ch/Work/sdk/iot2000/sysroots/i586-nlp-32-poky-linux/usr/include/efi
+--with-gnuefi-lds-dir=/home/ch/Work/sdk/iot2000/sysroots/i586-nlp-32-poky-linux/usr/lib
+--with-gnuefi-lib-dir=/home/ch/Work/sdk/iot2000/sysroots/i586-nlp-32-poky-linux/usr/lib
+make
+```
+
## Installation ##

### Environment setup ###
--
2.11.0

Reichel Andreas

unread,
Jun 27, 2017, 7:23:47 AM6/27/17
to efibootg...@googlegroups.com, jan.k...@siemens.com, Reichel Andreas
Add compilation instructions to README.md

Signed-off-by: Andreas Reichel <andreas.r...@siemens.com>
---
README.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

diff --git a/README.md b/README.md
index 9286d2b..1ef5589 100644
--- a/README.md
+++ b/README.md
@@ -225,6 +225,32 @@ pacman -S gnu-efi-libs pciutils
apt-get install gnu-efi libparted-dev libpci-dev
```

+## Compilation ##
+
+To compile `efibootguard`, checkout the sources and run
+
+```
+autoreconf -i
+./configure
+make
+```
+
+To cross-compile, the environment variables must be set accordingly, i.e. `CCXX=<compiler-to-use>`. The cross-compiler prefix `CROSS_COMPILE=` does *NOT* work. The following example shows how to specify needed paths for an out-of-tree build, where cross-compilation environment variables have already been set before:
+
+```
+mkdir build
+cd build
+autoreconf --install ..
+../configure --host=i586
+--with-gnuefi-sys-dir=<sys-root-dir>
+--with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi
+--with-gnuefi-lds-dir=<sys-root-dir>/usr/lib
+--with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
+make
+```
+
+where `<sys-root-dir>` points to the wanted sysroot for cross compilation.

Jan Kiszka

unread,
Jun 27, 2017, 7:53:29 AM6/27/17
to Reichel Andreas, efibootg...@googlegroups.com
On 2017-06-27 13:19, Reichel Andreas wrote:
> Add compilation instructions to README.md
>
> Signed-off-by: Andreas Reichel <andreas.r...@siemens.com>
> ---
> README.md | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/README.md b/README.md
> index 9286d2b..1ef5589 100644
> --- a/README.md
> +++ b/README.md
> @@ -225,6 +225,32 @@ pacman -S gnu-efi-libs pciutils
> apt-get install gnu-efi libparted-dev libpci-dev
> ```
>
> +## Compilation ##
> +
> +To compile `efibootguard`, checkout the sources and run
> +
> +```
> +autoreconf -i

I would recommend -fi.

> +./configure
> +make
> +```
> +
> +To cross-compile, the environment variables must be set accordingly, i.e. `CCXX=<compiler-to-use>`. The cross-compiler prefix `CROSS_COMPILE=` does *NOT* work. The following example shows how to specify needed paths for an out-of-tree build, where cross-compilation environment variables have already been set before:

Please wrap long lines after 80 chars and possibly also rebase over next.

> +
> +```
> +mkdir build
> +cd build
> +autoreconf --install ..

Is this run in the right directory? Thought you need to call it in the
source dir.

> +../configure --host=i586
> +--with-gnuefi-sys-dir=<sys-root-dir>
> +--with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi
> +--with-gnuefi-lds-dir=<sys-root-dir>/usr/lib
> +--with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
> +make
> +```
> +
> +where `<sys-root-dir>` points to the wanted sysroot for cross compilation.
> +
> ## Installation ##
>
> ### Environment setup ###
>

Jan

--
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux

Jan Kiszka

unread,
Jun 27, 2017, 7:57:03 AM6/27/17
to Reichel Andreas, efibootg...@googlegroups.com
As you are add it ;), could you also add a link to the mailing list and
its archives
(https://www.mail-archive.com/jailho...@googlegroups.com/) to the
README?

Thanks!

Reichel Andreas

unread,
Jun 27, 2017, 9:00:24 AM6/27/17
to efibootg...@googlegroups.com, Reichel Andreas
Add instructions for compilation
Add mailing-list reference for development
---
README.md | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

diff --git a/README.md b/README.md
index 95292e8..17d57dc 100644
--- a/README.md
+++ b/README.md
@@ -6,6 +6,17 @@ Provides the following functionality:
* Arm a hardware watchdog prior to loading an OS
* Provides a simple update mechanism with fail-save algorithm

+## Development ##
+
+Mailing list:
+[efibootg...@googlegroups.com](efibootg...@googlegroups.com)
+
+Archive:
+[https://www.mail-archive.com/efibootg...@googlegroups.com/](https://www.mail-archive.com/efibootg...@googlegroups.com)
+
+For sending patches, please refer to the mailing list and `CONTRIBUTING.md` in
+the source tree.
+
## Watchdog support ##

The following watchdog drivers are implemented:
@@ -240,6 +251,35 @@ pacman -S gnu-efi-libs pciutils
apt-get install gnu-efi libparted-dev libpci-dev
```

+## Compilation ##
+
+To compile `efibootguard`, checkout the sources and run
+
+```
+autoreconf -fi
+./configure
+make
+```
+
+To cross-compile, the environment variables must be set accordingly, i.e.
+`CXX=<compiler-to-use>`. The cross-compiler prefix `CROSS_COMPILE=` does *NOT*
+work. The following example shows how to specify needed paths for an out-of-tree
+build, where cross-compilation environment variables have already been set
+before:
+
+```
+mkdir build
+cd build
+autoreconf --install ..
+../configure --host=i586 --with-gnuefi-sys-dir=<sys-root-dir> \
+ --with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi \
+ --with-gnuefi-lds-dir=<sys-root-dir>/usr/lib \
+ --with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
+make
+```
+
+where `<sys-root-dir>` points to the wanted sysroot for cross-compilation.
+
## Installation ##

### Environment setup ###
--
2.11.0

Christian Storm

unread,
Jun 28, 2017, 3:20:30 AM6/28/17
to efibootg...@googlegroups.com
Hi,

> Add instructions for compilation
> Add mailing-list reference for development
> ---
> README.md | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)

While you're at it, could you please add a note on how to compile
efibootguard's libebgenv.a with debug symbols?

Thanks.

Kind regards,
Christian

--
Dr. Christian Storm
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany

Jan Kiszka

unread,
Jun 28, 2017, 10:06:53 AM6/28/17
to [ext] Reichel Andreas, efibootg...@googlegroups.com
Thanks, applied to next.

Jan Kiszka

unread,
Jun 28, 2017, 10:19:10 AM6/28/17
to [ext] Reichel Andreas, efibootg...@googlegroups.com
On 2017-06-28 16:06, Jan Kiszka wrote:
> On 2017-06-27 14:56, [ext] Reichel Andreas wrote:
>> Add instructions for compilation
>> Add mailing-list reference for development

Merging was too quick: Missed that there is no signed off, but I also
missed...
...that this is not consistent with the autoreconf line above (--install
vs. -fi).

autoreconf will only work against the source dir anyway, so let's pull
this ahead of creating and changing to build.

>> +../configure --host=i586 --with-gnuefi-sys-dir=<sys-root-dir> \
>> + --with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi \
>> + --with-gnuefi-lds-dir=<sys-root-dir>/usr/lib \
>> + --with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
>> +make
>> +```
>> +
>> +where `<sys-root-dir>` points to the wanted sysroot for cross-compilation.
>> +
>> ## Installation ##
>>
>> ### Environment setup ###
>>
>
> Thanks, applied to next.

Removed again for now (didn't push yet anyway).

Claudius Heine

unread,
Jun 28, 2017, 10:21:35 AM6/28/17
to Jan Kiszka, [ext] Reichel Andreas, efibootg...@googlegroups.com
Hi,

sorry for joining the party here a bit late.

On Wed, 2017-06-28 at 16:06 +0200, Jan Kiszka wrote:
> > +To cross-compile, the environment variables must be set
> > accordingly, i.e.
> > +`CXX=<compiler-to-use>`. The cross-compiler prefix
> > `CROSS_COMPILE=` does *NOT*
> > +work. The following example shows how to specify needed paths for
> > an out-of-tree
> > +build, where cross-compilation environment variables have already
> > been set

Just as a question. Should the `CROSS_COMPILE` prefix be used?

I normally use just a yocto toolchain environment and that defines
everything necessary.

> > +before:
> > +
> > +```
> > +mkdir build
> > +cd build
> > +autoreconf --install ..
> > +../configure --host=i586 --with-gnuefi-sys-dir=<sys-root-dir> \
> > + --with-gnuefi-include-dir=<sys-root-dir>/usr/include/efi \
> > + --with-gnuefi-lds-dir=<sys-root-dir>/usr/lib \
> > + --with-gnuefi-lib-dir=<sys-root-dir>/usr/lib
> > +make

Also `host=i596` should be variable, depending on your chosen
architecture.

Currently supported are: i586* i686* x86_64* ia64*

Maybe that should be documented as well somewhere apart from the
configure.ac script.

Cheers,
Claudius

--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: c...@denx.de

PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153
Keyserver: hkp://pool.sks-keyservers.net
signature.asc
Reply all
Reply to author
Forward
0 new messages