]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #19124 from takaswie/topic/fw-audio-entries
Lennart Poettering [Fri, 23 Apr 2021 09:31:34 +0000 (11:31 +0200)] 
Merge pull request #19124 from takaswie/topic/fw-audio-entries

hwdb/rule: add database and rules for known audio  and music unit in IEEE 1394 bus

3 years agoAdd D-Bus property exposing Ctrl-Alt-Delete action (#19217)
Flos Lonicerae [Fri, 23 Apr 2021 07:57:14 +0000 (15:57 +0800)] 
Add D-Bus property exposing Ctrl-Alt-Delete action (#19217)

3 years agoMerge pull request #19392 from yuwata/network-dhcp-split-link_set_dhcp_routes
Yu Watanabe [Thu, 22 Apr 2021 23:32:46 +0000 (08:32 +0900)] 
Merge pull request #19392 from yuwata/network-dhcp-split-link_set_dhcp_routes

network: split link_set_dhcp_routes() into smaller functions

3 years agoMerge pull request #19336 from pdmorrow/reloading_restart
Lennart Poettering [Thu, 22 Apr 2021 14:39:06 +0000 (16:39 +0200)] 
Merge pull request #19336 from pdmorrow/reloading_restart

core,test: services in reloading state should exit without waiting TimeoutStartSec

3 years agoMerge pull request #19346 from mihajlov/dhcp_broadcast_l3
Dimitri John Ledkov [Thu, 22 Apr 2021 13:22:50 +0000 (14:22 +0100)] 
Merge pull request #19346 from mihajlov/dhcp_broadcast_l3

network: enable DHCP broadcast flag if required by interface

3 years agoMerge pull request #19390 from poettering/repart-copy-fixes
Luca Boccassi [Thu, 22 Apr 2021 13:06:10 +0000 (14:06 +0100)] 
Merge pull request #19390 from poettering/repart-copy-fixes

repart: fix CopyFiles= corner case when copying into root dir of newly formatted fs

3 years agodissect: fix two minor typos in comments
Lennart Poettering [Thu, 22 Apr 2021 12:34:53 +0000 (14:34 +0200)] 
dissect: fix two minor typos in comments

3 years agoboot/efi: compile on riscv64
Emil Renner Berthing [Thu, 22 Apr 2021 07:33:51 +0000 (09:33 +0200)] 
boot/efi: compile on riscv64

This makes systemd-boot compile against the latest gnu-efi which
just added support for riscv64.

3 years agodissect-image: prefer PARTN= uevent property over "partition" sysfs attr
Lennart Poettering [Thu, 22 Apr 2021 09:31:14 +0000 (11:31 +0200)] 
dissect-image: prefer PARTN= uevent property over "partition" sysfs attr

The kernel will send us a PARTN= uevent proprty with partition add
events, let's use it instead of going for the "partition" sysfs attr.
It's less racy that way and there are reports the sysfs attr shows up
after the device, which makes it evern worse.

3 years agotest: add a test to cover restarting services in reloading state 19336/head
Peter Morrow [Tue, 13 Apr 2021 16:22:52 +0000 (17:22 +0100)] 
test: add a test to cover restarting services in reloading state

Cover the case where a service is recovered out of reloading state via
a restart Restart= configuration.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
3 years agocore: allow services stuck in reloading state to exit
Peter Morrow [Tue, 13 Apr 2021 16:20:42 +0000 (17:20 +0100)] 
core: allow services stuck in reloading state to exit

If a service is in reloading state but has exited do not delay
the final exit until the service reload timer expires. Instead allow
the service to exit immediately since we can't expect the service to
ever transition out of reloading state.

For example if a service sent RELOADING=1 but crashed before it could
send READY=1 then it should be restarted if the service had
Restart= configured.

Signed-off-by: Peter Morrow <pemorrow@linux.microsoft.com>
3 years agofix: point to the correct drop-ins subdirectory for confs
Jóhann B. Guðmundsson [Wed, 21 Apr 2021 21:09:29 +0000 (21:09 +0000)] 
fix: point to the correct drop-ins subdirectory for confs

3 years agogpt: we actually honour the ReadOnly= flag on XBOOTLDR partitions too
Lennart Poettering [Wed, 21 Apr 2021 15:38:21 +0000 (17:38 +0200)] 
gpt: we actually honour the ReadOnly= flag on XBOOTLDR partitions too

The partition type is defined in our Discoverable Partition Spec, and we
honour the flag for it, hence allow setting it too.

3 years agonetwork: dhcp4: simplify link_set_dns_routes() 19392/head
Yu Watanabe [Sun, 11 Apr 2021 23:48:29 +0000 (08:48 +0900)] 
network: dhcp4: simplify link_set_dns_routes()

3 years agonetwork: dhcp4: introduce link_set_dhcp_gateway() and link_set_dhcp_route_to_gateway()
Yu Watanabe [Sun, 11 Apr 2021 23:43:09 +0000 (08:43 +0900)] 
network: dhcp4: introduce link_set_dhcp_gateway() and link_set_dhcp_route_to_gateway()

3 years agonetwork: dhcp4: introduce link_set_dhcp_static_routes()
Yu Watanabe [Sun, 11 Apr 2021 23:22:24 +0000 (08:22 +0900)] 
network: dhcp4: introduce link_set_dhcp_static_routes()

3 years agonetwork: dhcp4: introduce link_set_dhcp_prefix_route()
Yu Watanabe [Sun, 11 Apr 2021 10:11:26 +0000 (19:11 +0900)] 
network: dhcp4: introduce link_set_dhcp_prefix_route()

3 years agorepart: don't try to extract directory of root dir when copying directories 19390/head
Lennart Poettering [Wed, 21 Apr 2021 21:23:07 +0000 (23:23 +0200)] 
repart: don't try to extract directory of root dir when copying directories

It's OK to specify the root dir as target directory when copying
directories. However, in that case path_extract_filename() is going to
fail, because the root dir simply has not filename.

Let's address that by moving the call further down into the loop, when
we made sure that the target dir doesn't exist yet (the root dir always
exists, hence this check is sufficient).

Moreover, in the branch for copying regular files, also move the calls
down, and generate friendly error messages in case people try to
overwrite dirs with regular files (and the root dir is just a special
case of a dir).

Altogether this makes CopyFiles=/some/place:/ work, i.e. copying some
dir on the host into the root dir of the newly created fs. Previously
this would fail with an error about the inability to extract a filename
from "/", needlessly.

3 years agorepart: don't use basename() when we called path_extract_filename() anyway already
Lennart Poettering [Wed, 21 Apr 2021 21:22:26 +0000 (23:22 +0200)] 
repart: don't use basename() when we called path_extract_filename() anyway already

We already have the string, use it.

3 years agorepart: prefix the correct path with root dir in log output
Lennart Poettering [Wed, 21 Apr 2021 21:21:21 +0000 (23:21 +0200)] 
repart: prefix the correct path with root dir in log output

When we copy files into the freshly formatted file system, the mount
point prefix must be prepended to the *target* path, not the *source*
path. Not just in code but in the log message about it, too.

3 years agoMerge pull request #19387 from poettering/discoverable-part-fix
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 21:10:48 +0000 (23:10 +0200)] 
Merge pull request #19387 from poettering/discoverable-part-fix

