Commit graph

38787 commits

Author SHA1 Message Date
Lennart Poettering c03f9cec42
Merge pull request #11898 from keszybz/meson-conv-lib
Use a convenience library for the sources shared between core/ and shutdown/
2019-03-06 10:46:18 +01:00
Lennart Poettering 13a16a2bb3 json: log about the right line number
We mean the line number in the json data, not the line number in our
C source code.

Addresses: https://github.com/systemd/systemd/pull/9762#issuecomment-441183987
2019-03-05 21:10:57 +01:00
Zbigniew Jędrzejewski-Szmek 68d923d0d0 meson: drop "_la_" from variable name
A left-over from libtool times.
2019-03-05 21:02:40 +01:00
Zbigniew Jędrzejewski-Szmek 53f79e125d meson: use a convenience library for the sources shared between core/ and the outside
This avoids double compilation. Those files are tiny, so it doesn't save time,
but we avoid repeated warnings and errors, and it's generally cleaner to it
this way.

The number of commands in 'ninja -C build clean && ninja -C build' drops from
1462 to 1455 for me.
2019-03-05 21:01:17 +01:00
Zbigniew Jędrzejewski-Szmek 3170dfe42d
Merge pull request #10495 from poettering/login-boot-hookup
add "systemctl reboot --boot-loader-menu=" and "systemctl reboot --boot-loader-entry="
2019-03-05 20:38:41 +01:00
Zbigniew Jędrzejewski-Szmek 23bdba61b1 pkgconfig: avoid double slash with split-usr configuration
By defining rootprefix= we avoid a double slash in $systemdsystemunitdir and
other variables. This fixes a regression introduced in
1c2c7c6cb3 where the variables using rootprefix=/
would start with a double slash. This should be interpreted the same, but is
certainly ugly.

