efilinux 0.9

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Make the efi include dir configurable

When crosscompiling, it's common to need to specify a different include dir
location.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Find crt0 and the LD script automatically

gnuefi doesn't install crt0 and the ld script to a gnuefi directory by
default, but some distributions stick it there. Use find via a shell
command to take the last matching file for each of CRT0 and LDSCRIPT.

This avoids forcing the caller to duplicate the script generating the
ARCH variable used throughout the Makefile.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Matt Fleming <matt.fleming@intel.com>
efilinux: Minimal configuration file support

efilinux lacks a way of automatically booting a default
kernel. Instead, the kernel image path and kernel command line
arguments must be passed as arguments to efilinux on every invocation.

This commit allows a simple config file to specify a default kernel
and kernel arguments, which are passed to efilinux instead of
requiring them to be entered at the EFI shell. Now, when efilinux is
started it will first search for a file named 'efilinux.cfg' in the
same directory as the efilinux executable.

The syntax for a configuration file is exactly the same as the syntax
for efilinux's command line arguments. For example, to boot a linux
kernel the contents of 'efilinux.cfg' would be a single line,

	"-f 0:\EFI\BOOT\vmlinux console=ttys0 initrd=0:\EFI\BOOT\initrd"

The contents of the file are passed to efilinux as though they were
typed at the EFI shell prompt. Multiple lines are not supported.

Cc: Darrent Hart <dvhart@linux.intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
fs: Don't print message if we fail to open a file

Now that we have config file support failing to open a fail isn't
worthy of a warning. Many users won't be using a config file at all
and printing,

	"Unable to open file <filename>"

everytime efilinux is executed is useless and annoying. Leave it to
the caller of file_open() to print any messages about failing to open
files.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
efilinux: Stop printing "Error" when displaying usage

At the moment whenever efilinux exits after displaying either the
command argument syntax, the list of devices or prints the memory map
the following message is printed,

	"Error: Invalid Parameter"

Tidy up the exit path of parse_args() so that we can print these
useful bits of information without the user thinking that some kind of
error occurred.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
efilinux 1.0

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Makefile: Do not include symbol table in efilinux.efi

objcopy will leave the symbol table intact when creating an EFI
executable from the ELF shared object, which is unnecessary, but more
importantly the existence of the symbol table causes some EFI hashing
tools to fail when signing the executable for secure boot because the
symbol table is considered to be garbage.

Strip all symbol table and relocation information when creating the
EFI executable.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>