]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoudev: move declaration of ResolveNameTiming to udev-rules.c 28577/head
Yu Watanabe [Tue, 18 Jul 2023 21:58:19 +0000 (06:58 +0900)] 
udev: move declaration of ResolveNameTiming to udev-rules.c

It is only used by udevd and udevadm, not necessary in src/shared.

This also moves UDEV_NAME_SIZE and friends.

2 years agoudev: move udev_parse_config_full() to udevd.c
Yu Watanabe [Tue, 18 Jul 2023 21:44:37 +0000 (06:44 +0900)] 
udev: move udev_parse_config_full() to udevd.c

Then, rename it to manager_parse_udev_config().

No functional change, just refactoring.

2 years agoudev: rename test-udevd.c -> test-udev-manager.c
Yu Watanabe [Tue, 18 Jul 2023 20:37:35 +0000 (05:37 +0900)] 
udev: rename test-udevd.c -> test-udev-manager.c

2 years agoudev: split udevd.c into two
Yu Watanabe [Tue, 18 Jul 2023 20:17:03 +0000 (05:17 +0900)] 
udev: split udevd.c into two

2 years agoudev: move arg_xyz into Manager
Yu Watanabe [Tue, 18 Jul 2023 20:15:57 +0000 (05:15 +0900)] 
udev: move arg_xyz into Manager

No functional changes, just preparation for later commits.

2 years agoudev: drop mostly unused Manager.pid
Yu Watanabe [Tue, 18 Jul 2023 18:16:38 +0000 (03:16 +0900)] 
udev: drop mostly unused Manager.pid

It is only used by the assertion in event_queue_insert().
We have similar check e.g. in sd-bus or sd-event, but udevd.c is not a
library code, hence such check is not necessary.

2 years agoudev: merge manager_clear_for_worker() with manager_free()
Yu Watanabe [Tue, 18 Jul 2023 18:09:12 +0000 (03:09 +0900)] 
udev: merge manager_clear_for_worker() with manager_free()

The function manager_clear_for_worker() is now not called by workers,
and only called from manager_free(). Let's merge them.

This also drops unused Manager.rtnl, and outdated comment in
event_free().

2 years agoudev: split-out worker code from udevd.c
Yu Watanabe [Tue, 18 Jul 2023 17:11:16 +0000 (02:11 +0900)] 
udev: split-out worker code from udevd.c

While doing that, the Manager object allocated by the main process
is now _not_ freed in the spawned worker process, to follow our usual
coding style. See discussion in #24043.

2 years agoudev: move several functions from udev-util.c to relevant udevd source files
Yu Watanabe [Tue, 18 Jul 2023 07:10:36 +0000 (16:10 +0900)] 
udev: move several functions from udev-util.c to relevant udevd source files

The functions are only used by udevd (and relevant tests), hence it is
not necessary to be in src/shared.

2 years agoudev: rename test-udev-event.c -> test-udev-spawn.c
Yu Watanabe [Tue, 18 Jul 2023 14:39:04 +0000 (23:39 +0900)] 
udev: rename test-udev-event.c -> test-udev-spawn.c

2 years agoudev: split-out formatter and spawning commands from udev-event.c
Yu Watanabe [Tue, 18 Jul 2023 14:10:41 +0000 (23:10 +0900)] 
udev: split-out formatter and spawning commands from udev-event.c

No functional changes, just refactoring.

2 years agoudev: move DEVICE_TRACE() to udev-trace.h
Yu Watanabe [Tue, 18 Jul 2023 14:10:32 +0000 (23:10 +0900)] 
udev: move DEVICE_TRACE() to udev-trace.h

It is only used by udevd, and not necessary in src/shared.

2 years agomeson: sort files
Yu Watanabe [Tue, 18 Jul 2023 14:12:52 +0000 (23:12 +0900)] 
meson: sort files

2 years agoudev-util: drop udev_queue_init() from shared
Yu Watanabe [Tue, 18 Jul 2023 06:55:12 +0000 (15:55 +0900)] 
udev-util: drop udev_queue_init() from shared

