Daan De Meyer [Tue, 23 Nov 2021 16:54:26 +0000 (17:54 +0100)]
shared: Add support for non-native architectures to dissect_image()
To allow dissecting images of architectures other than the native
(or secondary) one, we add a third designator 'OTHER' to represent
architectures other than the native or secondary one.
If no partitions of the native or secondary arch are available, we
check if a root partition of any other arch is available and use that
instead if we found one.
Daan De Meyer [Wed, 24 Nov 2021 09:30:27 +0000 (10:30 +0100)]
gpt: Store the partition type in GptPartitionType
This replaces the _GPT_ALL_ARCHES macro.
Daan De Meyer [Tue, 23 Nov 2021 16:52:27 +0000 (17:52 +0100)]
gpt: Store the architecture in GptPartitionType
We also add a function gpt_partition_type_uuid_to_arch() to get the
architecture of a partition type uuid.
Daan De Meyer [Tue, 23 Nov 2021 16:49:30 +0000 (17:49 +0100)]
basic: Rename SECONDARY_ARCHITECTURE to ARCHITECTURE_SECONDARY
For easier integration with the _GPT_ALL_ARCHES macro in a future
commit.
Daan De Meyer [Tue, 23 Nov 2021 16:34:05 +0000 (17:34 +0100)]
gpt: Rename PPC64LE TO PPC64_LE
For consistency with ARCHITECTURE_PPC64_LE
Daan De Meyer [Tue, 23 Nov 2021 16:22:18 +0000 (17:22 +0100)]
basic: Give architecure enum a name
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 17:19:59 +0000 (18:19 +0100)]
basic/architectures: sort by name and remove duplicates
C.f.
086df29f35069bb454d52a21a146f76cf7bd42dc.
Julia Kartseva [Tue, 23 Nov 2021 23:38:11 +0000 (15:38 -0800)]
bpf: fix memleak in restrict_fs_bpf
Memory allocated in bpf skeleton is not freed. Wrap ptr in _cleanup_.
Fixes: #21471
Lennart Poettering [Wed, 24 Nov 2021 08:37:04 +0000 (09:37 +0100)]
Merge pull request #21448 from poettering/disk-image-purpose
encode disk image purpose in extension-release.d + os-release
Lennart Poettering [Tue, 23 Nov 2021 21:18:31 +0000 (22:18 +0100)]
recurse-dir: give callers of recurse_dir_at() control over path prefix
One of the niceties of recurse_dir()/recurse_dir_at() is that the path
argument is decoration, it's not used for actually accessing the fs in
anyway. That's very handy in environments where chroots and relative
paths are used, as we can path in any path we like and the recursion
function will suffix with whatever it discovers but will not try to make
sense of the prefix you pass.
This works great, except that the recurse_dir_at() wrapper broke that:
it adjusted the path if NULL to "." simply for the sake of making
openat() on the top work. Let's make this adjustment more local and do
it only for the openat() itself, and otherwise pass the path through the
way we got it. This means: if a caller really wants the paths that are
concatenated to start with a "." it can just pass that. This way the
caller gets full control back of the path prefix. Win!
Note that all current users of recurse_dir_at() don't pass NULL as
second arg, hence this check is without any real effect for now. It's
preparation for future uses however.
Lennart Poettering [Thu, 18 Nov 2021 21:00:20 +0000 (22:00 +0100)]
update TODO
Lennart Poettering [Tue, 23 Nov 2021 15:34:40 +0000 (16:34 +0100)]
test: test new SYSEXT_SCOPE=/PORTABLE_PREFIXES= fields in TEST-29
Lennart Poettering [Fri, 19 Nov 2021 15:20:00 +0000 (16:20 +0100)]
dissect: show intended purpose of images in dissection output
With this the tool will show whether an image is intended to be a
bootable OS image, a system extension, or a portable service image.
Example output with this patch:
<snip>
Name: image_53.raw
Size: 3.2G
Machine ID:
bb9f2921198040feb7c82270bf66e4b8
OS Release: NAME=Fedora
VERSION=34 (Thirty Four)
…
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
IMAGE_VERSION=53
Use As: ✓ bootable system for UEFI
✓ bootable system for container
✗ portable service
✗ extension for system
✗ extension for initrd
✗ extension for portable service
RW DESIGNATOR PARTITION UUID PARTITION LABEL FSTYPE ARCHITECTURE VERITY GROWFS NODE PARTNO
rw root
d56af2b4-35eb-2e40-8f08-
2d3b7012b0fc Root Partition btrfs x86-64 no no /dev/loop1p2 2
rw esp
e3d11339-05c1-a74a-ae77-
aae76812c134 ESP System Partition vfat - - no /dev/loop1p1 1
…
</snip>
Lennart Poettering [Fri, 19 Nov 2021 15:19:19 +0000 (16:19 +0100)]
os-release: add new PORTABLE_PREFIXES= field for declaring valid portable service match prefixes
Lennart Poettering [Thu, 18 Nov 2021 21:00:31 +0000 (22:00 +0100)]
extension-release.d/: add a new field SYSEXT_SCOPE= for clarifying what a system extension is for
This should make things a bit more robust since it ensures system
extension can only applied to the right environments. Right now three
different "scopes" are defined:
1. "system" (for regular OS systems, after the initrd transition)
2. "initrd" (for sysext images that apply to the initrd environment)
3. "portable" (for sysext images that apply to portable images)
If not specified we imply a default of "system portable", i.e. any image
where the field is not specified is implicitly OK for application to OS
images and for portable services – but not for initrds.
Lennart Poettering [Fri, 19 Nov 2021 14:48:41 +0000 (15:48 +0100)]
dissect-image: when extracting metadata from image also check if it contains init system
It's good to know whether we can boot the image.
Lennart Poettering [Fri, 19 Nov 2021 14:47:20 +0000 (15:47 +0100)]
dissect: add helper call for unifying three loops
Lennart Poettering [Tue, 23 Nov 2021 13:08:01 +0000 (14:08 +0100)]
bootctl: use new red/green check/cross mark helpers at two places
Lennart Poettering [Tue, 23 Nov 2021 09:37:03 +0000 (10:37 +0100)]
pretty-print: add helper for quickly outputting red/green cross/check marks
Compound constructors FTW!
Miika Karanki [Tue, 23 Nov 2021 15:23:01 +0000 (17:23 +0200)]
sd-bus: Fix standard method argument names
The argument names of methods under org.freedesktop.DBus.Properties and
org.freedesktop.DBus.Introspectable interfaces are specifies in D-Bus
specification[1]. They are:
org.freedesktop.DBus.Introspectable.Introspect (out STRING xml_data)
org.freedesktop.DBus.Properties.Get (in STRING interface_name,
in STRING property_name,
out VARIANT value);
org.freedesktop.DBus.Properties.Set (in STRING interface_name,
in STRING property_name,
in VARIANT value);
org.freedesktop.DBus.Properties.GetAll (in STRING interface_name,
out DICT<STRING,VARIANT> props);
sd-bus is using different argument names in the introspection document.
Usually this is not a problem but in case something tries to map the
argument names based on the introspection document to the position of
the arguments in the method call, then using names different than the
ones specified in the D-Bus specification is confusing.
So fix the names to match the D-Bus specification.
[1] https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-introspectable
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 18:42:38 +0000 (19:42 +0100)]
docs: remove comment that makes githubs renderer very angry
It is fine on github.com, but not on github.io.
Lennart Poettering [Tue, 23 Nov 2021 17:42:45 +0000 (18:42 +0100)]
Merge pull request #21479 from keszybz/cosmetic-initialization-adjustments
Cosmetic initialization adjustments
Lennart Poettering [Tue, 23 Nov 2021 15:54:19 +0000 (16:54 +0100)]
process-util: add missing NULL initialization for _cleanup_ variable
This is will otherwise trigger a bad memory access in the error path
Lennart Poettering [Tue, 23 Nov 2021 15:44:26 +0000 (16:44 +0100)]
Merge pull request #21440 from poettering/homed-initial-fs-size
homed: also support minimizing/maximizing home dirs when creating them
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 13:35:33 +0000 (14:35 +0100)]
resolved: add _unused_ annotations to appease clang
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:12:39 +0000 (12:12 +0100)]
shared/format-table: add cosmetic initialization
p is unconditionally initialized below, but our coding style says that
initialization should be added anyway.
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:30:46 +0000 (12:30 +0100)]
resolved: inline declarations of iterator variables
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:30:30 +0000 (12:30 +0100)]
resolved: move packet rewinder initalization inline
There is no functional change, but this reduces the risk that
in some future refactoring we'll forget the do the initialization in all
execution paths.
Boqun Feng [Tue, 23 Nov 2021 07:09:26 +0000 (15:09 +0800)]
virt: Fix the detection for Hyper-V VMs
Use product_version instead of product_name in DMI table and the string
"Hyper-V" to avoid misdetection.
Fixes: #21468
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Lennart Poettering [Tue, 23 Nov 2021 12:13:06 +0000 (13:13 +0100)]
Merge pull request #21443 from poettering/homed-grow-shrink-on-login-logout
homed: add ability to auto-grow home dir in login and auto-shrink on logout (if luks2+btrfs is used)
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 11:13:56 +0000 (12:13 +0100)]
udev/cdrom_id: use a macro to initialize context
c was initialized unconditionally, but one has to look at the function
body to understand this. Let's make the whole thing shorter and more
direct.
Frantisek Sumsal [Tue, 23 Nov 2021 10:32:41 +0000 (10:32 +0000)]
Merge pull request #21472 from mrc0mmand/sanitizer_suppressions
test: suppress certain leaks reported by LSan
Lennart Poettering [Fri, 19 Nov 2021 08:58:50 +0000 (09:58 +0100)]
test: update test to use --disk-size=min
Lennart Poettering [Fri, 19 Nov 2021 08:58:34 +0000 (09:58 +0100)]
man: document min/max for --disk-space= too
Lennart Poettering [Thu, 4 Nov 2021 22:49:17 +0000 (23:49 +0100)]
homework: correct initial minimal fs size calculations by LUKS2/GPT overhead
So far we assumed we ignore the LUKS2/GPT header overhead when
determining what the lower bound for images sizes is. Let's correct
this.
Lennart Poettering [Thu, 4 Nov 2021 20:54:46 +0000 (21:54 +0100)]
homework: when creating home dir also treat specified size as hint
The resize logic is now able to handle resize requests that cannot be
fulfilled in full gracefully. Let's do the same when allocating new home
directories.
This means "homectl create foo --disk-size=min" and "homectl create foo
--disk-size=max" may now be used to create the smallest or largest home
directory we support.
Andrew Stone [Thu, 11 Nov 2021 21:45:47 +0000 (13:45 -0800)]
core/automount: Add ExtraOptions field
Lennart Poettering [Fri, 19 Nov 2021 09:55:57 +0000 (10:55 +0100)]
man/doc: document auto resize modes
Lennart Poettering [Tue, 2 Nov 2021 17:24:02 +0000 (18:24 +0100)]
homework: upload home password into kernel keyring if needed
If we do automatic disk space rebalancing, we must be able to unlock the
encrypted volume for that in the background, thus we need to decryption
key around in userspace. Let's do this via the kernel keyring. This
allows us to do this in a relatively secure way, so that it sticks
around between homework invocations, but still is destroyed
automatically when homed goes down.
Lennart Poettering [Fri, 29 Oct 2021 08:15:00 +0000 (10:15 +0200)]
homework: add auto-shrink/auto-grow
Lennart Poettering [Thu, 4 Nov 2021 17:05:49 +0000 (18:05 +0100)]
homectl: expose new autoResizeMode JSON user record property
Lennart Poettering [Fri, 29 Oct 2021 07:45:17 +0000 (09:45 +0200)]
user-record: add auto-resize property
Lennart Poettering [Tue, 23 Nov 2021 07:01:50 +0000 (08:01 +0100)]
Merge pull request #21470 from poettering/resolved-250-fixes
various smaller additions/fixes for resolved
Lennart Poettering [Mon, 22 Nov 2021 21:05:57 +0000 (22:05 +0100)]
man: fix type in sd_bus_error_add_map() prototype
Fixes: #21467
Lennart Poettering [Mon, 22 Nov 2021 17:32:57 +0000 (18:32 +0100)]
resolved: lower connection timeout for DoT connections in opportunistic mode
Fixes: #20801
Lennart Poettering [Mon, 22 Nov 2021 17:29:17 +0000 (18:29 +0100)]
resolved: clean up manager_write_resolv_conf() a bit
Let's downgrade log messages which are not fatal for the service to
LOG_WARNING.
And let's simplify clean-up by using _cleanup_(unlink_and_freep).
Lennart Poettering [Mon, 22 Nov 2021 15:14:07 +0000 (16:14 +0100)]
resolved: make sure we don't hit an assert when dealing with incomplete DNSSD service definitions
Fixes: #21142
Lennart Poettering [Mon, 22 Nov 2021 14:17:34 +0000 (15:17 +0100)]
resolved: properly signal transient errors back to NSS stack
NSS mostly knows four error cases: SUCCESS, NOTFOUND, UNAVAIL, TRYAGAIN,
and they can all be used in nsswitch.conf to route requests.
So far nss-resolve would return SUCCESS + NOTFOUND + UNAVAIL. Let's also
return TRYAGAIN in some cases, specifically the ones where we are
currntly unable to resolve a request but likely could later. i.e.
errors caused by networking issues or such.
Fixes: #20786
Lennart Poettering [Mon, 22 Nov 2021 13:37:54 +0000 (14:37 +0100)]
resolved: fix ResolveService() hostname handling
Let's eat up special returns of dns_query_process_cname_many() when
storing hostname resolution results.
The rest of the code assumes only == 0 means success and != 0 means
error, but so far > 0 also could mean success, let's fix that.
Fixes: #21365 #21140
(This was originally broken in
1db8e6d1db0880de240e5598e28d24d708479434)
Lennart Poettering [Mon, 22 Nov 2021 13:37:48 +0000 (14:37 +0100)]
nspawn: voidify expose_port_execute() calls
Lennart Poettering [Mon, 22 Nov 2021 11:20:05 +0000 (12:20 +0100)]
resolved: add "proxy-only" stub on 127.0.0.54
This beefs up the DNS stub logic to listen on two IP addresses:
127.0.0.53 (as before) + 127.0.0.54 (new). When the latter is contact
our stub will operate in "bypass" mode only, i.e we'll try to pass DNS
requests as unmodified upstream as we can (and not do mDNS/LLMNR and
such, also no DNSSEC validation – but we'll still do DNS-over-TLS
wrapping).
This is supposed to be useful for container environments or tethering:
this stub could be exposed (via NAT redirect) to clients of this system
and we'll try to stay out of the way with doing too much DNS magic
ourselves, but still expose whatever the current DNS server is from
upstream under a stable address/port.
How to use this:
# iptables -t nat -I PREROUTING -p udp -i <interface> --dport 53 -j DNAT --to 127.0.0.54:53
# echo 1 > /proc/sys/net/ipv4/conf/<interface>/route_localnet
Lennart Poettering [Mon, 22 Nov 2021 10:29:42 +0000 (11:29 +0100)]
socket-util: add helper for generically initializing sockaddr_union from in_addr_union
Lennart Poettering [Mon, 22 Nov 2021 10:13:26 +0000 (11:13 +0100)]
resolved: include IP address info in debug output for incoming datagrams
Frantisek Sumsal [Mon, 22 Nov 2021 21:12:09 +0000 (22:12 +0100)]
test: drop the `su` wrapper and use `systemctl` directly
ASan is having a hard time to get its LD_PRELOAD= shenanigans straight
with all the shells flying around. Let's make it a bit easier by using
one of the nifty systemctl's features instead.
Frantisek Sumsal [Mon, 22 Nov 2021 19:13:51 +0000 (20:13 +0100)]
test: suppress certain leaks reported by LSan
so we can run TEST-46 under sanitizers once again.
`systemd-homed` runs fsck on home directories, which reports a memory
leak we're not interested in. Let's introduce an LSan suppression file
to get around this. Since the patterns in the suppression file are
matched using basic substring match[0], they're a bit cumbersome, but
should get the work one.
[0] https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions
Example leaks (as reported by TEST-46):
```
systemd-homed[1333]: =================================================================
systemd-homed[1333]: ==1333==ERROR: LeakSanitizer: detected memory leaks
systemd-homed[1333]: Direct leak of 24 byte(s) in 1 object(s) allocated from:
systemd-homed[1333]: #0 0x7f0c8facccd1 in calloc (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xf4cd1)
systemd-homed[1333]: #1 0x558d9494ff67 (/usr/bin/fsck+0x3f67)
systemd-homed[1333]: Direct leak of 6 byte(s) in 1 object(s) allocated from:
systemd-homed[1333]: #0 0x7f0c8fa906c1 in strdup (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xb86c1)
systemd-homed[1333]: #1 0x558d949518fd (/usr/bin/fsck+0x58fd)
systemd-homed[1333]: SUMMARY: AddressSanitizer: 30 byte(s) leaked in 2 allocation(s).
systemd-homed[1337]: ==1337==WARNING: Symbolizer was blocked from starting itself!
systemd-homed[1337]: =================================================================
systemd-homed[1337]: ==1337==ERROR: LeakSanitizer: detected memory leaks
systemd-homed[1337]: Direct leak of 67584 byte(s) in 1 object(s) allocated from:
systemd-homed[1337]: #0 0x7f01edb84b19 (/usr/lib/clang/12.0.1/lib/linux/libclang_rt.asan-x86_64.so+0xf4b19)
systemd-homed[1337]: #1 0x7f01e8326829 (/usr/bin/../lib/libLLVM-12.so+0xb46829)
systemd-homed[1337]: SUMMARY: AddressSanitizer: 67584 byte(s) leaked in 1 allocation(s).
```
With the suppression file:
```
systemd-homed[1339]: -----------------------------------------------------
systemd-homed[1339]: Suppressions used:
systemd-homed[1339]: count bytes template
systemd-homed[1339]: 2 30 /bin/fsck$
systemd-homed[1339]: -----------------------------------------------------
systemd-homed[1343]: ==1343==WARNING: Symbolizer was blocked from starting itself!
systemd-homed[1343]: -----------------------------------------------------
systemd-homed[1343]: Suppressions used:
systemd-homed[1343]: count bytes template
systemd-homed[1343]: 1 67584 /lib/libLLVM
systemd-homed[1343]: -----------------------------------------------------
```
Frantisek Sumsal [Mon, 22 Nov 2021 19:51:15 +0000 (20:51 +0100)]
test: fix a couple of "new" shellcheck-related issues
related to https://github.com/koalaman/shellcheck/wiki/SC2295
Lennart Poettering [Mon, 22 Nov 2021 10:08:32 +0000 (11:08 +0100)]
resolved: use RET_NERRNO() where it makes sense
Jan Janssen [Mon, 22 Nov 2021 15:08:37 +0000 (16:08 +0100)]
Remove own copyright line
Luca Boccassi [Mon, 22 Nov 2021 13:09:38 +0000 (13:09 +0000)]
Merge pull request #21357 from mbd98/usr-verity-auto
veritysetup-generator, fstab-generator: Setup and mount usr verity device when 'usrhash' (and optionally systemd.verity_usr_*) is present as kernel command line parameter
Robert-L-Turner [Mon, 22 Nov 2021 11:43:44 +0000 (19:43 +0800)]
FIDO2 device removal instructions (#21426)
* man: document FIDO2 device removal
Indicate to users how to remove FIDO2 device in the --fido2-device=path section by setting path to an empty string (""). Tested on systemd 249 (249.6-3-arch)
Daan De Meyer [Mon, 22 Nov 2021 09:35:34 +0000 (10:35 +0100)]
Merge pull request #21452 from vcaputo/mmap-cache-fd
mmap-cache: simplify MMapFileDescriptor-centric function signatures
Lennart Poettering [Mon, 22 Nov 2021 09:10:05 +0000 (10:10 +0100)]
Merge pull request #21425 from keszybz/ppc64-fixes
Add base-filesystem defines for arm64/ppc64el/riscv64 and make build quiet again
Luca Boccassi [Sat, 20 Nov 2021 00:44:13 +0000 (00:44 +0000)]
test runner: print time before/after tests
When a timeout occurs we actually can't see when the test started/stopped. Print the time.
Zbigniew Jędrzejewski-Szmek [Sat, 20 Nov 2021 10:42:31 +0000 (11:42 +0100)]
analyze: fix printing config when there is no main config file
Since
8b8024f1c231c166f5c450905c8fd91d11704ae7 and the follow-up commits, the
main config file may be located in /usr or in other paths. But the code in
analyze.c was still assuming that it must be in /etc. Things mostly worked for
our own config files because we usually install a comments-only file in /etc,
but was not correct in the general case.
This fixes in particular 'systemd-analyze cat-config systemd/zram-generator.conf'.
In Fedora we distribute a config file in zram-generator-defaults.rpm that is in
/usr/lib, and 'cat-config' would refuse to show it because
/etc/systemd/zram-generator.conf does not exist.
The main config file is optional, but let's print an informative message
because this is a slightly unusual case.
The file paths that we printed were missing the root prefix.
Luca Boccassi [Sat, 20 Nov 2021 18:00:35 +0000 (18:00 +0000)]
Merge pull request #21432 from DaanDeMeyer/journal-trivial-fixes
Journal trivial fixes
Luca Boccassi [Sat, 20 Nov 2021 17:58:51 +0000 (17:58 +0000)]
Merge pull request #21431 from DaanDeMeyer/issue-19799
journal: Limit the number of audit fields we add to a message
Lennart Poettering [Fri, 19 Nov 2021 14:48:01 +0000 (15:48 +0100)]
nspawn: use FOREACH_STRING() more
Christian Göttsche [Fri, 19 Nov 2021 16:34:08 +0000 (17:34 +0100)]
core: prefix functions to avoid identical static function names
The function name `method_reload` is used both in dbus-unit.c and
dbus-manager.c for static functions.
With the previous addition of adding the function name to the audit
information on SELinux denials, rename the one (and its relatives) in
dbus-unit.c as most of the functions in src/core/dbus-unit.c are already
prefixed with `bus_unit_`.
Christian Göttsche [Wed, 28 Jul 2021 15:00:02 +0000 (17:00 +0200)]
selinux: name mac_selinux_generic_access_check as internal function
`mac_selinux_generic_access_check()` should not be called directly, only
via the wrapper macros `mac_selinux_access_check` and
`mac_selinux_unit_access_check`.
Christian Göttsche [Wed, 28 Jul 2021 14:59:57 +0000 (16:59 +0200)]
selinux: improve debug log format
path might be NULL when checking against the system permissions, so wrap
with strna().
The command line might not be available over D-Bus and thus cl might be
empty. Print "n/a" instead of the empty string.
Christian Göttsche [Wed, 28 Jul 2021 14:59:51 +0000 (16:59 +0200)]
selinux: add function name to audit data
Include the systemd C function name in the audit message to improve the
debug ability on denials.
Similar like kernel denial messages include the syscall name.
Vito Caputo [Wed, 17 Nov 2021 04:37:30 +0000 (20:37 -0800)]
mmap-cache: s/mmap_cache/mmap_cache_fd_/ where apropos
Mostly mechanical renaming of mmap-cache functions that now
operate exclusively on the MMapFileDescriptor.
Vito Caputo [Wed, 17 Nov 2021 01:03:15 +0000 (17:03 -0800)]
mmap-cache: simplify API around MMapFileDescriptor
MMapFileDescriptor carries a reference to its originating
MMapCache, there's no value in supplying the
MMapFileDescriptor-centric functions a separate MMapCache.
A future commit will rename these functions to consistently use
an mmap_cache_fd_* prefix for improved clarity.
Mark Boudreau [Sat, 13 Nov 2021 18:15:17 +0000 (13:15 -0500)]
Document usr-specific verity parameters
Mention 'usrhash' and 'systemd.verity_usr_*' kernel command line
parameters in the man pages for veritysetup-generator and
kernel-command-line
Mark Boudreau [Wed, 10 Nov 2021 01:07:26 +0000 (20:07 -0500)]
fstab-generator: use 'usr' mapper device when 'usrhash' is present
If 'usrhash' is present as a kernel command line parameter, use the usr
mapper device for usr mount
Mark Boudreau [Wed, 10 Nov 2021 00:38:29 +0000 (19:38 -0500)]
veritysetup-generator: generate service for usr device
If 'usrhash' is present as a kernel command line parameter, generate a
veritysetup service for usr.
Also recognize systemd.verity_usr_* parameters.
Daan De Meyer [Thu, 18 Nov 2021 12:37:04 +0000 (12:37 +0000)]
journal: Limit the number of audit fields per log message
Similar to the kmsg handler, let's also limit the number of fields
we parse from audit messages.
Fixes #19799
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 16:26:36 +0000 (17:26 +0100)]
Add a trivial guard against using the same uuid twice
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 16:02:09 +0000 (17:02 +0100)]
shared/base-filesystem: use LIB_ARCH_TUPLE instead of string
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 15:34:17 +0000 (16:34 +0100)]
Trivial style fixes
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:16:20 +0000 (15:16 +0100)]
docs: document the partition UUID used by homed
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:15:55 +0000 (15:15 +0100)]
shared/gpt: fix bit-flip in LoongArch root partition UUID
4e767154891083069a58c5c960f386974ad87fb4 added a slightly different UUID
in the header and in the docs. This makes the code match the docs.
> As some downstream projects are already using the UUID as in the docs, most
> notably util-linux [1], we should adjust code to match doc; no shipping
> LoongArch systems are using upstream systemd, and no open-source distro is
> merging LoongArch support yet, so the change should break no one. This also
> matches the work being done by @yetist at loongarch64/systemd#7.
[1] https://github.com/util-linux/util-linux/commit/
2d29fccaad267d1b003dc0ed2bb9634ff76f3e49
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 14:09:30 +0000 (15:09 +0100)]
docs: generate table from header using a script
This adds a helper script:
$ python3 tools/list-discoverable-partitions.py <src/shared/gpt.h
<!-- generated with tools/list-discoverable-partitions.py -->
| Partition Type UUID | Name | Allowed File Systems | Explanation |
|---------------------|------|----------------------|-------------|
| _Root Partition (Alpha)_ | `
6523f8ae-3eb1-4e2a-a05a-
18b695ae656f` | [Root Partition] | [Root Partition more] |
| _Root Partition (ARC)_ | `
d27f46ed-2919-4cb8-bd25-
9531f3c16534` | ditto | ditto |
...
The output can be pasted into the markdown file. I think this works better than
trying to match the two lists by hand.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:48:17 +0000 (11:48 +0100)]
shared/gpt: ARM_64 → ARM64
"arm64" is generally written without the underscore.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:30:15 +0000 (11:30 +0100)]
shared/gpt: add entries for a bunch of architectures
I don't think we want people to send us pull requests over the next two years.
Let's just make something up ourselves, this is going to have at least as good
results, and will be much quicker.
Note that this only includes architectures for which there's some indication
that they are in active use. In architecture.h there are some more esoteric
ones like ARC_BE. We can add those if there's some actual user demand.
In particular, I included everything on the Debian "List of official ports" [1]
and a few other arches that we have received patches for in recent times.
[1] https://www.debian.org/ports/#portlist-released
Zbigniew Jędrzejewski-Szmek [Fri, 19 Nov 2021 15:06:27 +0000 (16:06 +0100)]
shared/gpt: add a macro to make the definitions a bit less onerous
Daan De Meyer [Tue, 16 Nov 2021 14:39:18 +0000 (14:39 +0000)]
journal: Add verify_hash_table()
The existing verify_hash_table() function is renamed to
verify_data_hash_table() since it only verifies the data hash table.
The verify information is also made a little more detailed by splitting
one of the checks in two.
Daan De Meyer [Fri, 12 Nov 2021 11:17:01 +0000 (11:17 +0000)]
journal: Add journal_file_object_to_string()
Daan De Meyer [Mon, 15 Nov 2021 11:45:00 +0000 (11:45 +0000)]
journal: Simplify definition of HEADER_INCOMPATIBLE_SUPPORTED
Daan De Meyer [Thu, 11 Nov 2021 15:35:28 +0000 (15:35 +0000)]
journal: Use more structured initialization
Daan De Meyer [Sun, 31 Oct 2021 12:33:40 +0000 (12:33 +0000)]
journal: Use size_t instead of unsigned for array sizes
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 10:00:56 +0000 (11:00 +0100)]
shared/gpt: reorder arches alphabetically
It's just too annoying to add new ones otherwise.
Lennart Poettering [Fri, 19 Nov 2021 14:39:19 +0000 (15:39 +0100)]
update TODO
Lennart Poettering [Fri, 19 Nov 2021 14:39:32 +0000 (15:39 +0100)]
doc: rebreak boot loader spec
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 09:48:30 +0000 (10:48 +0100)]
docs: switch the first two columns in partition uuid list
Readers are most likely to want to go from a partition id to the uuid,
so puts the uuid second
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 18:10:18 +0000 (19:10 +0100)]
shared/base-filesystem: add define for s390x
This is based on the information in #14311 and
https://refspecs.linuxfoundation.org/LSB_3.2.0/LSB-Core-S390X/LSB-Core-S390X.pdf
and https://wiki.debian.org/Multiarch/Tuples.
Fixes #14311.
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 09:15:17 +0000 (10:15 +0100)]
shared/base-filesystem: m68k is 32-bit only
Zbigniew Jędrzejewski-Szmek [Thu, 18 Nov 2021 08:57:26 +0000 (09:57 +0100)]
shared/base-filesystem: add define for arm
$ ls -l /lib /lib64
ls: cannot access '/lib64': No such file or directory
lrwxrwxrwx. 1 root root 7 Jan 26 2021 /lib -> usr/lib
$ ldd /bin/sh|grep ld
/lib/ld-linux-armhf.so.3 (0xb6f80000)
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 14:10:20 +0000 (15:10 +0100)]
shared/base-filesystem: add define for riscv64
https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora.
$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Aug 13 2020 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Aug 13 2020 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib/ld-linux-riscv64-lp64d.so.1 (0x0000003fb8185000)
$ ls -l /lib/ld-linux-riscv64-lp64d.so.1
lrwxrwxrwx 1 root root 19 Aug 4 19:28 /lib/ld-linux-riscv64-lp64d.so.1 -> ../lib64/ld-2.32.so
$ uname -r
5.10.6+
So even though the canonical linker path uses /lib/, we need the /lib64 symlink
to be present.
Zbigniew Jędrzejewski-Szmek [Wed, 17 Nov 2021 14:01:18 +0000 (15:01 +0100)]
shared/base-filesystem: add define for ppc64el
https://wiki.debian.org/ArchitectureSpecificsMemo shows the triplet, but no the
linker paths. I used the linker path from Fedora, but I can't look up the
linker paths for BE and 32 bit. At least the ifdef scaffolding is provided, so
it should be trivial to fill in if somebody has access to such a system.
$ ls -l /lib /lib64
lrwxrwxrwx. 1 root root 7 Jan 26 2021 /lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jan 26 2021 /lib64 -> usr/lib64
$ ldd /bin/sh|grep ld
/lib64/ld64.so.2 (0x00007fffa0a90000)
$ uname -r
5.14.9-200.fc34.ppc64le
Note that the macro defines listed in the wiki page don't match what I get
on Fedora: __PPC64__ vs. __ppc64__.
$ cpp -dM < /dev/null |grep -iE '__(powerpc|ppc)'|sort
#define __powerpc__ 1
#define __powerpc64__ 1
#define __PPC__ 1
#define __PPC64__ 1
First half of the fix for #14311.