Commit graph

47 commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen a8fbdf5424 shared: include what we use
The next step of a general cleanup of our includes. This one mostly
adds missing includes but there are a few removals as well.
2015-12-06 13:49:33 +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 b5efdb8af4 util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
Lennart Poettering 15a5e95075 util-lib: split out printf() helpers to stdio-util.h 2015-10-27 13:25:57 +01:00
Lennart Poettering a09561746f util-lib: introduce dirent-util.[ch] for directory entry calls
Also, move a couple of more path-related functions to path-util.c.
2015-10-27 13:25:56 +01:00
Lennart Poettering 6bedfcbb29 util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] 2015-10-27 13:25:55 +01:00
Lennart Poettering c004493cde util-lib: split out IO related calls to io-util.[ch] 2015-10-26 01:24:38 +01:00
Lennart Poettering 3ffd4af220 util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over.
2015-10-25 13:19:18 +01:00
Lennart Poettering 75f86906c5 basic: rework virtualization detection API
Introduce a proper enum, and don't pass around string ids anymore. This
simplifies things quite a bit, and makes virtualization detection more
similar to architecture detection.
2015-09-07 13:42:47 +02:00
Lennart Poettering 6b62bbbc7b logind: some firmware implementations remove OsIndications if it is unset
We shouldn't fall over that, and just assume it is 0 in this case.

Fixes #499.
2015-07-11 17:32:25 -03:00
Thomas Hindoe Paaboel Andersen 920b52e490 tree-wide: remove spurious space 2015-06-08 23:11:26 +02:00
Tom Gundersen b28ce7c6db shared: efivars - fix compile on non-EFI systems
systemctl and logind were unconditionally using functions that were not compiled
on non-EFI systems. Add stubs returning -EOPNOTSUPP to fix compile again.
2015-04-10 19:55:49 +02:00
Tom Gundersen 9df49b3358 shared: efivars - is_efi_*() returns bool instead of int
There was a bug where is_efi_*() could return a negative error value, which would be treated as 'true',
just make this a bool in the helper library to avoid the problem.
2015-04-10 19:55:49 +02:00
Jan Janssen 5bdf22430e logind,systemctl: add reboot to EFI firmware support 2015-04-07 18:51:45 +02:00
Zbigniew Jędrzejewski-Szmek ad7bcf526d efivars: itialize variable
Introduced a few commits ago.
2015-03-09 22:10:54 -04:00
Zbigniew Jędrzejewski-Szmek 7432b24b83 efivars: use greedy_realloc 2015-03-09 16:45:28 -04:00
Zbigniew Jędrzejewski-Szmek 0797f2329c efivars: use more _cleanup_
Also rename r to buf, since r is customarily reserved for the return value.
2015-03-09 16:45:27 -04:00
Zbigniew Jędrzejewski-Szmek 0aa3b7830f efivars: do binary and before converting to bool
I'm pretty sure that this is what was meant here.
2015-03-09 16:45:27 -04:00
Zbigniew Jędrzejewski-Szmek a8436474fa efivars: rename last remaining err to r 2015-03-09 16:45:27 -04:00
Zbigniew Jędrzejewski-Szmek b7749eb517 efivars: modernization
Fix return value if unlink fails.
2015-03-09 16:45:27 -04:00
Lennart Poettering 885fdebc13 tree-wide: use _packed_ macro instead of raw gcc __attribute__ 2015-03-09 18:02:22 +01:00
Thomas Hindoe Paaboel Andersen 2eec67acbb remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use.
2015-02-23 23:53:42 +01:00
Kay Sievers 0974a682d1 bootctl: add sd-boot support 2015-02-17 14:36:59 +01:00
Lennart Poettering 7e8185ef94 fix a couple of more lazy "return -1"
Fix should strictly follow the rule to return negative errno-style
error codes from functions, hence let's fix more "return -1"-style
lazinesses.
2014-08-11 18:35:54 +02:00
Lennart Poettering 73b80ec2d9 gpt-auto-generator: automatically find the root disk of the system
When run in an initrd and no root= argument is set (or is set to
root=gpt-auto) we will automatically look for the root partition on the
same disk the EFI ESP is located on.

