]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 years agonspawn: Move --network-interface interfaces back to the host. 14401/head
Daan De Meyer [Thu, 19 Dec 2019 20:17:57 +0000 (21:17 +0100)] 
nspawn: Move --network-interface interfaces back to the host.

4 years agonspawn-network: Split off udev checking from parse_interface.
Daan De Meyer [Thu, 19 Dec 2019 20:16:30 +0000 (21:16 +0100)] 
nspawn-network: Split off udev checking from parse_interface.

4 years agoMerge pull request #14378 from keszybz/unit-docs
Lennart Poettering [Thu, 19 Dec 2019 18:00:14 +0000 (19:00 +0100)] 
Merge pull request #14378 from keszybz/unit-docs

Unit documentation and build-system tweaks

4 years agonetwork: update log message in message_rtnl_process_xyz()
Yu Watanabe [Thu, 19 Dec 2019 11:17:15 +0000 (20:17 +0900)] 
network: update log message in message_rtnl_process_xyz()

Also lower the log level when the family is not supported.

4 years agoman: add section about user manager units 14378/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 10:23:30 +0000 (11:23 +0100)] 
man: add section about user manager units

4 years agoman: add remote-*.targets to the bootup sequence
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 09:32:03 +0000 (10:32 +0100)] 
man: add remote-*.targets to the bootup sequence

I think this makes it easier to see the difference between local and remote
mounts.

Make the graph a bit narrower while at it.

4 years agotime-util: also use 32bit hack on EOVERFLOW
Lennart Poettering [Wed, 18 Dec 2019 13:57:11 +0000 (14:57 +0100)] 
time-util: also use 32bit hack on EOVERFLOW

As per
https://github.com/systemd/systemd/issues/14362#issuecomment-566722686
let's also prepare for EOVERFLOW.

4 years agoMerge pull request #14388 from anitazha/man_uid_updates
Lennart Poettering [Thu, 19 Dec 2019 11:45:59 +0000 (12:45 +0100)] 
Merge pull request #14388 from anitazha/man_uid_updates

man: document uids for user journals

4 years agoMerge pull request #13823 from anitazha/unpriv_privateusers
Lennart Poettering [Thu, 19 Dec 2019 11:03:06 +0000 (12:03 +0100)] 
Merge pull request #13823 from anitazha/unpriv_privateusers

core: PrivateUsers=true for (unprivileged) user managers

4 years agoRevert "cryptsetup: umount encrypted devices before detaching it during shutdown"
Zbigniew Jędrzejewski-Szmek [Thu, 19 Dec 2019 09:42:14 +0000 (10:42 +0100)] 
Revert "cryptsetup: umount encrypted devices before detaching it during shutdown"

This reverts commit 362c378291e85df3e00aaad491d1e08233ad127f.

This commit introduced an ordering loop: remote-cryptsetup.target was both
before and after remote-fs-pre.target. It also globally ordered all cryptsetup
volumes before all mounts. Such global ordering is problematic if people have
stacked storage. Let's look for a different solution.

See https://github.com/systemd/systemd/pull/14378#discussion_r359460109.

4 years agoMerge pull request #14382 from topimiettinen/fix-analyze-security-rootimage
Anita Zhang [Thu, 19 Dec 2019 00:21:36 +0000 (16:21 -0800)] 
Merge pull request #14382 from topimiettinen/fix-analyze-security-rootimage

analyze: badness if neither of RootImage and RootDirectory exists

4 years ago[man] note which UID ranges will get user journals 14388/head
Anita Zhang [Thu, 19 Dec 2019 00:09:49 +0000 (16:09 -0800)] 
[man] note which UID ranges will get user journals

Fixes #13926

4 years ago[man] fix URL
Anita Zhang [Thu, 19 Dec 2019 00:08:53 +0000 (16:08 -0800)] 
[man] fix URL

4 years agotest: add test case for PrivateDevices=y and Group=daemon 13823/head
Anita Zhang [Wed, 20 Nov 2019 01:25:23 +0000 (17:25 -0800)] 
test: add test case for PrivateDevices=y and Group=daemon

