Commit Graph

84457 Commits

Author SHA1 Message Date
Lennart Poettering
d2d1fc59b4 conf-files: optionally truncate suffix from discovered files 2025-11-02 21:14:35 +01:00
Lennart Poettering
86279dc970 format-table: add field type that outputs hex values prefixed with 0x 2025-11-02 21:14:35 +01:00
Lennart Poettering
7ecc69c33b fileio: add new flag READ_FULL_FILE_VERIFY_REGULAR() that checks if file we operate on is regular 2025-11-02 21:14:35 +01:00
Lennart Poettering
1acec1c890 fileio: make filename/path argument optional in xfopenat_full(), read_full_file_full() 2025-11-02 21:14:35 +01:00
Zbigniew Jędrzejewski-Szmek
5fa2fb65a6 Enhance docs for ukify and direct kernel boots (#39516) 2025-11-02 18:04:15 +01:00
Zbigniew Jędrzejewski-Szmek
cde713bfe4 man: say "systemd-boot" instead of "sd-boot" consistently
As requested in

https://github.com/systemd/systemd/pull/39516#pullrequestreview-3407564896.
2025-11-02 15:20:59 +01:00
Zbigniew Jędrzejewski-Szmek
02539f008d man/ukify: mention all functionality in intro, add example of direct boot
Over the time, the functionality in ukify has grown. This should all be briefly
mentioned in the first section so the user does't have to read the whole page
to figure out what types of functionality are implemnted.

Also add an example of direct kernel boot. It's a nifty technology (and frankly
underutilized, considering how cool it is is).
2025-11-02 15:19:00 +01:00
Zbigniew Jędrzejewski-Szmek
4808c1686b man/sd-boot: add some meat to the direct kernel boot example
Unfortunately qemu still default to BIOS boot, so for the direct kernel
boot with an efi file to be of any use, the complex param used to switch
to UEFI mode needs to be provided.

