}
check_kernel_space() {
- local available_disk_space kernel_size linux_images pkg ret
+ local available_disk_space kernel_size linux_images metapkg pkg ret
available_disk_space=$(free_space /)
linux_images=$(apt-cache show kernel-2.6-cn | grep ^Depends: \
- | grep -o 'linux-image[^ ]*')
- for pkg in $linux_images; do
+ | grep -o 'linux-image[^, ]*')
+ for metapkg in $linux_images; do
+ pkg=$(apt-cache show $metapkg | grep ^Depends: \
+ | grep -o 'linux-image[^, ]*' | head -1)
+ [ "$pkg" ] || continue
+
kernel_size=$(installed_size $pkg)
ret=$?
[ $ret -eq 0 ] && break