summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxiwell S. Garcia <maxiwell@linux.ibm.com>2019-09-23 19:30:21 -0300
committerJeremy Kerr <jk@ozlabs.org>2020-01-23 11:55:39 +0800
commit827a7af51bb120579a7addbcda216300988a3b1e (patch)
tree7a07e350c725a4e4d3b2f3567dda1d3bfb8c65a7
parent059cc5168f9b24eb5278e084909afe47db2861a6 (diff)
downloadtalos-petitboot-827a7af51bb120579a7addbcda216300988a3b1e.tar.gz
talos-petitboot-827a7af51bb120579a7addbcda216300988a3b1e.zip
configure: Add libelf as a requirement
With this library, petitboot is able to open the ELF binary to check information, like annotation in ELF notes section. Minor libelf-dw dependency additions by Jeremy Kerr <jk@ozlabs.org>. Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--configure.ac10
-rw-r--r--discover/Makefile.am3
-rw-r--r--docker/Dockerfile.builder2
-rw-r--r--utils/Makefile.am3
4 files changed, 16 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 5d541fb..6683be6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,15 @@ AC_CHECK_LIB([udev], [udev_new],
[AC_MSG_FAILURE([The libudev development library is required by petitboot. Try installing the package libudev-dev or libudev-devel.])]
)
+AC_CHECK_LIB([elf], [elf_begin],
+ [ELF_LIBS=-lelf],
+ [AC_MSG_FAILURE([The libelf development library is required by petitboot. Try installing the package libelf-dev or elfutils-libelf-devel.])]
+)
+
+AC_CHECK_HEADERS([elfutils/libdw.h],
+ [],
+ [AC_MSG_FAILURE([elfutils/libdw.h not found. Try installing the package libdw-dev or elfutils-devel.])]
+)
PKG_CHECK_EXISTS(libudev >= 218, [old_udev=no], [old_udev=yes])
if test "$old_udev" = "yes" ; then
AC_DEFINE(UDEV_LOGGING, 1, [Support old udev logging interface])
@@ -476,6 +485,7 @@ AS_IF(
)
AC_SUBST([UDEV_LIBS])
+AC_SUBST([ELF_LIBS])
AC_SUBST([DEVMAPPER_LIBS])
AC_SUBST([CRYPT_LIBS])
AC_SUBST([FDT_LIBS])
diff --git a/discover/Makefile.am b/discover/Makefile.am
index bfe33fa..e2d0e93 100644
--- a/discover/Makefile.am
+++ b/discover/Makefile.am
@@ -58,7 +58,8 @@ discover_pb_discover_LDADD = \
discover/native/native-parser.ro \
discover/platform.ro \
$(core_lib) \
- $(UDEV_LIBS)
+ $(UDEV_LIBS) \
+ $(ELF_LIBS)
discover_pb_discover_LDFLAGS = \
$(AM_LDFLAGS) \
diff --git a/docker/Dockerfile.builder b/docker/Dockerfile.builder
index 321629f..8757871 100644
--- a/docker/Dockerfile.builder
+++ b/docker/Dockerfile.builder
@@ -25,6 +25,8 @@ RUN apt-get update && apt-get install -y \
libncurses-dev \
libssl-dev \
libuv-dev \
+ libelf-dev \
+ libdw-dev \
pkg-config \
strace \
&& rm -rf /var/lib/apt/lists/*
diff --git a/utils/Makefile.am b/utils/Makefile.am
index a523430..8788150 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -18,7 +18,8 @@ dist_pkglibexec_SCRIPTS = utils/pb-console
sbin_PROGRAMS += utils/pb-event utils/pb-config
utils_pb_config_LDADD = $(top_builddir)/lib/libpbcore.la \
- $(top_builddir)/discover/platform.ro
+ $(top_builddir)/discover/platform.ro \
+ $(ELF_LIBS)
utils_hooks_30_dtb_updates_SOURCES = utils/hooks/30-dtb-updates.c
utils_hooks_30_dtb_updates_LDADD = $(top_builddir)/lib/libpbcore.la \
OpenPOWER on IntegriCloud