Commit Graph
63092 Commits
Author SHA1 Message Date
Mike Yuan 8992667fef edit-util: minor cleanups
Reuse unlink_and_free() and avoid unnecessary
call to rmdir()
2023-03-13 00:40:15 +08:00
Mike Yuan 7d28e496e8 Merge pull request #26756 from yuwata/edit-util-cleanups
edit-util: several cleanups
2023-03-12 19:23:19 +08:00
Yu Watanabe 5654a4f9c5 sd-boot: fix incompatible type
Fixes the following build error:
```
../src/boot/efi/vmm.c: In function ‘get_smbios_table’:
../src/boot/efi/vmm.c:217:24: error: incompatible types when returning type ‘_Bool’ but ‘const SmbiosHeader *’ was expected
  217 |                 return false;
      |                        ^~~~~
```
2023-03-12 19:49:16 +09:00
Yu Watanabe 0a742f3622 edit-util: unlink temporary file on failure
Addresses the suggestion
https://github.com/systemd/systemd/pull/26756#discussion_r1133078705.
2023-03-11 22:20:54 +09:00
Yu Watanabe aec8200b12 edit-util: fix potentical crash when no edit markers
This also makes trim_edit_markers() take EditFile as the argument.
2023-03-11 22:19:22 +09:00
Yu Watanabe c629a5bc44 edit-util: make create_edit_temp_file() take EditFile as the argument
No functional changes, just refactoring.
2023-03-11 22:19:22 +09:00
Yu Watanabe 043db3400c edit-util: make EditFile take reference of EditFileContext
No functional change, just preparation for later commits.
2023-03-11 22:19:22 +09:00
Yu Watanabe 321291d82b systemctl-edit: invert one error check 2023-03-11 22:19:22 +09:00
Yu Watanabe 7a2a7f2c00 systemctl-edit: shorten code a bit 2023-03-11 22:19:22 +09:00
Daan De Meyer 9c34405241 mkosi: Update to latest 2023-03-11 13:55:41 +01:00
Yu Watanabe c9501b03cd Merge pull request #26641 from medhefgo/boot-elf2efi
boot: Drop gnu-efi / Add elf2efi.py
2023-03-11 17:15:01 +09:00
Yu Watanabe 91e07dd476 Merge pull request #26303 from YHNdnzj/edit-util
shared: add edit-util (part of which extracted from systemctl-edit)
2023-03-11 17:13:27 +09:00
Yu Watanabe 5b23987eaf Merge pull request #26739 from ldv-alt/udevadm-verify
udevadm verify: introduce --root option
2023-03-11 17:12:57 +09:00
Yu Watanabe dcbe37ca2f Merge pull request #26752 from Foxboron/morten/fix-manpage
src: Fixup copy-paste error for terminal_urlify_man
2023-03-11 17:12:47 +09:00
Morten Linderud 9e60dc0daf man: Fix pcrphase.service manvolnum from 1 to 8 2023-03-10 20:29:56 +01:00
Morten Linderud 6dadf31d61 src: Fixup copy-paste error for terminal_urlify_man
Signed-off-by: Morten Linderud <morten@linderud.pw>
2023-03-10 20:21:30 +01:00
Yu Watanabe c3600c380a generator: fix comment 2023-03-11 03:32:23 +09:00
Mike Yuan f8970df54b edit-util: several cleanups for run_editor
run_editor is now switched to heap allocation
for simplicity. The code for child is made into
an individual function for simpler error handling.
2023-03-11 02:02:51 +08:00
Mike Yuan 90c462bdd1 systemctl: edit: several cleanups 2023-03-11 02:02:44 +08:00
Mike Yuan 9a11b4f953 edit-util: introduce EditFileContext
This is a rather large change which moves
the add and install logic into edit-util.

We store an EditFile array and the number of
elements, along with the edit markers used in
temporary files and whether to remove the parent
directories of the target files if they're empty
in an EditFileContext object.

Call edit_files_add() to add an file to edit,
and do_edit_files_and_install() to do the actual
editing (through create_edit_temp_file(),
run_editor() and trim_edit_markers()).
After that, edit_file_context_done() can be used
to destroy the object.
2023-03-11 02:01:00 +08:00
Mike Yuan fa2413dd57 edit-util: several cleanups to create_edit_temp_file
original_path and comment_paths can now be used
together.

