Univention Bugzilla – Attachment 5789 Details for
Bug 34085
Adjust pre- and postup.sh to UCS 3.2-1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Findings from early QA: prune old kernels
34085_preup321.diff (text/plain), 2.35 KB, created by
Philipp Hahn
on 2014-02-11 13:42:06 CET
(
hide
)
Description:
Findings from early QA: prune old kernels
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2014-02-11 13:42:06 CET
Size:
2.35 KB
patch
obsolete
>diff --git a/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/preup.sh b/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/preup.sh >index 43d2446..4025872 100644 >--- a/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/preup.sh >+++ b/branches/ucs-3.2/ucs-3.2-1/base/univention-updater/script/preup.sh >@@ -167,6 +167,12 @@ fi > > #################### Bug #22093 > >+list_passive_kernels () { >+ kernel_version="$1" >+ dpkg-query -W -f '${Package}\n' "linux-image-${kernel_version}-ucs*" | >+ fgrep -v "linux-image-$(uname -r)" >+} >+ > get_latest_kernel_pkg () { > # returns latest kernel package for given kernel version > # currently running kernel is NOT included! >@@ -175,8 +181,8 @@ get_latest_kernel_pkg () { > > latest_dpkg="" > latest_kver="" >- for kver in $(COLUMNS=200 dpkg -l linux-image-${kernel_version}-ucs\* 2>/dev/null | grep linux-image- | awk '{ print $2 }' | sort -n | grep -v "linux-image-$(uname -r)") ; do >- dpkgver="$(apt-cache show $kver | sed -nre 's/Version: //p')" >+ for kver in $(list_passive_kernels "$kernel_version") ; do >+ dpkgver="$(apt-cache show "$kver" 2>/dev/null | sed -nre 's/Version: //p')" > if dpkg --compare-versions "$dpkgver" gt "$latest_dpkg" ; then > latest_dpkg="$dpkgver" > latest_kver="$kver" >@@ -191,16 +197,16 @@ pruneOldKernel () { > # ==> at least one and at most two kernel should remain for given kernel version > kernel_version="$1" > >- ignore_kver="$(get_latest_kernel_pkg "$kernel_version")" >- DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Options::=--force-confold -y --force-yes remove --purge $(COLUMNS=200 dpkg -l linux-image-${kernel_version}-ucs\* 2>/dev/null | grep linux-image- | awk '{ print $2 }' | sort -n | egrep -v "linux-image-$(uname -r)|$ignore_kver" | tr "\n" " ") >>/var/log/univention/updater.log 2>&1 >+ list_passive_kernels "$kernel_version" | >+ fgrep -v "$(get_latest_kernel_pkg "$kernel_version")" | >+ DEBIAN_FRONTEND=noninteractive xargs -r apt-get -o DPkg::Options::=--force-confold -y --force-yes purge > } > > if [ "$update32_pruneoldkernel" = "yes" ]; then > echo "Purging old kernel..." | tee -a /var/log/univention/updater.log >- pruneOldKernel "2.6.18" >- pruneOldKernel "2.6.26" >- pruneOldKernel "2.6.32" >- pruneOldKernel "3.2" >+ pruneOldKernel "3.2.0" >+ pruneOldKernel "3.10.0" >+ #pruneOldKernel "*" # only keep running and next kernel > echo "done" | tee -a /var/log/univention/updater.log > fi >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 34085
: 5789