Since we look for swap, /home and /srv on the disk the root partition is
located on, we hence have a fully discoverable chain:

    Firmware discovers the EFI ESP partition → the initrd discovers the
    root partition → the host OS discovers swap, /home, and /srv.

Note that this requires an EFI boot loader that sets the
LoaderDevicePartUUID EFI variable, such as Gummiboot.
2014-03-07 04:31:26 +01:00
Lennart Poettering 39883f622f make gcc shut up
If -flto is used then gcc will generate a lot more warnings than before,
among them a number of use-without-initialization warnings. Most of them
without are false positives, but let's make them go away, because it
doesn't really matter.
2014-02-19 17:53:50 +01:00
Zbigniew Jędrzejewski-Szmek b47d419c25 Modernization
Fixes minor leak in error path in device.c.
2013-10-13 17:56:54 -04:00
Zbigniew Jędrzejewski-Szmek 7ff7394d9e Never call qsort on potentially NULL arrays
This extends 62678ded 'efi: never call qsort on potentially
NULL arrays' to all other places where qsort is used and it
is not obvious that the count is non-zero.
2013-10-13 17:56:54 -04:00
Lennart Poettering 62678deda2 efi: never call qsort on potentially NULL arrays 2013-10-02 19:45:12 +02:00
Kay Sievers c51d84dc09 support acpi firmware performance data (FPDT)
Prefer firmware-provided performance data over loader-exported ones; if
ACPI data is available, always use it, otherwise try to read the loader
data.

The firmware-provided variables start at the time the first EFI image
is executed and end when the operating system exits the boot services;
the (loader) time calculated in systemd-analyze increases.
2013-09-24 15:43:41 +02:00
Zbigniew Jędrzejewski-Szmek 5483a18693 efivars: un-leak a few strings 2013-04-04 22:46:19 -04:00
Zbigniew Jędrzejewski-Szmek 742af54adc efivars: fix return code
Was returning 1 on read error.
2013-03-21 22:39:24 -04:00
Kay Sievers bc6f2e7c62 bootctl: print secure boot flags 2013-03-10 22:48:27 +01:00
Kay Sievers 02a6fc3ea6 efi: compare by substraction 2013-02-17 19:54:29 +01:00
Lennart Poettering b872e9a059 build-sys: make EFI support build-time optional 2013-02-13 23:08:25 +01:00
Lennart Poettering 9db11a99be efi: efi_get_boot_options() should already sort the entries, the random order in the efivars fs is probably not useful
This also introduces a new FOREACH_DIRENT macro and makes use of it.
2013-02-13 22:02:40 +01:00
Lennart Poettering 61cc634bc2 efi: use efi_get_variable_string() instead of efi_get_variable() where we can 2013-02-13 21:24:10 +01:00
Kay Sievers 4d34c4951a efi: unify BootXXXX reading 2013-02-13 17:35:20 +01:00
Lennart Poettering 726c6b6b3d efi: add missing #include 2013-02-13 00:18:29 +01:00
Lennart Poettering 9cde64ff26 efi: various cleanups 2013-02-13 00:12:58 +01:00
Kay Sievers 7b4d7cc082 bootctl: add boot loader and firmware interface tool 2013-02-11 19:35:52 +01:00
Lennart Poettering ff47c895c8 efi: fix returned length of efi_get_variable() 2013-02-11 06:21:20 +01:00
Kay Sievers e9cea16db6 efi: fix Usec vs. USec 2013-01-24 10:33:52 +01:00
Kay Sievers 5dbe9f5398 efi: read microseconds from boot loader info instead of "ticks" magic 2013-01-23 02:16:11 +01:00
Lennart Poettering f4ce2b3e5c efi: add efi boot generator that automatically mounts the ESP to /boot 2013-01-21 01:04:16 +01:00
Lennart Poettering 34e5a31ec5 util: move is_efiboot() to efivars.c 2013-01-21 01:04:16 +01:00
Lennart Poettering 2e3d069236 core: if the bootloader supports it, determine firmware and boot loader delay
This allows us to print simple performance data of all parts of the boot now:

- firmware
- boot loader
- kernel
- initrd
- userspace

This only works for bootloaders which support passing TSC data via EFI
variables. As of now that's only gummiboot.
2013-01-19 04:22:09 +01:00