Removes reference to "unit"
2023-03-11 01:38:52 +08:00
Mike Yuan a01c4bc9af shared: extract edit-util from systemctl-edit 2023-03-11 01:38:52 +08:00
Dmitry V. Levin b2f7bb760a udev_rules_parse_file: issue diagnostics about duplicate LABEL tokens
When a rules contains several LABEL tokens, the parser used to silently
discard all of them besides the last one without any diagnostics at all.
It's time to break the vow of silence and let the parser issue a warning.
2023-03-10 17:10:41 +00:00
Will Fancher 6e017b19a8 mount: Include After=local-fs-pre.target by default in initrd
Although it may be true that /sysroot and its children don't belong in
local-fs.target, that doesn't mean they shouldn't come after
local-fs-pre.target. For instance, systemd-hibernate-resume@.service needs to
come before /sysroot and its children, but currently that only happens
coincidentally because of the ordering between systemd-fsck@.service and
local-fs-pre.target. As a result, mount units can be mistakenly started
simultaneously with systemd-hibernate-resume@.service, which can cause
corruption and data loss in the worst of cases.
2023-03-11 02:10:41 +09:00
Dmitry V. Levin c8f39ddcf6 testsuite-17.11.sh: check udevadm verify --root 2023-03-10 17:10:41 +00:00
Dmitry V. Levin 0a7eda348c udevadm verify: introduce --root option
When udevadm verify is invoked without positional arguments and loads
all rules files from the system like the udev daemon does, this option
can be used to operate on files underneath the specified root path.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin e8c53080c4 udevadm verify: load all rules from the system if no rules were given
When udevadm verify is invoked without positional arguments, that is,
when no udev rules files are specified, load all rules files from the system
like the udev daemon does, and verify them.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin 197f695a75 testsuite-17.11.sh: prepare to test udevadm verify --root 2023-03-10 17:10:41 +00:00
Dmitry V. Levin 99f2445171 testsuite-17.11.sh: create all files in a temporary directory
Make sure the test would not collide with anything else by moving
all files it created into a temporary directory.
2023-03-10 17:10:41 +00:00
Dmitry V. Levin 0b1ee3e311 testsuite-17.11.sh: robustify unknown user/group checks
Use certainly invalid user/group names in the tests that check
unknown user/group diagnostics.
2023-03-10 17:10:41 +00:00
Daan De Meyer aa41079175 Merge pull request #26726 from DaanDeMeyer/cleanups
Various small cleanups
2023-03-10 14:22:53 +01:00
Lennart Poettering d0ed83f3ae Merge pull request #26737 from poettering/runtime-scope
add RuntimeScope enum, replacing LookupScope and various booleans indicating whether we are called in a per-system or per-user context
2023-03-10 13:09:40 +01:00
Lennart Poettering 8c327f7e98 Merge pull request #26747 from poettering/dissect-common-decrypt
minor clean-ups for src/dissect/dissect.c
2023-03-10 13:07:22 +01:00
Luca Boccassi 5c67a8a188 test: run script from /tmp, not /run
On Debian the test fails because /run is noexec. Simply create the
script in /tmp (and use a BindPath=), as other tests are doing.

Follow-up for 3b7101183c
2023-03-10 11:01:22 +00:00
Daan De Meyer 37c485482f lock-util: Use unposix_lock() in make_lock_file() and release_lock_file() 2023-03-10 11:57:43 +01:00
Daan De Meyer 460accdf3d user-util: Use unposix_lock() in take_etc_passwd_lock() 2023-03-10 11:57:43 +01:00
Daan De Meyer 4dd888dc92 lock-util: Move to src/basic 2023-03-10 11:57:43 +01:00
Daan De Meyer b4cbfa5f1b lock-util: Add CLEANUP_UNPOSIX_UNLOCK()
Also migrate the logic in dynamic-user.c to use the new cleanup
macro.
2023-03-10 11:57:43 +01:00
Daan De Meyer 663fd3e103 lock-util: Add unposix_lock()
Let's add an interface to UNPOSIX locks that mimicks the flock()
interface for BSD locks.
2023-03-10 11:57:40 +01:00
Jan Janssen 2c7c68e4e4 meson: Use static library for EFI tests
This also moves them so that fuzz builds do not need pyelftools around.
2023-03-10 11:41:08 +01:00
Jan Janssen 5d5525245b boot: Fix unused function warning 2023-03-10 11:41:08 +01:00
Jan Janssen e8509329d7 ci: Adjust for new EFI build 2023-03-10 11:41:08 +01:00
Jan Janssen 31ffb6b183 boot: Add RISCV32 and LoongArch support
This is completely untested, but should work in theory, as it's just
adding a couple defines according to the specs.
2023-03-10 11:41:08 +01:00
Jan Janssen c4ad9b23ca boot: Fix debug experience 2023-03-10 11:41:08 +01:00
Jan Janssen 2afeaf1675 boot: Bring back bootloader builds
This adds back sd-boot builds by using meson compile targets directly.
We can do this now, because userspace binaries use the special
dependency that allows us to easily separate flags, so that we don't
pass anything to EFI builds that shouldn't be passed.

Additionally, we pass a bunch of flags to hopefully disable/override any
distro provided flags that should not be used for EFI binaries.

Fixes: #12275
2023-03-10 11:41:08 +01:00
Jan Janssen dfca5587cf tree-wide: Drop gnu-efi
This drops all mentions of gnu-efi and its manual build machinery. A
future commit will bring bootloader builds back. A new bootloader meson
option is now used to control whether to build sd-boot and its userspace
tooling.
2023-03-10 11:41:03 +01:00
Jan Janssen 9214828313 meson: Introduce userspace dep
This will help in a later commit to separate userspace from EFI builds.
2023-03-10 11:40:14 +01:00
Lennart Poettering b7df862213 dissect: use a switch statements where appropriate 2023-03-10 11:36:34 +01:00
Lennart Poettering 94abea2abf dissect: share dissected_image_decrypt_interactively() invocation between actions
Let's invoke dissected_image_decrypt_interactively() at once place only,
instead of in each function separately.

No actual changes, just some minor refactoring.
2023-03-10 11:36:34 +01:00
Lennart Poettering f69edd6faf Merge pull request #26331 from ddstreet/tpm2_pcr_read
Tpm2 pcr read
2023-03-10 10:24:39 +01:00