minor doc fixes

3 years agojournald: Retry if posix_fallocate returned -1 (EINTR)
Igor Zhbanov [Tue, 20 Apr 2021 17:22:28 +0000 (17:22 +0000)] 
journald: Retry if posix_fallocate returned -1 (EINTR)

On some conditions (particularly when mobile CPUs are going to sleep),
the posix_fallocate(), which is called when a new journal file is allocated,
can return -1 (EINTR). This is counted as a fatal error. So the journald
closes both old and journals, and simply throwing away further incoming
events, because of no log files open.

Introduce posix_fallocate_loop() that restarts the function in the case
of EINTR. Also let's make code base more uniform by returning negative
values on error.

Fix assert in test-sigbus.c that incorrectly counted positive values as
success. After changing the function return values, that will actually work.

Fixes: #19041
Signed-off-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
3 years agodoc: slightly reorder/improve partition type table 19387/head
Lennart Poettering [Wed, 21 Apr 2021 16:12:25 +0000 (18:12 +0200)] 
doc: slightly reorder/improve partition type table

Let's put swap and generic linux data partitions next to each other, and
clarify they predated this spec.

3 years agodoc: verity partitions may only contain Verity data (fix copypasta)
Lennart Poettering [Wed, 21 Apr 2021 16:10:08 +0000 (18:10 +0200)] 
doc: verity partitions may only contain Verity data (fix copypasta)

3 years agoman: --add was renamed --copy-to when it was merged, fix man page reference to it
Lennart Poettering [Wed, 21 Apr 2021 15:00:45 +0000 (17:00 +0200)] 
man: --add was renamed --copy-to when it was merged, fix man page reference to it

3 years agoMerge pull request #19271 from yuwata/dhcp-duid-uuid
Lennart Poettering [Wed, 21 Apr 2021 19:59:35 +0000 (21:59 +0200)] 
Merge pull request #19271 from yuwata/dhcp-duid-uuid

network: fix issues arround DHCP DUID-UUID

3 years agoMerge pull request #19365 from keszybz/sd_id128_equals
Lennart Poettering [Wed, 21 Apr 2021 19:45:14 +0000 (21:45 +0200)] 
Merge pull request #19365 from keszybz/sd_id128_equals

Add sd_id128_in_set()

3 years agoupdate TODO
Lennart Poettering [Wed, 21 Apr 2021 19:43:33 +0000 (21:43 +0200)] 
update TODO

