Commit graph

66886 commits

Author SHA1 Message Date
Daan De Meyer 9a441937e1
Merge pull request #28766 from DaanDeMeyer/repart-copy-from
repart: Allow specifying --copy-from more than once
2023-08-11 14:51:24 +02:00
Michael A Cassaniti c2dfcbd48e file-io: Fix copying sparse files
This change makes sure a data copy using copy_bytes() does not exceed the
max_bytes value when using COPY_HOLES and max_bytes stops before the next
data section.
2023-08-11 14:30:54 +02:00
Daan De Meyer e1536d1fb0 repart: Allow specifying --copy-from more than once
Definitions will be synthesized from each of the given images.
2023-08-11 11:05:31 +02:00
Jan Macku e868f5efae docs: update link to RHEL/CentOS Stream tracker
Also update link to systemd downstream GitHub repo.
2023-08-11 09:55:10 +01:00
Daan De Meyer 3cdcf4e204 repart: Allow acquire shared lock on --copy-from files/devices
We're not going to modify these, so no need for an exclusive lock.
2023-08-11 10:42:12 +02:00
Franck Bui 487ae08b85 test-mountpoint-util: /root might be mounted
On openSUSE with BTRFS, /root has to be mounted as dedicated subvolume to avoid
restoring it when a rollback of the system happens.
2023-08-11 09:34:20 +01:00
Yu Watanabe f80ca7b7eb
Merge pull request #28779 from yuwata/iovw-append
io-util, coredump: introduce iovw_append() and use it
2023-08-11 07:21:32 +09:00
Yu Watanabe 3a19fe4637 coredump: fix various invalid memory access
Previously, we did not check error from iovw_put(). If it fails, the
target iovw may have no iov or partial iovs from the journal importar.
So, the finalization may cause underflow and may access and free invalid
memory.

Follow-up for 946dc7c635.
2023-08-11 06:08:38 +09:00
Yu Watanabe 3746131aac io-util: introduce iovw_append() helper function 2023-08-11 06:08:36 +09:00
cvlc12 c82cc3709e Make ukify the default ifUKI_GENERATOR is unset 2023-08-10 21:49:21 +01:00
Lennart Poettering bf77d59772 vconsole-setup: use "@kernel" rather than "kernel" as special string to leave keymap untouched
This is a magic string, and we should avoid stepping into the territory
of normal keymap names with that, given that users can pick names
otherwise freely.

Hence, prefix the name with a special char to avoid any namespace
issues.

Follow-up for: #28660
2023-08-11 04:17:57 +09:00
Yu Watanabe 09256904ed
Merge pull request #28760 from poettering/coredump-tweaks
coredump: minor tweaks/modernizations
2023-08-11 04:16:31 +09:00
Lennart Poettering 490b4486a7 file-io: let's use offsetof() rather than sizeof() for determining EFI_FILE_INFO prefix size
The gnu-efi definition of the struct uses [1], our local one [0] to size
the filename array. Let's avoid an ambiguity and use offsetof() so that
this difference doesn't matter. Also, doing it this way makes very clear
to the read what happens here: it's a structure with a variable size
suffix.
2023-08-11 04:11:05 +09:00
Yu Watanabe 91085a0a13
Merge pull request #28749 from yuwata/udev-net-id-fix-and-cleanup
udev-builtin-net_id: fix and cleanups
2023-08-11 04:10:32 +09:00
Daan De Meyer c1e704626a ukify: Use length= instead of ignore_padding= in inspect
ignore_padding= was only added in a recent version of pefile. Let's
set length= to the virtual size instead which is what ignore_padding
does behind the scenes so we're compatible with older versions of
pefile.
2023-08-10 19:35:21 +01:00
Yu Watanabe fc275ef315
Merge pull request #28767 from poettering/epoll-eperm-journalctl
journalctl epoll/EPERM follow-up
2023-08-11 03:18:36 +09:00
Michal Koutný 9e42433ff9 mkosi: Copy sources under /usr in the image
Originally, the source code was copied under /root/src.
This home directory is part of root FS and the new mkosi building
paradigm has only ephemeral root FS that is generated lazily.
Any files placed on the root FS in the build environment are that
excluded from the final image.

It is useful to have source codes available in the image's runtime (not
build time) environment for debugging.

ExtraTrees= as used currently are ineffective, so change the destination
to copy files under /usr to achieve the intention.

gdb sees source files as:
> 1354	../src/src/systemctl/systemctl.c: No such file or directory.

Modify gdb configration in the built image accordingly (that file cannot
be in /root neither) to resolve to the moved sources.

