1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-22 22:03:43 +03:00

38622 Commits

Author SHA1 Message Date
Lennart Poettering
fbf45d22da bootctl: teach bootctl the new partition type 2019-03-01 12:41:32 +01:00
Lennart Poettering
a2f8664e9a bootspec: load entries from both the ESP and XBOOTLDR partitions
Let's simply search in both.
2019-03-01 12:41:32 +01:00
Lennart Poettering
9fc32cd9b3 systemctl: add missing OOM checks 2019-03-01 12:41:32 +01:00
Lennart Poettering
8a1ef3bf8d systemctl: use SYNTHETIC_ERRNO() where appropriate 2019-03-01 12:41:32 +01:00
Lennart Poettering
947fbaea8b systemctl: drop arg_esp_path variable from systemctl
It's not set ever (and there's no real need to make it settable, since
users can as well set $SYSTEMD_ESP_PATH to configure this.
2019-03-01 12:41:32 +01:00
Lennart Poettering
43b736a84b bootspec: store 'root' field in each bootspec entry we load
This 'root' field contains the root path of the partition we found the
snippet in. The 'kernel', 'initrd', 'efi', … fields are relative to this
path.

This becomes particularly useful later when we add support for loading
snippets from both the ESP and XBOOTLDR, but already simplifies the code
for us a bit in systemctl.
2019-03-01 12:41:32 +01:00
Lennart Poettering
15cb6c9897 bootspec: add internal APIs to discover the XBOOTLDR partition 2019-03-01 12:41:32 +01:00
Lennart Poettering
9f1cb0c1fa gpt-auto: also load the boot loader partition during regular boots 2019-03-01 12:41:32 +01:00
Lennart Poettering
d9223c07f5 dissect: when mounting an image mount the XBOOTLDR partition to /boot
Previously, we'd mount the ESP to /efi if that existed and was empty,
falling back to /boot if that existed and was empty.

With this change, the XBOOTLDR partition is mounted to /boot
unconditionally. And the EFI is mounted to /efi if that exists (but it
doesn't have to be empty — after all the name is very indicative of what
this is supposed to be), and to /boot as a fallback but only if it
exists and is empty (we insist on emptiness for that, since it might be
used differently than what we assume).

The net effect is that $BOOT should be reliably found under /boot, and
the ESP is either /efi or /boot.

(Note that this commit only is relevant for nspawn and suchlike, i.e.
the codepaths that mount an image without involving udev during boot.)
2019-03-01 12:41:32 +01:00
Lennart Poettering
a8c47660bb dissect: automatically detect boot loader spec $BOOT partition
The boot loader spec supports two places to store boot loader
configuration: the ESP and a generic replacement for it in case the ESP
is not available or not suitable. Let's look for both.
2019-03-01 12:41:32 +01:00
Lennart Poettering
7b5de29569 gpt: add definition for boot loader spec partition
As listed in the boot loader spec since a long time:

