autotools: Make petitboot autoreconfable The standard way to regenerate the autotools bits is with 'autoreconf', but that doesn't work with our custom bootstrap script. We only need the bootstrap script to generate the version in configure.ac, which we can easily do with m4_esyscmd_s instead. This change allows autoreconfiguration with `autoreconf -f -i`. Includes changes proposed by Yann E. Morin <yann.morin.1998@free.fr>, and modifications from the original patch from Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Jeff Bailey <jeffbailey@google.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
configure: Use AC_GNU_SOURCE Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: Don't depend on tftp failure for type detection Rather than always trying both TFTP client types, do a runtime detection on first invocation. This can be fixed at build-time with --with-tftp=TYPE. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/grub2: Hook up flex/bison parser to discover server Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
test: Add --enable-test-valgrind Add an --enable-test-valgrind argument to configure, to run all tests under valgrind, configured to fail on leaked memory Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
configure: Update to use AX_WITH_CURSES For a more portable build system convert to using the autoconf-archive AX_WITH_CURSES macros. Allows building on openSUSE, which has a different header file layout than other distros, and fixes menu entries with UTF-8 characters; this causes fedora installs (codename "Schrödinger´s cat") to break the UI. Signed-off-by: Geoff Levand <geoff@infradead.org>
Add pkgsysconfdir We'll need a sysconf dir to store the boot hooks. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover: Add network handling Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
configure: Add check for libncurses Signed-off-by: Geoff Levand <geoff@infradead.org>
configure: Remove -Winline I'm getting the following errors when compiling with --enable-werror: kboot-parser.c: In function 'kboot_process_pair': ./parser-conf.h:50:21: error: inlining failed in call to 'conf_get_pair_equal': call is unlikely and code size would grow [-Werror=inline] kboot-parser.c:65:7: error: called from here [-Werror=inline] Since this is a header function, the inline isn't there for optimisation reasons; the warning is just informing us of a code optimisation decision. Drop -Winline to allow -Werror builds. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/udev: remove unnecessary udevadm references Since we interact with libudev now, we no longer need to run udevadm. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
configure: More helpful missing libudev message Signed-off-by: Geoff Levand <geoff@infradead.org>
discover: Update udev routines to use libudev Support for 'RUN+="socket:' in udev rules files has been removed in udev version 183. Update the discover server to use libudev. Signed-off-by: Geoff Levand <geoff@infradead.org>
test: Rename test/list to test/lib Having a test/list directory is a little too specific, so rename the test/list directory to test/lib as a place for any lib tests. Signed-off-by: Geoff Levand <geoff@infradead.org>
test: Add list test Signed-off-by: Geoff Levand <geoff@infradead.org>
test: Add URL parser test infrastructure This change adds some simple testing infrastrcture to the URL parser. We use a small C binary (parse-url) to run the url parser on its argument, and compare the output with an expected datafile. An initial test is included, to check the behaviour of URLs with multiple slashes between host and pathname. This test currently fails. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Allow host programs to be configured Rather than hard-coding in lib/system/system.c, this change adds a set of #defines for host programs, through the autoheader config.h These host programs can then be set through configure: ./configure HOST_PROG_MOUNT=/usr/bin/mount Because we need to define nine host programs, we add an autoconf macro to avoid repeating the definition code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
configure.ac: Add --enable-werror Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Parser test cleanup Major cleanup of parser tests. * Change test data directory layout to ease test automation. * Remove some unneeded files. * Re-write test wraper script, rename to run-parser-tests. * Rework for autotools. Signed-off-by: Geoff Levand <geoff@infradead.org>
Convert test to automake Signed-off-by: Geoff Levand <geoff@infradead.org>