]> code.ossystems Code Review - openembedded-core.git/commitdiff
mkefidisk: fix installation of kernel image
authorChong Yi Chai <chong.yi.chai@intel.com>
Thu, 6 Sep 2018 03:29:08 +0000 (11:29 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 10 Oct 2018 12:23:45 +0000 (13:23 +0100)
Kernel image can be 'vmlinuz' for 'bzImage' but the script is written to
support 'vmlinuz' only. When building with meta-intel on sumo branch, the
kernel image is now bzImage and the installation will fail. Add option to
install bzImage as well.

Signed-off-by: Chong Yi Chai <chong.yi.chai@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
scripts/contrib/mkefidisk.sh

index ac4ec9c7fba949abc0809d959f629f7de243844b..39e4bcf08a1e8ebd587d155d242fd8de19c165b2 100755 (executable)
@@ -381,7 +381,15 @@ mount $BOOTFS $BOOTFS_MNT >$OUT 2>&1 || error "Failed to mount $BOOTFS on $BOOTF
 
 info "Preparing boot partition"
 EFIDIR="$BOOTFS_MNT/EFI/BOOT"
-cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy vmlinuz"
+# Get kernel image name
+if [ -e "$HDDIMG_MNT/vmlinuz" ]; then
+       kernel_image="vmlinuz"
+elif [ "$HDDIMG_MNT/bzImage" ]; then
+       kernel_image="bzImage"
+else
+       die "No kernel image found"
+fi
+cp $HDDIMG_MNT/${kernel_image} $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy ${kernel_image}"
 # Copy the efi loader and configs (booti*.efi and grub.cfg if it exists)
 cp -r $HDDIMG_MNT/EFI $BOOTFS_MNT >$OUT 2>&1 || error "Failed to copy EFI dir"
 # Silently ignore a missing systemd-boot loader dir (we might just be a GRUB image)
@@ -407,7 +415,7 @@ if [ -e "$GRUB_CFG" ]; then
        sed -i "s/ LABEL=[^ ]*/ /" $GRUB_CFG
 
        sed -i "s@ root=[^ ]*@ @" $GRUB_CFG
-       sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG
+       sed -i "s@${kernel_image} @${kernel_image} root=$TARGET_ROOTFS ro rootwait console=ttyS0 console=tty0 @" $GRUB_CFG
 fi
 
 # Look for a systemd-boot installation