It is only used in libudev, let's move it.

2 years agoMerge pull request #28596 from keszybz/doc-updates
Luca Boccassi [Mon, 31 Jul 2023 10:11:11 +0000 (11:11 +0100)] 
Merge pull request #28596 from keszybz/doc-updates

Two documentation updates

2 years agoman/systemd.service: advise Type=exec instead of Type=simple 28596/head
Zbigniew Jędrzejewski-Szmek [Sun, 30 Jul 2023 10:11:33 +0000 (12:11 +0200)] 
man/systemd.service: advise Type=exec instead of Type=simple

The descriptions of various options are reworked: first say what protocol
actually is, i.e. describe what type of notification the manager waits
for. Only after that describe various steps and things the service should
do. Also, apply some paragraph breaks.

Instead of recommending Type=simple, recommend Type=exec. Say explicitly that
Type=simple, Type=forking are not recommended. Type=simple ignores failure in a
way that doesn't make any sense except as a historical accident. We introduced
'exec' instead of changing 'simple' to keep backwards-compatiblity, but
'simple' is not very useful. 'forking' works, but is inefficient: correctly
programming the interface requires a lot of work, and at runtime, the
additional one or two forks are just a waste of CPU resources. Furthermore, we
now understand that because of COW traps, they may also increase memory
requirements. There is really no reason to use 'forking', except if it's
already implemented and the code cannot be changed to use 'notify'.

Also, remove the recommendations to use Type=simple to avoid delaying boot. In
most cases, if the service can support notifications about startup, those
should be done.

Overall, for new services, "notify", "notify-reload", and "dbus" are the
types that make sense.

2 years agosystemd-battery-check: provide more debug logs
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jul 2023 17:29:33 +0000 (19:29 +0200)] 
systemd-battery-check: provide more debug logs

The logs would give no hint about the answer to most interesting question: why
we decided to return true or false from the program. If we find batteries
that are low or uncertain, log at info level.

2 years agoMerge pull request #28474 from yuwata/chase-fix
Daan De Meyer [Mon, 31 Jul 2023 08:46:19 +0000 (10:46 +0200)] 
Merge pull request #28474 from yuwata/chase-fix

chase: handle ".." more carefully

2 years agoNEWS: fix misstatement
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jul 2023 17:28:55 +0000 (19:28 +0200)] 
NEWS: fix misstatement

We don't have type 'ready'.

2 years agoMerge pull request #28595 from medhefgo/elf2efi-fixes
Luca Boccassi [Sun, 30 Jul 2023 23:07:28 +0000 (00:07 +0100)] 
Merge pull request #28595 from medhefgo/elf2efi-fixes

elf2efi: Fixes

2 years agoMerge pull request #28269 from yuwata/udev-builtin-net_id-cleanups-part1
Luca Boccassi [Sun, 30 Jul 2023 22:56:54 +0000 (23:56 +0100)] 
Merge pull request #28269 from yuwata/udev-builtin-net_id-cleanups-part1

udev: cleanups and several fixes for net_id builtin

2 years agoMerge pull request #28567 from yuwata/meson-versiondep
Luca Boccassi [Sun, 30 Jul 2023 22:40:51 +0000 (23:40 +0100)] 
Merge pull request #28567 from yuwata/meson-versiondep

meson:  cleanups for version dependency

2 years agostub: Also reserve sections for EFI stub 28595/head
Jan Janssen [Sun, 30 Jul 2023 19:05:24 +0000 (21:05 +0200)] 
stub: Also reserve sections for EFI stub

The stub image may not have enough sections to cause enough PE header
space to be free for later expansion. Given that the stub is guaranteed
to be expanded we should always reserve enough sections for it.

This also bumps the reservation to 15. It doesn't add more space
compared to current builds but it more closely reflects the amount of
sections that a UKI could have in total if all optional sections are
used.

Fixes: #28593
2 years agoelf2efi: Fix header size calculation
Jan Janssen [Sun, 30 Jul 2023 18:59:04 +0000 (20:59 +0200)] 
elf2efi: Fix header size calculation

