aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Add basic completions for the fish shellHEAD0.6.0masterWolfgang Müller2022-10-27-0/+15
|
* Fix mandoc linting errors0.5.0Wolfgang Müller2022-04-26-3/+4
|
* Use /proc/config.gz for config diffsWolfgang Müller2022-04-26-11/+15
| | | | | | | | | | | | | | | | | | | | diff_kernel relies on the existence of the /boot/config-{kernel} file which is usually installed by the install-kernel script. This file may be missing on systems with a custom install workflow or EFI systems that use the systemd install_kernel functionality. The latter installs the EFI stub kernel only, no auxiliary files of any kind. Comparisons against the /boot/config-{kernel} file therefore fail on such systems. This commit attempts to support a wider range of install workflows by extracting the config from /proc/config.gz instead. Regardless of how the kernel is installed, this particular file should exist as long as CONFIG_IKCONFIG is enabled in the running kernel. A word about "running config": The way that phrase was used previous to this commit is technically inaccurate, since the "running config" could change by installing a kernel and replacing the config file under /boot. Now we *always* refer to the configuration saved within the currently running kernel.
* Check for kernel source directoryWolfgang Müller2022-04-26-0/+8
| | | | | | | | | | Some commands need to be launched inside the kernel source directory. Even though the manual points this out, users may not know or forget. Make sure to refuse working on a non-kernel directory: this will point users in the right direction and avoid doing unnecessary work. To detect a kernel source tree, check for existence of the 'Kbuild' and 'Kconfig' files.
* Update name and add .mailmap for consistencyWolfgang Müller2021-03-10-2/+3
|
* Move sed invocation into its own function0.4.0Wynn Wolf Arbor2020-06-04-2/+7
| | | | | | In test_diff() we are duplicating the sed invocation that strips config files of anything irrelevant. Move that part of the functionality into its own function.
* Drop nvim(1) dependency in diff_kernelWynn Wolf Arbor2020-06-04-3/+10
| | | | | | | | | | | | | | Commit 1b8d91f ("Use configuration file under /boot instead of /proc/config.gz") enables us to drop neovim as a dependency, since we can now access all configuration data through actual files. Use git-diff(1) (which has automatic paging & colours) if available to show the changes between kernel configurations, else fall back to diff(1). Since the exit code of diff utilities is >0 if inputs are different, ignore the exit code of the diff utility in test_diff() to continue like normal.
* Use configuration file under /boot instead of /proc/config.gzWynn Wolf Arbor2020-06-04-11/+23
| | | | | | | | | | | | | | | | | | | | kern(1) has been using /proc/config.gz as the source of the currently running kernel's config since its initial commit. Whilst this location is convenient because of its static nature, it does need a specific kernel option, IKCONFIG_PROC, to be set. Furthermore, it introduces a dependency on gzip(1) to decompress the file on the fly. Consequently, we need to stream gzip's output to commands or save it in a temporary file to access it neatly. Since Gentoo's default install script for the kernel, installkernel(8), places each kernel's configuration file in /boot, we can use this location to retrieve the currently running kernel's configuration instead and work around all of the above limitations. Of course we need to make sure that /boot is mounted before we try accessing any configuration files on there. We use the already existing code from install_kernel() for that.
* Inline SRCDIRWynn Wolf Arbor2020-06-04-3/+2
| | | | | | kern(1) is supposed to be used on Gentoo Linux, and the canonical location for kernels is /usr/src. Until there is an actual need to have the user override this location, remove SRCDIR and inline its contents.
* Use readlink(1) to get the currently selected kernelWynn Wolf Arbor2020-06-04-1/+1
| | | | | | get_selected_kernel uses eselect(1) to retrieve the currently selected kernel. Since the eselect tool itself does nothing other than invoke readlink(1) on /usr/src/linux, use that instead.
* Rename get_current_kernel to get_selected_kernelWynn Wolf Arbor2020-06-04-3/+3
| | | | | | | | In a similar vein to commit 5f83bed ("Use consistent and explicit terminology in set_kernel()"), the term "current" kernel is ambiguous here. An upcoming commit will introduce the concept of the "running config", which is the kernel configuration the currently running kernel uses. To reduce any ambiguity, use "selected" instead of "current".
* Use OR lists instead of if commandsWynn Wolf Arbor2020-06-04-6/+2
| | | | | Use a more succinct and clear style in two places by converting if commands into simple OR lists.
* Mention the base template in kern.1Wynn Wolf Arbor2020-05-16-2/+3
| | | | | Since fragment merging will fail if the base template does not exist, make sure to mention it in the manual.
* Don't exit if newest kernel is selectedWynn Wolf Arbor2020-05-16-2/+7
| | | | | | It was really never a good idea to make this a fatal error, especially considering consecutive calls of kern(1) without any arguments will fail after the kernel has been set successfully once.
* Simplify conditional logic in test_diff()Wynn Wolf Arbor2020-05-16-7/+5
| | | | | | | | | | | | | | | | | Previously we recorded the return value of the sed ... | diff pipeline into a variable and later used it to test whether the command returned successfully or not. Since we enable errexit, this meant that the diff command failing would terminate the execution of the whole script. We are unsure how this was not caught earlier as the script has been in use for quite a while now - it is possible that bash 5.0 shows different behaviour here. It is our understanding that bash's current behaviour is correct, however. Instead of using a variable to store the return value, put the whole pipeline into an if clause, and react to its success or failure there. Whilst this does remove our ability to indicate diff's actual return value, it makes this test simpler and more straightforward.
* Add TODO item regarding /boot/config-* supportWynn Wolf Arbor2020-05-05-0/+2
|
* Add manuals to Makefile0.3.0Wynn Wolf Arbor2020-05-05-1/+3
|
* Use consistent and explicit terminology in set_kernel()Wynn Wolf Arbor2020-05-05-2/+2
| | | | | | | | | With the introduction of the manuals, we realized that the term "active kernel" is ambiguous. It might refer to both the currently selected kernel in eselect and the kernel the system is running on at the moment. Use "selected" instead of "active" to make this more explicit and line it up with the usage in the manual.
* Add kern(1) and kernfrag(7) manualsWynn Wolf Arbor2020-05-05-0/+281
|
* Remove && from all()0.2.0Wynn Wolf Arbor2020-03-23-7/+7
| | | | | Since the script uses the `set -e' option, chaining together commands with && will fully negate its effects.
* Exit if the kernfrag directory is inaccessibleWynn Wolf Arbor2020-03-23-0/+4
|
* Check whether /boot is already mountedWynn Wolf Arbor2020-03-23-1/+5
| | | | | | | This commit adds code to check whether /boot is mounted or not, and will skip the mount command if the path is already mounted. This will fix an issue where the script exited prematurely if /boot was already present, as the mount command failed and we use `set -e'.
* Add a prompt to test_diff instead of exiting unconditionallyWynn Wolf Arbor2020-03-16-1/+5
| | | | | | For differences in config files that can safely be ignored, introduce the possibility of continuing with the build and install instead of exiting unconditionally.
* Hide potential warning about broken symlinkWynn Wolf Arbor2020-03-16-1/+1
| | | | | | | If the user removes the old kernel sources whilst still having the symlink point to the kernel directory, eselect will issue a warning about an invalid kernel target. For the purposes of kern, we can safely ignore this warning.
* Initial import0.1.0Wynn Wolf Arbor2020-02-29-0/+137