3 years agoMerge pull request #19381 from poettering/generator-tweaks
Lennart Poettering [Wed, 21 Apr 2021 16:33:05 +0000 (18:33 +0200)] 
Merge pull request #19381 from poettering/generator-tweaks

generator: two minor tweaks

3 years agogenerator: write out special systemd-fsck-usr.service
Lennart Poettering [Wed, 7 Apr 2021 08:57:19 +0000 (10:57 +0200)] 
generator: write out special systemd-fsck-usr.service

So far all file systems where checked by instances of
systemd-fsck@.service, with the exception of the root fs which was
covered by systemd-fsck-root.service. The special handling is necessary
to deal with ordering issues: we typically want the root fs to be
checked before all others, and — weirdly — allow mounting it before the
fsck done (for compat with initrd-less boots).

This adds similar special handling for /usr: if the hierarchy is placed
on a separate file system check it with a special
systemd-fsck-usr.service instead of a regular sysemd-fsck@.service
instance. Reason is again ordering: we want to allow mounting of /usr
without the root fs already being around in the initrd, to cover for
cases where the root fs is created on first boot and thus cannot be
mounted/checked before /usr.

3 years agoMerge pull request #19362 from yuwata/network-dhcp6-pd-log-19354
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 16:20:49 +0000 (18:20 +0200)] 
Merge pull request #19362 from yuwata/network-dhcp6-pd-log-19354

network: dhcp6: add logs about delegated prefix

3 years agoMerge pull request #19370 from mrc0mmand/shellcheck-pt4
Zbigniew Jędrzejewski-Szmek [Wed, 21 Apr 2021 16:14:32 +0000 (18:14 +0200)] 
Merge pull request #19370 from mrc0mmand/shellcheck-pt4

More shellcheck shenanigans

3 years agonetwork: enable DHCP broadcast flag if required by interface 19346/head
Viktor Mihajlovski [Wed, 14 Apr 2021 11:01:35 +0000 (13:01 +0200)] 
network: enable DHCP broadcast flag if required by interface

Some interfaces require that the DHCPOFFER message is sent via broadcast
if they can't receive unicast messages before they've been configured
with an IP address.

E.g., s390 ccwgroup network interfaces operating in layer3 mode face
this limitation. This can prevent the interfaces from receiving an
IP address via DHCP, if the have been configured for layer3.

To allow DHCP over such interfaces, we're introducing a new device
property ID_NET_DHCP_BROADCAST which can be set for those.
The networkd DHCP client will check whether this property is set
for an interface, and if so will set the broadcast flag, unless
the network configuration for the interface has an explicit
RequestBroadcast setting.

Besides that, we're adding a udev rule to set this device property
for ccwgroup devices operating in layer3 mode, which is the case
if the ID_NET_DRIVER property is qeth_l3.

Supercedes #18829

3 years agorepart: reword log message 19365/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Apr 2021 13:43:01 +0000 (15:43 +0200)] 
repart: reword log message

The UUID does not exist, a partion with the UUID exists. So let's
say that the UUID is "already used" for clarity.

3 years agopartition,shared/gpt: use sd_id128_in_set()
Zbigniew Jędrzejewski-Szmek [Mon, 19 Apr 2021 13:42:05 +0000 (15:42 +0200)] 
partition,shared/gpt: use sd_id128_in_set()

I was worried that the text size will grow, but apparently that's not the
case:
With --optimization=2:
$ size build/src/shared/libsystemd-shared-248.a.p/gpt.c.o*
   text    data     bss     dec     hex filename
   3674    1104       0    4778    12aa build/src/shared/libsystemd-shared-248.a.p/gpt.c.o.old
   3085    1104       0    4189    105d build/src/shared/libsystemd-shared-248.a.p/gpt.c.o