The PE header size calculation failed to take the PE magic and coff
header size into account, which will lead to header truncation if we are
writing only 5 sections.

2 years agoMerge pull request #28573 from yuwata/network-address-next-part2
Yu Watanabe [Sun, 30 Jul 2023 19:14:16 +0000 (04:14 +0900)] 
Merge pull request #28573 from yuwata/network-address-next-part2

network: make Address object more consistent with assigned address

2 years agotest-network: add testcase for overriding Address.RouteMetric= 28573/head
Yu Watanabe [Sun, 9 Jul 2023 00:54:25 +0000 (09:54 +0900)] 
test-network: add testcase for overriding Address.RouteMetric=

For issue #25843.

2 years agonetwork/address: also save/update priority of prefix route
Yu Watanabe [Sun, 9 Jul 2023 03:36:34 +0000 (12:36 +0900)] 
network/address: also save/update priority of prefix route

Strictly speaking, this is not necessary, but let's make the managed
Address objects more consistent with the kernel's addresses.

2 years agonetwork/address: introduce address_get_harder() and use it where appropriate
Yu Watanabe [Tue, 11 Jul 2023 03:11:18 +0000 (12:11 +0900)] 
network/address: introduce address_get_harder() and use it where appropriate

With the previous change, now Address objects under requesting are not
owned by Link object, hence we need to also search corresponding Address
object in the request queue.

2 years agonetwork/address: do not add Address object to Link on requesting
Yu Watanabe [Sat, 8 Jul 2023 23:42:25 +0000 (08:42 +0900)] 
network/address: do not add Address object to Link on requesting

Then, all addresses managed by a link really exist (unless the kernel
silently removes addresses).
By this change, now Address objects managed by Link and owned by Request
are decoupled, and always requested settings will be applied.

Fixes #25843.

2 years agonetwork/address: make Address object more consistent with assigned address
Yu Watanabe [Sat, 8 Jul 2023 06:40:57 +0000 (15:40 +0900)] 
network/address: make Address object more consistent with assigned address

This makes `manager_rtnl_process_address()`
- first read minimal information to get managed Address object,
- then update the managed Address object directly.

Previously, we updated the Address object managed by Link partially,
e.g. peer address did not updated.
This makes the managed Address object more consistent with the assigned
address.

2 years agonetwork: fix typo
Yu Watanabe [Sun, 30 Jul 2023 17:08:24 +0000 (02:08 +0900)] 
network: fix typo

Follow-up for bbeceaf2956f6cc12d75d2dc571cfc9fb1d9d839.

2 years agoresolved: added show-server-state verb and DumpStatistics varlink method
Kiran Vemula [Fri, 7 Jul 2023 12:39:20 +0000 (18:09 +0530)] 
resolved: added show-server-state verb and DumpStatistics  varlink method

Added show-server-state verb to resolvectl
Added DumpStatistics and ResetStatistics  methods to varlink

2 years agoMerge pull request #28591 from yuwata/network-neighbor-next
Yu Watanabe [Sun, 30 Jul 2023 16:42:39 +0000 (01:42 +0900)] 
Merge pull request #28591 from yuwata/network-neighbor-next

network/neighbor: follow the kernel's way how to manage neighbors

2 years agoMerge pull request #28575 from yuwata/network-address-next-part3
Yu Watanabe [Sun, 30 Jul 2023 15:59:31 +0000 (00:59 +0900)] 
Merge pull request #28575 from yuwata/network-address-next-part3

network: check specified address settings in more detail

2 years agoMerge pull request #28572 from yuwata/network-ipv4acd
Yu Watanabe [Sun, 30 Jul 2023 15:58:54 +0000 (00:58 +0900)] 
Merge pull request #28572 from yuwata/network-ipv4acd

network: split-out sd_ipv4acd object management from Address object

2 years agotmpfiles.d: adjust /dev/vfio/vfio access mode
Frantisek Sumsal [Sun, 30 Jul 2023 13:21:31 +0000 (15:21 +0200)] 
tmpfiles.d: adjust /dev/vfio/vfio access mode