For root, group enforcement needs to come after PrivateDevices=y set up
according to 096424d1230e0a0339735c51b43949809e972430. Add a test to
verify this is the case.

4 years agocore: create inaccessible nodes for users when making runtime dirs
Anita Zhang [Tue, 19 Nov 2019 22:24:52 +0000 (14:24 -0800)] 
core: create inaccessible nodes for users when making runtime dirs

To support ProtectHome=y in a user namespace (which mounts the inaccessible
nodes), the nodes need to be accessible by the user. Create these paths and
devices in the user runtime directory so they can be used later if needed.

4 years agocore: add test case for PrivateUsers=true in user manager
Filipe Brandenburger [Wed, 13 Nov 2019 18:32:24 +0000 (10:32 -0800)] 
core: add test case for PrivateUsers=true in user manager

The test exercises that PrivateTmp=yes and ProtectHome={read-only,tmpfs}
directives work as expected when PrivateUsers=yes in a user manager.

Some code is also added to test-functions to help set up test cases that
exercise the user manager.

4 years agocore: PrivateUsers=true for (unprivileged) user managers
Anita Zhang [Wed, 23 Oct 2019 00:37:47 +0000 (17:37 -0700)] 
core: PrivateUsers=true for (unprivileged) user managers

Let per-user service managers have user namespaces too.

For unprivileged users, user namespaces are set up much earlier
(before the mount, network, and UTS namespaces vs after) in
order to obtain capbilities in the new user namespace and enable use of
the other listed namespaces. However for privileged users (root), the
set up for the user namspace is still done at the end to avoid any
restrictions with combining namespaces inside a user namespace (see
inline comments).

Closes #10576

4 years agoanalyze: badness if neither of RootImage and RootDirectory exists 14382/head
Topi Miettinen [Wed, 18 Dec 2019 18:25:03 +0000 (20:25 +0200)] 
analyze: badness if neither of RootImage and RootDirectory exists

Instead of requiring both RootImage and RootDirectory directives, give badness
points if neither is present. Fixes conversion in d737b451f.

4 years agoMerge pull request #14376 from poettering/sd-event-no-stack
Lennart Poettering [Wed, 18 Dec 2019 16:18:07 +0000 (17:18 +0100)] 
Merge pull request #14376 from poettering/sd-event-no-stack

sd-event: don't use stack for event queue array

4 years agonetwork: introduce AddPrefixRoute= and deprecate PrefixRoute=
Yu Watanabe [Sat, 7 Dec 2019 15:32:36 +0000 (00:32 +0900)] 
network: introduce AddPrefixRoute= and deprecate PrefixRoute=

PrefixRoute= was added by e63be0847c39bfdca45c25c505922814374581a7,
but unfortunately, the meaning of PrefixRoute= is inverted; when true
IFA_F_NOPREFIXROUTE flag is added. This introduces AddPrefixRoute=
setting.

4 years agoMerge pull request #14377 from keszybz/fixups
Lennart Poettering [Wed, 18 Dec 2019 15:21:20 +0000 (16:21 +0100)] 
Merge pull request #14377 from keszybz/fixups

Fixups

4 years agoMerge pull request #14365 from yuwata/networkctl-altname
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 11:44:34 +0000 (12:44 +0100)] 
Merge pull request #14365 from yuwata/networkctl-altname

network, udev: further alternative name support

4 years agoMake openssl dependency optional again 14377/head
Zbigniew Jędrzejewski-Szmek [Wed, 18 Dec 2019 08:38:25 +0000 (09:38 +0100)] 
Make openssl dependency optional again

4 years agoupdate TODO 14376/head
Lennart Poettering [Wed, 18 Dec 2019 10:02:21 +0000 (11:02 +0100)] 
update TODO

4 years agosd-event: don't allocate event queue array on stack
Lennart Poettering [Wed, 18 Dec 2019 09:59:27 +0000 (10:59 +0100)] 
sd-event: don't allocate event queue array on stack

We might have quite a number of event sources, hence allocate this in a
buffer we can reuse on the heap, rather than on the stack.