(I don't understand the generated assembly, even though it seems to work:

Disassembly of section .text.gpt_partition_type_is_usr_verity:

0000000000000000 <gpt_partition_type_is_usr_verity>:

bool gpt_partition_type_is_usr_verity(sd_id128_t id) {
   0:   48 83 ec 08             sub    $0x8,%rsp
        return sd_id128_in_set(id,
   4:   4c 8b 05 00 00 00 00    mov    0x0(%rip),%r8        # b <gpt_partition_type_is_usr_verity+0xb>
   b:   31 c0                   xor    %eax,%eax
   d:   4c 8b 0d 00 00 00 00    mov    0x0(%rip),%r9        # 14 <gpt_partition_type_is_usr_verity+0x14>
  14:   48 8b 15 00 00 00 00    mov    0x0(%rip),%rdx        # 1b <gpt_partition_type_is_usr_verity+0x1b>
  1b:   48 8b 0d 00 00 00 00    mov    0x0(%rip),%rcx        # 22 <gpt_partition_type_is_usr_verity+0x22>
  22:   6a 00                   pushq  $0x0
  24:   6a 00                   pushq  $0x0
  26:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 2c <gpt_partition_type_is_usr_verity+0x2c>
  2c:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 32 <gpt_partition_type_is_usr_verity+0x32>
  32:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 38 <gpt_partition_type_is_usr_verity+0x38>
  38:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 3e <gpt_partition_type_is_usr_verity+0x3e>
  3e:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 44 <gpt_partition_type_is_usr_verity+0x44>
  44:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 4a <gpt_partition_type_is_usr_verity+0x4a>
  4a:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 50 <gpt_partition_type_is_usr_verity+0x50>
  50:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 56 <gpt_partition_type_is_usr_verity+0x56>
  56:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 5c <gpt_partition_type_is_usr_verity+0x5c>
  5c:   ff 35 00 00 00 00       pushq  0x0(%rip)        # 62 <gpt_partition_type_is_usr_verity+0x62>
  62:   e8 00 00 00 00          callq  67 <gpt_partition_type_is_usr_verity+0x67>
  67:   85 c0                   test   %eax,%eax
  69:   0f 95 c0                setne  %al
                               GPT_USR_ARM_VERITY,
                               GPT_USR_ARM_64_VERITY,
                               GPT_USR_IA64_VERITY,
                               GPT_USR_RISCV32_VERITY,
                               GPT_USR_RISCV64_VERITY);
}
  6c:   48 83 c4 68             add    $0x68,%rsp
  70:   c3                      retq
)

3 years agosd-id128: add convenience functions to compare multiple sd_id128_t
Zbigniew Jędrzejewski-Szmek [Mon, 19 Apr 2021 13:36:10 +0000 (15:36 +0200)] 
sd-id128: add convenience functions to compare multiple sd_id128_t

Similar to sd_bus_error_has_names() that was added in
2b07ec316a0e25a3e10c270c7f6baee9e0187bf8.

It is made inline in the hope that the compiler will be able to optimize
all the va_args boilerplate away, and do an efficient comparison when
the arguments are all constants.

3 years agojournald: enforce longer line length limit during "setup" phase of stream protocol
Yangyang Shen [Wed, 24 Mar 2021 13:23:01 +0000 (21:23 +0800)] 
journald: enforce longer line length limit during "setup" phase of stream protocol

This PR made modification on Lennart Poettering's basis. Fix the LineMax's function failure problem.

Signed-off-by: Yangyang Shen <shenyangyang4@huawei.com>
3 years agogenerator: explain why systemd-root-fsck.service exists in a comment 19381/head
Lennart Poettering [Wed, 7 Apr 2021 09:21:50 +0000 (11:21 +0200)] 
generator: explain why systemd-root-fsck.service exists in a comment

3 years agogenerator: exit early when asked to generate fsck unit for / and /usr in initrd
Lennart Poettering [Wed, 7 Apr 2021 09:19:29 +0000 (11:19 +0200)] 
generator: exit early when asked to generate fsck unit for / and /usr in initrd

Let's exit early if we are invoked to generate an fsck unit for the
rootfs or /usr of the initrd itself. The "systemd-root-fsck.service" and
"systemd-usr-fsck.service" units are after all for the host file
systems, and the initrd file hierarchy is from an unpacked cpio anyway.
Hence, this semantically doesn't really make sense, so quickly exit if
we detect this case. This allows us to remove some checks further down
the codepath.

3 years agonetwork: dhcp: constify link_get_duid() 19271/head
Yu Watanabe [Wed, 21 Apr 2021 04:35:57 +0000 (13:35 +0900)] 
network: dhcp: constify link_get_duid()

3 years agonetwork: dhcp: introduce duid_needs_product_uuid() helper function
Yu Watanabe [Wed, 21 Apr 2021 04:21:02 +0000 (13:21 +0900)] 
network: dhcp: introduce duid_needs_product_uuid() helper function

3 years agonetwork: configure non-dhcp configs earlier even DUID-UUID is used by DHCP clients
Yu Watanabe [Sat, 10 Apr 2021 02:47:50 +0000 (11:47 +0900)] 
network: configure non-dhcp configs earlier even DUID-UUID is used by DHCP clients

Previously, if DUID-UUID is used, all configurations are configured
after networkd gets product uuid of machine.

This makes only DHCP clients are delayed, and other configs are
configured earlier.

3 years agonetwork: make IAID and DUID for DHCPv6 configurable explicitly
Yu Watanabe [Sat, 10 Apr 2021 01:24:17 +0000 (10:24 +0900)] 
network: make IAID and DUID for DHCPv6 configurable explicitly

Closes #18996.

3 years agonetwork: move dhcp related conf parsers to networkd-dhcp-common.c
Yu Watanabe [Fri, 9 Apr 2021 11:11:33 +0000 (20:11 +0900)] 
network: move dhcp related conf parsers to networkd-dhcp-common.c