kmod-static-nodes.service sets the mode to 0600, but we want it
to be 0666 as specified in 50-udev-default.rules.

Resolves: #28588

2 years agotest-network: add tests for several invalid neighbor settings, and overriding settings 28591/head
Yu Watanabe [Mon, 10 Jul 2023 03:16:51 +0000 (12:16 +0900)] 
test-network: add tests for several invalid neighbor settings, and overriding settings

This also makes the checks stricter.

2 years agonetwork/neighbor: do not add Neighbor object to Link on requesting
Yu Watanabe [Mon, 10 Jul 2023 01:12:10 +0000 (10:12 +0900)] 
network/neighbor: do not add Neighbor object to Link on requesting

Then, all neighbors managed by a link really exist (unless the kernel
silently removes neighbors).

2 years agoMerge pull request #28428 from ldv-alt/ERRNO_IS
Luca Boccassi [Sun, 30 Jul 2023 15:31:16 +0000 (16:31 +0100)] 
Merge pull request #28428 from ldv-alt/ERRNO_IS

treewide: cleanup use of ERRNO_IS_*(r)

2 years agonetwork/neighbor: follow the way how kernel distinguish neighbor settings
Yu Watanabe [Mon, 10 Jul 2023 02:30:11 +0000 (11:30 +0900)] 
network/neighbor: follow the way how kernel distinguish neighbor settings

The kernel manages neighbors by the destination address, and the
LinkLayerAddress is mutable. Let's manage neighbors in the same way, and
dedup settings.

2 years agonetwork/neighbor: skip to request neighbors with unmatching link layer address length
Yu Watanabe [Mon, 10 Jul 2023 02:55:25 +0000 (11:55 +0900)] 
network/neighbor: skip to request neighbors with unmatching link layer address length

2 years agonetwork/ipv4acd: split out sd_ipv4acd management from Address to Link 28572/head
Yu Watanabe [Sun, 30 Jul 2023 14:16:41 +0000 (23:16 +0900)] 
network/ipv4acd: split out sd_ipv4acd management from Address to Link

Then, we can start IPv4ACD without adding corresponding Address object
to Link.

Hopefully, no functional change, just refactoring and preparation for
later commits.

2 years agoin-addr-util: introduce PTR_TO_IN4_ADDR() and IN4_ADDR_TO_PTR()
Yu Watanabe [Sat, 8 Jul 2023 03:23:27 +0000 (12:23 +0900)] 
in-addr-util: introduce PTR_TO_IN4_ADDR() and IN4_ADDR_TO_PTR()

These should be useful when an IPv4 address is used as a key of a
hashmap.

2 years agosd-ipv4acd: introduce sd_ipv4acd_is_bound()
Yu Watanabe [Sat, 8 Jul 2023 03:24:57 +0000 (12:24 +0900)] 
sd-ipv4acd: introduce sd_ipv4acd_is_bound()

2 years agonetwork/ipv4acd: drop unused argument
Yu Watanabe [Sat, 8 Jul 2023 05:24:41 +0000 (14:24 +0900)] 
network/ipv4acd: drop unused argument

2 years agonetwork/ipv4acd: use IN4_ADDR_TO_STRING()
Yu Watanabe [Sat, 8 Jul 2023 03:31:25 +0000 (12:31 +0900)] 
network/ipv4acd: use IN4_ADDR_TO_STRING()

2 years agonetwork/address: ignore address settings with unsupported flags 28575/head
Yu Watanabe [Tue, 11 Jul 2023 02:07:21 +0000 (11:07 +0900)] 
network/address: ignore address settings with unsupported flags

2 years agonetwork/address: drop IPv6 settings when the kernel does not support IPv6
Yu Watanabe [Mon, 10 Jul 2023 03:32:40 +0000 (12:32 +0900)] 
network/address: drop IPv6 settings when the kernel does not support IPv6

