Bug 31012 - remove old kernel images before apt-get upgrade/dist-upgrade/install (apt-get hook?)
remove old kernel images before apt-get upgrade/dist-upgrade/install (apt-get...
Status: CLOSED FIXED
Product: Univention Corporate Client (UCC)
Classification: Unclassified
Component: General
unspecified
Other Linux
: P5 normal
: UCC 1.0-errata
Assigned To: Felix Botner
Erik Damrose
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-10 11:38 CEST by Felix Botner
Modified: 2013-04-24 17:26 CEST (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
apt-get-pre-invoke-prune-kernel (5.99 KB, patch)
2013-04-11 17:45 CEST, Felix Botner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2013-04-10 11:38:46 CEST
After the update of an ucc client (to ucc-errata an with the ubuntu updates), the boot partition is pretty full.

-> df -h /boot
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
/dev/vda2        92M     71M   17M   82% /boot

The next update (with a new kernel) will definitely fail unless we somehow remove the old kernel.

possible approach:

We remove old, unused kernel packages before apt-get upgrade/dist-upgrade/install. Maybe there is a kind of apt-get hook for this.
Comment 1 Felix Botner univentionstaff 2013-04-11 12:44:04 CEST
> - Wir haben beim Kernel das Problem, dass die Bootpartition insgesamt sehr
> klein ist. Derzeit passen zwei Kernel auf die Partition, ein dritter wird
> schwierig.
>
> - Es gibt unterschiedliche Optionen, ich halte es für am sinnvollsten ein
> Skript zu erstellen, mit dem alte Kernel deinstalliert werden können.
> Zunächst einfach als Kommandozeilen Tool.
>
> - Auf einem Thin Client ist aktuell die Bootpartition zwar RO, aber wir
> müssen das Paket aus dpkg entfernen. Da sehe ich nur die Option, dass wir
> das in einem Pre-APT-Hook implementieren, gesteuert über eine UCR Variable.
> Falls die Variable gesetzt ist, werden alle Kernel Varianten deinstalliert,
> die entweder nicht laufen oder die am aktuellsten sind. Per Default sollten
> wir die Variable setzen und direkt im Handbuch dokumentieren.
Comment 2 Felix Botner univentionstaff 2013-04-11 17:45:12 CEST
Created attachment 5168 [details]
apt-get-pre-invoke-prune-kernel

Added patch for univention-corporate-client

New script in /usr/share/univention-corporate-client/apt-pre-invoke.d/univention-ucc-prune-old-kernel-packages used for deleting old kernel packages

New apt-get pre-invoke config /etc/apt/apt.conf.d/900-ucc-pre-invoke starting run-parts /usr/share/univention-corporate-client/apt-pre-invoke.d

[ucc/update/remove/old/kernel]
Description[en]=Remove old kernel packages before managing software packages with apt-get (default: true)

[ucc/update/remove/old/kernel/pkgregex]
Description[en]=Regular expression used for search for kernel packages (default: linux-image-[[:digit:]])
Comment 3 Felix Botner univentionstaff 2013-04-23 12:20:03 CEST
Added apt-get Pre-Invoke Hook "run-parts /usr/share/univention-corporate-client/apt-get-pre-invoke.d" to run /usr/share/univention-corporate-client/apt-get-pre-invoke.d/univention-ucc-prune-old-kernel-packages (removes old, unused kernel packages).

Configuration:

[ucc/update/remove/old/kernel]
Description[en]=Remove old kernel packages before managing software packages
with apt-get (default: true)

[ucc/update/remove/old/kernel/pkgregex]
Description[en]=Regular expression used for search for kernel packages
(default: linux-image-[[:digit:]])

YAML:

2013-04-23-univention-corporate-client.yaml

QA:

Has to be tested very carefully, because an error in univention-ucc-prune-old-kernel-packages stops the entire apt-get process.
Comment 4 Erik Damrose univentionstaff 2013-04-24 11:26:00 CEST
Removal of unused kernel packages works: OK
YAML: OK

I could not produce a state in which the apt hook caused problems while installing/upgrading/removing packages.

verified
Comment 5 Janek Walkenhorst univentionstaff 2013-04-24 17:26:27 CEST
http://errata.univention.de/ucc/1.0/12.html