1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-16 03:24:49 +03:00

69493 Commits

Author SHA1 Message Date
Richard Maw
e07bbb8290 mkosi: Install locales in fedora
locale files are not generated on-demand in Fedora like they are in
Debian-like systems and are typically installed from package instead.

This is necessary for the locale tests,
which expect en_US.UTF-8 to be available.
2023-12-14 16:26:23 +00:00
Yu Watanabe
ae3fb96d1f
Merge pull request #30440 from yuwata/network-nexthop-cleanups-2
network/nexthop: several cleanups
2023-12-14 21:44:02 +09:00
Zbigniew Jędrzejewski-Szmek
f36c796e0f man/tmpfiles: update summary
It hasn't been just about "volatile" and "files" for a long time.
2023-12-14 12:52:28 +01:00
Yu Watanabe
5f6ab79571 sd-netlink: the kernel ignores NLM_F_APPEND in RTM_NEWNEXTHOP message but uses NLM_F_REPLACE
See insert_nexthop() in net/ipv4/nexthop.c of the kernel.
2023-12-14 18:58:26 +09:00
Yu Watanabe
68149118cb network/nexthop: check existing nexthop can be replaced with requested one 2023-12-14 18:58:26 +09:00
Yu Watanabe
cdf3bee6a2 network/nexthop: do not add NextHop object to Link on requesting
Then, all nexthops managed by networkd really exist (unless the kernel
silently removes a nexthop).

This is the same for nexthop already done by
3c283289aefb3cfb8bfa5c759209368b63d1692c and
0a0c2672dbd22dc85d660e5baa7e1bef701beb88 (for address), and
5d098f5d3614d1c0be7c825925637e9ab3d904fb (for neighbor).
2023-12-14 18:58:26 +09:00
Yu Watanabe
352eba2e49 network/nexthop: manage all nexthops by manager
The kernel manages nexthops by their IDs. Previously networkd manages
nexthops in three ways:
- by the corresponding link, if a nexthop has ifindex,
- by the manager, if a nexthop does not have ifindex,
- by the manager with their IDs.

This unifies the three managements of nexthops into one, and use the
same way as the kernel uses.