2 years agonetwork: ndisc - Honour CurHopLimit
Susant Sahani [Tue, 18 Jul 2023 14:42:46 +0000 (20:12 +0530)] 
network: ndisc - Honour CurHopLimit

RFC4861 Neighbor Discovery – Sections 4.2 and 6.3.4

From section 4.2. Router Advertisement Message Format:

Cur Hop Limit        8-bit unsigned integer.  The default value that
                     should be placed in the Hop Count field of the IP
                     header for outgoing IP packets.  A value of zero
                     means unspecified (by this router).

2 years agonetwork/address: merge address_needs_to_set_broadcast() with address_get_broadcast()
Yu Watanabe [Tue, 11 Jul 2023 01:53:27 +0000 (10:53 +0900)] 
network/address: merge address_needs_to_set_broadcast() with address_get_broadcast()

No functional change, preparation for later commits.

2 years agoMerge pull request #28574 from yuwata/network-queue-next
Luca Boccassi [Sun, 30 Jul 2023 13:27:43 +0000 (14:27 +0100)] 
Merge pull request #28574 from yuwata/network-queue-next

network/queue: preparations

2 years agoMerge pull request #28571 from yuwata/network-address-next-part1
Luca Boccassi [Sun, 30 Jul 2023 13:01:53 +0000 (14:01 +0100)] 
Merge pull request #28571 from yuwata/network-address-next-part1

network: several trivial cleanups

2 years agonetwork/neighbor: drop IPv6 settings when the kernel does not support IPv6
Yu Watanabe [Mon, 10 Jul 2023 02:54:33 +0000 (11:54 +0900)] 
network/neighbor: drop IPv6 settings when the kernel does not support IPv6

2 years agonetwork: rename sd_netlink_message* req -> m
Yu Watanabe [Mon, 10 Jul 2023 01:06:08 +0000 (10:06 +0900)] 
network: rename sd_netlink_message* req -> m

This also merges neighbor_configure_message() with neighbor_configure().

2 years agoMerge pull request #28564 from YHNdnzj/gpt-auto-kill-more-duplicate
Yu Watanabe [Sat, 29 Jul 2023 23:59:50 +0000 (08:59 +0900)] 
Merge pull request #28564 from YHNdnzj/gpt-auto-kill-more-duplicate

gpt-auto: don't mount ESP if there's an fstab entry for it

2 years agomeson: use kwargs to declare efi binaries
Yu Watanabe [Sun, 25 Jun 2023 22:11:53 +0000 (07:11 +0900)] 
meson: use kwargs to declare efi binaries

No functional change, just refactoring.

2 years agoanalyze: fix pcrs verb output without TPM support
Frantisek Sumsal [Sat, 29 Jul 2023 19:04:44 +0000 (21:04 +0200)] 
analyze: fix pcrs verb output without TPM support

If we don't have TPM support then `alg` is NULL and passing this to
table_new() means we'd get a table with only two columns instead of
three, leading up to a very confusing output:

$ build/systemd-analyze pcrs
System lacks full TPM2 support, not showing PCR state.
                 NR NAME
                  0 platform-code
                  - 1
    platform-config -
                  2 external-code
                  - 3
    external-config -
                  4 boot-loader-code
                  - 5
 boot-loader-config -
                  6 -
                  - 7
...

Let's name the header in this case with a simple dash, as it's going
to be hidden anyway, to make the table nice again:

$ build/systemd-analyze pcrs
System lacks full TPM2 support, not showing PCR state.
NR NAME
 0 platform-code
 1 platform-config
 2 external-code
 3 external-config
 4 boot-loader-code
 5 boot-loader-config
 6 -
 7 secure-boot-policy
...

2 years agomeson: unconditionally add version dependency for all executables and libraries 28567/head
Yu Watanabe [Sat, 29 Jul 2023 13:28:58 +0000 (22:28 +0900)] 
meson: unconditionally add version dependency for all executables and libraries

Otherwise, we can easily forget the dependency.
No functional change, just refactoring.