(Commit fdecbf7 ("Enable unprivileged image builds") envisions bind
mounting or virtiofsd for nspawn or qemu containers respectively.)
2023-08-10 19:14:40 +01:00
Luca Boccassi bd95029c3e
Merge pull request #28743 from mrc0mmand/lint-python-scripts
tools: lint Python scripts
2023-08-10 19:13:45 +01:00
Lennart Poettering a5e4f3ab4e tmpfiles: move static vars into Context object
Same as #28722, but for tmpfiles rather than sysusers
2023-08-10 19:12:06 +01:00
Franck Bui 372d40fb03 test: testsuite-35.sh needs manual/test-session-properties to be installed on SUSE 2023-08-10 19:11:07 +01:00
Frantisek Sumsal 79f902eb09 Add .pylintrc to globally suppress warnings we don't really care about
Also, drop the respective disable directives from existing files.
2023-08-10 18:13:29 +02:00
Frantisek Sumsal 2d49429e58 tools: pylint meson-render-jinja2.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal d853b9be98 tools: pylint analyze-dump-sort.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal fecdbd7227 tools: pylint dump-auxv.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal de9eca7e86 tools: pylint gdb-sd_dump_hashmaps.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 8708cd47b2 tools: pylint list-discoverable-partitions.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 54a9070ce5 tools: pylint xml_helper.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 234909f9d6 tools: pylint update-man-rules.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 019e726958 tools: pylint update-dbus-docs.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal c6041b8bf8 tools: pylint make-man-index.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 947727681b tools: pylint make-directive-index.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 564602400f tools: pylint make-autosuspend-rules.py 2023-08-10 18:13:29 +02:00
Frantisek Sumsal 782051f3cb tools: pylint generate-gperfs.py 2023-08-10 18:13:29 +02:00
Lennart Poettering 8c8c8fce4d networkd: add comment about order of IPReversePathFilter enum
Follow-up for: #28391
2023-08-10 16:17:59 +02:00
Daan De Meyer 257f2063ec mkosi: Move python3dist(pytest-flakes) to base preset build packages
We don't want to pull in python in the base image to keep the initrd
small.
2023-08-10 14:58:21 +01:00
Lennart Poettering 33bc21c3cb update TODO 2023-08-10 15:29:27 +02:00
Lennart Poettering a06c92eb48 sd-event: explicit document what to do with epoll-incompatible fds 2023-08-10 15:02:03 +02:00
Lennart Poettering 9050632ec0 journalcl: simplify handling of stdout being a regular file and epoll()
Let's not check the fd type beforehand, let's instead gracefully handle
if we get EPERM back from epoll_ctl() because the fd doesn't do epoll.
THis should be safer and more generic.

The epoll_ctl(2) man page clearly documents EPERM is being returned in
this case, hence it's safe to check for exactly that case.

Follow-up for: #28644
2023-08-10 15:01:48 +02:00
Lennart Poettering e5e900edcd man: let's tone down the recommendation to use Type=exec a bit
This is a follow-up for #28596.

I think the suggestion to use Type=exec uses too strong wording:
Type=exec has non-trivial drawbacks over Type=simple, and they deserve
to be mentioned.

Hence drop the <emphasis> and turn this around so that Type=exec is
*recommended*, but Type=simple is not expressly discouraged, because
there are plenty reasons to use it.

Add a brief discussion where Type=simple might be preferable.

Also, fix the outright unruth that Type=exec was the "simplest and
fastest", because it certainly is a lot, but not that.
2023-08-10 14:41:14 +02:00
Daan De Meyer 3a78b0e9c4 execute: Chown credentials files and directories to service group
For a userns root user to be able to access the credentials, both
the uid and gid of the credentials directory have to be mapped into
the userns. Currently, the credentials directory group is root, which
we obviously do not want to map in to a userns, so let's make sure
that the credentials directory and files are owned by the service
group instead, which can generally be safely mapped into the userns.

Since we use permissions mode 0600, this shouldn't cause any change
in who is able to access the credentials.

Fixes #28747
2023-08-10 14:36:26 +02:00
Daan De Meyer 4152fd46bb
Merge pull request #28756 from DaanDeMeyer/repart-fix
repart --copy-from followups
2023-08-10 14:36:02 +02:00
Yu Watanabe 8aa0aa40cf udev-builtin-net_id: use strjoin() if possible
Addresses the post-merge comment
https://github.com/systemd/systemd/pull/28623#pullrequestreview-1571307466.
2023-08-10 20:13:43 +09:00
Yu Watanabe f5f1e766ba udev-builtin-net_id: add more debugging logs 2023-08-10 20:09:11 +09:00
Yu Watanabe ce8ff47f74 udev-builtin-net_id: introduce get_first_syspath_component() helper function
Obtaining a component from syspath is a common pattern. Let's split out
the pattern. No functional change, just refactoring.
2023-08-10 20:09:11 +09:00
Yu Watanabe 5dc06b376f udev-builtin-net_id: introduce get_matching_parent() helper function
The pattern is common in many naming scheme. Let's split out the
pattern. No functional change, just refactoring.
2023-08-10 20:09:06 +09:00
Lennart Poettering d67a0999aa coredump: let's use FOREACH_ARRAY() at once very obvious place 2023-08-10 12:13:46 +02:00
Lennart Poettering 946dc7c635 coredump: fix error path
We must go through finish, to undo the destruction of the final elements
of the iovw properly.
2023-08-10 12:13:09 +02:00
Lennart Poettering db9ac80163 coredump: rename gather_pid_metadata() → gather_pid_metadata_from_procfs()
Let's make clear what this function does, and what it distinguishes with
the more precisely named gather_pid_metadata_from_argv().
2023-08-10 12:11:55 +02:00
Lennart Poettering e6aa443feb coredump: add four assert()s 2023-08-10 12:11:33 +02:00
Lennart Poettering 6257e2fb1a coredump: use a cleanup handler for destroying iovw objects 2023-08-10 12:10:47 +02:00