Commit Graph

10179 Commits

Author SHA1 Message Date
Felix Pehla
aaa3e6880d shared/bootspec: parse loader.conf options added in v258 2025-09-29 23:14:11 +02:00
Felix Pehla
5fb90fa319 shared/bootspec: parse 'profile' boot entry option
Commit 1e9c9773b9 makes sd-boot recognize
a 'profile' option in a boot loader entry but bootctl and other
components parsing said config do not know about it.

This commit makes the option get parsed correctly and displays it too.
2025-09-29 23:01:12 +02:00
Felix Pehla
4a94a1b83f shared/bootspec: parse 'uki' boot entry option
Commit e2a3d56218 (as part of #36314)
makes sd-boot recognize a 'uki' stanza in a boot loader entry and
uapi-group/specifications@3f2bd8236d adds
it to the BLS, but bootctl and other components parsing said config do
not know about it, leading to the error message
`Unknown line 'uki', ignoring.` when attempting to parse the same entry.

This commit makes it get parsed the same way that that 'efi' is.
2025-09-29 22:59:49 +02:00
Mike Yuan
fb10ffc4f4 Various small cleanups (#39155) 2025-09-27 17:22:57 +02:00
Luca Boccassi
463f0a027a Revert "Bump required minimum version of libfido2 to 1.5.0" and add missing def instead
It helps nobody to break compatibility for a missing definition
for printing an error.
Just add the missing definition if not present, as it is already
done for thousands of others from the kernel, glibc, etc.

This partially reverts commit d8b60944f5.
2025-09-27 15:46:13 +02:00
Zbigniew Jędrzejewski-Szmek
aab2fef516 shared/generator: fix grammar in comment 2025-09-27 16:12:54 +03:00
Daan De Meyer
d15343d561 ethtool-util: several cleanups for applying link settings (#38879) 2025-09-27 14:31:11 +02:00
Xarblu
a3ad821b4c shared: add missing alloc-util.h include
Needed for _cleanup_free_
2025-09-26 23:56:11 +01:00
Yu Watanabe
f6e9e1e304 ethtool-util: drop use of union ethtool_link_usettings
Previously, we shift arrays on read and then shift back on write.
It is inefficient and not necessary.
Let's directly use the buffer that kernel provides as is.
2025-09-26 19:45:58 +09:00
Yu Watanabe
f8606bc54e ethtool-util: fix comment
The very initial implementation sets cmd with zero when the bitmap
length does not match. But, it is fixed by
793cf87de9

Fortunately, our code does not follow the outdated comment, but checks
cmd field correctly.
2025-09-26 19:45:58 +09:00
Yu Watanabe
8a4929c4e4 ethtool-util: rename functions and update log messages 2025-09-26 19:45:58 +09:00
Yu Watanabe
5505c528b9 ethtool-util: drop use of deprecated ETHTOOL_GSET and ETHTOOL_SSET
The methods are deprecated since kernel v4.20,
9b30049535
and they are trivial wrapper of ETHTOOL_GLINKSETTINGS and ETHTOOL_SLINKSETTINGS,
respectively. Hence, the fallback logic is nowadays completely
meaningless. Let's drop them.
2025-09-26 19:45:58 +09:00
Daan De Meyer
4feade85d7 dissect: Add more debug logging (#39125) 2025-09-26 11:53:35 +02:00
Daan De Meyer
f9b46986e1 dissect: Add more debug logging 2025-09-26 11:53:05 +02:00
Lennart Poettering
bd4c39a384 mute console kernel log/pid1 status output while firstboot is running (#39101)
This is also preparation for the installer later, split out of #38764.
It makes the experience a lot nicer if our nice little tools aren't
constantly interrupted by log spew from the kernel.

Fixes: #34448
2025-09-26 11:12:24 +02:00
Lennart Poettering
83b6ef9b62 libselinux: turn into dlopen() dep 2025-09-26 11:12:04 +02:00
Lennart Poettering
40e742be3c prompt-util: add client helper for muting the console 2025-09-26 09:42:13 +02:00
Lennart Poettering
ac63a04bd6 mute-console: add simple varlink service that can disable log/status spew to kernel console
For "wizard" style interactive tools it's very annoying if they are
interrupted by kernel log output or PID1's status output. let's add some
infra to disable this temporarily. I decided to implement this as an IPC
service so that we can make this robust: if the client request the
muting dies we can automatically unmute again.

This is hence a tiny varlink service, but it can also be started
directly from the cmdline.
2025-09-26 09:42:13 +02:00
Lennart Poettering
45c04464dc shutdown: move printk changing code int generic code 2025-09-26 09:39:00 +02:00
Daan De Meyer
a93593df2f dissect: Add full stop to debug log messages in dissect_image() 2025-09-26 09:26:06 +02:00
Lennart Poettering
b3243f4bee libmount: make dlopen() dependency 2025-09-26 08:29:37 +09:00
Lennart Poettering
d9c5566c0f machined: make image locking runtime scope aware, too
We cannot create an image lock in /run if we are unpriv, hence create it
in $XDG_RUNTIME_DIR instead.
2025-09-25 22:43:59 +02:00
Lennart Poettering
e1b3319b6c discover-image: support runtime scope also for .nspawn settings files and the pool dir
discover-image.[ch] largely already supports per-scope operations, let's
extend this however to also cover finding .nspawn settings files and
managing the pool dir.
2025-09-25 22:43:59 +02:00
Lennart Poettering
b7f6bdbbd3 service-util: add generic parser for runtime scope 2025-09-25 22:43:59 +02:00
Lennart Poettering
aaca6bd5d9 libseccomp: turn into dlopen() dependency 2025-09-26 03:30:11 +09:00
Yu Watanabe
04e434cedb find-esp: fix error handling
Follow-up for 4b2b2f3ab7.
2025-09-25 20:08:13 +02:00
Daan De Meyer
946cc446c0 gpt: Introduce function to convert verity hash or sig to data partition
Let's rename the existing partition_verity_to_data() to
partition_verity_hash_to_data() and make a new partition_verity_to_data() that
handles both verity hash and verity signature partitions.

Rename other functions to match the new naming.
2025-09-25 20:06:11 +02:00
Daan De Meyer
2c4263f987 dissect: Add more debug logging
Currently it's next to impossible to find out why dissect_image()
has failed with EADDRNOTAVAIL, so let's add debug logging and use
EREMOTE for the different architectures error to help out with
debugging a bit.
2025-09-25 14:11:36 +02:00
Lennart Poettering
1a00afe0ff mountfsd: slightly relax restrictions on dir fds to mount
When establishing a idmapped mount for a directory with foreign mapping
we so far insisted in the dir being properly opened (i.e. via a
non-O_PATH fd) being passed to mountfsd. This is problematic however,
since the client might not actually be able to open the dir (which after
all is owned by the foreign UID, not by the user). Hence, let's relax
the rules, and accept an O_PATH fd too (which the client can get even
without privs). This should be safe, since the load-bearing security
check is whether the dir has a parent owned by the client's UID, and
for that check O_PATH or not O_PATH is not relevant.
2025-09-25 14:06:34 +02:00
Lennart Poettering
ec3139db8b loop-util: fully suppress unnecessary size changes
Typically we set the offset argument to UINT64_MAX in most calls, but
this caused us to not detect no-change invocations. Fix that.
2025-09-25 08:49:25 +02:00
Lennart Poettering
4b2b2f3ab7 blkid-util: add blkid_probe_lookup_value_id128() helper
And similar, add a blkid_probe_lookup_value_u64() helper
2025-09-24 18:13:10 +02:00
Lennart Poettering
c349edfe49 libblkid: turn into dlopen() based dep 2025-09-24 18:13:10 +02:00
Yu Watanabe
77adf896ca firstboot: some love (#39070)
This is split out of #38764.

It mostly introduces the "chrome" stuff that puts a blue at the top of
bottom of the terminal screen when going through interactive tools such
as firstboot, homed-firstboot, and (in future) systemd-sysinstall).

it also introduces a generic "prompt_loop()" helper thatn queries the
user for some option in a loop until the rsponse matches certain
requirements. It's a generalization of a function of the same name that
so far only existed in firstboot.c. The more generic version will be
reused in a later PR by homed-firstboot and by sysinstall.
2025-09-25 00:38:23 +09:00
Yu Watanabe
faa3cc2974 machine: fix wrong field name in varlink IDL
Follow-up for d5feeb373c (v258).
2025-09-24 23:23:37 +09:00
Lennart Poettering
73ee723aa7 firstboot: show blue "chrome" bar at top 2025-09-24 15:46:30 +02:00
Lennart Poettering
8191bbd23c prompt-util: add helpers that paint some "chrome" on top/bottom of screen
We'll soon have three different kind of interactive "wizard"-like console
UIs: systemd-firstboot, homectl firstboot and soon systemd-sysinstall.
Let's give them a limited, recognizable visual identity, to distinguish
them from the usual console output: let's add a bit of "chrome" to the
top and bottom of the screen, that we show during ther wizards, but hide
again afterwards.

This makes use of the DECSTBM sequence that reduces the scrolling area
by chopping off blocks from the top or bottom of the screen. The
sequence is quite standard, given it has been part of VT100 already.
xterm, vte, Linux console all support it just fine.
2025-09-24 15:46:30 +02:00
Lennart Poettering
32e0af0835 pretty-print: add WITH_BUFFERED_STDOUT() helper 2025-09-24 15:46:30 +02:00
Lennart Poettering
fa350969ab prompt-util: add generic prompt loop implementation
This is a generalization of the logic in systemd-firstboot. This also
ports over firstboot.c to make use of the new generalization.
2025-09-24 15:46:30 +02:00
Yu Watanabe
d88ecd2bca libacl → turn into dlopen() dependency (#39087) 2025-09-24 18:25:20 +09:00
Yu Watanabe
01598d644f udev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)
Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
u-boot set mac-address for wifi without an eeprom"

So we need to handle both while generating names. Refactor most of the
logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet", and, in the new names_devicetree():

- For prefix "en", use alias_prefix "ethernet"
- For prefix "wl", try alias_prefix "wifi" first, and if that was not
found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.
2025-09-24 18:10:27 +09:00
Lennart Poettering
7c3a7f925f acl: turn libacl dep into a dlopen() one
I initially didn't think it would be worth doing this, but I changed my
mind. People out there quite successfully build systemd without ACL
support, and that suggests life without it is quite possible. Moreover
we only use it as very specific places:

1. in udev/logind for "uaccess" mgmt
2. in tmpfiles to implement explicitly configured acl changes
3. in journald/coredump/pstore to manage access to unpriv users
4. in pid1 to manage access to credential files
5. when shifting UIDs of container trees

I specific container environments it should be entirely fine to live without all
of these, hence let's pull this in on demand only.
2025-09-24 09:47:41 +02:00
dramforever
20693ffcd8 udev-builtin-net_id: Add DeviceTree-based names for WLAN devices
Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
  sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
  u-boot set mac-address for wifi without an eeprom"

Therefore for prefix "wl", try alias_prefix "wifi" first, and if that
was not found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.
2025-09-24 03:13:32 +08:00
Yu Watanabe
41c4a69653 udev: move devnode_acl() back to libshared
This effectively reverts 1abb592f2f.
No functional change, preparation for the next commit.
2025-09-23 19:53:39 +09:00
Lennart Poettering
ba793df4b9 blockdev-list,repart: optionally hide zero-size block devices
Block devices with removable media (e.g. SD card readers) indicate a
missing medium with a zero size. Optionally ignore such block devices
that carry no medium currently.
2025-09-23 09:25:11 +02:00
Lennart Poettering
ed90a0cdc9 blockdev-list,repart: optionally, filter list of candidate block device and remove OS root disk 2025-09-23 09:23:55 +02:00
Lennart Poettering
19f2baccce repart: add basic Varlink support, for now only with a ListCandidateDevices() call 2025-09-23 09:22:04 +02:00
Lennart Poettering
e863e2dbb5 blockdev-list: also pick up block device size 2025-09-23 09:18:21 +02:00
Lennart Poettering
9f6b2745ea blockdev-list: optionally return finds as list instead of writing it to stdout 2025-09-23 09:13:13 +02:00
Mike Yuan
1fbe44d013 pam-util,libaudit-util: strip "lib" prefix from dlopen "feature" field
As per our usual coding style.
2025-09-22 20:08:45 +02:00
Mike Yuan
f497a3f1c3 pam-util: fix build without PAM
Follow-up for 882c9ce040
Prompted by #39077

Note that HAVE_PAM ifdeffery in pam-util.c is removed,
since its build as a whole is conditioned out if
!HAVE_PAM in shared/meson.build.
2025-09-22 20:08:44 +02:00