Commit Graph
60841 Commits
Author SHA1 Message Date
Lennart Poettering db02190eec dissect: add a new "--mtree" switch for generating a BSD mtree(5) compatible file manifest 2022-11-09 22:20:51 +01:00
Lennart Poettering b21ec07b54 recurse-dir: optionally, call callback when entering/leaving toplevel dir, too
So far recurse_dir() will call the callback whenever we enter a
directory, and then pass the struct dirent for that directory, and an fd
for the directory the dirent is part of (i.e. the parent of the
directory we call things for). For the top-level dir the function is
invoked for we will not call the callback however, because we have no
dirent for that, and not fd for the directory the top-level dir is part
of. Let's add a flag to call it anyway, and in that case pass a NULL
dirent and -1 as directory fd.

This is useful when we want to treat the top-level dir the same as any
dir further down.

This is done opt-in since the callback must be ablet to handle a NULL
dirent and a -1 directory fd.
2022-11-09 18:55:58 +01:00
Franck Bui a2f0dbb810 random-seed: make sure to load machine id even if the seed file is missing 2022-11-09 18:41:30 +01:00
Lennart Poettering 718e5d3f60 Merge pull request #25321 from poettering/acpi-timing-fix
acp-fpdt: minor tweaks/fixes
2022-11-09 18:32:34 +01:00
Lennart Poettering 0b24845d1f Merge pull request #25302 from poettering/dissect-with
dissect: add new --with command for excuting commands with a DDI mounted
2022-11-09 18:31:54 +01:00
Lennart Poettering 31edf44064 acpi-fpdt: make sure length/type fields are available in acpi_fpdt_header
some extra safety: make sure the two fields we care about are actually
properly present before the buffer is over.
2022-11-09 15:16:12 +01:00
Lennart Poettering 8cee3283f0 acpi-fpdt: don't accidentally drop signedness of pread() return 2022-11-09 15:09:08 +01:00
Lennart Poettering ab10dfe0d5 acpi-fpdt: use our usual ret_xyz naming scheme 2022-11-09 15:08:40 +01:00
Lennart Poettering efffde8e5f test: extend TEST-50-DISSECT for systemd-dissect --list and --with 2022-11-09 14:57:23 +01:00
Lennart Poettering 1a06ce16b2 man: document the new --with switch of systemd-dissect 2022-11-09 14:57:23 +01:00
Lennart Poettering 06186c4c99 dissect: add new --with command 2022-11-09 14:57:23 +01:00
Lennart Poettering fab2294646 dissect: officially support initrd DDIs (to implement 2nd stage initrds)
Let's complete support for DDI discovery, and also support 2nd stage
initrds.
2022-11-09 14:43:55 +01:00
Lennart Poettering 00fa567d4a Merge pull request #25314 from poettering/dissect-list-tweaks
dissect: minor tweaks to "systemd-dissect --list"
2022-11-09 14:42:30 +01:00
Lennart Poettering 2e1f76f6ea dissect: open pager in --list mode, output might be long 2022-11-09 11:52:50 +01:00
Lennart Poettering a245225e2d dissect: simplify flags for recurse_dir()
We are not interested in the struct dirent data, hence there's no point
in passing RECURSE_DIR_ENSURE_TYPE. Let's drop it, and thus avoid some
extrac work on file systems where readdir() does not report .d_type.

Also drop RECURSE_DIR_SAME_MOUNT, because DDIs after all may contain
multiple partitions, and we mount them all together. The --list command
really should report the full set of files in an image.
2022-11-09 11:44:17 +01:00
Lennart Poettering 0f01320ec7 dissect: remove unused variable 2022-11-09 11:41:38 +01:00
Luca Boccassi a297b7297c Merge pull request #25300 from DaanDeMeyer/kernel-selftests
mkosi: Build and install kernel selftests
2022-11-09 11:07:00 +01:00
blutch112 19b036cf31 po: Translated using Weblate (French)
Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: blutch112 <vincent.lefebvre59@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fr/
Translation: systemd/main
2022-11-09 09:22:57 +00:00
Zbigniew Jędrzejewski-Szmek 1a25a77f3e basic/virt: treat missing /proc as sign of being in a chroot
The logic of running_in_chroot() has been the same since the introduction of
this function in b4f10a5e89: if /proc is not
mounted, the function returns -ENOENT and all callers treat this as false. But
that might be the most common case of chrooted calls, esp. in all the naïve
chroots that were done with the chroot binary without additional setup.