2 years agotree-wide: drop unnecessary inclusion of version.h
Yu Watanabe [Tue, 27 Jun 2023 21:08:47 +0000 (06:08 +0900)] 
tree-wide: drop unnecessary inclusion of version.h

2 years agoboot: always set SBAT_DISTRO_VERSION
Yu Watanabe [Sat, 29 Jul 2023 13:42:27 +0000 (22:42 +0900)] 
boot: always set SBAT_DISTRO_VERSION

2 years agomeson: drop short script to generate vcs tag
Yu Watanabe [Sat, 29 Jul 2023 13:41:43 +0000 (22:41 +0900)] 
meson: drop short script to generate vcs tag

2 years agotree-wide: fix typo
Yu Watanabe [Sat, 29 Jul 2023 15:23:28 +0000 (00:23 +0900)] 
tree-wide: fix typo

2 years agonetwork/queue: detach request from queue when netlink reply received 28574/head
Yu Watanabe [Sat, 8 Jul 2023 22:06:24 +0000 (07:06 +0900)] 
network/queue: detach request from queue when netlink reply received

Then, we can find and use the Request object after sending netlink
message.

Preparation for later commits.

2 years agonetwork/queue: free assigned userdata only when a new request is queued
Yu Watanabe [Mon, 10 Jul 2023 01:27:09 +0000 (10:27 +0900)] 
network/queue: free assigned userdata only when a new request is queued

2 years agonetwork/address: split-out address_match_null() 28571/head
Yu Watanabe [Sat, 8 Jul 2023 22:10:57 +0000 (07:10 +0900)] 
network/address: split-out address_match_null()

No functional change, preparation for later commits.

2 years agonetwork: drop unnecessary conditions
Yu Watanabe [Mon, 10 Jul 2023 00:38:38 +0000 (09:38 +0900)] 
network: drop unnecessary conditions

When link_get_by_index() succeeds, the result is always non-NULL.

2 years agonetwork: use address_remove_and_drop()
Yu Watanabe [Mon, 10 Jul 2023 00:30:58 +0000 (09:30 +0900)] 
network: use address_remove_and_drop()

2 years agonetwork/address: free Address object by caller that passed to link_request_address()
Yu Watanabe [Sat, 8 Jul 2023 22:15:21 +0000 (07:15 +0900)] 
network/address: free Address object by caller that passed to link_request_address()

Follow-up for 9684a8ded083dd427f843b0c40aa0292e6c7ae06.

Now, the input Address object is always copied, hence it is not
necessary to free it in link_request_address().

2 years agoudev-builtin-net_id: make parse_hotplug_slot_from_function_id() always set return... 28269/head
Yu Watanabe [Thu, 22 Sep 2022 05:55:47 +0000 (14:55 +0900)] 
udev-builtin-net_id: make parse_hotplug_slot_from_function_id() always set return value on success

This also updates comment in the code.

2 years agoudev-builtin-net_id: make names_xen() self-contained
Yu Watanabe [Tue, 27 Sep 2022 08:01:23 +0000 (17:01 +0900)] 
udev-builtin-net_id: make names_xen() self-contained

It is not necessary to store its partial result into NetNames.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: use sd_device_get_sysnum() to get index of netdevsim
Yu Watanabe [Wed, 28 Sep 2022 09:00:17 +0000 (18:00 +0900)] 
udev-builtin-net_id: use sd_device_get_sysnum() to get index of netdevsim

2 years agoudev-builtin-net_id: make names_netdevsim() self-contained
Yu Watanabe [Tue, 27 Sep 2022 07:55:09 +0000 (16:55 +0900)] 
udev-builtin-net_id: make names_netdevsim() self-contained

It is not necessary to store its partial result into NetNames.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: do not assume the current ifname is ethX
Yu Watanabe [Thu, 29 Sep 2022 08:26:42 +0000 (17:26 +0900)] 
udev-builtin-net_id: do not assume the current ifname is ethX

Otherwise, `udevadm test-builtin` may not work.

2 years agoudev-builtin-net_id: make names_platform() self-contained
Yu Watanabe [Tue, 27 Sep 2022 07:44:29 +0000 (16:44 +0900)] 
udev-builtin-net_id: make names_platform() self-contained