This is the one for nexthop already done by
aa9626ee3b96e0d2a9a816b5efd38fd7dc829def for neighbor.
2023-12-14 18:58:26 +09:00
Yu Watanabe
ac21790335 network/nexthop: rename manager_get_nexthop_by_id() -> nexthop_get_by_id() 2023-12-14 18:58:26 +09:00
Yu Watanabe
84faee4141 network/nexthop: rename nexthop_owned_by_link() -> nexthop_bound_to_link()
No functional change.
2023-12-14 18:58:19 +09:00
Yu Watanabe
a533473a48 network/nexthop: NextHop.id is always positive when nexthop_configure() is called
If a nexthop is requested without a valid ID, then nexthop_acquire_id()
assigns an unused ID. So, at the time nexthop_configure() is called, the
ID is always valid.
2023-12-14 18:57:43 +09:00
Yu Watanabe
c624143b59 network/nexthop: do not assign invalid ID
This also reduces the scope of the iterator.
2023-12-14 18:57:43 +09:00
Yu Watanabe
58830ef5eb network/nexthop: split-out nexthop_update_group()
No functional change, just refactoring and preparation for later
commits.
2023-12-14 18:57:43 +09:00
Yu Watanabe
c2aed12836 network: do not trigger assertion when link_get_by_index() called with an invalid ifindex
Should not change any behavior. Preparation for later commit.
2023-12-14 18:57:43 +09:00
Daan De Meyer
3d11b46bf7
Add $SYSTEMD_HWDB_UPDATE_BYPASS (#30463)
Same as $KERNEL_INSTALL_BYPASS, but for hwdb. This will speed up
cross architecture image builds in mkosi as I can disable package
managers from running the costly hwdb update stuff in qemu user
mode and run it myself with a native systemd-hwdb with --root=.
2023-12-14 18:57:05 +09:00
Mike Yuan
bd546b9b48 machine-credential: introduce MachineCredentialContext
This allows more straightforward memory management and
the use of static destructor.

Requested (by me) in https://github.com/systemd/systemd/pull/30143#discussion_r1401980763
2023-12-14 08:50:44 +00:00
Luca Boccassi
266e8d0eb6
Merge pull request #30417 from YHNdnzj/unit-log-resource
core/unit: clean up unit_log_resources
2023-12-14 08:45:26 +00:00
Artur Pak
5f1cc125a8 Add three Dell platforms to sensor accel location base 2023-12-14 08:41:28 +00:00
Daan De Meyer
9ce4dad81f
Merge pull request #30467 from poettering/loop-block-tweaks
various tweaks to block device ioctls, and loop device mgmt
2023-12-14 09:38:17 +01:00
Lennart Poettering
21c43631d7 rlimit-util: add pid_getrlimit() helper
This is gets the resource limits off a specified process, and is very
similar to prlimit() with a NULL new_rlimit argument. In fact, it tries
that first. However, it then falls back to use /proc/$PID/limits. Why?
Simply because Linux prohibits access to prlimit() for processes with a
different UID, but /proc/$PID/limits still works.

This is preparation to allow nspawn to run unprivileged.
2023-12-14 08:31:29 +00:00
Luca Boccassi
1845fccada
Merge pull request #30469 from poettering/userdbd-tweaks2
userdb: some smaller userdb tweaks
2023-12-14 08:19:51 +00:00
Colin Walters
47374e0601 docs/CREDENTIALS: Don't write authorized_keys with executable bits
No reason to make this file executable.
2023-12-14 07:58:30 +00:00
Lennart Poettering
bb59b92256 mount-util: make sure mount_switch_root() works as clean NOP when '/' is specified as target 2023-12-14 13:13:45 +09:00
Richard Maw
0947748555 mkosi: Add testuser and tar to system image
The integration tests are installed into the image
with the intention that it should be possible to run those tests,
but those tests require the named user testuser
and tar is needed for machined-import
2023-12-13 17:55:46 +00:00
Richard Maw
eae7ce2d61 mkosi: Allow the output directory to be overridden
For integration tests it would be preferable to operate on a copy
so tests can be run in parallel and avoid interfering.
2023-12-13 17:55:46 +00:00
Richard Maw
8799346862 test: mount overlayfs over /usr in some tests
Most of the integration tests have been made to not write to /usr
but some genuinely need to do so.

Because mkosi creates images with a read-only /usr
it is not normally writeable.

By mounting an overlayfs with /usr as the lower dir
and upper and working dirs in /var tests may write to /usr.
2023-12-13 17:55:45 +00:00
Lennart Poettering
3d33798803 userdbd: split out function to find listener fd
no actual code changes, just some refactoring and modernization
2023-12-13 18:25:10 +01:00
Lennart Poettering
523121d543 userbd: modernize process_connection() fd possession logic 2023-12-13 18:19:42 +01:00
Lennart Poettering
404a12e1d6 userdbd: realign table 2023-12-13 18:19:20 +01:00
Lennart Poettering
43185f5dc0 userdbd: drop redundant empty line 2023-12-13 18:19:00 +01:00
Lennart Poettering
0e3cb8cf88 userdbd: properly close the listener fd on exit 2023-12-13 18:18:39 +01:00
Lennart Poettering
1fdab6c306 update TODO 2023-12-13 18:04:55 +01:00
Lennart Poettering
7c695beadc userwork: port to pidref_set_parent() 2023-12-13 18:00:14 +01:00
Lennart Poettering
a1796e9bd8 pidref: add pidref_set_parent() for race-freely getting pidref on ppid 2023-12-13 18:00:14 +01:00
Lennart Poettering
64cd3d13ea dissect-tool: hide device column if it's a short-lived loopback device
It's pointless showing info that isn#t going to survive the current
invocation, hence hide it.

The "partition number" column is more useful since it kinda shows the
same information, but without the device node name prefixed that is
local to the currentl invocation.
2023-12-13 17:41:18 +01:00
Lennart Poettering
5b1b37c86a dissect-tool: show sector/image size from DissectedImage object
The information is provided to us already in the structure now, hence
use it.
2023-12-13 17:35:22 +01:00
Lennart Poettering
51778dea0d dissect-image: also store the image size in DissectedImage
That way we can easily access it the same way regardless if we operate
on a block device or on a regular file.
2023-12-13 17:35:22 +01:00
Lennart Poettering
6bc201343f loop-util: remember if we created the LoopDevice
Let's store in a bool whether a LoopDevice object was created via
loop_device_open() or loop_device_make().
2023-12-13 17:35:22 +01:00
Lennart Poettering
c961a8c605 loop-util: also store the device size in LoopDevice
That makes the field easily accessible, just as the sector size.
2023-12-13 17:35:22 +01:00
Lennart Poettering
01db9c85cf blockdev-util: add new helper blockdev_get_device_size()
This function is just a wrapper around the BLKGETSIZE64. Which is a
pretty simple ioctl. The only reason to wrap it, is that the headers we
need to call it are a bit messy (as "linux/fs.h" is incompatible with
certain glibc headers). Hence add the simple helper that wraps it and
allows us to do the header mess needed in one file only.

It's also nicely symmetric to blockdev_get_sector_size().
2023-12-13 17:35:22 +01:00
Frantisek Sumsal
f9ba9d3eb7 test: install all necessary units & generators for LVM on Debian
And derivates.

Replaces: #30458
2023-12-13 23:56:14 +09:00
Luca Boccassi
b896058883
Merge pull request #30450 from poettering/cgroups-delegate-attr-update
cgroup: bring list of delegated cgroup attributes up-to-date with cur…
2023-12-13 13:50:41 +00:00
Zbigniew Jędrzejewski-Szmek
0b4cf0a540
Merge pull request #30232 from keszybz/ukify-imports
Use exec() to import ukify
2023-12-13 14:38:03 +01:00
Richard Maw
0129395173 test: slacken plugged -> dead test
This test is for if devices transition from plugged -> dead -> plugged
on boot, but it is normal to see loop devices transition plugged -> dead
on first boot when systemd-repart adds the root partition.
2023-12-13 13:35:04 +00:00
Richard Maw
8f764b32ea test: Create analyze chroot with --rbind
The systemd-analyze integration test also tests chroots.
It builds its chroot by bind-mounting /,
but since /usr might be a separate mountpoint
it should create the chroot with --rbind.
2023-12-13 13:35:04 +00:00
Mike Yuan
3e5b96eed3
core/unit: clean up unit_log_resources
* Use a unified struct to store accounting fields/suffixes
* Use strextendf_with_separator where appropriate
* Don't mix stack and heap allocation for one iovec array
2023-12-13 20:42:06 +08:00
Mike Yuan
b1b84bc590
core/unit: raise log level for unit_log_resources on certain memory thresholds
We already do this for all other types of accountings. Let's
make this nicer for memory accounting too.
2023-12-13 20:42:06 +08:00
Mike Yuan
55b8f8100c
macro-fundamental: add U64_{K,M,G}B 2023-12-13 20:42:05 +08:00
Mike Yuan
ba354c164f
iovec-util: add missing assertion 2023-12-13 20:42:05 +08:00
Lennart Poettering
113defc76b test: test that delegation of some newer attrs that shall be delegated work 2023-12-13 10:10:56 +01:00
Lennart Poettering
2c70a81de6 cgroup: bring list of delegated cgroup attributes up-to-date with current kernels
THis brings the list of attributes to delegate to managers of subcgroups
to the state of kernel 6.6.

We probably should unify this list, and maybe generate it automatically
from /sys/kernel/cgroup/delegate, but let's do that another time.
2023-12-13 09:58:45 +01:00