diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-12-17 13:24:56 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-01-04 10:46:48 +0100 |
commit | 04085f46dea9a95dd86123ac00187a63cc4ba2c0 (patch) | |
tree | 654ce33cec489562c663ddcf77dcd8a6a2b3f428 /doc | |
parent | 290a4cf9455f45895718ed698147061fcd0a2dcb (diff) |
Determine autoremovable kernels at run-time
Our kernel autoremoval helper script protects the currently booted
kernel, but it only runs whenever we install or remove a kernel,
causing it to protect the kernel that was booted at that point in time,
which is not necessarily the same kernel as the one that is running
right now.
Reimplement the logic in C++ such that we can calculate it at run-time:
Provide a function to produce a regular expression that matches all
kernels that need protecting, and by changing the default root set
function in the DepCache to make use of that expression.
Note that the code groups the kernels by versions as before, and then
marks all kernel packages with the same version.
This optimized version inserts a virtual package $kernel into the cache
when building it to avoid having to iterate over all packages in the
cache to find the installed ones, significantly improving performance at
a minor cost when building the cache.
LP: #1615381
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/configure-index | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/examples/configure-index b/doc/examples/configure-index index b73166082..571bf2369 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -54,6 +54,9 @@ APT Build-Profiles "<STRING_OR_LIST>"; NeverAutoRemove "<LIST>"; // list of package name regexes + LastInstalledKernel "<STRING>"; // last installed kernel version + VersionedKernelPackages "<LIST>"; // regular expressions to be protected from autoremoval (kernel uname will be appended) + Protect-Kernels "<BOOL>"; // whether to protect installed kernels against autoremoval (default: true) // Options for apt-get Get |