From: Valentin Vidic Date: Wed, 17 Jun 2009 11:41:35 +0000 (+0200) Subject: Fix size detection for CN kernels. X-Git-Tag: debian/5.0.0~5 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=d19d35ee60642e56df241eb2d64c8b6e3530e620;p=carnet-upgrade.git Fix size detection for CN kernels. --- diff --git a/src/functions.sh b/src/functions.sh index beccc6d..b931651 100644 --- a/src/functions.sh +++ b/src/functions.sh @@ -1297,16 +1297,23 @@ check_archives_space() { } check_kernel_space() { - local available_disk_space kernel_size + local available_disk_space kernel_size linux_images pkg ret available_disk_space=$(free_space /) - kernel_size=$(installed_size kernel-2.6-cn) + linux_images=$(apt-cache show kernel-2.6-cn | grep ^Depends: \ + | grep -o 'linux-image[^ ]*') + for pkg in $linux_images; do + kernel_size=$(installed_size $pkg) + ret=$? + [ $ret -eq 0 ] && break + done - if [ $? -ne 0 ]; then + if [ $ret -ne 0 ]; then log "Failed to get installed size, skipping check." return 0 fi log "Free space in /: ${available_disk_space}MB" + log "Kernel package: $pkg" log "Kernel size: ${kernel_size}MB" if LC_ALL=C apt-get --yes --print-uris install kernel-2.6-cn \