Commit graph

47 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2c201c2140 meson: use booleans for conf.set and drop unecessary conditionals
Using conf.set() with a boolean argument does the right thing:
either #ifdef or #undef. This means that conf.set can be used unconditionally.

Previously I used '1' as the placeholder value, and that needs to be changed to
'true' for consistency (under meson 1 cannot be used in boolean context). All
checks need to be adjusted.
2017-05-02 16:29:11 -04:00
Max Resch 489e15a8b3 meson: add compiler flags for "--tpm" in EFI apps (#5829)
Readds boot log tpm feature that was missing in meson by readding a
defines in efi_conf.h
2017-04-27 20:59:37 -04:00
Zbigniew Jędrzejewski-Szmek b884196cc1 meson: also indent scripts with 8 spaces 2017-04-25 08:49:16 -04:00
Zbigniew Jędrzejewski-Szmek 6800fe7f06 meson: define gnu_efi_arch for the arch efi name, fix ldsdir detection
This fixes ldsdir detection under Debian.

v2:
- define gnu_efi_arch for the arch efi include directory name

  In the autotools naming convention, efi_arch and this directory always had
  the same name. But meson.cpu_family() uses a slightly different convention,
  so those two don't always match.
2017-04-24 19:24:36 -04:00
Zbigniew Jędrzejewski-Szmek 86b3ca7a66 meson: use "sh -eu" and make .sh +x, .py -x
Shell scripts should be executable so that meson reports their
invocation succinctly (does not print 'sh' '-e').
Python scripts should not be executable so that meson does the
detection of the right python binary itself.

Add -u everywhere to catch potential errors.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 37efbbd821 meson: reindent all files with 8 spaces
The indentation for emacs'es meson-mode is added .dir-locals.

All files are reindented automatically, using the lasest meson-mode from git.
Indentation should now be fairly consistent.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 0a76b0e8a2 meson: use efi-includedir to look for header
This change mirrors cba49f2dea.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek d83f4f506d test-efi-create-disk.sh: allow running from separate build dir, hook up to meson
This allow test-efi-disk.img to be created under meson.
The invocation of qemu is not converted yet, in particular because the
command-line used in Makefile.am is outdated.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 4390be305b meson: replace yes/no/auto with true/false/auto
This doesn't feel as natural, but is more consistent with the boolean options
which require true/false, and allows setting of options without knowing of
which type the option is.
2017-04-23 21:47:28 -04:00
Michael Biebl e17e5ba9bf meson: use join_paths consistently
With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or
//lib/udev for various dir variables. Using join_paths() avoids this.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek b710072da4 meson: add support for building efi modules
This is a very straightforward conversion of the rules in Makefile.am.
Generated objects (on arm64) are identical.
The only difference in executed commands is that automake uses ld -m
elf_x86_64, without us specifying the -m option anywhere. I suspect that
using the default for the given linker should be OK, so it's fine to just
skip it.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 948aaa7c52 tree-wide: standardize on $(PACKAGE_VERSION) for the version string
We defined both $(VERSION) and $(PACKAGE_VERSION) with the same contents.
$(PACKAGE_VERSION) is slightly more descriptive, so settle on that, and
drop the other define.
2017-04-04 20:36:09 -04:00
Mikko Ylinen 293b167349 sd-boot: stub: check LoadOptions contains data (#5467)
With some UEFI shells LoadOptionsSize is reported being > 0
but the corresponding LoadOptions does not contain any data
(the first element has value 0).

When that happens, the stub feature that allows .cmdline to be
replaced by what's in LoadOptions ends up copying nothing/random
data to the kernel cmdline resulting in different kinds of boot
problems.

To fix this, add a check to see if LoadOptions contains data
before replacing the .cmdline.

Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
2017-02-27 20:03:07 +01:00
AsciiWolf 13e785f7a0 Fix missing space in comments (#5439) 2017-02-24 18:14:02 +01:00
Zbigniew Jędrzejewski-Szmek 7db5706eec boot: fix two typos 2017-01-31 00:49:53 -05:00
Yassine Imounachen b3f76b0d61 Update boot.c (#4780) 2016-12-01 15:58:58 +01:00
Lans Zhang 59991e3fe3 sd-boot: trigger to record further logs to tcg 2.0 final event log area (#4302)
According to TCG EFI Protocol Specification for TPM 2.0 family,
all events generated after the invocation of EFI_TCG2_GET_EVENT_LOG
shall be stored in an instance of an EFI_CONFIGURATION_TABLE aka
EFI TCG 2.0 final events table. Hence, it is necessary to trigger the
internal switch through calling get_event_log() in order to allow
to retrieve the logs from OS runtime.

msekletar:
> I've looked at EDK2 and indeed log entry is added to FinalEventsTable only after 
> EFI_TCG2_PROTOCOL.GetEventLog was called[1][2]. Also, same patch was currently
> merged to shim by Peter Jones [3].

[1] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L698
[2] https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c#L824
[3] rhinstaller/shim#64
2016-10-09 18:59:54 -04:00
Jan Janssen 03e749af53 sd-boot: Fix waiting for keyboard input (#3735)
WaitForKeyEx may never return on some UEFI systems depending
on firmware, hardware configuration and the phase of the moon.
Use ConIn->WaitForKey unconditionally instead.

Fixes #3632
2016-07-18 15:19:32 -04:00
Vito Caputo 9ed794a32d tree-wide: minor formatting inconsistency cleanups 2016-02-23 14:20:34 -08:00
Harald Hoyer 92ed3bb49e sd-boot: put hashed kernel command line in a PCR of the TPM
The UEFI BIOS already hashes the contents of the loaded image, so the
initrd and the command line of the binary are recorded.

Because manually added LoadOptions are not taken into account, these
should be recorded also.

This patch logs and extends a TPM PCR register with the LoadOptions.

This feature can be enabled with configure --enable-tpm

The PCR register index can be specified with
configure --with-tpm-pcrindex=<NUM>
2016-02-11 17:48:09 +01:00
Daniel Mack b26fa1a2fb tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
2016-02-10 13:41:57 +01:00
Thomas Hindoe Paaboel Andersen cf0fbc49e6 tree-wide: sort includes
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Lennart Poettering 1f6b411372 tree-wide: update empty-if coccinelle script to cover empty-while and more
Let's also clean up single-line while and for blocks.
2015-09-09 14:59:51 +02:00
Lennart Poettering 52efd56a63 tree-wide: we place the opening bracket on the same line as the function name
Let's do this everywhere the same way.
2015-08-27 17:48:24 +02:00
Kay Sievers 540536ffd1 systemd-boot: sort /EFI/Linux/*.efi files 2015-07-30 18:28:02 +02:00
Kay Sievers 8110e144ff sd-boot: stub - export LoaderDevicePartUUID 2015-07-29 19:36:17 +02:00
Kay Sievers fc7bdb583f systemd-boot: fix whitespace 2015-07-26 00:38:01 +02:00
Jose Carlos Venegas Munoz b1da143f2a sd-boot:Show stub cmdline when edit
If Linux efi stub is used, embedded cmdline in efi stub is
not shown. As a result, it is required to rewrite all the
line, if is only required to modify it. This behavior only
happen using Linux efi stub.

This patch allows boot loader to show embedded cmdline when
'e' key is pressed to edit boot loader options.
2015-07-20 14:56:02 -05:00
David Herrmann 59658d1958 boot: use BUILD_ID if VERSION_ID is not present
According to os-release(5), VERSION_ID is not mandatory and BUILD_ID only
needs to be unique underneath VERSION_ID. Therefore, assuming a missing
VERSION_ID field means 'empty', we can rely on BUILD_ID to be unique.

Use BUILD_ID if VERSION_ID is not present. This way, rolling-release
distros can still provide a proper os-release entry without crafting
random VERSION_ID strings.

This fixes #186.
2015-07-09 13:07:27 +02:00
David Herrmann d8c64b7f90 boot: fix memleaks in os-release parser
There is no guarantee that the os-release section contains each key only
once, nor any guarantee that all keys are present. Make sure we properly
free memory in both cases.

Not that it matters much, as we're short-living, anyway. But correct code
is always nicer to read..
2015-07-09 13:02:54 +02:00
Kay Sievers b40c3dfa32 boot: function parameters are separated by comma 2015-05-12 17:58:59 +02:00
Koen Kooi 0d8d368907 boot/util: add ticks_read() stub 2015-04-11 11:54:45 +02:00
Koen Kooi 8403daa284 boot/util: use x86 ASM only on x86 platforms. 2015-04-11 11:48:39 +02:00
Zbigniew Jędrzejewski-Szmek 7c5925a448 efi: widen operand to avoid overflow
CID #1287141.
2015-03-13 23:42:16 -04:00
Kay Sievers 4db7e6d781 boot: efi - add config option to disable the command line editor 2015-03-11 23:33:53 +01:00
Zbigniew Jędrzejewski-Szmek 56c70b32af boot/efi: do not assign variable twice
If the highlighted line did not move outside of the visible
region, it should not be necessary to update idx_last.

CID #1287137, #1287138.
2015-03-09 16:45:27 -04:00
Kay Sievers 9d3dec15ae boot: efi - ignore .conf snippets starting with "auto-" 2015-03-01 13:16:10 +01:00
Kay Sievers ea1851b60c boot: efi - remove a couple of Loader* variables 2015-03-01 13:16:10 +01:00
Marcel Holtmann 2bdbf32183 boot: efi - fix missing include
src/boot/efi/splash.c:312:9: warning: implicit declaration of function ‘graphics_mode’ [-Wimplicit-function-declaration]
         err = graphics_mode(TRUE);
         ^
2015-02-27 03:43:31 +01:00
Kay Sievers 7361099e42 boot: efi - remove custom splash support 2015-02-26 19:51:08 +01:00
Kay Sievers 2f8d336478 boot: efi - split graphics and splash handling 2015-02-26 19:45:08 +01:00
Kay Sievers 37fa369066 boot: efi - support embedded splash image 2015-02-26 18:58:30 +01:00
Kay Sievers 20b1538df6 boot: efi - print generic error message if we fail to execute an image 2015-02-26 01:15:18 +01:00
Kay Sievers a19b0678be boot: efi - remove default boot splash handling 2015-02-26 01:03:29 +01:00
Kay Sievers 11d63aea3a build-sys: update gitignore 2015-02-20 15:42:32 +01:00
Thomas Hindoe Paaboel Andersen 04155c6713 systemd-boot: fix alignment of version in table 2015-02-18 22:19:17 +01:00
Tom Gundersen e7dd673d1e gummiboot/sd-boot/systemd-boot: rename galore
What used to be gummiboot, was renamed sd-boot when it was merged into
systemd. Let's try to be a bit more consistent with the rest of systemd
and rename it again as follows:

The EFI bootloader is now called 'systemd-bootx64.efi', and its sources are in
'src/boot/efi/'. The drop-in directory where bootctl will find EFI loaders
is now /usr/lib/systemd/boot/efi/.
2015-02-18 15:23:23 +01:00