1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 23:51:28 +03:00
Commit Graph

42804 Commits

Author SHA1 Message Date
Lennart Poettering
76b73ce21c man: we support growing xfs too these days 2019-12-17 18:02:04 +01:00
Lennart Poettering
601f91bec5 time-util: deal with systems where userspace has 64bit time_t but kernel does not
Fixes: #14362
2019-12-18 00:38:39 +09:00
Yu Watanabe
e7bdadb5c6 network: support alternative name to get bus path for the link 2019-12-18 00:05:50 +09:00
Yu Watanabe
f7581ed6e0 networkctl: support alternative name to specify interface 2019-12-18 00:05:50 +09:00
Yu Watanabe
4d016e965b udev: sort alternative names
Kernel preserves the order of alternative names. So, for user
visibility, let's sort the alternative names.
2019-12-18 00:05:50 +09:00
Yu Watanabe
b04c5e51da sd-netlink: introduce rtnl_resolve_link_alternative_names() 2019-12-18 00:05:50 +09:00
Lennart Poettering
13b6c4c8de
Merge pull request #14267 from poettering/pkcs11-cryptsetup
just the pkcs11 hookup for classic cryptsetup (/etc/crypttab) split out of the homed PR
2019-12-17 15:30:32 +01:00
Yu Watanabe
6e5df4036f
Merge pull request #14337 from yuwata/network-tc-fq-more
network: tc: introduce more FQ settings
2019-12-17 23:30:10 +09:00
Anita Zhang
1209ef94bd [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
2019-12-17 23:14:53 +09:00
Yu Watanabe
4d92039fce
Merge pull request #14352 from yuwata/sd-netlink-tiny-fixes
sd-netlink: tiny fixes
2019-12-17 23:10:46 +09:00
Yu Watanabe
3267cb45e9
Merge pull request #14208 from poettering/json-homed-prepare
json bits from homed PR
2019-12-17 23:10:08 +09:00
Jan Alexander Steffens (heftig)
05de16766b hwdb: Add Bluetooth-attached Logitech MX Master
Except for the product IDs, the original MX Master appears identical to
the MX Master 2S.
2019-12-17 13:02:28 +01:00
Zbigniew Jędrzejewski-Szmek
0d9ac4ea57
Merge pull request #14360 from yuwata/udev-alternative-names-policy
udev: introduce AlternativeNamesPolicy= setting
2019-12-17 12:13:47 +01:00
Bart Willems
4afb4a9cc5 systemctl: show what verbs support --dry-run in the help page
Signed-off-by: Bart Willems <bwillems@protonmail.com>
2019-12-17 11:08:00 +01:00
Lennart Poettering
c16782577b
Merge pull request #14241 from keszybz/resume-timeout
Bump resume timeout to infinity
2019-12-17 10:34:43 +01:00
Yu Watanabe
6d185cffb1 sd-netlink: add a whitespce between cast operator and variable 2019-12-17 17:36:08 +09:00
Yu Watanabe
f501c25151 sd-netlink: make netlink_container_parse() takes size_t for rt_len
And use another unsigned short variable for RTA_OK() macro.
2019-12-17 17:35:25 +09:00
Yu Watanabe
49f5cbe924 network: set AlternativeNamesPolicy= in 99-default.link 2019-12-17 15:44:48 +09:00
Yu Watanabe
ef1d2c07f9 udev: introduce AlternativeNamesPolicy= setting 2019-12-17 15:44:43 +09:00
Yu Watanabe
bb181dd4a6 udev: do not fail if kernel does not support alternative names 2019-12-17 15:43:50 +09:00
Yu Watanabe
e16f18bddf
Merge pull request #14339 from keszybz/invalid-enablement-logs
Small enhancements to logs for enabling of invalid units
2019-12-17 15:04:14 +09:00
Yu Watanabe
a0f11d1d11 random-util: call initialize_srand() after fork() 2019-12-17 15:03:36 +09:00
Anita Zhang
024941a521
Merge pull request #14351 from yuwata/util-constify-strv-xxx
util: constify arguments of strv_xxx()
2019-12-16 18:08:04 -08:00
Yu Watanabe
78f8849f84 udev: extend the length of ID_NET_NAME_XXX= to ALTIFNAMSIZ 2019-12-17 11:04:11 +09:00
Lennart Poettering
861f178905 efivars: properly NUL terminate EFI variables when reading
A follow-up for 35b9eb0a72.
2019-12-16 15:35:31 +01:00
Thomas Haller
e40b4caa1f 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)
          |            ^
