summaryrefslogtreecommitdiffstats
path: root/src/kernel-install (follow)
Commit message (Collapse)AuthorAgeFilesLines
* sd-json,tree-wide: add sd_json_format_enabled() and use it everwhereZbigniew Jędrzejewski-Szmek2024-10-281-1/+1
| | | | | | | | | | | | | | | | | | | We often used a pattern like if (!FLAGS_SET(flags, SD_JSON_FORMAT_OFF)), which is rather verbose and also contains a double negative, which we try to avoid. Add a little helper to avoid an explicit bit check. This change clarifies an aditional thing: in some cases we treated SD_JSON_FORMAT_OFF as a flag (flags & SD_JSON_FORMAT_OFF), while in other cases we treated it as an independent enum value (flags == SD_JSON_FORMAT_OFF). In the first form, flags like SD_JSON_FORMAT_SSE do _not_ turn the json output on, while in the second form they do. Let's use the first form everywhere. No functional change intended. Initially I wasn't sure if this helper should be made public or just internal, but it seems such a common pattern that if we expose the flags, we might just as well expose it too, to make life easier for any consumers.
* fs-util: rename laccess to access_nofollowMike Yuan2024-10-051-1/+1
| | | | In order to distinguish it from libc function naming.
* various: correct laccess() error checkMike Yuan2024-10-041-5/+3
| | | | laccess is our own macro that uses RET_NERRNO.
* kernel-install: add uki.conf examplecvlc122024-09-202-0/+37
|
* kernel-install: unquote plugin paths in KERNEL_INSTALL_PLUGINSYu Watanabe2024-09-182-4/+11
| | | | | | To support the case that paths to plugins contain spaces. Prompted by #34459
* kernel-install: discard comments in cmdline filesrindeal2024-08-161-3/+3
| | | It was quite a surprise to find my comments in a booted kernel cmdline.
* kernel-install: Try some more initrd variants in 90-loaderentry.installDaan De Meyer2024-07-291-2/+12
| | | | | | On CentOS/Fedora, dracut is configured to write the initrd to /boot/initramfs-$KERNEL_VERSION...img so let's check for that as well if no initrds were supplied.
* kernel-install: Only read cmdline from /proc/cmdline when not in containerDaan De Meyer2024-07-291-2/+4
| | | | | | | If we're running from within a container, we're very likely not going to want to use the kernel command line from /proc/cmdline, so let's add a check to see if we're running from a container to decide whether we'll use the kernel command line from /proc/cmdline.
* kernel-install: remove depmod generated file modules.weakdepJose Ignacio Tornos Martinez2024-07-261-0/+1
| | | | | | | | | The new file, modules.weakdep, generated by depmod to get the weak dpendencies information can be present (https://github.com/kmod-project/kmod/commit/05828b4a6e9327a63ef94df544a042b5e9ce4fe7), so remove it like the other similar files. Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
* kernel-install: Remove existing loader entries and UKIsJörg Behrmann2024-07-152-0/+11
| | | | | | | | | | | When boot counting is enabled, adding a new loader entry or UKI can conflict with an existing one that has booted successfully and therefore has its boot counter removed. systemd-bless-boot will fail to bless the new successful boot, since a file without a boot counter already exists. Since kernel-install will clobber existing files without boot counting, we should therefore remove files without a boot count as well, when we add a file with one. Fixes: #33504
* meson: Fix various versionsDaan De Meyer2024-07-041-1/+1
| | | | | | | | | Follow up for 8b3b01c4b7e0fde39b4be354990ee68f5e612c52 We switch to PROJECT_VERSION instead of PROJECT_VERSION_FULL where we report our version and which is likely being parsed to avoid breaking compat. If we didn't, the output would change from systemd 255 to systemd 255.1 which could break various tools.
* kernel-install: correct the place where it works in man and help textAntonio Alvarez Feijoo2024-06-191-1/+1
|
* libsystemd: turn json.[ch] into a public APILennart Poettering2024-06-121-2/+2
| | | | | | | | | | | | | | | This is preparation for making our Varlink API a public API. Since our Varlink API is built on top of our JSON API we need to make that public first (it's a nice API, but JSON APIs there are already enough, this is purely about the Varlink angle). I made most of the json.h APIs public, and just placed them in sd-json.h. Sometimes I wasn't so sure however, since the underlying data structures would have to be made public too. If in doubt I didn#t risk it, and moved the relevant API to src/libsystemd/sd-json/json-util.h instead (without any sd_* symbol prefixes). This is mostly a giant search/replace patch.
* kernel-install,bootctl: unify the config parsing procedureZbigniew Jędrzejewski-Szmek2024-05-231-38/+10
| | | | Fixes https://github.com/systemd/systemd/issues/32992.
* kernel-install/60-ukify: also search in {/run,/usr/local/lib}/kernel/Mike Yuan2024-04-221-1/+5
| | | | | | | | | | | | After db26d8025e5bbc188f93b645124126bbc550caa5, kernel-install takes config files under /run/ and /usr/local/lib/ into account too. The same should apply to ukify. Note that ukify when invoked alone searches under /run/systemd/, /etc/systemd/, /usr/local/lib/systemd/, and /usr/lib/systemd/, respectively, which is against our usual order...
* Revert "kernel-install: Add kernel version to title (#31581)"Lennart Poettering2024-04-031-2/+2
| | | | This reverts commit 85b774de49caff8be819f021740dd680ba76ab77.
* kernel-install/60-ukify: do not rebuild existing UKIsVitaly Kuznetsov2024-03-251-0/+6
| | | | | | | | | | | In case kernel-install is called to install what's already a UKI, 60-ukify must be skipped. E.g. when distro shipped and signed UKI is being installed, it is counter-productive to try to rebuild it with ukify. Also, the existing script is not ready to handle UKIs with embedded initramfs. Note, it is already possible to disable 60-ukify by setting KERNEL_INSTALL_UKI_GENERATOR to something but in case it is not set, 60-ukify assumes it should run.
* Merge pull request #31862 from keszybz/add-strdup_to-helperYu Watanabe2024-03-211-10/+10
|\ | | | | Add strdup_to() helper
| * Replace strdup_or_null() by strdup_to()Zbigniew Jędrzejewski-Szmek2024-03-201-10/+10
| | | | | | | | | | | | I didn't know that this helper existed… It is very similar to strdup_to_full(), but all callers can actually be replaced by strdup_to(), which has more fitting semantics.
* | kernel-install: fix uki-copy deinstallGerd Hoffmann2024-03-201-2/+2
|/ | | | | | | | | | | | For "kernel-install remove ..." only the kernel version is passed, not the kernel image. So auto-detecting KERNEL_INSTALL_IMAGE_TYPE and setting KERNEL_INSTALL_LAYOUT does not work for uninstall. The 90-uki-copy.install plugin must consider this and *not* exit early for the "remove" command, otherwise $BOOT_ROOT will be filled with stale kernel images. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge pull request #30480 from keszybz/kernel-install-more-pathsZbigniew Jędrzejewski-Szmek2024-03-082-51/+49
|\ | | | | Read kernel-install config from /run/kernel too
| * kernel-install: support full set of config files and drop-insZbigniew Jędrzejewski-Szmek2024-03-072-50/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings the handling of config for kernel-install in line with most of systemd, i.e. we search the set of paths for the main config file, and the full set of drop-in paths for drop-ins. This mirrors what 07f5e35fe7967c824a87f18a3a1d3c22e5be70f5 did for udev.conf. That change worked out fine, so I hope this one will too. The update in the man page is minimal. I think we should split out a separate page for the config file later on. One motivating use case is to allow a drop-in to be created for temporary config overrides and then removed after the operation is done.
| * udev,backlight,kernel-install: reword sentences starting with "Skipping to"Zbigniew Jędrzejewski-Szmek2024-03-071-1/+1
| | | | | | | | | | | | | | That's not gramatically correct. In backlight, change "assocation" to "deduplication". Without the context, it's probably not clear at all that we "associate" them to ignore them.
* | Use VERSION_TAG instead of GIT_VERSION in kernel-install scriptsDaan De Meyer2024-03-062-2/+2
| | | | | | | | | | | | GIT_VERSION only makes sense for C files as it depends on C preprocessor macro expansion now so let's use VERSION_TAG instead of GIT_VERSION for the two remaining usages of GIT_VERSION that are not in C files.
* | stat-util: generalize is_* and verify_* handlingMike Yuan2024-03-041-1/+1
| |
* | kernel-install: Add kernel version to title (#31581)Guilhem Lettron2024-03-031-2/+2
| | | | | | | | | | | | When using uki, kernel installations always have the same name in systemd-boot menu. Signed-off-by: Guilhem Lettron <guilhem@barpilot.io>
* | dissect-image: add flag for explicitly enabling userspace verity signature ↵Lennart Poettering2024-02-281-1/+2
|/ | | | | | | | | | checking let's make userspace verity signature checking optional. This adds a dissection flag to enable the logic and patches through all our users to enable it by default, thus effectively not changing anything from the status quo ante. However, know we have a knob to turn this off in certain scenarios.
* meson: Start adding devel and rc suffixes to the project versionDaan De Meyer2024-02-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Let's make sure that versions generated by meson-vcs-tag.sh always sort higher than official and stable releases. We achieve this by immediately updating the meson version in meson.build after a new release. To make sure this version always sorts lower than future rcs, we suffix it with "~devel" which will sort lower than "~rcX". The new release workflow is to update the version in meson.build for each rc and the official release and to also update the version number after a new release to the next development version. The full version is exposed as PROJECT_VERSION_FULL and used where it makes sense over PROJECT_VERSION. We also switch to reading the version from a meson.version file in the repo instead of hardcoding it in meson.build. This makes it easier to access both inside and outside of the project. The meson-vcs-tag.sh script is rewritten to query the version from meson.version instead of passing it in via the command line. This makes it easier to use outside of systemd since users don't have to query the version themselves first.
* tree-wide: port over various pieces of code to strv_extend_many()Lennart Poettering2024-01-171-5/+4
|
* Merge pull request #30851 from lnussel/kernel-installYu Watanabe2024-01-161-17/+20
|\ | | | | kernel-install fixes
| * kernel-install: silence num kernels installedLudwig Nussel2024-01-151-1/+1
| |
| * kernel-install: fix context_copyLudwig Nussel2024-01-151-16/+19
| | | | | | | | Don't reopen or dup values that weren't set before. Fixes add-all.
* | tree-wide: Load entry-token and layout.conf from /usr/lib/kernel/ as wellDaan De Meyer2024-01-161-21/+2
|/
* Add --root= support for list and prepare add-all for --root= supportDaan De Meyer2024-01-121-17/+11
| | | | | | Let's make sure these follow the rest of kernel-install and always operate on the given root directory, even if the verb itself can't support --root= just yet.
* kernel-install: clarify what is currently supported with --root and --imageAntonio Alvarez Feijoo2024-01-101-2/+8
| | | | | | `list` and `add-all` ignore `--root` or `--image`, working on the running system instead. Also improve the error message if `--image` is used.
* kernel-install: fix memory leakAntonio Alvarez Feijoo2024-01-101-0/+1
|
* Merge pull request #30232 from keszybz/ukify-importsZbigniew Jędrzejewski-Szmek2023-12-131-19/+15
|\ | | | | Use exec() to import ukify
| * kernel-install/60-ukify: use exec() instead of runpyZbigniew Jędrzejewski-Szmek2023-12-011-19/+15
| | | | | | | | | | | | As suggested by Daniele Nicolodi. Also drop left-over debug line.
* | kernel-install: Fix inspect with --root= when no version is specifiedDaan De Meyer2023-12-111-3/+3
| | | | | | | | | | | | Using the kernel version from the host is incorrect in this case, so fix the logic so it handles no version being specified correctly with --root=.
* | kernel-install: Look for uki.conf in /usr/lib/kernel as wellDaan De Meyer2023-12-111-2/+1
|/
* ukify: be more explicit about where to find ukifyPaymon MARANDI2023-11-251-1/+2
| | | | | | | | | | | when KERNEL_INSTALL_UKIFY is not supplied we set ukify to $PWD/ukify that will fail (perhaps only for manual installations): FileNotFoundError: [Errno 2] No such file or directory: '/usr/src/linux-6.7-rc1/ukify' this will make sure we have a sane default for UKIFY Signed-off-by: Paymon MARANDI <paymon@utubeipod.xyz>
* kernel-install: do not resolve symlink in paths passed to pluginsYu Watanabe2023-11-211-27/+50
| | | | | | | | | | | When we resolve symlinks, paths (especially filenames) may be changed, but plugins may expect to see the kernel added under the name specified, not under the final name that the symlink chain resolves to. This makes symlinks in specified paths that passed to plugins are not resolved when neither --root nor --image specified. Fixes #29317.
* test: add test cases about plugin exit codeYu Watanabe2023-11-201-0/+25
|
* kernel-install: propagate failures in pluginsYu Watanabe2023-11-201-9/+8
| | | | | | | | | | | This fixes a regression introduced by 42551ea7e923bac5df12b20e3e735a487d38dcd5. In the shell script version, plugin failures are propagated to the caller. But after the commit, failures in plugins are logged, but never propagated as the exit code of the execution. Fixes #30087.
* tree-wide: fix typoYu Watanabe2023-11-081-1/+1
|
* update CILennart Poettering2023-11-071-1/+1
|
* kernel-install: make "inspect" work more like "add" regarding omission of ↵Lennart Poettering2023-11-071-24/+60
| | | | | | | | parameters This makes "kernel-install inspect" work more "kernel-install add": if the version or kernel image is specified as "-" or omitted we'll make it up.
* kernel-install: add add-all verbLennart Poettering2023-11-071-12/+178
|
* kernel-install: make version/kernel image parameters optional for "add"Lennart Poettering2023-11-071-6/+44
| | | | | | | | | | | | | | Let's make kernel-install a bit easier to use: If the kernel version is not specified, let's imply "uname -r", so that we regnerate the entries for the current kernel. If the kernel image is not specified let's imply using /usr/lib/modules/$version/vmlinuz, i.e. the location distros like Fedora drop the kernel into, which we generally recommend people to use. If the kernel is not found there, don't try to automatically pick the kernel path, and fail, as before.
* kernel-install: add command to list installed kernelsLennart Poettering2023-11-071-8/+83
| | | | | This simply dumps the dirs in /usr/lib/modules/ and whether they contain a vmlinuz binary.