3 years agoMerge pull request #19344 from yuwata/network-route-metric-19028
Yu Watanabe [Wed, 21 Apr 2021 11:51:31 +0000 (20:51 +0900)] 
Merge pull request #19344 from yuwata/network-route-metric-19028

network: add RouteMetric= setting in [Address] and more

3 years agounits: fix repart conditions to run if definitions exist in /sysroot + /sysusr
Lennart Poettering [Wed, 7 Apr 2021 09:22:21 +0000 (11:22 +0200)] 
units: fix repart conditions to run if definitions exist in /sysroot + /sysusr

The systemd-repart code was already smart enough to look for definitions
there, but the unit file conditions made that pointless. Let's fix that.

3 years agodoc: fix typo
Yu Watanabe [Wed, 21 Apr 2021 05:10:18 +0000 (14:10 +0900)] 
doc: fix typo

3 years agoman: mention sd_id128_is_allf(), SD_ID128_ALLF
Zbigniew Jędrzejewski-Szmek [Mon, 19 Apr 2021 13:33:09 +0000 (15:33 +0200)] 
man: mention sd_id128_is_allf(), SD_ID128_ALLF

It was added in 670814387ba8973245c08123e7240669f51a55a8, but not
mentioned in the man pages.

3 years agoman: dedent examples in sd-id128 to 2 columns
Zbigniew Jędrzejewski-Szmek [Mon, 19 Apr 2021 13:09:22 +0000 (15:09 +0200)] 
man: dedent examples in sd-id128 to 2 columns

In man pages, horizontal space it at premium, and everything should
generally be indented with 2 spaces to make it more likely that the
examples fit on a user's screen.

C.f. 798d3a524ea57aaf40cb53858aaa45ec702f012d.

3 years agonetwork: dhcp6: logs about generated addresses in delegated prefix 19362/head
Yu Watanabe [Tue, 20 Apr 2021 01:08:08 +0000 (10:08 +0900)] 
network: dhcp6: logs about generated addresses in delegated prefix

3 years agonetwork: dhcp6: logs about delegated prefixes
Yu Watanabe [Tue, 20 Apr 2021 01:50:36 +0000 (10:50 +0900)] 
network: dhcp6: logs about delegated prefixes

Closes #19354.

3 years agoin-addr-util: introduce 'struct in_addr_prefix' and hash ops for it
Yu Watanabe [Tue, 20 Apr 2021 01:49:21 +0000 (10:49 +0900)] 
in-addr-util: introduce 'struct in_addr_prefix' and hash ops for it

3 years agoin-addr-util: add assertions
Yu Watanabe [Tue, 20 Apr 2021 12:12:22 +0000 (21:12 +0900)] 
in-addr-util: add assertions

3 years agotest-network: update test for RouteMetric= 19344/head
Yu Watanabe [Sat, 17 Apr 2021 18:03:47 +0000 (03:03 +0900)] 
test-network: update test for RouteMetric=

3 years agoman: update explanation about route metric
Yu Watanabe [Sat, 17 Apr 2021 17:37:13 +0000 (02:37 +0900)] 
man: update explanation about route metric

3 years agonetwork: set metric for prefix route of IPv4 link-local address
Yu Watanabe [Sun, 18 Apr 2021 09:34:18 +0000 (18:34 +0900)] 
network: set metric for prefix route of IPv4 link-local address

3 years agonetwork: radv: add RouteMetric= setting in [IPv6Prefix]
Yu Watanabe [Sat, 17 Apr 2021 17:49:15 +0000 (02:49 +0900)] 
network: radv: add RouteMetric= setting in [IPv6Prefix]

3 years agonetwork: dhcp6-pd: add RouteMetric= setting in [DHCPv6PrefixDelegation]
Yu Watanabe [Sat, 17 Apr 2021 17:32:51 +0000 (02:32 +0900)] 
network: dhcp6-pd: add RouteMetric= setting in [DHCPv6PrefixDelegation]

3 years agonetwork: move RouteMetric= from [DHCPv6] to [IPv6AcceptRA]
Yu Watanabe [Sat, 17 Apr 2021 17:31:13 +0000 (02:31 +0900)] 
network: move RouteMetric= from [DHCPv6] to [IPv6AcceptRA]

As the value is used in the routes in RA.

3 years agonetwork: dhcp4: also apply RouteMetric= setting in [DHCPv4] to prefix route
Yu Watanabe [Sat, 17 Apr 2021 17:04:20 +0000 (02:04 +0900)] 
network: dhcp4: also apply RouteMetric= setting in [DHCPv4] to prefix route

3 years agonetwork: add RouteMetric= setting in [Address] section
Yu Watanabe [Sat, 17 Apr 2021 17:02:29 +0000 (02:02 +0900)] 
network: add RouteMetric= setting in [Address] section

