From d19d35ee60642e56df241eb2d64c8b6e3530e620 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Wed, 17 Jun 2009 13:41:35 +0200 Subject: [PATCH] Fix size detection for CN kernels. --- src/functions.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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 \ -- 1.7.10.4