Yu Watanabe
fd690a4b7f
blockdev-util: introduce block_device_new_from_fd() and block_device_new_from_path()
...
These are possible replacements of get_block_device(),
get_block_device_harder(), path_get_whole_disk(), and friends.
2022-09-28 17:42:23 +09:00
Yu Watanabe
612fc70fc0
blockdev-util: re-implement block_get_originating() by using sd_device
...
And split out the core logic as block_device_get_originating().
Hopefully, this changes no behavior. Just refactoring and preparation
for later commits.
2022-09-28 17:41:09 +09:00
Yu Watanabe
446f8db66b
blockdev-util: reopen file descriptor only when O_PATH is set
...
Prompted by 13879c54d4 .
2022-09-28 17:41:09 +09:00
Yu Watanabe
7e4a0387c4
blockdev-util: split-out fd_get_devnum()
...
No functional changes, just preparation for later commits.
2022-09-28 17:41:09 +09:00
Zbigniew Jędrzejewski-Szmek
87707784c7
coredump: when parsing json, optionally copy the string first
2022-09-28 09:38:13 +02:00
Yu Watanabe
08f14be417
dissect-image: introduce dissect_image_file() which works for regular file
2022-09-28 03:06:27 +09:00
Yu Watanabe
698bb074a3
dissect-image: split-out dissected_image_probe_filesystem()
...
No functional changes, just preparation for later commits.
2022-09-28 03:06:27 +09:00
Yu Watanabe
395c1d9a85
tpm2-util: fix build with -Dopenssl=false
...
Fixes #24800 .
2022-09-25 08:03:19 +09:00
Daan De Meyer
354dc913c5
Merge pull request #24635 from DaanDeMeyer/repart-verity-sig
...
repart: Add support for generating verity sig partitions
2022-09-23 18:53:04 +02:00
Daan De Meyer
8939d3351d
openssl-util: Add x509_fingerprint()
2022-09-23 16:15:37 +02:00
Daan De Meyer
bc958a19e3
openssl-util: Allow declaring openssl struct pointers without openssl
2022-09-23 16:15:34 +02:00
Lennart Poettering
dd5533801b
Merge pull request #24700 from poettering/ssh-creds
...
support easy provisioning for SSH key of root user
2022-09-23 16:01:09 +02:00
Lennart Poettering
e711431d50
Merge pull request #24794 from DaanDeMeyer/repart-follow-ups
...
repart: Extend squashfs logic to all read-only filesystems
2022-09-23 15:12:56 +02:00
Lennart Poettering
addc84ec91
Merge pull request #24686 from d4nuu8/delta_output
...
shared/logs-show: add new --output= format "short-delta"
2022-09-23 13:33:55 +02:00
Daan De Meyer
3dd73ea77e
dissect: Process verity sig partitions if a root hash is specified
...
If a root hash is specified, we should be checking that it matches
the root hash in the verity signature partition, so let's not skip
processing of the verity signature partitions if a root hash is
specified.
2022-09-23 12:24:09 +02:00
Daniel Braunwarth
893bcd3d07
shared/logs-show: add new --output= format "short-delta"
...
This new output formatting option is similar to "short-monotonic" but
also shows the time delta between two messages.
This fixes #24641 .
2022-09-23 10:07:03 +02:00
Daniel Braunwarth
275e6be052
logs-show: move timestamp reading into show_journal_entry()
2022-09-23 10:07:03 +02:00
Daan De Meyer
eaec699494
shared: Don't try to generate read-only filesystem that we don't support
...
We need explicit support to generate read-only filesystems, since we
always need to pass a source tree to the mkfs binary to populate the
filesystem. As such, let's add an explicit check to return a
recognizable error when users try to generate a read-only filesystem
that we don't support.
2022-09-23 09:55:26 +02:00
Daan De Meyer
eb43379cec
repart: Extend squashfs logic to all read-only filesystems
...
The same logic will apply to every read-only filesystem that we
might add support for in the future, so let's make this a bit more
future proof.
2022-09-23 09:55:17 +02:00
Lennart Poettering
da9dd029a2
fs-util: replace symlink_atomic() by symlinkat_atomic()
2022-09-23 09:22:36 +02:00
Luca Boccassi
c9d65b921b
Merge pull request #24771 from poettering/destroy-pcr11
...
extend boot phase information into PCR 11 during boot
2022-09-22 20:08:27 +01:00
Daan De Meyer
e3a1cd9e98
Merge pull request #24746 from DaanDeMeyer/repart-split
...
repart: Add --split option to generate split artifacts
2022-09-22 19:09:12 +02:00
Lennart Poettering
c5bf1f85cb
tpm2-util: add helper for determining enabled/used PCR banks
2022-09-22 16:50:53 +02:00
Lennart Poettering
59fafaee5d
tpm2-util: split out code that checks if bank has 24 pcrs into helper function of its own
...
Just some refactoring, not change in behaviour.
2022-09-22 16:49:47 +02:00
Lennart Poettering
1421943a71
tpm2-util: pick up Esys_PCR_Extend() symbol too
2022-09-22 16:48:11 +02:00
Daan De Meyer
1e58a0a82c
shared: Add GPT_PARTITION_TYPE_UUID_TO_STRING_HARDER()
2022-09-22 14:54:55 +02:00
Daan De Meyer
7b52dc7f4d
shared: Add specifier_uint64()
2022-09-22 14:52:37 +02:00
Lennart Poettering
add0c9b8bf
Merge pull request #24768 from keszybz/table-not-available-2
...
Adjust table n/a text in more places
2022-09-22 14:17:40 +02:00
Daan De Meyer
74235f6d08
shared: Add specifier_id128() and specifier_uuid()
2022-09-22 14:16:57 +02:00
Zbigniew Jędrzejewski-Szmek
29ca430865
shared/format-table: use empty_string instead of hardcoding "-" for invalid values
...
As requested in https://github.com/systemd/systemd/pull/24708#discussion_r973607866 .
2022-09-22 10:16:30 +02:00
Zbigniew Jędrzejewski-Szmek
c8b62cf600
shared/format-table: use enum instead of Table.empty_string
...
All users were setting this to some static string (usually "-"), so let's
simplify things by not doing strdup, but instead limiting callers to a fixed
set of values. In preparation for the next commit, the function is renamed from
"empty" to "replacement", because it'll be used for more than empty fields. I
didn't do the whole string-table setup, because it's all used internally in one
file and this way we can immediately assert if an invalid value is passed in.
Some callers were (void)ing the error, others were ignoring it, and others
propagating. It's nicer to remove the boilerplate.
2022-09-22 10:16:05 +02:00
Lennart Poettering
4d0d34b4e7
Merge pull request #24709 from keszybz/partition-table-constants
...
Expose various GPT UUIDs as public contants and link them up in docs
2022-09-21 20:07:21 +02:00
Lennart Poettering
df4bed3f92
Merge pull request #24753 from DaanDeMeyer/repart-squashfs
...
repart: Add squashfs support
2022-09-21 19:49:10 +02:00
Daan De Meyer
7f55ad775d
shared: Add squashfs support to make_filesystem()
...
The caveat is that the caller has to provide a source directory
to initialize the squashfs filesystem from.
2022-09-21 10:50:16 +02:00
Zbigniew Jędrzejewski-Szmek
92e7202812
headers: export partition uuids and flags in new sd-gpt.h file
...
I think those constants are generally useful. It's quite easy to make a mistake
when copying things from the docs, so let's make them easy and convenient to
access.
2022-09-20 16:48:50 +02:00
Lennart Poettering
2b3a821f91
find-esp: when searching, don't trip over inodes we expect to be dirs to be something else, just continue searching
2022-09-20 13:52:01 +02:00
Lennart Poettering
bd80fd7e56
find-esp: rework verify_fsroot_dir() around statx()
...
Let's rework verify_fsroot_dir() around two statx() calls, which should
usually give us all information we need. Let's then add a call to the
btrfs ioctl only if the caller actually wants to know the backing block
device (which it generally only wants if it then intends to verify
partition type, and similar).
This makes things more robust on new kernels, and bypasses the btrfs
ioctls in environments where we cannot actually interpret the results
properly (since they reference btrfs devices via /dev/ paths, which we
likely cannot resolve in containers)
Fixes : #24616
2022-09-20 13:52:01 +02:00
Lennart Poettering
13879c54d4
blockdev-util: make sure get_block_device_fd() works reliably for O_PATH, too
2022-09-20 13:52:01 +02:00
Yu Watanabe
2f9d231738
udev: use block_device_is_whole_disk()
...
No functional changes, just refactoring.
Note, this also makes synthesize_change() propagate the error from
synthesize_change_one(). However, the caller of synthesize_change()
ignores the failure anyway, hence the change does not take any effect.
2022-09-20 09:44:19 +02:00
Lennart Poettering
f92ebc86dd
tpm2-util: make tpm2_pcr_bank_from_string() case-insensitive
...
This way we can use it directly in measure.c, and thus remove a bit of
redundant code.
OpenSSL prefers uppercasing the MD names, others don't hence let's be
lenient here.
2022-09-19 22:50:44 +09:00
Yu Watanabe
5b4671ec47
Merge pull request #24646 from yuwata/udev-node-symlink_atomic
...
udev: introduce symlink_atomic_full() and use it
2022-09-19 05:25:58 +09:00
Yu Watanabe
3afe230d4a
Merge pull request #24725 from yuwata/blockdev-util-introduce-block_device_get_whole_disk
...
blockdev-util: introduce block_device_get_whole_disk()
2022-09-19 05:25:09 +09:00
Yu Watanabe
e330f97a89
tree-wide: drop unused reference to DecryptedImage
2022-09-18 23:47:20 +09:00
Yu Watanabe
3044d343dd
tree-wide: use dissected_image_relinquish()
2022-09-18 23:47:20 +09:00
Yu Watanabe
f906075a15
dissect-image: introduce dissected_image_relinquish()
2022-09-18 23:47:20 +09:00
Daan De Meyer
c72aed4c20
Merge pull request #24720 from yuwata/dissect-image-take-reference
...
dissect-image: make DissectedImage object take reference to DecryptedImage and LoopDevice
2022-09-18 16:08:13 +02:00
Yu Watanabe
5a27af52c7
blockdev-util: change return value when a partition device is passed to partition_enumerator_new()
...
To make it consistent what returned by block_device_get_whole_disk().
2022-09-18 22:54:20 +09:00
Yu Watanabe
55a437f8b2
blockdev-util: introduce block_device_get_whole_disk()
2022-09-18 22:54:20 +09:00
Yu Watanabe
c07186ec03
blockdev-util: split-out block_device_is_whole_disk()
...
No functional changes, just preparation for later commits.
2022-09-18 22:54:20 +09:00
Yu Watanabe
8b6a70f699
Merge pull request #24719 from yuwata/dissect-image-dissected-image-new
...
dissect-image: introduce dissected_image_new()
2022-09-18 22:41:49 +09:00