4 years agoman: add man page for sd_bus_message_sensitive()
Lennart Poettering [Mon, 26 Aug 2019 10:06:53 +0000 (12:06 +0200)] 
man: add man page for sd_bus_message_sensitive()

4 years agoRestore silent handling of BUS_ERROR_SPEED_METER_INACTIVE
Zbigniew Jędrzejewski-Szmek [Tue, 17 Dec 2019 11:32:36 +0000 (12:32 +0100)] 
Restore silent handling of BUS_ERROR_SPEED_METER_INACTIVE

This only matters for the case where new networkctl is running against older
networkd. We should still handle the old error to avoid unnecessary warning
about speedmeeter being disabled.

This partially reverts commit e813de549b17f2601750c95825d8e0740cbee38c.

4 years agoshared/loop-util: rename function
Zbigniew Jędrzejewski-Szmek [Mon, 16 Dec 2019 13:16:49 +0000 (14:16 +0100)] 
shared/loop-util: rename function

As suggested in https://github.com/systemd/systemd/pull/14261#pullrequestreview-332398625.

4 years agoshared/dropin: fix assert for invalid drop-in
Topi Miettinen [Tue, 17 Dec 2019 13:47:37 +0000 (15:47 +0200)] 
shared/dropin: fix assert for invalid drop-in

Don't try to show top level drop-in for non-existent units or when trying to
instantiate non-instantiated units:

$ systemctl cat nonexistent@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.
$ systemctl cat systemd-journald@.service
Assertion 'name' failed at src/shared/dropin.c:143, function unit_file_find_dirs(). Aborting.

4 years agoMerge pull request #14370 from poettering/homed-preparation-misc
Yu Watanabe [Wed, 18 Dec 2019 02:17:59 +0000 (11:17 +0900)] 
Merge pull request #14370 from poettering/homed-preparation-misc

four smaller preparation patches from the homed PR

4 years agoMerge pull request #14369 from poettering/pkcs11-cryptsetup-followup
Yu Watanabe [Wed, 18 Dec 2019 02:16:17 +0000 (11:16 +0900)] 
Merge pull request #14369 from poettering/pkcs11-cryptsetup-followup

PKCS#11 cryptsetup support followup

4 years agoinitrd: make udev cleanup service confict trigger and settle too
Dimitri John Ledkov [Fri, 13 Dec 2019 23:22:51 +0000 (23:22 +0000)] 
initrd: make udev cleanup service confict trigger and settle too

Otherwise, systemd-udev-trigger|settle.service that ran in the initrd may
ramain active, and never re-run again from the system root.

This is observed by forexample examining ESP with udevadm info, which in the
initrd has all the ID_* variables, and none of them in fully booted system.

4 years agovarlink: add varlink_close_unref() helper 14370/head
Lennart Poettering [Tue, 28 May 2019 12:18:49 +0000 (14:18 +0200)] 
varlink: add varlink_close_unref() helper

4 years agochown-recursive: add fd based API
Lennart Poettering [Tue, 16 Apr 2019 16:44:28 +0000 (18:44 +0200)] 
chown-recursive: add fd based API

4 years agochown-recursive: move src/core/chown-recursive.[ch] → src/shared/
Lennart Poettering [Sun, 23 Dec 2018 18:31:29 +0000 (19:31 +0100)] 
chown-recursive: move src/core/chown-recursive.[ch] → src/shared/

We want to use it outside of the core, hence let's moved it to the
shared code directory.

4 years agobasic: add quota-util.[ch] with some helpers for the Linux quotactl() API
Lennart Poettering [Fri, 22 Nov 2019 11:42:27 +0000 (12:42 +0100)] 
basic: add quota-util.[ch] with some helpers for the Linux quotactl() API

4 years agocryptsetup-pkcs11: just return zero on success, no need to return anything else 14369/head
Lennart Poettering [Tue, 17 Dec 2019 17:40:46 +0000 (18:40 +0100)] 
cryptsetup-pkcs11: just return zero on success, no need to return anything else

4 years agocryptsetup-pkcs11: line break some overly long lines
Lennart Poettering [Tue, 17 Dec 2019 17:40:26 +0000 (18:40 +0100)] 
cryptsetup-pkcs11: line break some overly long lines

