Commit Graph
69876 Commits
Author SHA1 Message Date
Daan De Meyer ebd6606515 repart: Add Minimize=best to --make-ddi= partition definitions
Otherwise, repart won't calculate the minimal size of the partition
automatically and things will fail once the partitions exceed the
minimal partition size (10M).
2023-12-06 11:54:48 +01:00
Zbigniew Jędrzejewski-Szmek f3d50fb2c6 ukify: raise error if genkey is called with no output arguments
The idea is that genkey is called with either
--secureboot-private-key= + --secureboot-certificate=, and then it
writes those, or with --pcr-private-key + optionally --pcr-public-key
and then it writes those, or both. But when called with no arguments
whatsover, it did nothing.

There is no implicit value for any of those parameters as input (unlike in
mkosi), so we also don't want to have implicit values when used as output.
But we shouldn't return success if no work was done, this is quite confusing.
2023-12-06 11:46:04 +01:00
Zbigniew Jędrzejewski-Szmek 7b0760ca9c ukify: remove stray line
As requested in review.
2023-12-06 11:44:40 +01:00
Zbigniew Jędrzejewski-Szmek b6ecab8541 ukify: add test for --secureboot-certificate-validity=
Follow-up for bf35f9c835.
2023-12-06 11:44:40 +01:00
Luca Boccassi a7418691e4 hwdb: update
ninja -C build update-hwdb
2023-12-06 10:06:50 +00:00
Luca Boccassi 48696c2d37 NEWS: note that newly introduced tools are experimental
So that we can change interfaces for at least one release if needed
2023-12-06 10:00:25 +00:00
Luca Boccassi e6e335b5d4 NEWS: update contributors list 2023-12-06 09:57:38 +00:00
Roland Singer bf35f9c835 ukify: fix handling of --secureboot-certificate-validity= (#30315)
Before:
$ python src/ukify/ukify.py genkey --secureboot-private-key=sb2.key --secureboot-certificate=sb2.cert --secureboot-certificate-validity=111
Traceback (most recent call last):
  File "/home/zbyszek/src/systemd-work/src/ukify/ukify.py", line 1660, in <module>
    main()
  File "/home/zbyszek/src/systemd-work/src/ukify/ukify.py", line 1652, in main
    generate_keys(opts)
  File "/home/zbyszek/src/systemd-work/src/ukify/ukify.py", line 943, in generate_keys
    key_pem, cert_pem = generate_key_cert_pair(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zbyszek/src/systemd-work/src/ukify/ukify.py", line 891, in generate_key_cert_pair
    now + ONE_DAY * valid_days
          ~~~~~~~~^~~~~~~~~~~~
TypeError: can't multiply sequence by non-int of type 'datetime.timedelta'

Now:
$ python src/ukify/ukify.py genkey --secureboot-private-key=sb2.key --secureboot-certificate=sb2.cert --secureboot-certificate-validity=111
Writing SecureBoot private key to sb2.key
Writing SecureBoot certificate to sb2.cert

The new code is also clearer.
2023-12-06 10:49:47 +01:00
Mike Yuan 9f08d7f777 repart: use correct errno 2023-12-06 10:03:21 +01:00
Yu Watanabe 6c7f4badea repart: fix coding style of error handling
Follow-up for c4a87b76c3.
2023-12-06 11:35:10 +09:00
Yu Watanabe 2ae16d36ac journal: use sd_event_now() 2023-12-06 11:01:32 +09:00
Yu Watanabe 90c27eb43b journal: use usec_add() and usec_sub_unsigned() 2023-12-06 11:01:28 +09:00
Yu Watanabe 6336c63559 journal: add short comment for boolean arguments 2023-12-06 11:00:48 +09:00
Yu Watanabe 80b1156b96 journal: split out server_new() from server_init()
Then, use DEFINE_MAIN_FUNCTION() macro in journald.
No functional change, just refactoring to follow our usual coding style.
2023-12-06 11:00:48 +09:00
Frantisek Sumsal 1ea27bd79e test: load the io controller before checking if io.latency exists
Otherwise the following test gets always skipped.
2023-12-05 19:58:48 +00:00
Daan De Meyer 0689d46a75 repart: Fix sysext definitions for --make-ddi=
CopyFiles= does not support multiple directories separated by
whitespace. Instead the setting has to be specified multiple times.
2023-12-05 19:26:58 +00:00
Luca Boccassi a14b75e218 selinux: downgrade log about state to trace
It is printed on every invocation of sd-executor, which is noisy and not useful

Follow-up for: bb5232b6a3
2023-12-05 19:25:50 +00:00
Zbigniew Jędrzejewski-Szmek 26e82eef01 sd-journal/catalog: modernize write_catalog() 2023-12-05 19:20:25 +01:00
Zbigniew Jędrzejewski-Szmek d333b236f4 networkd: unvoidify fwrite()
Those were the only two places we did that, so for consistency it's better
to drop it.
2023-12-05 19:18:28 +01:00
Zbigniew Jędrzejewski-Szmek f9568765d4 variuos: fwrite() does not set errno
The man page doesn't even mention errno. It just says that ferror() should
be used to check for errors. Those writes are unlikely to fail, but if they
do, errno might even be 0. Also, we have fflush_and_check() which does
additional paranoia around errno, because we apparently do not trust that
errno will always be set correctly.
2023-12-05 19:18:23 +01:00
Zbigniew Jędrzejewski-Szmek dd0630277b TEST-26: add test for systemctl edit --stdin 2023-12-05 18:47:19 +01:00
Zbigniew Jędrzejewski-Szmek 329050c5e2 systemctl: add "edit --stdin"
This is a fancy wrapper around "cat <<EOF", but:
- the user doesn't need to figure out the file name,
- parent directories are created automatically,
- daemon-reload is implied,
so it's a convenient way to create units or drop-ins.

Closes https://github.com/systemd/systemd/issues/21862.
2023-12-05 18:47:19 +01:00
Luca Boccassi f83a74dfb8 switch-root: also check that mount IDs are the same, not just inodes
If /run/nextroot/ has been set up, use it, even if the inodes are
the same. It could be a verity device that is reused, but with
different sub-mounts or other differences. Or the same / tmpfs with
different /usr/ mounts. If it was explicitly set up we should use it.

Use the new helper to check that the mount IDs are also the same,
not just the inodes.
2023-12-05 17:20:27 +00:00
Luca Boccassi 5134e54625 basic: add fds_are_same_mount() helper 2023-12-05 17:20:27 +00:00
Zbigniew Jędrzejewski-Szmek 232f017b1a systemctl: add message when edit is aborted
If the user edits result in an empty file (after stripping), we would silently
not do anything, aborting the edit. This is rather confusing, let's emit a
notice:

  $ build/systemctl --user edit asdf.service --full --stdin </dev/null
  /home/zbyszek/.config/systemd/user/asdf.service: after editing, new contents are empty, not writing file.

(This also works with an editor, instead of --stdin. The message is printed on
the console and is visible after the editor exits.)

While at it, fix the condition to skip writing file after stripping. We had
"old_contents", but we modified that string. In some code flows, we would
compare the stripped old contents (i.e. a string which by defintion doesn't
have a newline at the end) with a string to which we just appended a newline
(i.e. a string which by defintion has a newline at the end).
2023-12-05 18:11:45 +01:00
Zbigniew Jędrzejewski-Szmek 5161836bd0 shared/edit-util: split out function to populate temp file
In preparation for future changes: I want to add a mode where interactive
editing is not done, and when this preparation is moved to a helper, it's much
easier to skip it.

e->line is initialized to 1 and overwritten even if sync fails. Theoretically
this is against our style, but the alternative is to propagate a temporary
value of line through the layers, which adds a lot of noise. If we fail, this
EditFile object will not be used for anything, to the changed value of .line
has no effect.
2023-12-05 18:11:38 +01:00
Yu Watanabe 829732d40a basic: fix typo 2023-12-05 23:50:25 +09:00
Mike Yuan 5b3562898a systemctl: add support for Sleep() logind call 2023-12-05 22:18:32 +08:00
Mike Yuan cd4dd90b99 logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
Mike Yuan 0f15d14c76 logind: test: make sure string of HandleAction and SleepOperation match 2023-12-05 22:18:32 +08:00
Mike Yuan 181c525e9d logind: put more struct members into designated initializer 2023-12-05 22:18:32 +08:00
Mike Yuan c794877f1d logind: take HandleAction instead of HandleActionData at several places
Preparation for addition of HANDLE_SLEEP.
2023-12-05 22:18:31 +08:00
huyubiao 3769ba7570 fix: The example2 in hwdb.xml is unreasonable
use evdev:atkbd:dmi:bvnAcer:bvr:bdXXXXX:bd08/05/2010:svnAcer:pnX123: instead of evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pnX123
2023-12-05 14:09:18 +01:00
Mike Yuan 24ab77c3cd hibernate-resume: always clear HibernateLocation if system info matches
Follow-up for a628d933cc

HibernateInfo.from_efi is not actually useful. info.efi is only
set if the system identifier stored in EFI variable matches with
that of the running system, and thus the variable should be cleared
no matter whether resume= is set from kernel cmdline or not.
2023-12-05 16:52:19 +08:00
Mike Yuan 1fe536aa37 sleep: reduce the scope of hibernation_device 2023-12-05 16:52:19 +08:00
Mike Yuan 232efdc5bd hibernate-util: return 1 for hibernation_is_safe only when all checks pass
The return value is currently not used, but let's correct this.
2023-12-05 16:52:19 +08:00
Frantisek Sumsal 52c1fb6885 test: set correct group for systemd-journal-upload tests
We can't use the systemd-journal-upload user here, since it's created
dynamically by DynamicUser=yes. However, we can use the group specified
in SupplementaryGroups=, so do exactly that.
2023-12-05 09:07:14 +01:00
Frantisek Sumsal e4d216f2dc Revert "sysusers.d: create the user for systemd-journal-upload.service"
I have no idea what was my reasoning that led to this change, but it is
simply wrong: systemd-journal-upload.service uses
User=systemd-journal-upload together with DynamicUser=yes, so the user
doesn't have to (and shouldn't) exist before starting the service.

See:
  - https://github.com/systemd/systemd/commit/941afc4b902af21b0675e9e5d417c2ee6b202f30
  - https://src.fedoraproject.org/rpms/systemd/c/db8b8fe77ce30244ad82e70ec4e8302b0c9dbf41

This reverts commit 5b9dfd33c6.
2023-12-04 19:44:10 +01:00
Luca Boccassi 26522a66a3 Merge pull request #30313 from mrc0mmand/ubuntu-ci
Reduce the number of deny-list files for Ubuntu CI
2023-12-04 18:23:34 +00:00
Yu Watanabe 67bc3c1a8c tools/meson-vcs-tag: the third argument is optional
Follow-up for 1a71ac07ad.
2023-12-04 10:29:52 +00:00
Luca Boccassi a483c75822 Merge pull request #30314 from DaanDeMeyer/dmi
Document kernel configs required for reading credentials from SMBIOS
2023-12-04 10:29:06 +00:00
Daan De Meyer 6ee9467d4c mkosi: Update comment why we can't use linux-kvm yet 2023-12-04 11:16:52 +01:00
Daan De Meyer 2d05492040 Document kernel configs required for reading credentials from SMBIOS 2023-12-04 11:13:59 +01:00
Frantisek Sumsal 30349b09bd test: reenable TEST-30 on i*86
The original reason for deny-listing it was that it's flaky there. I'm
not sure if that's still the case, but the Ubuntu CI jobs for i*86 are
gone, so this file shouldn't be needed anymore anyway.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal fc55ef9b69 test: skip TEST-36 on s390x and powerpc
As QEMU there doesn't support NUMA nodes. Also, drop the now unneeded
deny-list file for Ubuntu CI.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal 6743066875 test: check if 'btrfs filesystem' supports 'mkswapfile'
Instead of deny-listing the test on Ubuntu CI, so it gets enabled
automagically once btrfs-progs is updated to a newer version there.
2023-12-04 11:12:51 +01:00
Frantisek Sumsal a311d4dd30 test: reenable TEST-25-IMPORT in Ubuntu CI
Let's see if #13973 is still an issue.
2023-12-04 10:16:02 +01:00
Luca Boccassi cc9f4cad8c executor: apply LogLevelMax earlier
SELinux logs before we have a chance to apply it, move it up as it
breaks TEST-04-JOURNAL:

[  408.578624] testsuite-04.sh[11463]: ++ journalctl -b -q -u silent-success.service
[  408.578743] testsuite-04.sh[11098]: + [[ -z Dec 03 13:38:41 H systemd-executor[11459]: SELinux enabled state cached to: disabled ]]

Follow-up for: bb5232b6a3
2023-12-04 11:45:22 +09:00
Yu Watanabe b88f0fdc87 Merge pull request #30305 from yuwata/seccomp-fix
seccomp: override the default action only when the filter is allow-list
2023-12-04 11:44:58 +09:00
Zbigniew Jędrzejewski-Szmek 8244f394da tests: fix section mapping in test_ukify.py
The regexp only worked if the sections were small enough for the size to
start with "0". I have an initrd that is 0x1078ec7e bytes, so the tests
would spuriously fail.
2023-12-03 12:34:43 +00:00