Commit Graph
64182 Commits
Author SHA1 Message Date
Daan De Meyer 58caedadbb mkosi: Enable some debugging options by default 2023-03-17 12:13:26 +09:00
Addison Snelling 0c868e3fad man: fix misspelled executable name (#26858) 2023-03-17 11:36:32 +09:00
Daan De Meyer e21be7976a repart: Report better errors if partition sizes are too small 2023-03-16 23:15:19 +01:00
Daan De Meyer d28c6ce62c repart: Zero full verity signature partition size
systemd-dissect requires the entirety of the partition following the
signature to be zeroed, so let's do just that.
2023-03-16 22:11:31 +01:00
Daan De Meyer 6eccec00fb repart: Make sure we seek to beginning of partition target before copy 2023-03-16 22:10:50 +01:00
Daan De Meyer 9f94d2741f mkosi: Use default timeout of 10s
Let's override the default timeout to something more reasonable for
mkosi builds.
2023-03-16 18:19:37 +01:00
Zbigniew Jędrzejewski-Szmek fe0637079f udev/ata_id: use unliagned helpers
The array is a union, aligned as uint16_t, so we were accessing fields at
offsets of two, so we didn't do actually do unaligned access. But let's make
this explicit.
2023-03-16 17:35:17 +01:00
Zbigniew Jędrzejewski-Szmek 42fff80cb8 udev/v4l_id: use O_CLOEXEC|O_NOCTTY
This is the usual set of flags. O_CLOEXEC doesn't matter because we don't spawn
anything, but O_NOCTTY could possibly make a difference if the helper is called
on a wrong device type.
2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 8a4c11e0e2 meson: add udev builtins to dist-check
They now pass, and we might as well test them to avoid unexpected
regressions.
2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 5356761da6 udev: implement --version in all builtins
Those are separate binaries, and occasionally people will get a misplaced
binary that doesn't match the rest of the installed system and be confused, so
it good to be able to check the version. It is also nice to have the same
interface in all binaries.

Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option
without a short name. We can use a less verbose approach of simply taking any
unused letter, which works just as well and even the compiler would warn us
if we tried to use the letter in another place. This way we avoid a few lines
of boilerplate.

The help texts are adjusted to have an empty line between the synopsis and
option list, and no empty lines after the option list.
2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek bd36d0281a udev/cdrom_id: do not abort on unknown options
Copy-pasta is good, but you have to pick a reliable source.
2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 32c2d046c6 udev/mtd_probe: convert to run() 2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 8b89b9d7c3 udev/mtd_probe: implement --help 2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 4b0f967484 udev/fido_id: implement --help 2023-03-16 16:46:44 +01:00
Zbigniew Jędrzejewski-Szmek 66026fca95 udev/ata_id: stop using errno, fix logic
The code was setting errno, which we don't do, and which is hard to get right…
Rework the code to use the usual negative-errno convention and add some
debug logging.

disk_scsi_inquiry_command() was working partially by accident: the v3 fallback
would enter the v4 check path, and pass it because the v4 data would still be
initialized to 0.
2023-03-16 16:46:43 +01:00
Zbigniew Jędrzejewski-Szmek 4dfe41e234 udev/ata_id: drop unused output parameter 2023-03-16 16:45:11 +01:00
Frantisek Sumsal e912bef85d test: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASan 2023-03-16 12:56:40 +00:00
Daan De Meyer a4180c0fb3 journald-console: Add colors when forwarding to console
Let's color output when we're forwarding to the console. To make this
work, we inherit TERM from pid 1 and use it to decide whether we should
output colors or not.
2023-03-16 11:22:58 +01:00
Daan De Meyer 197dd3a9a4 terminal-util: Don't assume terminal is dumb if connected to /dev/null
If we're connected to /dev/null, we're likely going to be writing
colors to something that's not stdout/stderr, so let's fall back to
checking TERM if that's the case.
2023-03-16 11:21:28 +01:00
Luca Boccassi e0b8bbbdbe doc: update ELF_PACKAGE_METADATA to use linker flag instead of manual script
bfd/gold/mold/lld support this flag, so document it explicitly, and drop the
manually written linker script which is no longer necessary
2023-03-16 08:38:39 +01:00
Yu Watanabe 7b4cae904b test: add tests for summary output of udevadm verify 2023-03-16 14:54:46 +09:00
Yu Watanabe f99deb1e94 test: reindent testsuite-17.11.sh 2023-03-16 14:54:46 +09:00
Yu Watanabe 7ec4e184ba udevadm-verify: add a short summary 2023-03-16 14:54:46 +09:00
Yu Watanabe 3b1b0f1aeb sd-journal: fix segfault
Unfortunately, journal_file_next_entry() returns 0 when the next entry
not found. The commit cc938e4a0a adds
FIXME comment about that. We should really fix that, but the function and
its return value are used in many place, hence checking all usecases is not
easy. So, let's workaround that here, and handle the 0 return value by
the caller.

Follow-up for 34af74946e.

Fixes #26822.
2023-03-16 00:26:22 +00:00
Luca Boccassi 77c26cd62a Merge pull request #26835 from poettering/userdb-modernizations
various userdbd modernizations
2023-03-16 00:25:01 +00:00
OMOJOLA JOSHUA 71243af72f updated usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WIT… (#26840)
* localed: update usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WITH_ARGS
2023-03-15 22:52:24 +00:00
Yu Watanabe b2b5a95227 github: update default and example in template 2023-03-15 20:31:34 +01:00
Yu Watanabe cb6ff2a42c Merge pull request #26771 from YHNdnzj/machinectl-edit
machinectl: add verb edit and cat to operate on .nspawn files
2023-03-16 04:02:11 +09:00
Ludwig Nussel 361cacf49e manager: fix scope for environment generators
fixes regression introduced by 4870133bfa
2023-03-16 03:59:49 +09:00
Dmitry V. Levin f5b28e6bd8 test: fix testsuite-17.10.sh
Make sure /etc/udev/hwdb.d/ exists before creating a file inside it.

Fixes: 95cf8cae77 ("test: add coverage test for udevadm")
2023-03-16 03:59:01 +09:00
Yu Watanabe 0e5b4d767a Merge pull request #26831 from YHNdnzj/edit-util-followup
edit-util: follow-ups
2023-03-16 03:51:55 +09:00
Dmitry V. Levin 3ec58d0cd8 udev-rules: check for conflicting and duplicate expressions
Log an error when a rule line contains conflicting match expressions, e.g.
  NAME=="value", NAME!="value"

Log a warning when a rule line contains duplicate expressions, e.g.
  NAME=="value", NAME=="value"
2023-03-16 03:49:57 +09:00
Cornelius Hoffmann 2ff7856e1e Update github issue template to include systemd-dissect 2023-03-15 16:52:32 +01:00
Lennart Poettering b260be2ca7 userdbd: make static const what we can make so 2023-03-15 16:10:21 +01:00
Lennart Poettering 66a3869e7e userdbd: rework to use sd_event_add_child() instead of manual SIGCHLD
Let's modernize userdbd furzer, and use the common child handling we
nowadays have in sd-event, instead of rolling our own.

This also means we'll start using pidfds where we can.
2023-03-15 15:57:25 +01:00
Lennart Poettering 755424e94f userdbd: make use of FORK_CLOSE_ALL_FDS + FORK_REOPEN_LOG where we can 2023-03-15 15:57:25 +01:00
Lennart Poettering 54f5522664 userdbd: modernize signal handling
Let's make use of SD_EVENT_SIGNAL_PROCMASK so that we don't have to mask
the signals manually. Let's use sd_event_set_exit_signal() instead of
rolling our own SIGTERM/SIGINT handling. Let's use "floating" event
sources instead of keeping references on our own.

Let's also debug log if we can't enable watchdog handling.
2023-03-15 15:57:03 +01:00
Daan De Meyer f5abe8f957 Merge pull request #26784 from DaanDeMeyer/chase-fix
Allow creating files and directories with chase_symlinks_open() and further improvements
2023-03-15 15:51:47 +01:00
Daan De Meyer 39eb3ffaaa fs-util: Drop unlink_noerrno() 2023-03-15 13:27:20 +01:00
Mike Yuan af0292844d test: add testsuite-74.machinectl 2023-03-15 19:56:19 +08:00
Mike Yuan 1ed35a0d93 machinectl: add verb edit and cat to operate on .nspawn files
This allows operating on .nspawn files using machinectl.

Closes #26246
2023-03-15 19:56:19 +08:00
Mike Yuan d3bf024f1a edit-util: log unexpected errors if we fail to remove the parent dir 2023-03-15 19:50:26 +08:00
Daan De Meyer a45332500d Merge pull request #26820 from DaanDeMeyer/dir-fd-is-root
fd-util: Add dir_fd_is_root()
2023-03-15 12:48:14 +01:00
Mike Yuan 00b6baf2be edit-util: use path_equal 2023-03-15 19:45:33 +08:00
Daan De Meyer ea8282b6fc chase-symlinks: Add more assertions
Let's turn some runtime errors into assertions and add a few new
assertions.
2023-03-15 12:38:14 +01:00
Daan De Meyer 47f0e1b5e0 chase-symlinks: Rework open() functions and some chase flags
Currently, when CHASE_PARENT is specified, we chase the parent directory
of the symlink itself. Let's change this and chase the parent directory
of the symlink target so that trying to open the actual file later with
O_NOFOLLOW doesn't fail with ELOOP.

To get the current behavior, callers can add CHASE_NOFOLLOW to chase
the parent directory of the symlink itself.

Currently, when CHASE_MKDIR_0755 is specified, we create all components
of the path as directories. Instead, let's change the flag to only create
parent directories and leave the final component of the PATH untouched.
Also, allow CHASE_NONEXISTENT with CHASE_MKDIR_0755 now that it doesn't
create all components anymore.

Finally, rework chase_symlinks_and_open() and chase_symlinkat_at_and_open()
to always chase the parent directory and use xopenat() to open the final
component of the path. This allows us to pass O_CREAT to create the file or
directory (O_DIRECTORY) if it is missing. If CHASE_PARENT is configured, we
just reopen the parent directory that we chased.
2023-03-15 12:38:11 +01:00
bri d6c623e884 Add rebrands of Medion Akoya notebooks/tablets 2023-03-15 10:59:06 +00:00
Luca Boccassi 1be50af42e Merge pull request #26804 from fbuihuu/fixes-for-test-58-repart
Fixes for test 58 repart
2023-03-15 10:56:07 +00:00
Daan De Meyer af423b4ba9 fd-util: Add dir_fd_is_root() 2023-03-15 11:51:08 +01:00
Daan De Meyer 9bf8441503 mountpoint-util: Add path_get_mnt_id_at() 2023-03-15 11:51:06 +01:00