4 years agocryptsetup-pkcs11: refuse keys above 16MiB size
Lennart Poettering [Tue, 17 Dec 2019 17:39:53 +0000 (18:39 +0100)] 
cryptsetup-pkcs11: refuse keys above 16MiB size

4 years agoman: tweaks to the crypttab(5) man page
Lennart Poettering [Tue, 17 Dec 2019 17:39:12 +0000 (18:39 +0100)] 
man: tweaks to the crypttab(5) man page

4 years agohwdb: assume all Medion Akoya E-models have the same matrix
cvoinf [Mon, 9 Dec 2019 22:28:09 +0000 (23:28 +0100)] 
hwdb: assume all Medion Akoya E-models have the same matrix

Since up to now all known Akoya E* models have the same Matrix, we assume all
other Akoya E* models work the same.

4 years agoman: whitespace fix
Lennart Poettering [Tue, 17 Dec 2019 10:24:02 +0000 (11:24 +0100)] 
man: whitespace fix

4 years agoman: we support growing xfs too these days
Lennart Poettering [Tue, 17 Dec 2019 16:30:55 +0000 (17:30 +0100)] 
man: we support growing xfs too these days

4 years agotime-util: deal with systems where userspace has 64bit time_t but kernel does not
Lennart Poettering [Tue, 17 Dec 2019 10:22:17 +0000 (11:22 +0100)] 
time-util: deal with systems where userspace has 64bit time_t but kernel does not

Fixes: #14362
4 years agonetwork: support alternative name to get bus path for the link 14365/head
Yu Watanabe [Tue, 17 Dec 2019 12:13:49 +0000 (21:13 +0900)] 
network: support alternative name to get bus path for the link

4 years agonetworkctl: support alternative name to specify interface
Yu Watanabe [Tue, 17 Dec 2019 12:07:46 +0000 (21:07 +0900)] 
networkctl: support alternative name to specify interface

4 years agoudev: sort alternative names
Yu Watanabe [Tue, 17 Dec 2019 11:41:21 +0000 (20:41 +0900)] 
udev: sort alternative names

Kernel preserves the order of alternative names. So, for user
visibility, let's sort the alternative names.

4 years agosd-netlink: introduce rtnl_resolve_link_alternative_names()
Yu Watanabe [Tue, 17 Dec 2019 09:28:36 +0000 (18:28 +0900)] 
sd-netlink: introduce rtnl_resolve_link_alternative_names()

4 years agoMerge pull request #14267 from poettering/pkcs11-cryptsetup
Lennart Poettering [Tue, 17 Dec 2019 14:30:32 +0000 (15:30 +0100)] 
Merge pull request #14267 from poettering/pkcs11-cryptsetup

just the pkcs11 hookup for classic cryptsetup (/etc/crypttab) split out of the homed PR

4 years agoMerge pull request #14337 from yuwata/network-tc-fq-more
Yu Watanabe [Tue, 17 Dec 2019 14:30:10 +0000 (23:30 +0900)] 
Merge pull request #14337 from yuwata/network-tc-fq-more

network: tc: introduce more FQ settings

4 years ago[import] fix stdin/stdout pipe behavior in import/export tar/raw
Anita Zhang [Tue, 17 Dec 2019 09:08:04 +0000 (01:08 -0800)] 
[import] fix stdin/stdout pipe behavior in import/export tar/raw

The code existed in machinectl to use stdin/stdout if the path for
import/export tar/raw was empty or dash (-) but a check to
`fd_verify_regular` in importd prevented it from working.

Update the check instead to explicitly check for regular file or
pipe/fifo.

Fixes #14346

4 years agoMerge pull request #14352 from yuwata/sd-netlink-tiny-fixes
Yu Watanabe [Tue, 17 Dec 2019 14:10:46 +0000 (23:10 +0900)] 
Merge pull request #14352 from yuwata/sd-netlink-tiny-fixes

sd-netlink: tiny fixes