The rootprefix variable was added to systemd.pc in
1c2c7c6cb3, so there is no question of backwards
compatiblity. If people try to "override" the prefix and specify
--define-variable=rootprefix=/, they will get a double slash, which should be
OK, and is the same as --define-variable=rootprefix=/something/, which also
results in a double slash somewhere in the strings.
2019-03-05 18:49:28 +01:00
Lennart Poettering 12be0693eb update TODO 2019-03-05 16:52:46 +01:00
Lennart Poettering e86c7a3abc docs: document the new environment variables logind groks 2019-03-05 16:52:46 +01:00
Lennart Poettering 350f9518ac logind: refactor logic of returning polkit challenge result into its own function
Let's share some code.
2019-03-05 16:52:46 +01:00
Lennart Poettering 97af80c5a7 systemctl: add support for booting into boot menu/entry
(This also removes support for booting into the EFI firmware setup
without logind. That's because otherwise the non-EFI fallback logind
implements can't work.)

Fixes: #9896
2019-03-05 16:52:46 +01:00
Lennart Poettering 31b221cf5e logind: add support for booting into the boot menu or a specific boot menu entry
This behaves similar to the "boot into firmware" logic, and also allows
either direct EFI operation (which sd-boot supports and others might
support eventually too) or override through env var.
2019-03-05 16:52:46 +01:00
Lennart Poettering eed7210a5c bootspec: validate bootpsec entry ids before we use them 2019-03-05 16:50:58 +01:00
Lennart Poettering 38bd74d67e bootspec: get rid of find_default_boot_entry() entirely
Now only two operations are left. Let's just move this into the caller,
since it should make things simpler, clearer and shorter, in particular
as there's only a single user for this.
2019-03-05 16:50:58 +01:00
Lennart Poettering b1a8771996 bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto()
it's pretty much the same code now, hence use it.
2019-03-05 16:50:58 +01:00
Lennart Poettering eea4ce1ec7 bootspec: introduce new helper boot_entries_load_config_auto()
It's a simple wrapper around boot_entries_load_config(), but determines
the ESP/XBOOTLDR paths automatically at first. Also, it looks for a path
/run/boot-loader-entries/ and loads the entries from there if it
exists. This is supposed to be a hook for other boot loaders to make our
tools aware of their own entries.
2019-03-05 16:50:58 +01:00
Lennart Poettering dba33c4a2c bootspec: correct error code shown in log msg 2019-03-05 16:50:58 +01:00
Lennart Poettering 93f14ce28d bootspec: move augmentation of loader-discovered entries into bootspec.c
Previously, bootctl would show boot loader entries discovered by the
boot loader which couldn't found locally separately in the output.

Let's move this code into bootspec.c, and beef it up a bit. This way we
can use it later on for logind, and correctly show automatically
discovered windows/macos entries too.
2019-03-05 16:50:58 +01:00
Lennart Poettering 5b1da1ba6d bootspec: simplify find_default_boot_entry()
If the only caller passes NULL for the two paths, let's remove the
parameter altogether.
2019-03-05 16:50:58 +01:00
Lennart Poettering c943e95f89 systemctl: let's FORK_WAIT where we can 2019-03-05 16:50:58 +01:00
Lennart Poettering 0f88d82979 systemctl: when something is not supported use EOPNOTSUPP 2019-03-05 16:50:58 +01:00
Lennart Poettering 78c38fe79c systemctl: be careful with boot loader entries lacking a 'linux' line
A boot loader entry might not have a 'linux' line, but an 'efi' line or
something else. Let's handle that case nicely.
2019-03-05 16:50:58 +01:00
Lennart Poettering 7800322ca5 bootspec: move log msg from systemctl.c to bootspec.c
find_default_boot_entry() is only used by systemctl.c, and currently
handles one log message in the caller instead of the callee. Let's
simplify that and move it over, too
2019-03-05 16:50:58 +01:00
Lennart Poettering 4629499e7f bootctl: tweak 'list' output a bit
Let's suppress the final newline in the list if it's the last entry we
are outputting.
2019-03-05 16:50:58 +01:00
Lennart Poettering e667266a74 logind: optionally support non-EFI reboot-to-firmware
This extends the reboot-to-firmware logic in logind, so that other than
EFI firmwares could be theoretically support. The scheme is like this:
if you want to support this, set the $SYSTEMD_REBOOT_TO_FIRMWARE=1 env
var for logind. If so, this will override the EFI logic, and cause a
file /run/systemd/reboot-to-firmware file to be created when
reboot-to-firmware is requested. This file has no contents, it's mere
existance indicates a reboot with reboot-to-firmware set.

The idea is that for alternative firmwares a drop-in for logind is added
that sets the env var, in combination with some code run during shutdown
that checks for the file and does the right thing.
2019-03-05 16:50:58 +01:00
Lennart Poettering 3279692370 efivars: extend character set that may be used in boot loader entry ids a bit
See https://github.com/systemd/systemd/pull/10495#discussion_r233992570
2019-03-05 16:22:17 +01:00
Zbigniew Jędrzejewski-Szmek bea3d64a73
Merge pull request #11896 from poettering/shutdown-fixes
move src/core/shutdown.c and helpers to src/shutdown/
2019-03-05 15:36:03 +01:00
Zbigniew Jędrzejewski-Szmek 57903f93c9 docs: add a note about compilation options
Closes #6371.
2019-03-05 13:58:06 +01:00
Lennart Poettering 55dadc5c57 core: warn if people use the undocumented/depreacted ConditionNull=
Triggered by:

https://github.com/systemd/systemd/issues/11812
2019-03-05 13:54:20 +01:00
Franck Bui 3c37dadf62 udev: restore debug level when logging a failure in the external prog called by IMPORT{program}
It was already the case before commit a75211421f,
which upgraded the log to warning.

This seems an unintended side effect as the commit message doesn't mention it
and the old behavior looks more appropriate.
2019-03-05 13:53:25 +01:00
Lennart Poettering 9e71f5d983 shutdown: rearrange shutdown sources in source tree
Let's move the shutdown binary into its own subdirectory in
src/shutdown, after all it is relatively isolated from the normal PID 1
sources, being a different binary and all.

Unfortunately it's not possible to move some of the code, since it is
shared with PID 1, that I wished we could move, but I still think it's
worth it.
2019-03-05 12:21:17 +01:00
Lennart Poettering 3a736a3216 shutdown: (void)ify more stuff 2019-03-05 12:21:17 +01:00
Lennart Poettering 66034f9c07 shutdown: fix up return type of sync_making_progress()
We shouldn't return negative errnos as "bool", hence fix the type of the
function to "int".
2019-03-05 12:21:17 +01:00
Lennart Poettering fc420dfbe6 update TODO 2019-03-05 12:21:17 +01:00
Lennart Poettering 73622e02fb
Merge pull request #11881 from yuwata/networkd-vs-interface-renaming
Networkd vs interface renaming
2019-03-05 10:05:57 +01:00
Yu Watanabe 39a15c8a8d udev: run programs in the specified order
This fixes bugs introduced by 29448498c7
and d838e14515.

Previously, RUN and SECLABEL keys are stored in udev_list with its unique
flag is false. If the flag is false, then udev_list is just a linked
list and new entries are always added in the last.
So, we should use OrderedHashmap instead of Hashmap.

Fixes #11368.
2019-03-05 09:27:29 +01:00
roadrunner2 0dcb426328 hwdb: add touchpad resolutions for 2015-2017 MacBook(Pro)'s. (#11874)
These are all models using an SPI keyboard and touchpad and using the
same applespi kernel driver.
2019-03-05 17:52:22 +10:00
Evgeny Vereshchagin c5b4b18e7d travis: use /bin/systemd instead of /usr/bin/systemd
Apparently systemd is in /bin now.
2019-03-05 08:00:22 +03:00
Yu Watanabe 23041689ca dhcp: refuse to configure DHCP IAID if the interface is under renaming
systemd-networkd itself does not start dhcp client, but the code
may be used in other projects. So, check that the interface is under
renaming or not.
2019-03-05 12:48:26 +09:00
Yu Watanabe 299ad32d48 network: do not configure interfaces under renaming 2019-03-05 10:33:42 +09:00
Yu Watanabe 90ba130f00 util: introduce device_is_renaming()
It will be used in the later commit.
2019-03-05 10:33:41 +09:00
Yu Watanabe 30de2b89d1 network: always drop configs when interface is renamed
Before the renaming, wrong .network file may be assigned to the link.
So, let's always drop link configuration.
2019-03-05 10:33:27 +09:00
Yu Watanabe a4055a608e udev: set ID_RENAMING property when interface renaming is requested
And drop the property on the corresponding 'move' uevent.
2019-03-05 10:31:35 +09:00
Yu Watanabe 6d0fdf4513 udev: do not read UdevEvent object before checking it is non-NULL 2019-03-05 10:31:20 +09:00
Yu Watanabe 589384be8d udev: drop unnecessary copy of new interface name 2019-03-05 10:02:09 +09:00
Yu Watanabe 4d64309955 netlink: check new interface name is valid or not before sending request 2019-03-05 10:02:09 +09:00
Lennart Poettering bb5e88a226
Merge pull request #11841 from keszybz/dns-packet-speedup
DNS packet speedup
2019-03-04 19:30:23 +01:00
Lennart Poettering 1788875576
Merge pull request #11871 from yuwata/systemctl-show-format-unprintable
systemctl: format many entries in 'show' command
2019-03-04 19:04:27 +01:00
Lennart Poettering 38ba8c8874
Merge pull request #11888 from keszybz/non-atomic
Drop unused atomic operations
2019-03-04 19:03:46 +01:00
Zbigniew Jędrzejewski-Szmek f27abfccd0 fuzz-dns-packet: add test case with lots of labels
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13422
2019-03-04 15:53:37 +01:00
Zbigniew Jędrzejewski-Szmek dffb827772 resolved: when adding RR to an answer, avoid comparing keys twice
We'd call dns_resource_record_equal(), which calls dns_resource_key_equal()
internally, and then dns_resource_key_equal() a second time. Let's be
a bit smarter, and call dns_resource_key_equal() only once.

(before)
dns_resource_key_hash_func_count=514
dns_resource_key_compare_func_count=275
dns_resource_key_equal_count=62371
4.13s user 0.01s system 99% cpu 4.153 total

(after)
dns_resource_key_hash_func_count=514
dns_resource_key_compare_func_count=276
dns_resource_key_equal_count=31337
2.13s user 0.01s system 99% cpu 2.139 total
2019-03-04 15:53:37 +01:00