}
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 \