4 years agoMerge pull request #14208 from poettering/json-homed-prepare
Yu Watanabe [Tue, 17 Dec 2019 14:10:08 +0000 (23:10 +0900)] 
Merge pull request #14208 from poettering/json-homed-prepare

json bits from homed PR

4 years agohwdb: Add Bluetooth-attached Logitech MX Master
Jan Alexander Steffens (heftig) [Sat, 14 Dec 2019 22:13:17 +0000 (23:13 +0100)] 
hwdb: Add Bluetooth-attached Logitech MX Master

Except for the product IDs, the original MX Master appears identical to
the MX Master 2S.

4 years agoMerge pull request #14360 from yuwata/udev-alternative-names-policy
Zbigniew Jędrzejewski-Szmek [Tue, 17 Dec 2019 11:13:47 +0000 (12:13 +0100)] 
Merge pull request #14360 from yuwata/udev-alternative-names-policy

udev: introduce AlternativeNamesPolicy= setting

4 years agosystemctl: show what verbs support --dry-run in the help page
Bart Willems [Mon, 16 Dec 2019 15:45:59 +0000 (16:45 +0100)] 
systemctl: show what verbs support --dry-run in the help page

Signed-off-by: Bart Willems <bwillems@protonmail.com>
4 years agoMerge pull request #14241 from keszybz/resume-timeout
Lennart Poettering [Tue, 17 Dec 2019 09:34:43 +0000 (10:34 +0100)] 
Merge pull request #14241 from keszybz/resume-timeout

Bump resume timeout to infinity

4 years agosd-netlink: add a whitespce between cast operator and variable 14352/head
Yu Watanabe [Mon, 16 Dec 2019 09:42:25 +0000 (18:42 +0900)] 
sd-netlink: add a whitespce between cast operator and variable

4 years agosd-netlink: make netlink_container_parse() takes size_t for rt_len
Yu Watanabe [Mon, 16 Dec 2019 09:40:36 +0000 (18:40 +0900)] 
sd-netlink: make netlink_container_parse() takes size_t for rt_len

And use another unsigned short variable for RTA_OK() macro.

4 years agonetwork: set AlternativeNamesPolicy= in 99-default.link 14360/head
Yu Watanabe [Mon, 16 Dec 2019 15:30:38 +0000 (00:30 +0900)] 
network: set AlternativeNamesPolicy= in 99-default.link

4 years agoudev: introduce AlternativeNamesPolicy= setting
Yu Watanabe [Mon, 16 Dec 2019 14:44:42 +0000 (23:44 +0900)] 
udev: introduce AlternativeNamesPolicy= setting

4 years agoudev: do not fail if kernel does not support alternative names
Yu Watanabe [Tue, 17 Dec 2019 06:32:22 +0000 (15:32 +0900)] 
udev: do not fail if kernel does not support alternative names

4 years agoMerge pull request #14339 from keszybz/invalid-enablement-logs
Yu Watanabe [Tue, 17 Dec 2019 06:04:14 +0000 (15:04 +0900)] 
Merge pull request #14339 from keszybz/invalid-enablement-logs

Small enhancements to logs for enabling of invalid units

4 years agorandom-util: call initialize_srand() after fork()
Yu Watanabe [Mon, 16 Dec 2019 10:47:48 +0000 (19:47 +0900)] 
random-util: call initialize_srand() after fork()

4 years agoMerge pull request #14351 from yuwata/util-constify-strv-xxx
Anita Zhang [Tue, 17 Dec 2019 02:08:04 +0000 (18:08 -0800)] 
Merge pull request #14351 from yuwata/util-constify-strv-xxx

util: constify arguments of strv_xxx()

4 years agoudev: extend the length of ID_NET_NAME_XXX= to ALTIFNAMSIZ
Yu Watanabe [Tue, 17 Dec 2019 02:01:35 +0000 (11:01 +0900)] 
udev: extend the length of ID_NET_NAME_XXX= to ALTIFNAMSIZ

4 years agoefivars: properly NUL terminate EFI variables when reading
Lennart Poettering [Mon, 16 Dec 2019 11:07:06 +0000 (12:07 +0100)] 
efivars: properly NUL terminate EFI variables when reading