3 years agonetwork: show route metric in debug log
Yu Watanabe [Sun, 18 Apr 2021 16:23:54 +0000 (01:23 +0900)] 
network: show route metric in debug log

3 years agosd-netlink: add missing address types
Yu Watanabe [Sat, 17 Apr 2021 16:32:19 +0000 (01:32 +0900)] 
sd-netlink: add missing address types

3 years agoMerge pull request #19371 from poettering/repart-initrd-usr-only
Lennart Poettering [Tue, 20 Apr 2021 21:46:17 +0000 (23:46 +0200)] 
Merge pull request #19371 from poettering/repart-initrd-usr-only

two /sysusr/ changes for repart, split out of #19234

3 years agoMerge pull request #19372 from poettering/repart-initrd-usr-begin
Lennart Poettering [Tue, 20 Apr 2021 21:44:49 +0000 (23:44 +0200)] 
Merge pull request #19372 from poettering/repart-initrd-usr-begin

fstab-generator: mount.usr= handling changes, split out of #19234

3 years agoMerge pull request #19368 from poettering/loop-seqnum
Lennart Poettering [Tue, 20 Apr 2021 21:43:57 +0000 (23:43 +0200)] 
Merge pull request #19368 from poettering/loop-seqnum

loop-util: let's try harder to avoid loopback block device recycle issues

3 years agotools: shellcheck-ify most of the tool scripts 19370/head
Frantisek Sumsal [Tue, 20 Apr 2021 11:02:02 +0000 (13:02 +0200)] 
tools: shellcheck-ify most of the tool scripts

3 years agoman: document new initrd-usr-fs.target 19372/head
Lennart Poettering [Wed, 31 Mar 2021 15:18:25 +0000 (17:18 +0200)] 
man: document new initrd-usr-fs.target

3 years agounits: change order of settings to match order in other similar unit
Lennart Poettering [Sat, 27 Mar 2021 12:47:25 +0000 (13:47 +0100)] 
units: change order of settings to match order in other similar unit

3 years agorepart: use /sysusr/ as --root= default in initrd, if mounted 19371/head
Lennart Poettering [Wed, 7 Apr 2021 09:18:43 +0000 (11:18 +0200)] 
repart: use /sysusr/ as --root= default in initrd, if mounted

3 years agorepart: try harder to find OS prefix
Lennart Poettering [Fri, 26 Mar 2021 15:26:32 +0000 (16:26 +0100)] 
repart: try harder to find OS prefix

This teaches repart to look for the root block device both as the
backing for /sysroot and for /sysusr/usr.

The latter is a new addition, and starts making more sense with the next
commit. It's about supporting systems that are shipped with only a /usr/
fs, but where a root fs is allocated and formatted on first boot via
systemd-repart (or a similar tool). In this case it's useful to be able
to mount the ultimate /usr/ early on without mounting the root fs
right-away (simple because the rootfs might not exist yet, and we need
the repart data encoded in /usr/ to actually format it). Hence, instead
of requiring that we mount /sysroot/ first and /sysroot/usr/ second as
we did so far, let's rearrange things slightly:

1. We mount the /usr/ file system we discover to /sysusr/usr/
2. We mount the root file system we discover to /sysroot/
3. Once both are established we bind mount /sysusr/usr/ to /sysroot/usr/

And that' it. The first two steps can happen in either order, and we can
access /usr/ with or without a rootfs being around.

This commit implements nothing of the above. Instead, it teaches
systemd-repart to check both /sysroot/ and /sysusr/ for repart drop-ins,
and use the first of these hierarchies it finds populated. This way
systemd-repart can be spawned once /usr is mounted and it will work
correctly without root fs having to exist, or we can invoke it when the
root fs is already mounted, where it also will work correctly.

3 years agosrc: shellcheck-ify shell scripts
Frantisek Sumsal [Mon, 19 Apr 2021 16:07:51 +0000 (18:07 +0200)] 
src: shellcheck-ify shell scripts

3 years agofstab-generator: properly order generated mount units before "post" target units
Lennart Poettering [Wed, 7 Apr 2021 09:12:39 +0000 (11:12 +0200)] 
fstab-generator: properly order generated mount units before "post" target units

Let's make sure, that our mount unit are properly ordered before the
"post" target unit even if DefaultDependencies= is used on the target
unit.

3 years agofstab-generator: extend logging a bit
Lennart Poettering [Sat, 27 Mar 2021 12:47:04 +0000 (13:47 +0100)] 
fstab-generator: extend logging a bit

3 years agofstab-generator: if usr= is specified, mount it to /sysusr/usr/ first
Lennart Poettering [Fri, 26 Mar 2021 21:40:40 +0000 (22:40 +0100)] 
fstab-generator: if usr= is specified, mount it to /sysusr/usr/ first