It is not necessary to store its partial result into NetNames.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: do not assume the current interface name is ethX
Yu Watanabe [Wed, 28 Sep 2022 09:40:41 +0000 (18:40 +0900)] 
udev-builtin-net_id: do not assume the current interface name is ethX

Otherwise, `udevadm test-builtin` does not work as expected.

2 years agoudev-builtin-net_id: make names_vio() self-contained
Yu Watanabe [Tue, 27 Sep 2022 07:32:22 +0000 (16:32 +0900)] 
udev-builtin-net_id: make names_vio() self-contained

It is not necessary to store its partial result in NetNames.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: make names_ccw() self-contained
Yu Watanabe [Tue, 27 Sep 2022 07:13:51 +0000 (16:13 +0900)] 
udev-builtin-net_id: make names_ccw() self-contained

It is not necessary to store its partial result in NetNames.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: make dev_devicetree_onboard() self-contained
Yu Watanabe [Tue, 27 Sep 2022 07:05:34 +0000 (16:05 +0900)] 
udev-builtin-net_id: make dev_devicetree_onboard() self-contained

and rename it to names_devicetree().

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: make names_mac() self-contained
Yu Watanabe [Tue, 27 Sep 2022 06:41:20 +0000 (15:41 +0900)] 
udev-builtin-net_id: make names_mac() self-contained

The MAC address is only used by names_mac() and ieee_oui(). Let's parse
it in names_mac() and drop it from LinkInfo.

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: split out get_ifname_prefix()
Yu Watanabe [Tue, 27 Sep 2022 06:51:25 +0000 (15:51 +0900)] 
udev-builtin-net_id: split out get_ifname_prefix()

No functional changes, just refactoring.

2 years agoudev-builtin-net_id: swap arguments for streq() and friends
Yu Watanabe [Fri, 7 Jul 2023 03:55:40 +0000 (12:55 +0900)] 
udev-builtin-net_id: swap arguments for streq() and friends

2 years agoudev-builtin-net_id: drop unused value from NetNameType
Yu Watanabe [Wed, 28 Sep 2022 05:57:46 +0000 (14:57 +0900)] 
udev-builtin-net_id: drop unused value from NetNameType

2 years agochase: propagate error in dir_fd_is_root() 28474/head
Yu Watanabe [Fri, 28 Jul 2023 01:07:05 +0000 (10:07 +0900)] 
chase: propagate error in dir_fd_is_root()

Otherwise, if it fails, chaseat() may return unexpected result and
triggers an assertion in chase().

2 years agochase: check root path in more detail
Yu Watanabe [Fri, 21 Jul 2023 04:28:39 +0000 (13:28 +0900)] 
chase: check root path in more detail

In chaseat() we call dir_fd_is_root() several places, and the final
result depends on it. If the root path specified to `chase()` is not
normalized but points to "/", e.g. "/../", assertions in `chaseat()` or
`chase()` may be triggered.

2 years agochase: carefully handle result of extracting parent directory
Yu Watanabe [Thu, 20 Jul 2023 06:17:27 +0000 (15:17 +0900)] 
chase: carefully handle result of extracting parent directory

Should not change any behavior.

2 years agochase: add two more assertions
Yu Watanabe [Fri, 21 Jul 2023 02:07:01 +0000 (11:07 +0900)] 
chase: add two more assertions

When 'need_absolute' is true, 'done' should always contain "/" at the
beginning, and thus should not be NULL.

2 years agochase: drop CHASE_AT_RESOLVE_IN_ROOT earlier
Yu Watanabe [Thu, 20 Jul 2023 12:17:32 +0000 (21:17 +0900)] 
chase: drop CHASE_AT_RESOLVE_IN_ROOT earlier

The flag will be anyway dropped in chaseat(), but let's shortcut.

2 years agochase: fix CHASE_STEP with ".."
Yu Watanabe [Thu, 20 Jul 2023 06:04:01 +0000 (15:04 +0900)] 
chase: fix CHASE_STEP with ".."

