From 58f5a543d47eb0f1c3f01817a5dcc02c75a7a81e Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Sun, 31 Aug 2014 17:25:04 +0200
Subject: [PATCH] Fix openSUSE kernel/initrd detection

For some of the scripts, the unversioned name is not
good enough. so determine the link target of "vmlinuz" and
"initrd" to get the full versioned path.

Change-Id: I52f9b5435fafaf7925e2332058a9e41b26478f1c
---
 lib/img-functions | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/img-functions b/lib/img-functions
index 08a8ef426..3a89ddbcc 100644
--- a/lib/img-functions
+++ b/lib/img-functions
@@ -164,8 +164,8 @@ function select_boot_kernel_initrd () {
         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
-        KERNEL=vmlinuz
-        RAMDISK=initrd
+        KERNEL=$(basename $(readlink -e $BOOTDIR/vmlinuz))
+        RAMDISK=$(basename $(readlink -e $BOOTDIR/initrd))
     else
         echo "ERROR: Unable to detect operating system"
         exit 1