This changes the fstab-generator to handle mounting of /usr/ a bit
differently than before. Instead of immediately mounting the fs to
/sysroot/usr/ we'll first mount it to /sysusr/usr/ and then add a
separate bind mount that mounts it from /sysusr/usr/ to /sysroot/usr/.

This way we can access /usr independently of the root fs, without for
waiting to be mounted via the /sysusr/ hierarchy. This is useful for
invoking systemd-repart while a root fs doesn't exist yet and for
creating it, with partition data read from the /usr/ hierarchy.

This introduces a new generic target initrd-usr-fs.target that may be
used to generically order services against /sysusr/ to become available.

3 years agoci: drop test/TEST-50-DISSECT/deny-list-ubuntu-ci 19368/head
Lennart Poettering [Tue, 20 Apr 2021 15:21:22 +0000 (17:21 +0200)] 
ci: drop test/TEST-50-DISSECT/deny-list-ubuntu-ci

Let's see if this makes the test stable on the CI.

3 years agodissect: ignore udev database entries from before the loopback attachment
Lennart Poettering [Tue, 20 Apr 2021 14:19:27 +0000 (16:19 +0200)] 
dissect: ignore udev database entries from before the loopback attachment

This tries to shorten the race of device reuse a bit more: let's ignore
udev database entries that are older than the time where we started to
use a loopback device.

This doesn't fix the whole loopback device raciness mess, but it makes
the race window a bit shorter.

3 years agoloop-util: track CLOCK_MONOTONIC timestamp immediately before attaching a loopback...
Lennart Poettering [Tue, 20 Apr 2021 14:08:43 +0000 (16:08 +0200)] 
loop-util: track CLOCK_MONOTONIC timestamp immediately before attaching a loopback device

This is similar to the preceding work to store the uevent seqnum, but
this stores the CLOCK_MONOTONIC timestamp.

Why? This allows to validate udev database entries, to determine if they
were created *after* we attached the device.

The uevent seqnum logic allows us to validate uevent, and the timestamp
database entries, hence together we should be able to validate both
sources of truth for us.