A follow-up for 35b9eb0a72b6254568a294f0ebd011da20958a64.

4 years agobasic/tmpfile: avoid maybe-uninitialized warning in mkostemp_safe()
Thomas Haller [Sun, 15 Dec 2019 14:50:43 +0000 (15:50 +0100)] 
basic/tmpfile: avoid maybe-uninitialized warning in mkostemp_safe()

The variable is always initialized, but the compiler might not notice
that. With gcc-9.2.1-1.fc31:

    $ CFLAGS='-Werror=maybe-uninitialized -Og' meson build
    $ ninja -C build
    [...]
    ../src/basic/tmpfile-util.c: In function ‘mkostemp_safe’:
    ../src/basic/tmpfile-util.c:76:12: error: ‘fd’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
       76 |         if (fd < 0)
          |            ^

4 years agoTODO: drop entry 14339/head
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 18:30:00 +0000 (19:30 +0100)] 
TODO: drop entry

Implemented in 7d1e91d1a9504ab1bc03894038f90a8e87a4e982.

4 years agoshared/install: log syntax error for invalid DefaultInstance=
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 18:25:50 +0000 (19:25 +0100)] 
shared/install: log syntax error for invalid DefaultInstance=

Ideally, we would want to report this over back over dbus. But that is pretty hard,
because the unitfile parsing logic doesn't provide any feedback.
systemd-analyze verify also doesn't notice the issue, because it doesn't look
at the [Install] section at all. Let's print a message in the logs at least.

4 years agoAdded Trekstor Primetab S11B
Benjamin Dahlhoff [Sat, 14 Dec 2019 16:48:06 +0000 (17:48 +0100)] 
Added Trekstor Primetab S11B

4 years agoMerge pull request #14354 from poettering/link-fix
Yu Watanabe [Mon, 16 Dec 2019 09:06:33 +0000 (18:06 +0900)] 
Merge pull request #14354 from poettering/link-fix

two trivial doc fixes

4 years agodocs: CSS files should not be executable 14354/head
Lennart Poettering [Mon, 16 Dec 2019 08:50:02 +0000 (09:50 +0100)] 
docs: CSS files should not be executable

4 years agogithub: use systemd.io links in issue template
Lennart Poettering [Mon, 16 Dec 2019 08:49:51 +0000 (09:49 +0100)] 
github: use systemd.io links in issue template

4 years agoMerge pull request #14261 from keszybz/loop-utils-and-efivars
Lennart Poettering [Mon, 16 Dec 2019 08:27:46 +0000 (09:27 +0100)] 
Merge pull request #14261 from keszybz/loop-utils-and-efivars

Fixes for networkd, shared/loop-util, basic/efivars

4 years agoMerge pull request #14196 from keszybz/gpt-auto-generator-debugging
Lennart Poettering [Mon, 16 Dec 2019 08:24:02 +0000 (09:24 +0100)] 
Merge pull request #14196 from keszybz/gpt-auto-generator-debugging

gpt-auto-generator debugging

4 years agoMerge pull request #14350 from yuwata/network-udev-altnames-support
Lennart Poettering [Mon, 16 Dec 2019 08:15:23 +0000 (09:15 +0100)] 
Merge pull request #14350 from yuwata/network-udev-altnames-support

network, udev: add altname support

4 years agoutil: constify arguments of strv_xxx() 14351/head
Yu Watanabe [Mon, 16 Dec 2019 06:51:04 +0000 (15:51 +0900)] 
util: constify arguments of strv_xxx()

4 years agotest-network: pass environment variables to networkctl 14350/head
Yu Watanabe [Sun, 15 Dec 2019 19:37:00 +0000 (04:37 +0900)] 
test-network: pass environment variables to networkctl

4 years agotest-network: add a test case for netdev altname
Yu Watanabe [Sun, 15 Dec 2019 19:17:57 +0000 (04:17 +0900)] 
test-network: add a test case for netdev altname

4 years agonetworkctl: show alternative names
Yu Watanabe [Sun, 15 Dec 2019 19:27:27 +0000 (04:27 +0900)] 
networkctl: show alternative names