(In particular rpm executes all scriptlets in a chroot without bothering to set
up /proc or /sys, and we have codepaths in sysusers and tmpfiles to support
running in such an environment.)

This change effectively shortcircuits various calls to udevadm, downgrades
logging in tmpfiles, and disables all verbs marked with VERB_ONLINE_ONLY in
systemctl. detect-virt -r is also affected:

$ sudo chroot /var/lib/machines/rawhide
before> systemd-detect-virt -r && echo OK
Failed to check for chroot() environment: No such file or directory
after> systemd-detect-virt -r && echo OK
OK
2022-11-09 10:10:59 +01:00
Yu Watanabe bf18862267 Merge pull request #25291 from keszybz/util-cleanup
Split/rename util.c+h and def.h
2022-11-09 09:23:17 +09:00
Khem Raj 239e4a42a6 networkd-ipv4acd.c: Use net/if.h for getting IFF_LOOPBACK definition
This helps in avoiding compiling errors on musl. Definition of
IFF_LOOPBACK is the reason for including linux/if_arp.h, this however
could be obtained from net/if.h glibc header equally and makes it
portable as well.
2022-11-09 01:17:37 +01:00
Yu Watanabe 68773437da Merge pull request #25297 from mrc0mmand/aux-test-fixes
test: fix a race in the systemd-mount test
2022-11-09 06:34:23 +09:00
Lennart Poettering bb69ec9507 dissect: grey out trailing slash in --list output
Given this is just auxiliary info, let's make it a tiny bit less visible
then the main part of the path.
2022-11-08 21:35:34 +01:00
Zbigniew Jędrzejewski-Szmek 28db6fbff1 Rename def.h to constants.h
The name "def.h" originates from before the rule of "no needless abbreviations"
was established. Let's rename the file to clarify that it contains a collection
of various semi-related constants.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek db62f51a9f basic/filesystems: fs_in_group() returns a boolean
is_{temporary,network}_fs() looked like they are incorrectly casting an error
to true, but actually the return type is misdeclared.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek 3ae6b3bf72 basic: rename util.h to logarithm.h
util.h is now about logarithms only, so we can rename it. Many files included
util.h for no apparent reason… Those includes are dropped.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek ee617a4e5c basic: move a bunch of cmdline-related funcs to new argv-util.c+h
I wanted to move saved_arg[cv] to process-util.c+h, but this causes problems:
process-util.h includes format-util.h which includes net/if.h, which conflicts
with linux/if.h. So we can't include process-util.h in some files.

But process-util.c is very long anyway, so it seems nice to create a new file.
rename_process(), invoked_as(), invoked_by_systemd(), and argv_looks_like_help()
which lived in process-util.c refer to saved_argc and saved_argv, so it seems
reasonable to move them to the new file too.

util.c is now empty, so it is removed. util.h remains.
2022-11-08 18:21:10 +01:00
Zbigniew Jędrzejewski-Szmek c47511da7e meson: add version.h as dependency to more targets
version.h can be generated after compilation starts, creating a race condition
between compilation of various .c files and creation of version.h. Let's add it
as a dependency to more build targets that require version.h or build.h.