2019-12-16 14:25:31 +01:00
Zbigniew Jędrzejewski-Szmek
b742942edf TODO: drop entry
Implemented in 7d1e91d1a9.
2019-12-16 14:19:49 +01:00
Zbigniew Jędrzejewski-Szmek
e51712963b 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.
2019-12-16 14:19:49 +01:00
Benjamin Dahlhoff
cb180b09fa Added Trekstor Primetab S11B 2019-12-16 11:18:05 +01:00
Yu Watanabe
3771024c24
Merge pull request #14354 from poettering/link-fix
two trivial doc fixes
2019-12-16 18:06:33 +09:00
Lennart Poettering
da7667518b docs: CSS files should not be executable 2019-12-16 09:50:02 +01:00
Lennart Poettering
90d81ee966 github: use systemd.io links in issue template 2019-12-16 09:49:51 +01:00
Lennart Poettering
c84d9b3b71
Merge pull request #14261 from keszybz/loop-utils-and-efivars
Fixes for networkd, shared/loop-util, basic/efivars
2019-12-16 09:27:46 +01:00
Lennart Poettering
3b5cd25f4d
Merge pull request #14196 from keszybz/gpt-auto-generator-debugging
gpt-auto-generator debugging
2019-12-16 09:24:02 +01:00
Lennart Poettering
32b7cdc14c
Merge pull request #14350 from yuwata/network-udev-altnames-support
network, udev: add altname support
2019-12-16 09:15:23 +01:00
Yu Watanabe
479ddcdf5a util: constify arguments of strv_xxx() 2019-12-16 15:51:04 +09:00
Yu Watanabe
7a2f6fb6f1 test-network: pass environment variables to networkctl 2019-12-16 10:56:02 +09:00
Yu Watanabe
6934ace05d test-network: add a test case for netdev altname 2019-12-16 10:56:02 +09:00
Yu Watanabe
511070ee95 networkctl: show alternative names 2019-12-16 10:56:02 +09:00
Yu Watanabe
572b21d96c network: make Name= in [Match] support alternative names of interfaces 2019-12-16 10:55:56 +09:00
Yu Watanabe
a5053a158b udev: support AlternativeName= setting in .link file 2019-12-16 10:52:22 +09:00
Yu Watanabe
4252696aec util: introduce ifname_valid_full() 2019-12-16 10:52:22 +09:00
Yu Watanabe
d08d92d5ee test: add a test for sd_netlink_message_{append,read}_strv() 2019-12-16 10:52:22 +09:00
Yu Watanabe
6d725977c4 sd-netlink: introduce sd_netlink_message_append_strv() 2019-12-16 10:52:22 +09:00
Yu Watanabe
8f3c185966 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.
2019-12-16 10:52:17 +09:00
Zbigniew Jędrzejewski-Szmek
0181314861 shared/loop-util: spin on open() returning ENOENT too
https://github.com/systemd/systemd/pull/14261#discussion_r355001559
2019-12-15 21:06:42 +01:00
Zbigniew Jędrzejewski-Szmek
35b9eb0a72 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.
2019-12-15 21:06:42 +01:00
Zbigniew Jędrzejewski-Szmek
a97abb30e7 shared/efi-loader: add some debugging statements
Should make it easier to figure out why some operations fail...
2019-12-15 21:06:42 +01:00
Zbigniew Jędrzejewski-Szmek
f2d9213fee 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.
2019-12-15 21:06:42 +01:00
Zbigniew Jędrzejewski-Szmek
e8af3bfd63 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.
2019-12-15 21:06:42 +01:00