4 years agonetwork: make Name= in [Match] support alternative names of interfaces
Yu Watanabe [Sun, 15 Dec 2019 13:46:19 +0000 (22:46 +0900)] 
network: make Name= in [Match] support alternative names of interfaces

4 years agoudev: support AlternativeName= setting in .link file
Yu Watanabe [Sun, 15 Dec 2019 14:21:18 +0000 (23:21 +0900)] 
udev: support AlternativeName= setting in .link file

4 years agoutil: introduce ifname_valid_full()
Yu Watanabe [Sun, 15 Dec 2019 14:01:54 +0000 (23:01 +0900)] 
util: introduce ifname_valid_full()

4 years agotest: add a test for sd_netlink_message_{append,read}_strv()
Yu Watanabe [Sun, 15 Dec 2019 12:48:12 +0000 (21:48 +0900)] 
test: add a test for sd_netlink_message_{append,read}_strv()

4 years agosd-netlink: introduce sd_netlink_message_append_strv()
Yu Watanabe [Sun, 15 Dec 2019 12:47:21 +0000 (21:47 +0900)] 
sd-netlink: introduce sd_netlink_message_append_strv()

4 years agosd-netlink: introduce sd_netlink_message_read_strv()
Yu Watanabe [Sun, 15 Dec 2019 12:32:25 +0000 (21:32 +0900)] 
sd-netlink: introduce sd_netlink_message_read_strv()

The combination of sd_netlink_message_enter_container() and
sd_netlink_message_read_string() only reads the last element if the attribute is
duplicated, such a situation easily happens for IFLA_ALT_IFNAME.
The function introduced here reads all matched attributes.

4 years agoshared/loop-util: spin on open() returning ENOENT too 14261/head
Zbigniew Jędrzejewski-Szmek [Sun, 15 Dec 2019 19:58:59 +0000 (20:58 +0100)] 
shared/loop-util: spin on open() returning ENOENT too

https://github.com/systemd/systemd/pull/14261#discussion_r355001559

4 years agobasic/efivars: do not return EIO if an efivar read is shorten than fstat size
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 11:13:34 +0000 (12:13 +0100)] 
basic/efivars: do not return EIO if an efivar read is shorten than fstat size

On my machine stat returns size 22, but only 20 bytes are read:

openat(AT_FDCWD, "/sys/firmware/efi/efivars/LoaderTimeInitUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=22, ...}) = 0
read(3, "\6\0\0\0", 4)                  = 4
read(3, "7\0001\0001\0003\0005\0002\0007\0\0\0", 18) = 16
Failed to read LoaderTimeInitUSec: Input/output error

Let's just accept that the kernel is returning inconsistent results.
It seems to happen two only two variables on my machine:
/sys/firmware/efi/efivars/LoaderTimeInitUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
/sys/firmware/efi/efivars/LoaderTimeMenuUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f
so it might be related to the way we write them.

4 years agoshared/efi-loader: add some debugging statements
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 10:55:20 +0000 (11:55 +0100)] 
shared/efi-loader: add some debugging statements

Should make it easier to figure out why some operations fail...

4 years agoshared/loop-util: spin on LOOP_CTL_REMOVE
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 10:35:57 +0000 (11:35 +0100)] 
shared/loop-util: spin on LOOP_CTL_REMOVE

If we call LOOP_CLR_FD and LOOP_CTL_REMOVE too rapidly, the kernel cannot deal
with that (5.3.13-300.fc31.x86_64 running on dual core
Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz).

$ sudo strace -eioctl build/test-dissect-image /tmp/foobar3.img
ioctl(3, TCGETS, 0x7ffcee47de20)        = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(4, LOOP_CTL_GET_FREE)             = 9
ioctl(5, LOOP_SET_FD, 3)                = 0
ioctl(5, LOOP_SET_STATUS64, {lo_offset=0, lo_number=0, lo_flags=LO_FLAGS_READ_ONLY|LO_FLAGS_AUTOCLEAR|LO_FLAGS_PARTSCAN, lo_file_name="", ...}) = 0
ioctl(5, BLKGETSIZE64, [299999744])     = 0
ioctl(5, CDROM_GET_CAPABILITY, 0)       = -1 EINVAL (Invalid argument)
ioctl(5, BLKSSZGET, [512])              = 0
Waiting for device (parent + 0 partitions) to appear...
Found root partition, writable of type btrfs at #-1 (/dev/block/7:9)
ioctl(5, LOOP_CLR_FD)                   = 0
ioctl(3, LOOP_CTL_REMOVE, 9)            = -1 EBUSY (Device or resource busy)
Failed to remove loop device: Device or resource busy

