1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00
Commit Graph

78094 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
fd409ff0e0 various: set info on varlink server object
The values that were previously hardcoded in sd-varlink.c are now defined
in new varlink_set_info_systemd() and that function is called everywhere
where we create a server.
2024-12-10 10:51:56 +01:00
Zbigniew Jędrzejewski-Szmek
29f63c67b0 sd-varlink: add sd_varlink_server_set_info
Fixes https://github.com/systemd/systemd/issues/35508.

As reported in the bug, the values were hardcoded for the systemd project.
https://varlink.org/Service lists vendor, product, version, url, and interfaces
as the mandatory parameters, so add an interface to set the first four. The
last field is set automatically based on the registered interfaces as before.

If the values are not filled in, we return empty strings. With NULL,
'varlinkctl info' would say:
  (string):1:25: Object field 'vendor' has wrong type null, expected string.
2024-12-10 10:43:14 +01:00
Yu Watanabe
053cbabce7
mkosi: several improvements for running with sanitizers (#35480) 2024-12-10 13:35:22 +09:00
Yu Watanabe
fb35d775a7 seccomp-util: add getxattrat and friends
The new syscalls are added in kernel-6.13:
6140be90ec
2024-12-10 11:16:44 +09:00
Yu Watanabe
896b53ef4e basic: update syscall tables 2024-12-10 11:15:48 +09:00
Yu Watanabe
d2d006cc8c test: use systemd-asan-env environment file at more places 2024-12-10 11:01:53 +09:00
Yu Watanabe
456727b5d4 test-network: check status of networkd after everything cleared on tear down
Otherwise, if networkd is failed, e.g. .network files that triggered the
failure will remain, and the next test case will start with previous
.network files. So, most subsequent test will fail.
2024-12-10 11:01:53 +09:00
Yu Watanabe
91ef65784e mkosi/sanitizers: add more ASAN options
This adds the following three options:
- detect_invalid_pointer_pairs=2
- handle_ioctl=1
- print_cmdline=1

Note, these options were used in the CentOS CI job.
2024-12-10 11:01:53 +09:00
Yu Watanabe
1bdb9e808f test: extract sanitizer reports from journal 2024-12-10 11:01:48 +09:00
Yu Watanabe
41b6486c9b mkosi: move drop-in config for sanitizers 2024-12-10 09:46:29 +09:00
Yu Watanabe
dbf83c6613 Revert "test: tentatively disable SELinux tests"
This reverts commit 261a3d191e.
2024-12-09 21:52:06 +01:00
Greg Heartsfield
86b236fe99 hwdb: Add Chuwi MiniBook X trackpad fuzz
This adds X/Y fuzz for the Chuwi MiniBook X trackpad.  There is
significant trackpad jitter without this setting applied.
2024-12-10 04:21:41 +09:00
Daan De Meyer
948bca0418 mkosi: Use rawhide tools tree in CI
To build rawhide images we might need more recent tools from rawhide
itself. While Arch would generally be up-to-date enough as well, it
doesn't provide the selinux tools so we use Fedora Rawhide instead.
2024-12-09 20:10:22 +01:00
Mike Yuan
f4a65d5f2d
gpt-auto: take timeout opts in rootflags= into account
We document that rootflags= is honored for gpt-auto,
but only fstab-generator actually carried the logic for
x-systemd.device-timeout= and .mount-timeout=.
Apply that to gpt-auto too.
2024-12-09 19:59:29 +01:00
Mike Yuan
756b6749a2
gpt-auto: define loader partition timeout as macro 2024-12-09 19:25:59 +01:00
Mike Yuan
149e05c7e9
fstab-generator: move write_(mount_)timeout() to shared/generator 2024-12-09 19:25:59 +01:00
Mike Yuan
a46f36de79
hibernate-resume: always respect user-defined timeout
Follow-up for 6cfce71b50

Let's not override resumeflags=x-systemd.device-timeout=
specified by user, especially in the case of EFI if
the user actually wants to extend the timeout.
2024-12-09 19:24:59 +01:00
Mike Yuan
9a097eced6
shared/generator: clean up generator_write_device_timeout() a bit
- Rephrase a few log messages
- Remove unused where parameter
- Return 1 if we set something

No functional change, preparation for later commits.
2024-12-09 19:22:33 +01:00
Mike Yuan
1d8ce41318
shared/generator: rename generator_write_device_deps() to _network_device_deps
The previous name was awfully vague. Let's be specific that this
is about _netdev only.
2024-12-09 19:03:57 +01:00
Mike Yuan
e82d4edd20
shared/generator: trivial coding style cleanups 2024-12-09 19:03:53 +01:00
Zbigniew Jędrzejewski-Szmek
9e5d0ed65f cryptenroll: advertise device autodetection and listing 2024-12-09 16:15:49 +01:00
Zbigniew Jędrzejewski-Szmek
be733b272b systemd-cryptenroll: drop unnecessary {} 2024-12-09 16:04:40 +01:00
Zbigniew Jędrzejewski-Szmek
4b034cc128 systemd-cryptenroll: use pager for --help, add --no-pager option 2024-12-09 16:04:25 +01:00
Yu Watanabe
fbee22c237 journalctl: show coredumps again when --unit= is specified
This is a revised version of cbd5f5d7d6,
which is reverted by 560412148f.

The filter condition for _UID= field was added by
fdcd37df3b. However, after
888e378da2, coredumps for system services are
stored by systemd-coredump user. Hence, _UID=0 does not match anything anymore.

When we are reading the system journal, let's set _UID=<systemd-coredump>,
then we can show coredumps for system services again. When we are reading
an external journal, then the uid of systemd-coredump may be different
from the one on the current system, so let's drop the filter condition
for _UID= in that case.
2024-12-09 15:18:55 +01:00
Lennart Poettering
9cbd4f9b61 systemctl: use correct runtime scope 2024-12-09 14:16:37 +00:00
Zbigniew Jędrzejewski-Szmek
423de11f04 boot: exclude the trailing padding from initrd size in initrd_prepare()
This is a follow-up for f8fa4222c9 (boot: Make
initrd_prepare() semantically equivalent to combine_initrds()). That commit
changed the way that the initrd is prepared for type#1 boot loader entries,
also effectively rounding up the sizes to a multiple of 4. In [1], downstream
packagers report that the trailing zeroes result in the calculated hash being
different. To restore compatibility with previous hash calculations and
signatures, change the reported size by excluding the trailing padding. This
should restore the calculation results for the case where only one initrd is
used.

This patch doesn't touch the stub, i.e. doesn't change behaviour for UKIs. The
seems fine, since we didn't change that recently, so any changes there would
break compatiblity. The measurement results for type#1 and type#2 entries are
generally going to be different anyway. ukify and systemd-measure are also out
of scope here, because they are for UKIs.

Fixes https://github.com/systemd/systemd/issues/35439.
The other changes to the way the initrd is constructed are kept, so hopefully
the original issue with booting in qemu is not recreated.

[1] https://bugzilla.suse.com/show_bug.cgi?id=1233752

My simple test: I'm booting a QEMU VM with systemd-boot and a type#1 entry.
With old systemd-boot:
$ sudo systemd-pcrlock log | grep 'kernel-initrd.*event-tag'
  9 █ kernel-initrd  event-tag  - a337a8321bf81de5c53a842843e8f9a926f73a676e5620ff76df94d1c66bc931 F   - Linux: kernel command line
  9 █ kernel-initrd  event-tag  - aec1aee5358bde36f5498f2dc243dec2b103f81242de57b887a11f53677f1272 F   - Linux: initrd
With updated systemd-boot:
$ sudo systemd-pcrlock log | grep 'kernel-initrd.*event-tag'
  9 █ kernel-initrd  event-tag  - a337a8321bf81de5c53a842843e8f9a926f73a676e5620ff76df94d1c66bc931 F   - Linux: kernel command line
  9 █ kernel-initrd  event-tag  - 3ccaa710304aef8734a20265ea7fd3dd67d5461c6b3309c6d30d5c7d2a3ae7f9 F   - Linux: initrd
This matches the initrd hash:
$ sudo sha256sum /efi//26f948d2082e4ae89f5a3af351b63149/6.12.0-rc4+/initrd-dracut
3ccaa710304aef8734a20265ea7fd3dd67d5461c6b3309c6d30d5c7d2a3ae7f9  /efi//26f948d2082e4ae89f5a3af351b63149/6.12.0-rc4+/initrd-dracut
2024-12-09 15:14:03 +01:00
Daan De Meyer
f7f5ba0192
mkosi: various improvements (#35491) 2024-12-08 16:12:21 +01:00
Daan De Meyer
e469add21e mkosi: Set meson --max-lines= to 300 in CI
By default meson only shows the last 100 lines of output for failed
tests. Let's bump this to 300 with the new --max-lines= option I added
so we get more useful output on test failures.
2024-12-08 12:55:43 +01:00
Daan De Meyer
71d19c5b56 mkosi: Use mkosi sandbox in CI with Fedora tools tree
This gives us a newer meson which will allow us to use the new
--max-lines= feature I added in meson 1.5.0.
2024-12-08 12:55:43 +01:00
Daan De Meyer
8f51cf6981 test: Set kernel loglevel to INFO when running tests unattended
This makes sure all kernel log messages are logged to the console.
This should be helpful during shutdown to detect possible issues with
journald when the logs can't be written to the journal itself anymore
but are written to kmsg.
2024-12-08 12:55:43 +01:00
Daan De Meyer
d82a93f3e1 mkosi: Move leak sanitizer supressions file to sanitizers extra tree 2024-12-08 12:55:43 +01:00
Daan De Meyer
ade7d04479 mkosi: Reduce kernel command line size
The kernel command line has a size limit and we've hit it before so
let's move some stuff to configuration files or scripts to reduce the
kernel command line size a bit.
2024-12-08 12:55:43 +01:00
Daan De Meyer
2ebb4c3991 mkosi: Update to latest 2024-12-08 12:55:35 +01:00
Yu Watanabe
261a3d191e test: tentatively disable SELinux tests
Currently, mkosi GitHub action complains the following:
===
Could not find 'setfiles' which is required to relabel files.
===
Let's tentatively disable SELinux test.
2024-12-08 12:59:08 +09:00
Abderrahim Kitouni
912ef24b66 sysupdate: fix typo in DBus config 2024-12-07 11:33:29 +00:00
Ryan Wilson
cf48bde7ae core: Add ProtectHostname=private
This allows an option for systemd exec units to enable UTS namespaces
but not restrict changing hostname via seccomp. Thus, units can change
hostname without affecting the host.

Fixes: #30348
2024-12-06 13:34:04 -08:00
Ryan Wilson
6746f28854 core: Migrate ProtectHostname to use enum vs boolean
Migrating ProtectHostname to enum will set the stage for adding more
properties like ProtectHostname=private in future commits.

In addition, we add PrivateHostnameEx property to dbus API which uses
string instead of boolean.
2024-12-06 13:33:49 -08:00
Daan De Meyer
ead814a0b0 test: Remove old bash test runner
We put a timeline of 257 to remove the old bash test runner so since
we're about to release 257, let's remove the old bash test runner in
favor of the meson + mkosi test runner.
2024-12-06 18:54:10 +00:00
Zbigniew Jędrzejewski-Szmek
560412148f Revert "journalctl: show coredumps again when --unit= is specified"
This reverts commit cbd5f5d7d6.
2024-12-07 02:21:51 +09:00
Yu Watanabe
cbd5f5d7d6 journalctl: show coredumps again when --unit= is specified
This effectively reverts fdcd37df3b.

After 888e378da2, coredumps for system
services are stored by systemd-coredump user. Henve, _UID=0 does not
match anything anymore.

Before:
```
$ build/journalctl -u systemd-networkd.service -p2 -n1
-- No entries --
```

After:
```
$ build/journalctl -u systemd-networkd.service -p2 -n1
Dec 06 05:39:55 H systemd-coredump[4187]: [🡕] Process 4145 (systemd-network) of user 192 dumped core.
(snip)
```
2024-12-06 09:56:09 +00:00
Sergey A
2715cf6d96 po: Translated using Weblate (Russian)
Currently translated at 100.0% (257 of 257 strings)

Co-authored-by: Sergey A <Ser82-png@yandex.ru>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ru/
Translation: systemd/main
2024-12-06 18:26:40 +09:00
Luca Boccassi
3e3c5739f0
More assert macros (#35471) 2024-12-06 00:50:07 +00:00
Daan De Meyer
272efe34d4 mkosi: Make sure the /coverage directory exists 2024-12-05 22:03:07 +01:00
Zbigniew Jędrzejewski-Szmek
5c0132a4cd test-parse-util: use ASSERT_* macros 2024-12-05 20:14:15 +01:00
Zbigniew Jędrzejewski-Szmek
ebb89ae6f6 test-condition: use xsprintf and drop pointless cast 2024-12-05 20:14:12 +01:00
Zbigniew Jędrzejewski-Szmek
1526396807 test-condition: use ASSERT_* macros
Some strange asserts are dropped.
2024-12-05 20:14:08 +01:00
Luca Boccassi
3f86ce166d mkosi: install util-linux-script in F42 too 2024-12-05 20:03:37 +01:00
Ryan Wilson
705cc82938 core: Add PrivateUsers=full
Recently, PrivateUsers=identity was added to support mapping the first
65536 UIDs/GIDs from parent to the child namespace and mapping the other
UID/GIDs to the nobody user.

However, there are use cases where users have UIDs/GIDs > 65536 and need
to do a similar identity mapping. Moreover, in some of those cases, users
want a full identity mapping from 0 -> UID_MAX.

Note to differentiate ourselves from the init user namespace, we need to
set up the uid_map/gid_map like:
```
0 0 1
1 1 UINT32_MAX - 1
```

as the init user namedspace uses `0 0 UINT32_MAX` and some applications -
like systemd itself - determine if its a non-init user namespace based on
uid_map/gid_map files. Note systemd will remove this heuristic in
running_in_userns() in version 258 and uses namespace inode. But some users
may be running a container image with older systemd < 258 so we keep this
hack until version 259.

To support this, we add PrivateUsers=full that does identity mapping for
all available UID/GIDs.

Fixes: #35168
2024-12-05 10:34:32 -08:00
Septatrix
5857f31c2c man: clarify wording regarding MONITOR_* envs 2024-12-06 03:01:19 +09:00
Tristan F.-R.
26dd4d3dd7 docs/MEMORY_PRESSURE: fix typo
corrects "focusses" -> "focuses"
2024-12-05 17:32:58 +00:00