Skip to content
Snippets Groups Projects
Forked from APT Developers / apt
Source project has a limited visibility.
  • Julian Andres Klode's avatar
    04085f46
    Determine autoremovable kernels at run-time · 04085f46
    Julian Andres Klode authored
    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
    04085f46
    History
    Determine autoremovable kernels at run-time
    Julian Andres Klode authored
    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