]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/kernel: fix symlink logic when bundling initramfs images
authorAndré Draszik <adraszik@tycoint.com>
Fri, 24 Jun 2016 13:40:08 +0000 (14:40 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Jul 2016 15:08:46 +0000 (16:08 +0100)
If linkpath points to the a file in KERNEL_OUTPUT_DIR, rather than
outside, then symlink creation for the bundled initramfs image files
fails.

This is because in that case $linkpath.initramfs and $realpath.initramfs
are in the same directory, KERNEL_OUTPUT_DIR, and hence are the same.
Since we just created $realpath.initramfs, creating a symlink with the
same name will fail.

Given that $linkpath is not necessarily the same as the kernel image type,
just removing this symlink creation is not the right thing to do, as
in that case kernel_do_deploy() wouldn't find the bundled file.

What we really want is a symlink from the name of the initramfs-bundled
kernel image type to the real initramfs-bundled kernel image, as that is
what is actually used later in do_deploy().

This brings the code path for when $KERNEL_OUTPUT_DIR/$type is a symlink
in line with when it is not.

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/kernel.bbclass

index 3127590480af115e5ba3bfd8261fdae0b5de1c3e..a56b66b291a8aeb1740a959613f91a52af61a97c 100644 (file)
@@ -232,8 +232,7 @@ do_bundle_initramfs () {
                        if [ -n "$realpath" ]; then
                                mv -f $realpath $realpath.initramfs
                                mv -f $realpath.bak $realpath
-                               cd ${B}/${KERNEL_OUTPUT_DIR}
-                               ln -sf $linkpath.initramfs
+                               ln -sf $linkpath.initramfs ${B}/${KERNEL_OUTPUT_DIR}/$type.initramfs
                        else
                                mv -f ${KERNEL_OUTPUT_DIR}/$type ${KERNEL_OUTPUT_DIR}/$type.initramfs
                                mv -f ${KERNEL_OUTPUT_DIR}/$type.bak ${KERNEL_OUTPUT_DIR}/$type