This seems to be clear race condition, and attaching strace is generally enough
to "win" the race. But even with strace attached, we will fail occasionally.
Let's wait a bit and retry. With the wait, on my machine, the second attempt
always succeeds:

...
Found root partition, writable of type btrfs at #-1 (/dev/block/7:9)
ioctl(5, LOOP_CLR_FD)                   = 0
ioctl(3, LOOP_CTL_REMOVE, 9)            = -1 EBUSY (Device or resource busy)
ioctl(3, LOOP_CTL_REMOVE, 9)            = 9
+++ exited with 0 +++

Without the wait, all 64 attempts will occasionally fail.

4 years agoshared/loop-util: fix error handling in loop_device_make_full()
Zbigniew Jędrzejewski-Szmek [Fri, 6 Dec 2019 10:10:10 +0000 (11:10 +0100)] 
shared/loop-util: fix error handling in loop_device_make_full()

The function no longer returns the fd. This complicated semantics, because it
wasn't clear what holds the ownership: the return value or the output
parameter.  There were no users of the fd in the return value, so let's
simplify things conceptually and only return the fd once.

Reduce the scope of variables.

LOOP_CLR_FD was called on the wrong fd. Let's use a cleanup function to make
this automatic and reduce chances of a mixup in the future.

CID 1408498.

4 years agosd-netlink: support IFLA_PROP_LIST and IFLA_ALT_IFNAME attributes
Yu Watanabe [Sun, 15 Dec 2019 11:57:51 +0000 (20:57 +0900)] 
sd-netlink: support IFLA_PROP_LIST and IFLA_ALT_IFNAME attributes

4 years agolinux: update headers
Yu Watanabe [Sun, 15 Dec 2019 11:25:25 +0000 (20:25 +0900)] 
linux: update headers

4 years agoAdd Acer Spin 1 SP111-33 to sensor hwdb
Jin Park [Sun, 15 Dec 2019 03:10:51 +0000 (12:10 +0900)] 
Add Acer Spin 1 SP111-33 to sensor hwdb

4 years agohwdb: Add accel orientation quirk for Thundersoft TST168 tablet
Hans de Goede [Fri, 13 Dec 2019 12:01:02 +0000 (13:01 +0100)] 
hwdb: Add accel orientation quirk for Thundersoft TST168 tablet

Add a quirk to fix the accelerometer orientation on the Thundersoft
TST168 tablet.

4 years agotest-network: add a test case for new FQ settings 14337/head
Yu Watanabe [Fri, 13 Dec 2019 12:12:41 +0000 (21:12 +0900)] 
test-network: add a test case for new FQ settings

4 years agoshared/install: provide a nicer error message for invalid WantedBy=/Required= values
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 17:36:29 +0000 (18:36 +0100)] 
shared/install: provide a nicer error message for invalid WantedBy=/Required= values

$ build/systemctl --user cat badinstall
 # /home/zbyszek/.config/systemd/user/badinstall.service
[Service]
ExecStart=true

[Install]
WantedBy=asdf

$ build/systemctl --user enable badinstall
Failed to enable unit: "asdf" is not a valid unit name.

Fixes #4209.

4 years agoshared/install: remove duplicated check
Zbigniew Jędrzejewski-Szmek [Fri, 13 Dec 2019 17:42:54 +0000 (18:42 +0100)] 
shared/install: remove duplicated check

install_info_add() does the exact same check.

4 years agonetwork: tc: add more settings for FQ
Yu Watanabe [Fri, 13 Dec 2019 11:55:33 +0000 (20:55 +0900)] 
network: tc: add more settings for FQ