(note that this is all racy, just a bit less racy, since we cannot
atomically attach loopback devices and get the timestamp for it, the
same way we can't get the uevent seqnum. Thus is shortens the race
window, but doesn#t close it).

3 years agosd-device: add API to query from when a udev database entry is
Lennart Poettering [Tue, 20 Apr 2021 14:01:53 +0000 (16:01 +0200)] 
sd-device: add API to query from when a udev database entry is

We already store a CLOCK_MONOTONIC timestamp for each device appearance,
let' make this queriable.

This is useful to determine whether a udev device database entry is from
a current appearance of the device or a previous one, by comparing it
with appropriately taken timestamps.

3 years agodissect: ignore old uevents when waiting for loopback partition scan
Lennart Poettering [Tue, 20 Apr 2021 13:57:29 +0000 (15:57 +0200)] 
dissect: ignore old uevents when waiting for loopback partition scan

Let's drop all monitor uevent that were enqueued before we actually
started setting up the device.

This doesn't fix the race, but it makes the race window smaller: since
we cannot determine the uevent seqnum and the loopback attachment
atomically, there's a tiny window where uevents might be generated by
the device which we mistake for being associated with out use of the
loopback device.

3 years agoloop-util: read kernel's uevent seqnum right before attaching a loopback device
Lennart Poettering [Tue, 20 Apr 2021 08:56:38 +0000 (10:56 +0200)] 
loop-util: read kernel's uevent seqnum right before attaching a loopback device

Later, this will allow us to ignore uevents from earlier attachments a
bit better, as we can compare uevent seqnums with this boundary. It's
not a full fix for the race though, since we cannot atomically determine
the uevent and attach the device, but it at least shortens the window a
bit.

3 years agoloop-util: initialize .devno in loop_device_open() too
Lennart Poettering [Tue, 20 Apr 2021 15:10:45 +0000 (17:10 +0200)] 
loop-util: initialize .devno in loop_device_open() too

3 years agoloop-util: port to random_u64_range()
Lennart Poettering [Tue, 20 Apr 2021 08:48:22 +0000 (10:48 +0200)] 
loop-util: port to random_u64_range()

Doesn't matter, but it's a bit easier to read I'd claim.

3 years agoloop-util: make loop_device_make() return fd in all code paths
Lennart Poettering [Tue, 20 Apr 2021 08:46:34 +0000 (10:46 +0200)] 
loop-util: make loop_device_make() return fd in all code paths

Previously, loop_device_make() would return the device fd in one success
code path, but not the other (where' we'd just return 0).
loop_device_open() returns it in all cases.

Hence, let's clean this up, and make sure in all success code paths of
both functions we return it (even though it strictly speaking is
redundant, since we return it in LoopDevice anyway, and currently noone
actually relies on this).

3 years agosd-device: use right clock when comparing initialization usec
Lennart Poettering [Tue, 20 Apr 2021 13:56:03 +0000 (15:56 +0200)] 
sd-device: use right clock when comparing initialization usec

we actually use CLOCK_MONOTONIC for the timestamp, hence when
comparing/subtracting it from the current time, also use
CLOCK_MONOTONIC.

3 years agosd-device: use right type for usec_initialized
Lennart Poettering [Tue, 20 Apr 2021 15:06:21 +0000 (17:06 +0200)] 
sd-device: use right type for usec_initialized

3 years agoupdate TODO
Lennart Poettering [Tue, 20 Apr 2021 13:33:15 +0000 (15:33 +0200)] 
update TODO

3 years agorelay role implementation
Yegor Alexeyev [Mon, 15 Mar 2021 20:19:52 +0000 (21:19 +0100)] 
relay role implementation

3 years agoman: fix typo
Yu Watanabe [Tue, 20 Apr 2021 09:59:24 +0000 (18:59 +0900)] 
man: fix typo

Follow-up for e73309c532999cb15490a78575dd882b24bbe96f.

3 years agodocument DefaultOOMPolicy
Miroslav Suchý [Tue, 20 Apr 2021 08:23:01 +0000 (10:23 +0200)] 
document DefaultOOMPolicy

the `man systemd.service` say:
   Defaults to the setting DefaultOOMPolicy= in systemd-system.conf(5) is set to
but there is no such line in this config.
This is the default value I extracted from
   systemctl show --property=DefaultOOMPolicy

3 years agowifi-util: do not set zero errno to log_debug_errno()
Yu Watanabe [Tue, 20 Apr 2021 00:23:33 +0000 (09:23 +0900)] 
wifi-util: do not set zero errno to log_debug_errno()

3 years agotest: make the test entrypoint scripts shellcheck-compliant
Frantisek Sumsal [Mon, 19 Apr 2021 11:01:59 +0000 (13:01 +0200)] 
test: make the test entrypoint scripts shellcheck-compliant

3 years agomount-util: make umount_and_rmdir_and_freep() cleanup handler deal with NULL
Lennart Poettering [Mon, 19 Apr 2021 20:50:32 +0000 (22:50 +0200)] 
mount-util: make umount_and_rmdir_and_freep() cleanup handler deal with NULL

3 years agoMerge pull request #19096 from poettering/repart-features
Lennart Poettering [Tue, 20 Apr 2021 08:20:22 +0000 (10:20 +0200)] 
Merge pull request #19096 from poettering/repart-features

repart: four new features: CopyBlocks=auto + --image= + ReadOnly=/Flags= + MakeDirectories=

3 years agoshell-completion: use base.lst, not xorg.lst
Peter Hutterer [Tue, 20 Apr 2021 07:09:48 +0000 (17:09 +1000)] 
shell-completion: use base.lst, not xorg.lst

Since 2005 xorg.lst has been the legacy symlink to the real file base.lst.

3 years agoMerge pull request #19356 from zxzax/sd-login-typos
Luca Boccassi [Mon, 19 Apr 2021 21:26:36 +0000 (22:26 +0100)] 
Merge pull request #19356 from zxzax/sd-login-typos

Fix some typos in sd-login header, docs

3 years agoupdate TODO 19096/head
Lennart Poettering [Tue, 23 Mar 2021 18:00:32 +0000 (19:00 +0100)] 
update TODO

3 years agotest: add test for new repart features
Lennart Poettering [Mon, 19 Apr 2021 15:30:33 +0000 (17:30 +0200)] 
test: add test for new repart features

3 years agodissect: ext4 and loopback files are unimpressed by read-only access
Lennart Poettering [Mon, 19 Apr 2021 20:47:33 +0000 (22:47 +0200)] 
dissect: ext4 and loopback files are unimpressed by read-only access

Even if we set up a loopback device read-only and mount it read-only
this means nothing, ext4 will still write through to the backing storage
file.

Yes, I lost 6h debugging time on this.

Apparently, we have to specify "norecovery" when mounting such file
systems, to force them into truly read-only mode. Let's do so.

3 years agorepart: add new ReadOnly= and Flags= settings for repart dropins
Lennart Poettering [Tue, 23 Mar 2021 15:16:42 +0000 (16:16 +0100)] 
repart: add new ReadOnly= and Flags= settings for repart dropins

Let's make the GPT partition flags configurable when creating new
partitions. This is primarily useful for the read-only flag (which we
want to set for verity enabled partitions).

This adds two settings for this: Flags= and ReadOnly=, which strictly
speaking are redundant. The main reason to have both is that usually the
ReadOnly= setting is the one wants to control, and it' more generic.
Moreover we might later on introduce inherting of flags from CopyBlocks=
partitions, where one might want to control most flags as is except for
the RO flag and similar, hence let's keep them separate.