Lennart Poettering [Mon, 7 Aug 2023 14:36:26 +0000 (16:36 +0200)]
shutdown: handle gracefully if MD_LEVEL udev propery is not set
See: #28490
Lennart Poettering [Mon, 7 Aug 2023 13:36:39 +0000 (15:36 +0200)]
varlink: don't allocate fd control buffer on each read()
We'll need this on each read() again, hence let's just allocate this
once and then reuse it for subsequent read()s.
Follow-up for: #28639
Daan De Meyer [Mon, 7 Aug 2023 18:17:41 +0000 (20:17 +0200)]
mkosi: Unmount /etc/resolv.conf if it's a mountpoint
Jan Macku [Mon, 7 Aug 2023 13:11:00 +0000 (15:11 +0200)]
ci(lint): exclude `.in` files from ShellCheck lint
Exclude all `.in` files because they may contain unsupported syntax, and
they have to be preprocessed first. For example:
```sh
Error: SHELLCHECK_WARNING:
./src/rpm/systemd-update-helper.in:130:37: warning[SC1083]: This { is literal. Check expression (missing ;/\n?) or quote it.
```
Related to: https://github.com/systemd/systemd/pull/28521
Zbigniew Jędrzejewski-Szmek [Mon, 7 Aug 2023 17:27:13 +0000 (19:27 +0200)]
Merge pull request #28521 from keszybz/rpm-reload
rpm: add %systemd_postun_with_reload and %systemd_user_postun_with_reload
Vincent Haupert [Mon, 7 Aug 2023 06:51:02 +0000 (08:51 +0200)]
repart: derive verity salt and uuid from seed
Daan De Meyer [Mon, 7 Aug 2023 13:23:49 +0000 (15:23 +0200)]
repart: Extend check for read-only verity partitions
Let's check for verity signature partitions as well. Let's also
check the configured verity mode, which is another way to indicate
verity partitions aside from the type UUID.
Lennart Poettering [Mon, 7 Aug 2023 13:36:32 +0000 (15:36 +0200)]
update TODO
Emil Renner Berthing [Sat, 29 Jul 2023 20:26:54 +0000 (22:26 +0200)]
90-loaderentry: support installing device trees
Like the cmdline file we look for a devicetree file in
$KERNEL_INSTALL_CONF_ROOT, /etc/kernel and /usr/lib/kernel. If it is
present we look for the specified device tree that comes with the kernel
we're adding and install it into $ENTRY_DIR_ABS and add a devicetree
stanza to the loader entry.
Unfortunately it seems there is no common consensus on where to install
device tree blobs, so we have to look in a few different places for it.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jul 2023 17:24:58 +0000 (19:24 +0200)]
rpm: add %systemd_user_daemon_reexec
This macros wraps the call to daemon-reexec in all user managers. It would be
called for example from systemd %post right after the call to systemctl
daemon-reexec.
This will be used in the Fedora systemd package to fix a long-standing FIXME.
Tested via building and reinstalling the systemd package with the patches.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jul 2023 17:03:21 +0000 (19:03 +0200)]
rpm: use rpm.execute() in more cases
7bde8293a4f4ccfe4b5c5000869068e3c1ac45c6 converted all the posix.execp()
calls, but I do not see why we shouldn't also convert the posix.exec()
calls.
Zbigniew Jędrzejewski-Szmek [Wed, 26 Jul 2023 07:02:04 +0000 (09:02 +0200)]
rpm: add %systemd_postun_with_reload and %systemd_user_postun_with_reload
For some units, the package would like to issue a reload. The machinery was
already in place since
c9615f73521986b3607b852c139036d58973043c:
systemctl reload-or-restart --marked
Enqueues restart jobs for all units that have the 'needs-restart'
mark, and reload jobs for units that have the 'needs-reload' mark.
When a unit marked for reload does not support reload, restart will
be queued.
The new macros allow a reload to be issued instead of a restart.
Based on the discussion on fedora-devel:
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/IJSUGIEJNYZZRE53FF4YFUEBRHRAVIXR/
Tested using dummy package https://github.com/keszybz/rpm-test-reload.
Zbigniew Jędrzejewski-Szmek [Fri, 28 Jul 2023 15:54:59 +0000 (17:54 +0200)]
manager: fix reloading in reload-or-restart --marked
bus_unit_queue_job_one has two callers:
- bus_unit_queue_job which would do the appropriate transormations
to turn JOB_TRY_RESTART into JOB_TRY_RELOAD,
- and method_enqueue_marked_jobs which did not.
In effect, method_enqueue_marked_jobs() would queue restart jobs for
units which has Markers= needs-reload or needs-restart.
When the chunk of code which does the transformations is moved from
bus_unit_queue_job to bus_unit_queue_job_one, there is no change for
bus_unit_queue_job, and method_enqueue_marked_jobs is fixed.
The additional checks that are done seem reasonable to do from
method_enqueue_marked_jobs: we shouldn't be restarting units which are
configured to not allow that, or force unwanted start of dbus-broker.
Marc Pervaz Boocha [Sun, 30 Jul 2023 17:05:39 +0000 (22:35 +0530)]
Teach 60-ukify.install to search the staging dir
60-ukify.install would only work with initrd provided by command line
arguements. Fixed to look for both microcode and initrd is found in
$KERNEL_INSTALL_STAGING_AREA which is placed by initrd generator like
mkinitcpio
Lennart Poettering [Mon, 7 Aug 2023 09:36:20 +0000 (11:36 +0200)]
Merge pull request #28627 from yuwata/udev-default-children-max
udev: allow to set 0 for the maximum number of worker process
Daan De Meyer [Sat, 5 Aug 2023 17:31:09 +0000 (19:31 +0200)]
repart: Stat temporary file again after mkfs
This makes sure we use the actual size after mkfs which seems to be
important for btrfs as it refuses to mount the partition otherwise.
Follow-up for
2843df3e5734aa07b82b96ba46b799921a6495b8
Mike Yuan [Sat, 5 Aug 2023 14:31:24 +0000 (22:31 +0800)]
shared/fstab-util: use is_device_path instead of is_device_node
Follow-up for
99299d0d5a722812cedc0a23e4987f90a257c2d2
is_device_node() calls lstat(), causing device node
symlinks under /dev/disk/ not being compared correctly
using devnode_same().
Fixes #28585
Frantisek Sumsal [Sat, 5 Aug 2023 14:35:09 +0000 (16:35 +0200)]
ukify: don't panic when prepending to an undefined list
Handle the case when all the arguments are passed in through a
configuration file:
$ cat ukify.conf
[UKI]
Linux = /boot/vmlinuz-linux
Initrd = /boot/initramfs-linux.img
Before:
$ src/ukify/ukify.py --config ukify.conf build
Traceback (most recent call last):
File "/root/systemd/src/ukify/ukify.py", line 1604, in <module>
main()
File "/root/systemd/src/ukify/ukify.py", line 1590, in main
opts = parse_args()
^^^^^^^^^^^^
File "/root/systemd/src/ukify/ukify.py", line 1584, in parse_args
apply_config(opts)
File "/root/systemd/src/ukify/ukify.py", line 1431, in apply_config
item.apply_config(namespace, section_name, group, key, value)
File "/root/systemd/src/ukify/ukify.py", line 1123, in apply_config
self.config_push(namespace, group, dest, value)
File "/root/systemd/src/ukify/ukify.py", line 1019, in config_list_prepend
setattr(namespace, dest, value + old)
~~~~~~^~~~~
TypeError: can only concatenate list (not "NoneType") to list
After:
$ src/ukify/ukify.py --config ukify.conf build
Kernel version not specified, starting autodetection 😖.
Found uname version: 6.4.7-arch1-3
Wrote unsigned vmlinuz-linux.unsigned.efi
Resolves: #28688
Yu Watanabe [Tue, 1 Aug 2023 16:19:37 +0000 (01:19 +0900)]
man: update document about the maximum number of child processes
Yu Watanabe [Tue, 1 Aug 2023 16:14:04 +0000 (01:14 +0900)]
udev: allow to set the maximum number of worker process to 0
In that case, the maximum is calculated based on the system resources.
Yu Watanabe [Tue, 1 Aug 2023 16:07:12 +0000 (01:07 +0900)]
udev: split out manager_set_default_children_max()
Mike Yuan [Sat, 5 Aug 2023 04:35:17 +0000 (12:35 +0800)]
man/systemd: avoid duplicate variable name
Frantisek Sumsal [Fri, 4 Aug 2023 16:02:01 +0000 (18:02 +0200)]
test: ignore missing libudev when creating the test image
Same scenario as with libsystemd - ldd might use unprefixed RPATH, and
we install our own stuff into the image unconditionally anyway.
Also, bail out early if we hit a missing DSO with a possibly helpful
message.
Dan Streetman [Fri, 4 Aug 2023 20:12:05 +0000 (16:12 -0400)]
tpm2: use ELEMENTSOF() instead of sizeof() for TPML_PCR_SELECTION pcrSelections field
The count field indicates the number of elements in the pcrSelections field,
and the size of each elements is greater than 1 byte, so using sizeof() is
incorrect when verifying the count field is valid; instead ELEMENTSOF() should
be used.
Caught by coverity check: https://github.com/systemd/systemd/pull/26331#pullrequestreview-
1556629586
Yu Watanabe [Sat, 5 Aug 2023 04:30:49 +0000 (13:30 +0900)]
Merge pull request #28681 from yuwata/udev-vs-tmpfiles
Udev vs tmpfiles
Luca Boccassi [Fri, 4 Aug 2023 20:04:03 +0000 (21:04 +0100)]
Merge pull request #28398 from ddstreet/tpm2_specify_pcr_value
Tpm2 specify pcr value
Yu Watanabe [Fri, 4 Aug 2023 20:03:16 +0000 (05:03 +0900)]
test: shorten timeout for 'udevadm monitor'
The command should never finish, it is not necessary to wait so long.
Yu Watanabe [Fri, 4 Aug 2023 19:52:16 +0000 (04:52 +0900)]
test: add short test for device node permission
Yu Watanabe [Fri, 4 Aug 2023 19:37:19 +0000 (04:37 +0900)]
unit: make udev rules take precesence over tmpfiles
Without this change, there are no ordering between udevd and tmpfiles,
and if tmpfiles is invoked later it may discard the permission set by
udevd.
Fixes an issue introduced by
b42482af904ae0b94a6e4501ec595448f0ba1c06.
Fixes #28588 and #28653.
Yu Watanabe [Fri, 4 Aug 2023 19:32:01 +0000 (04:32 +0900)]
Revert "tmpfiles.d: adjust /dev/vfio/vfio access mode"
The issue needs to be fixed by setting proper ordering between the
tmpfiles and udevd.
See issue #28653, especially
https://github.com/systemd/systemd/issues/28653#issuecomment-
1665181625.
This reverts commit
a3d610998ad3b4c88224fe89a048a84dbceb652b.
Zbigniew Jędrzejewski-Szmek [Fri, 4 Aug 2023 17:08:43 +0000 (18:08 +0100)]
journalctl: fix loggging invocation
Fixup for
f882a986c271c3de1c622df0f1586946b4a09fef.
Luca Boccassi [Fri, 4 Aug 2023 18:24:46 +0000 (19:24 +0100)]
Merge pull request #28679 from keszybz/two-new-news-tweaks
Two news tweaks
Daan De Meyer [Fri, 4 Aug 2023 18:16:55 +0000 (20:16 +0200)]
Merge pull request #28669 from DaanDeMeyer/mkosi-fix
mkosi: Make sure our systemd build always overrides the distros
Daan De Meyer [Fri, 4 Aug 2023 14:12:35 +0000 (16:12 +0200)]
tmpfiles: Consider ENOPKG as information not available
We already handle the case where /etc/machine-id is empty. Let's make
sure we also handle the case where /etc/machine-id is "uninitialized".
Luca Boccassi [Fri, 4 Aug 2023 12:34:00 +0000 (13:34 +0100)]
portablectl: fix regression when using --force without extension parameters
c18f4eb9e96836a made it possible to use --force with various verbs, by
going through the newer D-Bus methods. Except it didn't, as it regressed
during PR review refactorings, and nobody noticed because there were no
tests for it. Fix it, and add tests.
Follow-up for
c18f4eb9e96836a6a8285ec42fd8a34c8909f6d9
Luca Boccassi [Fri, 4 Aug 2023 15:46:56 +0000 (16:46 +0100)]
Merge pull request #28673 from YHNdnzj/hibernate-resume-escape-node
hibernate-resume-generator: escape device path passed to hibernate-resume
Dan Streetman [Thu, 13 Jul 2023 20:02:37 +0000 (16:02 -0400)]
tpm2: update TEST-70-TPM2 to test passing PCR value to systemd-cryptenroll
Add tests to use expected, not current, PCR values during sealing.
Dan Streetman [Fri, 14 Jul 2023 22:36:20 +0000 (18:36 -0400)]
man: update systemd-cryptenroll man page with details on --tpm2-pcrs format change
The previous commit extended the accepted format of --tpm2-pcrs to allow
specifying the hash algorithm (i.e. PCR bank) and hash digest value, this
updates the man page with those changes.
Dan Streetman [Wed, 12 Jul 2023 21:35:54 +0000 (17:35 -0400)]
tpm2: move policy calculation out of tpm2_seal()
Move the calculation of the sealed object policy hash out of the tpm2_seal()
function. Instead, callers of tpm2_seal() can directly call
tpm2_calculate_sealing_policy() and then provide the policy hash to
tpm2_seal().
Dan Streetman [Tue, 27 Jun 2023 19:03:08 +0000 (15:03 -0400)]
tpm2: add functions to convert TPM2B_PUBLIC to/from openssl pkey or PEM
Add functions to convert a PEM or pkey to TPM2B_PUBLIC, and functions to
convert TPM2B_PUBLIC to pkey or fingerprint.
Supports both RSA and ECC keys.
Add ECC support to some test-tpm2 tests, and tests to cover the newly added functions.
Dan Streetman [Thu, 6 Jul 2023 15:21:29 +0000 (11:21 -0400)]
openssl: add test-openssl
Add openssl unit tests.
Dan Streetman [Thu, 6 Jul 2023 15:21:29 +0000 (11:21 -0400)]
test: add DEFINE_HEX_PTR() helper function
Use function in test-tpm2 to convert hex strings to void* and len vars.
Dan Streetman [Tue, 4 Jul 2023 22:52:59 +0000 (18:52 -0400)]
openssl: add ecc_pkey_new(), ecc_pkey_from_curve_x_y(), ecc_pkey_to_curve_x_y()
Add function to create openssl pkey from ECC curve and point, and function to
get curve id and x/y point from existing ECC pkey. Also add function to create
new ECC key for specified curve.
Also add DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_MACRO() to handle case when func() is
a macro, not a function symbol; specifically in this case it is used for
OPENSSL_free() which is a macro.
Dan Streetman [Tue, 27 Jun 2023 18:53:46 +0000 (14:53 -0400)]
openssl: add rsa_pkey_new(), rsa_pkey_from_n_e(), rsa_pkey_to_n_e()
Add function to generate an EVP_PKEY for a specific 'n' and 'e', and function
to get 'n' and 'e' values from existing RSA public key. Also add a function to
generate a new RSA key with a specified number of bits.
Dan Streetman [Wed, 19 Jul 2023 02:48:34 +0000 (22:48 -0400)]
openssl: add openssl_pkey_from_pem()
Add function to create EVP_PKEY from PEM buffer.
Dan Streetman [Tue, 18 Jul 2023 16:56:25 +0000 (12:56 -0400)]
tpm2: add tpm2_pcr_read_missing_values()
Add function to read all unset values in an array of Tpm2PCRValue entries.
Also publish tpm2_pcr_read() in header.
Dan Streetman [Wed, 19 Jul 2023 11:49:07 +0000 (07:49 -0400)]
tpm2: add TPM2B_*_MAKE(), TPM2B_*_CHECK_SIZE() macros
The tpm2-tss library has many structs with only an array and size; these macros
make it easy to assign to these structs.
Dan Streetman [Thu, 13 Jul 2023 02:36:37 +0000 (22:36 -0400)]
tpm2: change tpm2_parse_pcr_argument() parameters to parse to Tpm2PCRValue array
In order to allow users to specify expected PCR values, change the
tpm2_parse_pcr_argument() to parse the text argument into an array of
Tpm2PCRValue objects, which provide not only the selected PCR indexes, but also
(optionally) the hash algorithm and hash value for each PCR index.
Dan Streetman [Thu, 13 Jul 2023 02:14:18 +0000 (22:14 -0400)]
tpm2: change tpm2_calculate_policy_pcr(), tpm2_calculate_sealing_policy() to use Tpm2PCRValue array
An array of Tpm2PCRValue objects effectively replaces a TPML_PCR_SELECTION
object combined with an array of (properly ordered) TPM2B_DIGEST objects.
Also update tpm2_calculate_sealing_policy() pin parameter to boolean use_pin,
since the function does not need to know the pin value, only if a pin is being
used.
Dan Streetman [Fri, 14 Jul 2023 11:23:55 +0000 (07:23 -0400)]
tpm2: declare tpm2_log_debug_*() functions in tpm2_util.h
Allow other code to use the log debug functions; e.g. they are useful in test
code.
Dan Streetman [Fri, 14 Jul 2023 15:38:11 +0000 (11:38 -0400)]
tpm2: move declared functions in header lower down
Move some function declarations lower down, below the Tpm2Context and
Tpm2Handle typedefs; later commits will reference the typedefs in some of the
functions, so the typedefs need to come first in the header.
This only moves the declarations, none of the declarations are modified.
Dan Streetman [Wed, 12 Jul 2023 01:23:36 +0000 (21:23 -0400)]
tpm2: add Tpm2PCRValue struct and associated functions
Add a new struct that can represent a PCR index, hash, and value all
together. This replaces code (e.g. the tpm2_pcr_read() parameters) that
required using both a TPML_PCR_SELECTION as well as array of TPM2B_DIGEST
entries, which was difficult to correlate the selection hash/index to each
digest.
Dan Streetman [Wed, 19 Jul 2023 12:50:06 +0000 (08:50 -0400)]
tpm2: add more helper functions for managing TPML_PCR_SELECTION and TPMS_PCR_SELECTION
Add more functions to help manage these objects.
Dan Streetman [Tue, 1 Aug 2023 16:55:17 +0000 (12:55 -0400)]
tpm2: change tpm2_tpm*_pcr_selection_to_mask() to return mask
This simplifies use of the functions, as well as avoiding the use of -ENOENT
from tpm2_tpml_pcr_selection_to_mask().
Dan Streetman [Tue, 11 Jul 2023 15:11:59 +0000 (11:11 -0400)]
tpm2: add tpm2_hash_alg_to_size()
Add function to get the hash size for a hash algorithm
Dan Streetman [Tue, 1 Aug 2023 18:09:04 +0000 (14:09 -0400)]
tpm2: add debug logging to functions converting hash or asym algs to/from strings or ids
Add debug log message if the algorithm name or id is not known.
Daan De Meyer [Fri, 4 Aug 2023 14:27:11 +0000 (16:27 +0200)]
mkosi: Use SuccessActionExitStatus= in mkosi-check-and-shutdown.service
Daan De Meyer [Fri, 4 Aug 2023 08:40:30 +0000 (10:40 +0200)]
mkosi: Make sure our systemd build always overrides the distros
Currently, we install the systemd install tree in the base image and
then build the initrd and final images from the base image. This means
if that any systemd package is pulled in during the initrd or final
image builds, it will override our version.
To fix this, we stop installing our build of systemd in the base image,
and store it in the output directory instead. That allows us to refer to
it using ExtraTrees= in the final and initrd image builds to install it
after all the distro packages have been installed, ensuring our version
always takes priority.
Daan De Meyer [Fri, 4 Aug 2023 14:48:58 +0000 (16:48 +0200)]
mkosi: Update to latest
Daan De Meyer [Fri, 4 Aug 2023 13:23:16 +0000 (15:23 +0200)]
test-user-util: Drop tty check in gid_to_name() test
The tty user is not guaranteed to exist, so let's remove the dependency
from the test.
Zbigniew Jędrzejewski-Szmek [Wed, 2 Aug 2023 14:01:50 +0000 (15:01 +0100)]
NEWS: adjust grammar
Zbigniew Jędrzejewski-Szmek [Wed, 2 Aug 2023 14:01:40 +0000 (15:01 +0100)]
NEWS: expand list of new Startup* settings
This way users can grep/search the NEWS file for when a given setting was
added.
Kingbom Dou [Wed, 7 Jun 2023 06:57:21 +0000 (14:57 +0800)]
timesyncd: emit signal when timesyncd NTPServers property changes
Emit signal when timesyncd LinkNTPServers property changes
Tested:
```
Monitoring bus message stream.
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=21 Timestamp="Fri 2023-05-19 07:50:47.427051 UT"
Sender=:1.623 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.623
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
STRING "10.8.8.19";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=28 Timestamp="Fri 2023-05-19 07:53:22.609416 UT"
Sender=:1.623 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.623
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
STRING "10.8.8.20";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=6 Timestamp="Fri 2023-05-19 08:12:26.964666 UTC"
Sender=:1.627 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Memberd
UniqueName=:1.627
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "LinkNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.8.8.18";
};
};
};
};
ARRAY "s" {
};
};
```
```
> Type=signal Endian=l Flags=1 Version=1 Cookie=162 Timestamp="Mon 2023-07-10 09:06:18.865654 UTC"
Sender=:1.1 Path=/org/freedesktop/timesync1 Interface=org.freedesktop.DBus.Properties Member=PropertiesChanged
UniqueName=:1.1
MESSAGE "sa{sv}as" {
STRING "org.freedesktop.timesync1.Manager";
ARRAY "{sv}" {
DICT_ENTRY "sv" {
STRING "RuntimeNTPServers";
VARIANT "as" {
ARRAY "s" {
STRING "10.2.16.10";
};
};
};
};
ARRAY "s" {
};
};
```
Signed-off-by: Kingbom Dou <doujinbao@bytedance.com>
Mike Yuan [Fri, 4 Aug 2023 12:41:46 +0000 (20:41 +0800)]
hibernate-resume-generator: escape device path passed to hibernate-resume
Follow-up for #27330
Fixes #28668
Mike Yuan [Fri, 4 Aug 2023 12:49:15 +0000 (20:49 +0800)]
man/systemd.unit: DefaultTimeoutStartSec= -> DefaultDeviceTimeoutSec=
for device unit job timeouts
Follow-up for #24044
Antonio Alvarez Feijoo [Fri, 4 Aug 2023 09:16:02 +0000 (11:16 +0200)]
man/systemd-fsck@.service: clarify passno and noauto combination in /etc/fstab
Fixes #28657
Daan De Meyer [Fri, 4 Aug 2023 06:25:53 +0000 (08:25 +0200)]
debug-generator: Use generator_add_symlink()
Dan Streetman [Thu, 3 Aug 2023 18:44:57 +0000 (14:44 -0400)]
tpm2: use CreatePrimary() to create primary keys instead of Create()
Older versions used CreatePrimary() to create a transient primary key to use
when creating a sealed data object. That was changed in v254 to use Create()
instead, which should result in the same transient key, but it seems some
hardware TPMs refuse to allow using Create() to generate primary keys.
This reverts to using CreatePrimary() to create primary key.
Fixes: #28654
Mike Yuan [Fri, 4 Aug 2023 04:45:32 +0000 (12:45 +0800)]
Merge pull request #28648 from yuwata/shutdown-skip-recursive-mount-run
shutdown: several fixlets
Daan De Meyer [Thu, 3 Aug 2023 20:38:10 +0000 (22:38 +0200)]
tree-wide: Fix -Wmaybe-uninitialized compilation warnings
OMOJOLA JOSHUA [Mon, 19 Jun 2023 14:16:23 +0000 (15:16 +0100)]
Add tool to display emergency log message full-screen on boot failure.
Yu Watanabe [Thu, 3 Aug 2023 19:03:29 +0000 (04:03 +0900)]
switch-root: reopen target directory after it is mounted
Fixes a bug introduced by
f717d7a40a696b351415976f22a4f498c401de41.
Yu Watanabe [Wed, 2 Aug 2023 19:19:14 +0000 (04:19 +0900)]
shutdown: do not umount recursively before MS_MOVE
Unmounting filesystem will be done gracefully by shutdown itself.
Follow-up for
f2c1d491a539035d6cc1fa53a7cef0cbc8d52902 and
268d1244e87a35ff8dff56c92ef375ebf69d462e.
Yu Watanabe [Wed, 2 Aug 2023 17:50:09 +0000 (02:50 +0900)]
shutdown: disable recursive mount of /run/ on switching root
Mounting /run/ recursively may be harmless, but not necessary on
shutdown as the new root is /run/initramfs.
Follow-up for
b12d41a8bb7c99f7d7a1c7821a886d98b42d9ce0.
Oğuz Ersen [Thu, 3 Aug 2023 17:21:04 +0000 (19:21 +0200)]
po: Translated using Weblate (Turkish)
Currently translated at 88.1% (200 of 227 strings)
Co-authored-by: Oğuz Ersen <oguz@ersen.moe>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/tr/
Translation: systemd/main
Mike Yuan [Thu, 3 Aug 2023 13:42:00 +0000 (21:42 +0800)]
vconsole: support KEYMAP=kernel for preserving kernel keymap
Follow-up for #26089 and #28505
Currently, if default-keymap is not empty, there's no way
to ask vconsole-setup to retain the kernel keymap. Let's
accept a special value "kernel" for that purpose.
Addresses the problem mentioned in https://github.com/systemd/systemd/pull/28505#issuecomment-
1663681665
Maxim Mikityanskiy [Thu, 3 Aug 2023 14:40:15 +0000 (17:40 +0300)]
hwdb: Mute SW rfkill keys on MSI Wind U100
Kernel patch [1] fixed bugs in rfkill handling on MSI Wind U100. Now
that the HW rfkill reports the correct state, and the SW rfkill is
controllable from userspace, it's necessary to mute KEY_WLAN and
KEY_BLUETOOTH generated on HW rfkill state changes. Otherwise, the
userspace will react to these keys and toggle the SW rfkill as well,
which is not desired, because the user may end up with non-functional
radios if HW and SW rfkills are out of sync.
Blocking these keycodes doesn't impair user experience, because the
desktop environment can still react to HW rfkill events and act
accordingly (for example, show notifications).
While at it, use "unknown" instead of "reserved" to mute keys, to avoid
the "atkbd serio0: Unknown key pressed" flood in dmesg.
[1]: https://lore.kernel.org/all/
20230721145423.161057-1-maxtram95@gmail.com/
Yu Watanabe [Thu, 3 Aug 2023 17:16:07 +0000 (02:16 +0900)]
Merge pull request #28628 from yuwata/meson-use-template-part6
meson: use template to declare executables (part 6)
Daan De Meyer [Thu, 3 Aug 2023 13:33:40 +0000 (15:33 +0200)]
mkosi: Update to latest
We modify all our scripts to execute in the image instead of on the
hosts. In the future we can adapt them to run on the host.
Daan De Meyer [Thu, 3 Aug 2023 11:49:31 +0000 (13:49 +0200)]
Merge pull request #28632 from DaanDeMeyer/repart-synthesize
repart: Add --copy-from option
Yu Watanabe [Mon, 26 Jun 2023 16:28:32 +0000 (01:28 +0900)]
meson: set suite for all tests, and adjust suite for some tests
Yu Watanabe [Mon, 26 Jun 2023 16:07:25 +0000 (01:07 +0900)]
meson: also merge declarations of fuzzers with other executables
Yu Watanabe [Sun, 25 Jun 2023 23:52:26 +0000 (08:52 +0900)]
meson: merge declarations of normal and test executables
Yu Watanabe [Thu, 3 Aug 2023 10:57:41 +0000 (19:57 +0900)]
test: rename udev-rule-runner -> test-udev-rule-runner
This partially revert
0454cf05d38d289474ca65c1917d414b2958f6b5.
The executable actually does not work with itself, but needs to be
combined with test-udev.py. But, even so, the executable is for testing.
In the next commit, test and normal executables are declared in the same
way, and naming of the executable becomes essential to classify them.
Let's rename the executable and prefix with 'test-'.
Yu Watanabe [Sun, 25 Jun 2023 20:01:03 +0000 (05:01 +0900)]
meson: use template to declare udev plugins
Yu Watanabe [Sat, 29 Jul 2023 21:32:53 +0000 (06:32 +0900)]
meson: introduce HAVE_DMI flag
The condition is used at several places. Let's introduce a simple flag
for that.
Yu Watanabe [Thu, 3 Aug 2023 11:36:51 +0000 (20:36 +0900)]
test: fix test executable name
Follow-up for
82a1d6d09625b656c991f25e82b5651c74a55945.
Yu Watanabe [Sun, 25 Jun 2023 18:46:05 +0000 (03:46 +0900)]
meson: move several test declarations
One of the notable change is that previously test-sysusers.sh was installed
unconditionally, but now it is installed only when sysusers is enabled.
Another change is that test-sysv-generator is now re-introduced which
was mistakenly dropped by
6c713961ab0831fe744a2df9c4e9e258b6ba3105.
Daan De Meyer [Tue, 1 Aug 2023 19:38:39 +0000 (21:38 +0200)]
repart: Add --copy-from option
--copy-from synthesizes partition definitions from the given image
which are then applied to the repart algorithm. In its most basic
form, this allows copying an image to another device but it can
also be combined with --definitions to copy + add partitions in the
same call to repart.
Luca Boccassi [Wed, 2 Aug 2023 23:12:05 +0000 (00:12 +0100)]
Merge pull request #28651 from kraj/kraj/include-fixes
Add missing system includes for `LOCK_EX` and `struct timex`
Khem Raj [Wed, 2 Aug 2023 19:18:24 +0000 (12:18 -0700)]
include missing sys/file.h for LOCK_EX
Khem Raj [Wed, 2 Aug 2023 19:14:56 +0000 (12:14 -0700)]
test/test-sizeof: Include sys/timex.h for struct timex
Fixes
../git/src/test/test-sizeof.c:64:41: error: incomplete definition of type 'struct timex'
64 | check(typeof(((struct timex *)0)->freq), SIZEOF_TIMEX_MEMBER);
| ~~~~~~~~~~~~~~~~~~~^
Yu Watanabe [Wed, 2 Aug 2023 21:45:09 +0000 (06:45 +0900)]
Merge pull request #28640 from medhefgo/boot-count
bless-boot: Actually return successfully
Yu Watanabe [Wed, 2 Aug 2023 15:53:48 +0000 (00:53 +0900)]
journalctl: do not add io event source for stdout if it is a file
Fixes a bug introduced by
713342d9b09d717e9942ed08bd620c9159a98fb8.
Fixes #28636.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=
2228089.
Frantisek Sumsal [Wed, 2 Aug 2023 12:55:50 +0000 (14:55 +0200)]
varlink: allocate the buffer for varlink FDs on the heap
Since it's ~16K, which might cause issues in environments with limited
stack space.
Resolves: #28635
Yu Watanabe [Wed, 2 Aug 2023 14:33:14 +0000 (23:33 +0900)]
udev: decrease devlink priority for encrypted partitions
Decrease devlink priority for encrypted partitions, and make the priority for
decrypted DM devices relatively higher. This is for the case that an encrypted
partition and its decrypted DM device have the same label.
Yu Watanabe [Wed, 2 Aug 2023 20:48:58 +0000 (05:48 +0900)]
Merge pull request #28646 from yuwata/network-generator-ip-dhcp
network-generator: make ip=dhcp works with container manager
Khem Raj [Wed, 2 Aug 2023 17:33:48 +0000 (10:33 -0700)]
include sys/file.h for LOCK_EX
Fixes
| ../git/src/basic/user-util.c:708:30: error: use of undeclared identifier 'LOCK_EX'; did you mean 'LOCK_BSD'?
| 708 | r = unposix_lock(fd, LOCK_EX);
| | ^~~~~~~
| | LOCK_BSD
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Etienne Dechamps [Wed, 2 Aug 2023 17:52:41 +0000 (18:52 +0100)]
NEWS: PrivateNetwork implies PrivateMounts
This is clearly a change that can break existing units, and broke my
system in at least two different ways. For this reason this should have
been added to NEWS in #26458, specifically
c2da3bf, but wasn't.
Yu Watanabe [Wed, 2 Aug 2023 17:12:10 +0000 (02:12 +0900)]
network-generator: make network file generated from ip=dhcp matches only physical interfaces
Otherwise, it also matches later created virtual devices, and that
breaks networks generated and managed by container management services,
like docker.
Closes #28626.