| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
format-table: add concept of "vertical" table
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Originally, the table formatting code was written to display a number of
records, one per line, and within each line multiple fields of the same
record. The first line contains the column names.
It was then started to be used in a "vertical" mode however,
i.e. with field names on the left instead of the top. Let's support such
a mode explicitly, so that we can provide systematic styling, and can
properly convert this mode to JSON.
A new constructor "table_new_vertical()" is added creating such
"vertical" tables. Internally, this is a table with two columns: "key"
and "value". When outputting this as JSON we'll output a single JSON
object, with key/value as fields. (Which is different from the
traditional output where we'd use the first line as JSON field names,
and output an array of objects).
A new cell type TABLE_FIELD is added for specifically marking the
"field" cells, i.e. the cells in the first column. We'll automatically
suffic ":" to these fields on output.
|
|\ \
| | |
| | | |
resolve: provide effective mDNS or LLMNR settings
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
image UUID
systemd-repart generates this in a suitably stable fashion, hence let's
actually use it as an identifier for the image. As a first step parse
it, and show it.
|
|/ |
|
|\
| |
| | |
Add more openat() style variants for existing stuff
|
| |
| |
| |
| |
| |
| |
| | |
In tests it's useful to be able to delete temporary directories
via a file descriptor to them, so let's add rm_rf_physical_and_close()
which gets the file descriptor path via /proc and tries to remove it
that way.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Initrd with overlayfs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in_initrd() was really doing two things: checking if we're in the initrd, and
also verifying that the initrd is set up correctly. But this second check is
complicated, in particular it would return false for overlayfs, even with an
upper tmpfs layer. It also doesn't support the use case of having an initial
initrd with tmpfs, and then transitioning into an intermediate initrd that is
e.g. a DDI, i.e. a filesystem possibly with verity arranged as a disk image.
We don't need to check if we're in initrd in every program. Instead, concerns
are separated:
- in_initrd() just does a simple check for /etc/initrd-release.
- When doing cleanup, pid1 checks if it's on a tmpfs before starting to wipe
the old root. The only case where we want to remove the old root is when
we're on a plain tempory filesystem. With an overlay, we'd be creating
whiteout files, which is not very useful. (*)
This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=2137631
which is caused by systemd refusing to treat the system as an initrd because
overlayfs is used.
(*) I think the idea of keeping the initrd fs around for shutdown is outdated.
We should just have a completely separate exitrd that is unpacked when we want
to shut down. This way, we don't waste memory at runtime, and we also don't
transition to a potentially older version of systemd. But we don't have support
for this yet.
This replaces 0fef5b0f0bd9ded1ae7bcb3e4e4b2893e36c51a6.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Back in e2857b3d87306d93f0fba526f3e79f4f6806fb02 I added this function
as static inline in order to avoid linking libmount into libshared.
Nevertheless, a dependency on libmount was added to libbasic in
9e7f941acb0d8fe7a31eec7826ff2c9c6af7044f, and later moved to libshared
in 77c772f227d866331560a8d0487fba12dd128dd4. So the shenanigan with an
inline function is not useful, let's make it a normal function.
|
| | |
| | |
| | |
| | |
| | | |
Just typos and grammar. In the end didn't add a use of a function, but
I read the comment carefully, and this commit is the result of that.
|
|\ \ \
| | | |
| | | | |
acp-fpdt: minor tweaks/fixes
|
| | | |
| | | |
| | | |
| | | |
| | | | |
some extra safety: make sure the two fields we care about are actually
properly present before the buffer is over.
|
| | | | |
|
| |/ / |
|
|/ /
| |
| |
| |
| | |
Let's complete support for DDI discovery, and also support 2nd stage
initrds.
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
basic/util.[ch] is a grab-bag of unrelated functions. Let's move a few
of the remaning functions to better locations.
|
|/
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
dissect: fix fsck invocation
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since f7725647bb41c3398a867f139efe526efe8aa1b3 when dissecting a disk
image we operate with fds to the device nodes in question wherever we
can. This includes when we fork off fsck, where we pass a /proc/self/fd/
path as argument. This only works if we keep that fd open however and
disable O_CLOEXEC on the fd. Hence do so, and fix fsck this way.
(Without this, all fsck will fail, since the fd path is invalid)
|
|/
|
|
|
|
|
| |
flock(2) works with file descriptors opened with O_RDONLY.
This affects SELinux systems where access to block devices is quite
restricted to avoid bypasses on filesystem objects.
|
|
|
|
| |
Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
|
|
|
|
| |
Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
|
|
|
|
|
|
| |
Except for 'threads'.
Follow-up for ede5a78f50ed2d5f86dc7a117de2a51b397d52d4.
|
|
|
|
|
|
| |
In the Xen case, it's the hypervisor which manages kexec. We thus
have to ask it whether a kernel is loaded, instead of relying on
/sys/kernel/kexec_loaded.
|
|
|
|
|
|
|
|
|
| |
Instead of succeeding when either the firmware reports a TPM device
or we find a TPM device, let's check that the firmware reports a TPM
device and the TPM subsystem is enabled in the kernel.
To check whether the subsystem enabled, we check if the relevant
subdirectory in /sys exists at all.
|
|
|
|
|
|
|
|
|
|
|
| |
To support predictable interface names in various embeeded systems
add support for an additional naming scheming using the USB host
interface. Several asics have usb controllers that are platform
devices and not children of a pci interface. These embedded systems
should be able to enumerate interfaces by udev path as well to support
configurations and policies.
Signed-off-by: Charles Hardin <charles.hardin@chargepoint.com>
|
|
|
|
|
|
| |
Follow-up for 94e7298d309fef7710174def820e9d38e512a086.
Fixes CID#1499992.
|
|
|
|
|
|
| |
After d71ece3f0b85c7a3decc50143b68ac07fc5831ae, the function is not used
in libbasic or libsystemd anymore. Let's move it to more appropriate
place.
|
|\
| |
| | |
Refusing linking files underneath our hierarchy, improve error messages
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We treat symlinks to unit files outside of the search path differently from
symlinks to unit files *in* the search path. The former are "linked" unit
files, while the latter are enablement symlinks and such and will be removed
when disabling the unit.
The history of the check for in_search_path() is interesting: this condition
was added already in the first version of the code in
830964834f330836b9d33752e83de09d4f38da87. Since the beginning, matching
arguments would simply be ignored. I think this is dubious. The man page says:
> Link a unit file that is *not* in the unit file search paths
> into the unit file search path
But for backwards-compat, let's continue to silently do nothing for files
*in* the search path.
The case of symlinks to unit files underneath the search path, but in some
subdirectory, is less clear. We didn't check for this case, so it was
implicitly allowed. But that's just an oversight, we don't want to allow people
to create additional subhierarchies under our hierarchy. Let's check for this
case and refuse.
Closes #24605.
|
| |
| |
| |
| |
| |
| |
| | |
This adds a check for an allocation error for the calls to install_changes_add()
where we're plannig to return success from the call. In cases where we're
returning failure, it doesn't matter as much: the operation will fail anyway,
and if the allocation fails, we'll just get a less descriptive error message.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The machinery to report a good error message only works if the
error was registered with install_changes_add() and a file name. Otherwise
we only get a generic "Op failed: %m" message.
In some places -EINVAL is replaced by -EUCLEAN, so that we get the proper
error message.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function was written to only return an error from internal allocation
failures, because when using it to create a bus message, we want to distinguish
a failed operation from an allocation error when sending the reply. But it
turns out that the only caller that makes this distinction checks that the
passed-in errno value ('type') is not negative beforehand. So we can make the
function pass 'type' value through, which makes most of the callers nicer.
No functional change.
|
| |
| |
| |
| | |
https://github.com/systemd/systemd/pull/24728#issuecomment-1260966910
|
|/
|
|
| |
Most places were already converted, but a few weren't for some reason.
|
|\
| |
| | |
Use "re" or "r" as appropriate for various calls
|
| | |
|
|\ \
| | |
| | | |
Fix coredump deadlock with overly long backtraces
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We would deadlock when passing the data back from the forked-off process that
was doing backtrace generation back to the coredump parent. This is because we
fork the child and wait for it to exit. The child tries to write too much data
to the output pipe, and and after the first 64k blocks on the parent because
the pipe is full. The bug surfaced in Fedora because of a combination of four
factors:
- 87707784c70dc9894ec613df0a6e75e732a362a3 was backported to v251.5, which
allowed coredump processing to be successful.
- 1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a was NOT backported, so the output
was very verbose.
- Fedora has the ELF package metadata available, so a lot of output can be
generated. Most other distros just don't have the information.
- gnome-calendar crashes and has a bazillion modules and 69596 bytes of output
are generated for it.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2135778.
The code is changed to try to write data opportunistically. If we get partial
information, that is still logged. In is generally better to log partial
backtrace information than nothing at all.
|
| | |
| | |
| | |
| | |
| | | |
It is useful to distinguish if json_parse_file() got no input or invalid input.
Use different return codes for the two cases.
|