https://systemd.io/BOOT_LOADER_SPECIFICATION#technical-details
2019-03-01 12:41:32 +01:00
Lennart Poettering
c4ba5b516d bootctl: safety check for regular file when reading EFI images 2019-03-01 12:41:32 +01:00
Lennart Poettering
78d5d4ed77 bootctl: use SYNTHETIC_ERRNO() where appropriate 2019-03-01 12:41:32 +01:00
Lennart Poettering
59ba6d0c17 dissect: use SYNTHETIC_ERRNO() where appropriate 2019-03-01 12:41:32 +01:00
Lennart Poettering
46bba8a51c bootspec: use SYNTHETIC_ERRNO() at one more place 2019-03-01 12:41:32 +01:00
Lennart Poettering
feb41f1ffe bootspec: update log message, to indicate the error is ignored 2019-03-01 12:41:32 +01:00
Lennart Poettering
71f514169b fs-util: add new helper syncfs_path() 2019-03-01 12:41:32 +01:00
Lennart Poettering
57d2db22de env-file: (void)ify an unlink() call 2019-03-01 12:41:32 +01:00
Lennart Poettering
96be0e89f2 json: don't call va_end() twice in json_build()
This was apparently left-over when json_buildv() was added, and
json_build() just became a wrapper for it.
2019-03-01 12:19:19 +01:00
Martin Pitt
59273a0c53
semaphoreci: Run subset of autopkgtests in LXC (#11814)
Run build/test in LXC for now, as full nested QEMU is too brittle right
now: https://github.com/semaphoreci/semaphore/issues/37
But this at least runs some tests. It ensures that systemd generally
works in containers, as well as provides some backup results if the main
Ubuntu CI is down.
2019-03-01 10:01:09 +01:00
Lennart Poettering
8e4fbe3f2d
Merge pull request #11852 from keszybz/coverity-memory-issues
Two small fixes for memory issues found by coverity
2019-02-28 19:04:04 +01:00
Lennart Poettering
04d7ca0228
Merge pull request #11856 from xtopherwong/new-time-zone-list
Use new time zone list
2019-02-28 18:57:26 +01:00
Lennart Poettering
737e2f306e
Merge pull request #11857 from rossburton/acrn
virt: detect the ACRN hypervisor
2019-02-28 18:56:48 +01:00
Zbigniew Jędrzejewski-Szmek
2fe4c28d30
Merge pull request #11834 from martinpitt/network-test-fixes
networkd-test fix/improvement
2019-02-28 17:48:41 +01:00
Ross Burton
0f0e30ad9c man: add ACRN hypervisor 2019-02-28 15:55:23 +00:00
Jörg Sommer
df3489ab1b Better C code formatting of arguments in Emacs
In [PR#11696][1] it came up that the formatting of continued arguments should
follow the default Emacs style. To ensure this happens when someone has changed
his setting in her private config, the value should be set by *dir-locals.el*.

[1]: https://github.com/systemd/systemd/pull/11696#pullrequestreview-205463987
2019-02-28 16:50:53 +01:00
Lennart Poettering
154c83e1b9
Merge pull request #11853 from keszybz/man-rules-update
man/rules update
2019-02-28 16:17:59 +01:00
Ross Burton
095b9cf45a virt: detect the ACRN hypervisor
Add magic string and enumeration for the ACRN hypervisor
(https://projectacrn.org).
2019-02-28 14:43:51 +00:00
Zbigniew Jędrzejewski-Szmek
f0e2e0db00 test-time-util: use standard intro and print timezones read from file
The asserts are OK, but it's also nice to see the list by eye.
2019-02-28 15:38:52 +01:00
Zbigniew Jędrzejewski-Szmek
781748af45 README: mention that we need tzdata >= 2014f
zone1970.tab was added in that version. Not that it makes sense to use
outdata timezone tables, but people do strange things.

C.f. https://github.com/nodatime/nodatime/issues/319.
2019-02-28 15:38:47 +01:00
Theo Ouzhinski
fa44cecae2 man/shutdown: Fix grammar 2019-02-28 15:17:32 +01:00
Christopher Wong
ba32084f08 Use new time zone list
When systemd retrieve the time zone it read what is in the file
/usr/share/zoneinfo/zone.tab provided by the Time Zone Database.
According to the comments in zone.tab its content is for backward-
compatibility aid for older programs. New programs should use
zone1970.tab. This patch replaces zone.tab with zone1970.tab.
2019-02-28 14:58:43 +01:00
Lennart Poettering
1f82f5bb42 sd-bus: deal with cookie overruns
Apparently this happens IRL. Let's carefully deal with issues like this:
when we overrun, let's not go back to zero but instead leave the highest
cookie bit set. We use that as indication that we are in "overrun
territory", and then are particularly careful with checking cookies,
i.e. that they haven't been used for still outstanding replies yet. This
should retain the quick cookie generation behaviour we used to have, but
permits dealing with overruns.

Replaces: #11804
Fixes: #11809
2019-02-28 13:44:05 +01:00
Zbigniew Jędrzejewski-Szmek
2dfdf9c4b2 man: create .so links for sd_bus_close_{unref,unrefp}
Follow-up for bd62b7448623fbe36665e089977731efb55524c0.
2019-02-28 13:10:08 +01:00
Zbigniew Jędrzejewski-Szmek
9e08359864 meson: remove workaround for old meson bug with command quoting
Those bugs were fixed a long time ago. Let's take advantage of this and use the
usual $() syntax.
2019-02-28 13:10:08 +01:00
Lennart Poettering
e19ebdd66d
Merge pull request #11840 from yuwata/network-route-onlink
network: enable GatewayOnLink= if no static address is configured
2019-02-28 12:02:08 +01:00
Zbigniew Jędrzejewski-Szmek
760034bebe udev-builtin-usb_id: guard against overflow when reading descriptor data
CID#996458. Coverity warns that we trust desc->bLength as read in
the input data to adjust our position in the buffer. This value could
be anything, leading to overflow. It's unlikely that the kernel feeds
us invalid data, but let's me more careful.

If any error is encountered, more logs are given.
2019-02-28 11:57:51 +01:00
Zbigniew Jędrzejewski-Szmek
8bdca77c40 udev-builtin-usb_id: use strjoina to simplify code 2019-02-28 11:40:44 +01:00
Zbigniew Jędrzejewski-Szmek
a05294ff05 shared/install: do not use a temporary variable outside of its scope
Coverity says:
> Pointer to local outside scope (RETURN_LOCAL)9.
> use_invalid: Using dirs, which points to an out-of-scope temporary variable of type char const *[5].

And indeed, the switch statement forms a scope. Let's use an if to
avoid creating a scope.
2019-02-28 11:29:38 +01:00
Yu Watanabe
358fb6862b fuzz: do not assume the existence of /sys/class/net/lo
Hopefully fixes oss-fuzz#13440.
2019-02-28 10:38:16 +01:00
Yu Watanabe
2850cd40ee network: wrap long lines 2019-02-28 10:57:20 +09:00
Yu Watanabe
33680b0a26 network: simplify config_parse_lifetime() 2019-02-28 10:56:33 +09:00
Yu Watanabe
4aa4c4b0f4 network: avoid address section freed
Otherwise, if HomeAddress= or friends are specified at the first line of
a section, then its assignment will be ignored.
2019-02-28 10:54:20 +09:00
Yu Watanabe
f205a92a5c network: cleanup logging in route related config parsers 2019-02-28 10:39:14 +09:00
Yu Watanabe
01d4e7323c network: do not override previously specified family 2019-02-28 10:37:58 +09:00
Yu Watanabe
af3b1498c6 test-network: add testcase for #1850 2019-02-28 10:34:27 +09:00
Yu Watanabe
4912ab7774 network: enable GatewayOnLink= if Gateway= without static address configured
And warn about that.

But this only done if GatewayOnLink= is not specified. When it is
explicitly disabled, then the flag will not be set.
2019-02-28 10:34:21 +09:00
Yu Watanabe
54901fd222 network: save GatewayOnLink= value as tristate in Route
This should not change any behavior. But used in the later commit.
2019-02-28 10:16:55 +09:00
Yu Watanabe
4bec2f237b network: relax the .network file check
Previously, if a .networ file contains invalid [Address] or [Route]
section, then the file is completely dropped. This makes networkd
just drops invalid sections.
2019-02-28 10:01:56 +09:00
Yu Watanabe
9cb8c55934 network: rename GatewayOnlink= to GatewayOnLink=
But still GatewayOnlink= is supported for backward compatibility.
2019-02-28 10:00:22 +09:00