So far we played whack'a'mole by adding versiondep whenever compilation failed.
In principle any target which includes compilation (i.e. any that has .c
sources directly), could require this. I don't understand why we didn't see
more failures… But it seems reasonable to just add the dependency more widely.
2022-11-08 18:18:34 +01:00
Lennart Poettering 084ecae56f update TODO 2022-11-08 16:39:27 +01:00
Daan De Meyer 6c2ff4a050 mkosi: Build and install kernel selftests 2022-11-08 16:24:21 +01:00
Daan De Meyer 165176d199 mkosi: Add back libasan/libubsan libraries
These were accidentally removed as part of #24025
2022-11-08 16:20:51 +01:00
Zbigniew Jędrzejewski-Szmek d6b4d1c7c4 basic: move version() to build.h+c 2022-11-08 13:41:14 +01:00
Zbigniew Jędrzejewski-Szmek c8715007e0 basic,shared: move disable_coredumps() to coredump-util.[ch] 2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek 3ec2ad35ba basic: move container_get_leader() to process-util.[ch]
basic/util.[ch] is a grab-bag of unrelated functions. Let's move a few
of the remaning functions to better locations.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek baa6a42d27 basic: create new basic/initrd-util.[ch] for initrd-related functions
I changed imports of util.h to initrd-util.h, or added an import of
initrd-util.h, to keep compilation working. It turns out that many files didn't
import util.h directly.

When viewing the patch, don't be confused by git rename detection logic:
a new .c file is added and two functions moved into it.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek b61b95ae9e tests: move tests for eqzero() to a new file
It's a bit silly to have a separate file that one short test, but this is the
last part of the test code that is misplaced, and here consistency beats
brevity.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek 737f274e1e tests: move tests for PROTECT_ERRNO to the right file
Also, rename them to uppercase so that the test name matches what we're
actually testing.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek 2ba6823716 tests: create test-raw-clone.c for raw-clone.h
The include for process-util.h is added for reset_cached_pid(). This
essentially fixes a pre-existing missing include.
2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek da603935d5 tests: create test-limits-util.c for limits-util funcs 2022-11-08 13:41:13 +01:00
Zbigniew Jędrzejewski-Szmek 0e58dc999c sd-journal: make prot_from_flags() static and rename
The function had just one caller and a name that didn't explain much.
Let's make it static and rename for clarity.

While at it, the only caller was not doing error handling correctly
— the function would potentially return a negative error value which
wasn't handled. In practice this couldn't happen, but let's remove
this ambiguity.
2022-11-08 13:41:13 +01:00
Frantisek Sumsal 45ff459b6a test: adjust systemd-mount's tests based on recent coverage reports 2022-11-08 12:44:37 +01:00
Frantisek Sumsal bf9b5691b8 test: install realpath into the test images 2022-11-08 12:43:57 +01:00
Zbigniew Jędrzejewski-Szmek 2fa6574e83 man: add note that network-generator is not a generator
Also fix indentation.
2022-11-08 12:13:45 +01:00
Frantisek Sumsal 9ffa095e46 test: fix a race in the systemd-mount test
Where we might check the automount unit before systemd has a chance to
react.
2022-11-08 12:01:13 +01:00
Hans de Goede 493f67d21d hwdb: Add accel orientation quirk for the Acer Switch V 10 SW5-017 2-in-1
Add a quirk for the accelerometer orientation for
the Acer Switch V 10 SW5-017 2-in-1.
2022-11-08 10:45:24 +09:00
drosdeck 4dbcb5dc10 Fix key toggle and programmable button for Positivo N14ZP 2022-11-07 22:30:33 +01:00
Luca Boccassi cda4d00dfc kernel-install: skip 50-depmod if depmod is not available
Images might be built without any kernel module, and without
installing depmod as it is not needed. Skip it.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1023607
2022-11-07 22:30:07 +01:00
Luca Boccassi 1824d3d6cc Merge pull request #25286 from mrc0mmand/systemd-mount-test-fix
test: replace tmpfs with vfat when testing --owner=
2022-11-07 20:24:52 +01:00
Antonio Alvarez Feijoo 802d9219aa kernel-install/90-loaderentry: do not override an existing systemd.machine_id
If the systemd.machine_id command line option is already set, do not override
it.
2022-11-07 19:54:16 +01:00
Frantisek Sumsal 5c1a5ac172 Merge pull request #25279 from mrc0mmand/firstboot-test-fixes
test: cover some interactive/error paths in firstboot
2022-11-07 18:41:44 +00:00