Merge "Handle non-existing *generic kernel and initrd"

This commit is contained in:
Jenkins 2014-10-09 16:44:52 +00:00 committed by Gerrit Code Review
commit 8a8bbb5673

View File

@ -158,11 +158,8 @@ function select_boot_kernel_initrd () {
exit 1 exit 1
fi fi
elif [ -f $TARGET_ROOT/etc/debian_version ]; then elif [ -f $TARGET_ROOT/etc/debian_version ]; then
KERNEL=$(basename $(ls -1rv $BOOTDIR/vmlinuz*generic | head -1)) KERNEL=$(basename $(ls -1rv $BOOTDIR/vmlinuz*generic 2>/dev/null || ls -1rv $BOOTDIR/vmlinuz* | head -1))
RAMDISK=$(basename $(ls -1rv $BOOTDIR/initrd*generic | head -1)) RAMDISK=$(basename $(ls -1rv $BOOTDIR/initrd*generic 2>/dev/null || ls -1rv $BOOTDIR/initrd* | head -1))
# in case files with "generic" suffix were not found, fall back to default
KERNEL=${KERNEL:-$(basename $(ls -1rv $BOOTDIR/vmlinuz* | head -1))}
RAMDISK=${RAMDISK:-$(basename $(ls -1rv $BOOTDIR/initrd* | head -1))}
elif [ -f $TARGET_ROOT/etc/SuSE-release ]; then elif [ -f $TARGET_ROOT/etc/SuSE-release ]; then
KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz)) KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz))
RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd)) RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd))