Skip to content

Commit

Permalink
Update to version v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
robertosassu committed Apr 17, 2020
1 parent 1df69fc commit 08e9bc2
Show file tree
Hide file tree
Showing 74 changed files with 4,036 additions and 5,021 deletions.
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
*.o
src/gen_digest_lists
src/verify_digest_lists
src/upload_digest_lists
src/modify_digest_lists
src/gen_parser_metadata
src/verify_digest_lists

tests/lib
tests/ima
tests/rpm
tests/gen

*Makefile.in
*Makefile
*~

ar-lib
config.h
Expand Down
7 changes: 6 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
SUBDIRS = docs \
include \
initrd \
lib \
generators \
parsers \
scripts \
src
src \
systemd \
tests

EXTRA_DIST = AUTHORS \
CHANGES
Expand Down
392 changes: 243 additions & 149 deletions README

Large diffs are not rendered by default.

111 changes: 70 additions & 41 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,72 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([digest-list-tools], [0.2], [roberto.sassu@huawei.com])
AC_INIT([digest-list-tools], [0.3], [roberto.sassu@huawei.com])
AC_CONFIG_HEADERS([config.h])
CFLAGS="$CFLAGS -Wall"

AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
AM_PROG_AR
AC_PROG_CC
LT_INIT

# Enable debug.
AC_ARG_ENABLE([debug], [ --enable-debug Turn on debugging],
[debug=${enableval}], [debug=no])

if test -z "$CFLAGS"; then
if test "$debug" == yes; then
CFLAGS="-O0 -g"
else
CFLAGS="-O2"
fi
fi

if test "$debug" == yes; then
CFLAGS="$CFLAGS -DDEBUG"
fi

big_endian=false
AC_C_BIGENDIAN ([big_endian=true], [big_endian=false])
if test "$big_endian" == true; then
CFLAGS="$CFLAGS -D__BIG_ENDIAN__"
fi

# Checks for programs.
AM_PROG_AR
AC_PROG_CC
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_LIBTOOL

# Checks for libraries.
AC_CHECK_LIB([crypto], [SHA256_Init],[found=yes],[],[])
AC_CHECK_LIB([rpm], [headerGet],[found=yes],[],[])
AC_CHECK_LIB([rpmio], [Fopen],[found=yes],[],[])
AC_CHECK_LIB([curl], [curl_easy_setopt],[found=yes],[],[])
AC_CHECK_LIB([z], [inflate],[found=yes],[],[])
AC_CHECK_LIB(rpm, headerGet,[rpm=yes], [rpm=no], [])
AC_CHECK_LIB([crypto], [SHA256_Init], [crypto=yes], [crypto=no], [])

# Checks for header files.
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([curl/curl.h])
AC_CHECK_HEADERS([rpm/rpmlib.h])
AC_CHECK_HEADERS([rpm/rpmlib.h], [], [rpm=no])
AC_CHECK_HEADERS([openssl/evp.h], [], [crypto=no])

PKG_CHECK_EXISTS(cmocka,
[AC_CHECK_HEADERS([stdarg.h stddef.h setjmp.h],
[], dnl We are only intrested in action-if-not-found
[AC_MSG_WARN([Header files stdarg.h stddef.h setjmp.h are
required by cmocka])
cmocka_required_headers="no"
]
)
AS_IF([test x"$cmocka_required_headers" != x"no"],
[PKG_CHECK_MODULES([CMOCKA], [cmocka], [cmocka="yes"])]
)],
dnl PKG_CHECK_EXISTS ACTION-IF-NOT-FOUND
[AC_MSG_WARN([No libcmocka library found, cmocka tests
will not be built])])

AM_CONDITIONAL([RPM], [test "$rpm" = yes])
AM_CONDITIONAL([CRYPTO], [test "$crypto" = yes])
AM_CONDITIONAL([CMOCKA], [test "$cmocka" = yes])

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
Expand All @@ -45,26 +81,6 @@ AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([ftruncate memset munmap strstr])

# Enable debug.
AC_ARG_ENABLE([debug],
[ --enable-debug Turn on debugging],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
esac],[debug=false])
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])

if test -z "$CFLAGS"; then
if test "$debug" == true; then
CFLAGS="-O0 -g"
else
CFLAGS="-O2 -g"
fi
elif test "$debug" == true; then
CFLAGS="$CFLAGS -O0 -g"
fi

# Check availability of initrd tools
DRACUT_SUBDIR=
AC_CHECK_FILE(/usr/bin/dracut, [DRACUT_SUBDIR=dracut], [])
Expand All @@ -74,13 +90,26 @@ AC_CHECK_FILE(/usr/sbin/mkinitramfs,
[INITRAMFS_TOOLS_SUBDIR=initramfs-tools], [])
AC_SUBST([INITRAMFS_TOOLS_SUBDIR])

CFLAGS="$CFLAGS -Wall -Werror"

AC_SUBST(CFLAGS)

AC_CONFIG_FILES([Makefile
initrd/Makefile
initrd/dracut/Makefile
initrd/initramfs-tools/Makefile
docs/Makefile
include/Makefile
lib/Makefile
src/Makefile
scripts/Makefile])
docs/Makefile
include/Makefile
initrd/Makefile
initrd/dracut/Makefile
initrd/initramfs-tools/Makefile
lib/Makefile
generators/Makefile
parsers/Makefile
scripts/Makefile
src/Makefile
systemd/Makefile
tests/Makefile])
AC_OUTPUT
cat <<EOF

CFLAGS: ${CFLAGS}

EOF
47 changes: 0 additions & 47 deletions dist/rpm/digest-list-tools-parser-sig.spec

This file was deleted.

99 changes: 0 additions & 99 deletions dist/rpm/digest-list-tools.spec

This file was deleted.

6 changes: 3 additions & 3 deletions docs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist_pkgdata_DATA = gen_digest_lists.txt \
setup_ima_digest_lists.txt \
verify_digest_lists.txt \
modify_digest_lists.txt \
gen_parser_metadata.txt
setup_ima_digest_lists_demo.txt \
upload_digest_lists.txt \
verify_digest_lists.txt
Binary file removed docs/digest_list_concept.png
Binary file not shown.
Binary file removed docs/digest_list_operational_phase.png
Binary file not shown.
Binary file removed docs/digest_list_setup_phase.png
Binary file not shown.

0 comments on commit 08e9bc2

Please sign in to comment.