2 years agochase: reuse "done" to open fd of starting point
Yu Watanabe [Thu, 20 Jul 2023 05:56:43 +0000 (14:56 +0900)] 
chase: reuse "done" to open fd of starting point

For readability that 'done' and 'fd' are always consistent with each other.

- dir_fd == AT_FDCWD:
  - path is absolute:
    - previous: fd = open("/")
    - current:  fd = openat(AT_FDCWD, "/")
  - path is relative:
    - previous: fd = openat(AT_FDCWD, ".")
    - current:  fd = openat(AT_FDCWD, ".")
- dir_fd >= 0:
  - dir_fd points to "/":
    - previous: fd = openat(dir_fd, ".")
    - current:  fd = openat(dir_fd, "/")
  - dir_fd does not point to "/":
    - previous: fd = openat(dir_fd, ".")
    - current:  fd = openat(dir_fd, ".")

Hence, this should not change any behavior. Just refactoring.

2 years agoMerge pull request #28562 from yuwata/ukify-option-length
Yu Watanabe [Sat, 29 Jul 2023 12:41:27 +0000 (21:41 +0900)] 
Merge pull request #28562 from yuwata/ukify-option-length

ukify: check option length

2 years agoMerge pull request #28563 from keszybz/configure-meson
Yu Watanabe [Sat, 29 Jul 2023 12:40:58 +0000 (21:40 +0900)] 
Merge pull request #28563 from keszybz/configure-meson

configure: update meson invocation

2 years agolabeller: add build-system label 28563/head
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jul 2023 12:11:14 +0000 (14:11 +0200)] 
labeller: add build-system label

2 years agoconfigure: update meson invocation
Zbigniew Jędrzejewski-Szmek [Sat, 29 Jul 2023 12:07:07 +0000 (14:07 +0200)] 
configure: update meson invocation

New meson says:
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.

Inspired by https://github.com/systemd/systemd/issues/28482.

2 years agogpt-auto: don't mount ESP if there's an fstab entry for it 28564/head
Mike Yuan [Sat, 29 Jul 2023 12:05:58 +0000 (20:05 +0800)] 
gpt-auto: don't mount ESP if there's an fstab entry for it

Follow-up for #28511

Fixes #28550

2 years agofstab-util: add fstab_has_node
Mike Yuan [Sat, 29 Jul 2023 12:00:55 +0000 (20:00 +0800)] 
fstab-util: add fstab_has_node

2 years agoMerge pull request #28557 from bluca/utils
Luca Boccassi [Sat, 29 Jul 2023 11:39:06 +0000 (12:39 +0100)] 
Merge pull request #28557 from bluca/utils

utils: add serialize_bool_elide() and send/receive helpers for FD array

2 years agoMerge pull request #28508 from yuwata/network-next-dhcp4
Luca Boccassi [Sat, 29 Jul 2023 11:15:38 +0000 (12:15 +0100)] 
Merge pull request #28508 from yuwata/network-next-dhcp4

network: several cleanups and fixes for DHCPv4 client

2 years agotest-ukify: add tests for an empty argument 28562/head
Yu Watanabe [Sat, 29 Jul 2023 10:20:39 +0000 (19:20 +0900)] 
test-ukify: add tests for an empty argument

2 years agoMerge pull request #28409 from yuwata/network-dhcp4-drop-duid-only
Yu Watanabe [Sat, 29 Jul 2023 10:55:57 +0000 (19:55 +0900)] 
Merge pull request #28409 from yuwata/network-dhcp4-drop-duid-only

network,dhcp4: drop "duid-only" option support in ClientIdentifier=

2 years agoserialize: add serialize_bool_elide() helper 28557/head
Luca Boccassi [Mon, 26 Jun 2023 15:13:49 +0000 (16:13 +0100)] 
serialize: add serialize_bool_elide() helper

In many case we serialize into objects that have been zero-initialized.
To save some time and resources when there are a lot of booleans, add a
helper that serializes only when the boolean is true.