Also add some links to qemu and OVMF.
2025-11-02 15:19:00 +01:00
Mike Yuan
a4dae3c118 rules.d/60-block.rules: fix typo 2025-11-02 10:56:31 +01:00
Yu Watanabe
c29e304562 Several OpenSSL related cleanups (#39455) 2025-11-02 17:21:51 +09:00
Alberto Planas
ab1f4e506f repart: support "nodatacow" in btrfs subvolumes
In btrfs-progs 6.15 it is planned to add a new parameter in mkfs.btrfs
--inode-flags, that can set attributes for subvolumes, directories, and
files.

The current supported attributes are "nodatacow", to disable CoW, and
"nodatasum", to disable the checksum.

This commit extend the "Subvolunes=" option to understand the
"nodatacow" flag for subvolums only.

If RepartOffline is enabled it will build the image without loopback
devices, using the correct --inode-flags parameters.

If RepartOffline is disabled it will use loopback devices and set the
btrfs attributes accordingly.

Signed-off-by: Alberto Planas <aplanas@suse.com>
2025-11-02 17:13:31 +09:00
Yu Watanabe
eeedea94da repart: fix typo
Follow-up for 15734190c7.
2025-11-02 17:03:03 +09:00
Yu Watanabe
4f589e8a50 resolvectl: fix typo
Follow-up for 7517e41a49.
2025-11-02 17:00:23 +09:00
Yu Watanabe
b7d752a67e openssl-util: drop unnecessary functions when OpenSSL support is disabled 2025-11-02 16:07:46 +09:00
Yu Watanabe
84946f12b5 openssl-util: sort cleanup functions 2025-11-02 16:07:46 +09:00
Yu Watanabe
c604b78b92 repart: drop OpenSSL specific logics when OpenSSL support is disabled 2025-11-02 16:07:46 +09:00
Yu Watanabe
e3ae29ead7 repart: merge common conditions
No functional change, just refactoring.
2025-11-02 16:07:46 +09:00
Yu Watanabe
6e91c5d8ea repart: make sign_verity_roothash() take Context
No functional change, just refactoring.
2025-11-02 16:07:46 +09:00
Yu Watanabe
0158eabb01 repart: load x509 certificate and private key after Context is allocated
This splits out context_load_keys() from parse_argv().
No functional change, just refactoring.
2025-11-02 16:07:46 +09:00
Yu Watanabe
219a67c131 bootctl: return earlier when secure boot auto-enrollment is requested but OpenSSL support is disabled 2025-11-02 16:07:46 +09:00
Yu Watanabe
1b48b63b51 bootctl: move conditions into corresponding functions 2025-11-02 16:07:46 +09:00
Yu Watanabe
61d1f394cc openssl-util: drop unused fake type definitions when OpenSSL is disabled 2025-11-02 16:07:46 +09:00
Yu Watanabe
09ae1c8ade pe-binary: drop pe_hash() and friends when OpenSSL support is disabled
These three functions are currently only used by sbsign, which requires
OpenSSL. Moreover, pe_hash() and uki_hash() anyway do not work if
OpenSSL is disabled. Let's only declare them when OpenSSL support is
enabled.
2025-11-02 16:07:46 +09:00
Yu Watanabe
ab9b3bec6a openssl-util: drop unused string_hashsum() and friends when OpenSSL is disabled 2025-11-02 16:07:46 +09:00
Yu Watanabe
a47a403ca2 resolvectl: return earlier from openpgp command when OpenSSL support is disabled
When OpenSSL is disabled, string_hashsum_sha256()/_sha224() in
resolve_openpgp() will fail anyway. Let's return earlier.
2025-11-02 16:07:46 +09:00
Yu Watanabe
a7807e66b7 coredump: several cleanups, modernizations, fixlets for corner cases (#39418) 2025-11-02 10:13:53 +09:00
Lennart Poettering
32f4e30be5 docs: add comment about requiring the mount hierarchy to be mounted MS_SHARED
This has been tripping up container manager people. let's document this
explicitly.

(Note that the container interface could really use some updates, i.e.
it was written before a time where cgroup namespacing was a thing. But I
am too lazy to fix that now, so let's just add this once facet.)
2025-11-02 00:19:57 +00:00
Yu Watanabe
ee3cd7890d Several cleanups for libcryptsetup dependency (#39452) 2025-11-02 08:07:15 +09:00
Lennart Poettering
d714edd26c repart: varlink support (#39421)
Split out of #38764

Replaces: #33741
2025-11-01 23:21:37 +01:00
Christoph Anton Mitterer
a983cf253f doc: indicate Type=oneshot also detects invocation failures
Type `simple` explicitly mentions that invocation failures like a missing binary
or `User=` name won’t get detected – whereas type `exec` mentions that it does.

Type `oneshot` refers to being similar to `simple`, which could lead one to
assume it doesn’t detect such invocation failures either – it seems however it
does.

Indicate this my changing its wording to be similar to `exec`.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
2025-11-01 22:48:28 +01:00
Lennart Poettering
d1aa3860b2 ci: add testcases for recently added stuff 2025-11-01 22:01:35 +01:00
Lennart Poettering
5f076e44fe repart: report vendor/model/subsystem fields in ListCandidateDevices
Prompted by: #39435
2025-11-01 22:01:35 +01:00
Lennart Poettering
ea94a05f8a blockdev-list: switch to log_device_xyz() style logging 2025-11-01 22:01:35 +01:00
Lennart Poettering
2103067f25 udev: introduce ID_BLOCK_SUBSYSTEM property
Virtual block devices are a bit weird: they have no parent device, and
thus cannot be related to the subsystem they belong to, except by
pattern matching their name. This is OK to do if one knows what to look
for. However for tools that do not want to carry a list of known
subsystems with their appropriate matching patters this sucks. Let's
introduce a new ID_BLOCK_SUBSYSTEM property we can set on block devices
that carries an explicit string for this. Do so for a small number of
key subsystems: DM, loopback and zram.
2025-11-01 22:01:35 +01:00
Lennart Poettering
63b9c8611d repart: sort input before output parameters in varlink IDL 2025-11-01 22:01:35 +01:00
Lennart Poettering
0f9d58cc36 repart: add knobs for automatically deferring all partitions marked as empty or for factory reset 2025-11-01 22:01:35 +01:00
Lennart Poettering
1c76e204d3 repart: send out progress information via varlink (if more flag is given)
And while we are at it, also send it out via sd_notify()
2025-11-01 22:01:35 +01:00
Lennart Poettering
15734190c7 repart: add Varlink call that runs repart's engine 2025-11-01 22:01:34 +01:00
Lennart Poettering
2ecfea7491 repart: if device node is specified as "-", calculate needed disk space
So far repart always required specification of a device node. And if
none was specified, then we'd fine the node backing the root fs. Let's
optionally allow that the device node is explicitly not specified (i.e.
specified as "-" or ""), in which case we'll just print the size of the
minimal image given the definitions.
2025-11-01 22:00:47 +01:00
Lennart Poettering
0eab6d2960 repart: split out main function that ponders about placement of partitions
Let's move the key code that places partitions into a function of its
own. That will make it easier to call this via varlink.
2025-11-01 21:58:28 +01:00
Lennart Poettering
a47cbb6d9d repart: move definitions + dry_run + empty fields into Context
This is preparation for making this eventually available via Varlink,
where we'd like to create Context object for each call that we can free
once it is done, but not inherit state from an earlier call.

Also fixes a couple of cases where we accessed arg_node, but where we
should have accessed the Context-specific copy in .node.
2025-11-01 21:58:28 +01:00
Lennart Poettering
eccd8d9a57 repart: use SD_JSON_BUILD_UNSIGNED for disk sizes, as we should 2025-11-01 21:58:28 +01:00
Lennart Poettering
b64eb98054 sd-varlink: fix sd_varlink_collect() with empty replies
Follow-up for: 48c64813ec
2025-11-01 21:58:28 +01:00
Lennart Poettering
633a4b8839 man: add documentation for the various sd_json_dispatch_xyz() calls
Now that we comprehensively return accept null it's a good idea to
document which function maps null to what.
2025-11-01 21:58:28 +01:00
Yu Watanabe
db1f63463a cryptsetup-util: sym_crypt_free() and friends are unused when libcryptsetup is disabled 2025-11-02 05:50:31 +09:00
Yu Watanabe
6afaa7fb3a cryptsetup-util: sort loaded function prototypes 2025-11-02 05:50:31 +09:00
Yu Watanabe
f8c33b1274 libcryptsetup: drop several unnecessary checks for existences of functions by libcryptsetyp
The functions crypt_set_metadata_size() and friends are supported since
libcryptsetup-2.0.

This also merges checks for functions used for supporting libcryptsetup
plugins with others.
Moreover, check existence of one more function (crypt_logf) that is used in
libcryptsetup plugins.
2025-11-02 05:49:29 +09:00
Lennart Poettering
93317e9c17 sd-json: parse signals also in string format 2025-11-01 21:43:37 +01:00
Lennart Poettering
786aaed943 sd-json: parse uid_t/gid_t as uint32_t first
Let's use the proper uint32_t parsers initially, so that the usual logic
of formatting integers as decimal strings, works too for uids/gids. Not
because it made any sense to encode them like that, but just to be
systematic here.
2025-11-01 21:43:37 +01:00
Lennart Poettering
e01f8990f1 sd-json: make sure all dispatch helpers do something sensible in case of "null" JSON value
Most of our dispatch helpers already do something useful in case they
are invoked on a null JSON value: they translate this to the appropriate
niche value for the type, if there is one.

Add the same for *all* dispatchers we have, to make this fully
systematic.

For various types it's not always clear which niche value to pick. I
opted for UINT{8,16,32,64}_MAX for the various unsigned integers, which
maps our own use in most cases. I opted for -1 for the various signed
integer types. For arrays/blobs of stuff I opted for the empty
array/blob, and for booleans I opted for false.

Of course, in various cases this is not going to be the right niche
value, but that's entirely fine, after all before a json value reaches a
dispatcher function it must pass one of two type checks first:

1. Either the .type field of sd_json_dispatch_field must be
   _SD_JSON_VARIANT_TYPE_INVALID to not do a type check at all

2. Or the .type field is set, but then the SD_JSON_NULLABLE flag must be
   set in .flags.

This means, accidentally generating the niche values on null is not
really likely.
2025-11-01 21:43:37 +01:00