]> code.ossystems Code Review - openembedded-core.git/commitdiff
kernel: Fix symlinks
authorDavid Vincent <freesilicon@gmail.com>
Tue, 20 Dec 2016 09:53:29 +0000 (10:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 22 Dec 2016 08:46:36 +0000 (08:46 +0000)
When installing a kernel package, the symlinks created by
update-alternatives should point to a path relative to KERNEL_IMAGEDEST
and not an absolute path to '/boot'.

Failing to do so causes problems when resolving the symlink inside some
bootloaders which mount the boot partition elsewhere.

Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/kernel.bbclass
meta/recipes-kernel/linux/linux-dtb.inc

index fa598cff7f7b7e4b7b6c4a0bf1e5ad9344dda9e2..3630042dbd269bcebabe2540f64ab033115380ae 100644 (file)
@@ -45,10 +45,11 @@ python __anonymous () {
 
     for type in types.split():
         typelower = type.lower()
+        imagedest = d.getVar('KERNEL_IMAGEDEST')
 
         d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower)
 
-        d.setVar('FILES_kernel-image-' + typelower, '/boot/' + type + '-${KERNEL_VERSION_NAME}')
+        d.setVar('FILES_kernel-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}')
 
         d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower)
 
@@ -56,9 +57,8 @@ python __anonymous () {
 
         d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1')
 
-        imagedest = d.getVar('KERNEL_IMAGEDEST')
         priority = d.getVar('KERNEL_PRIORITY')
-        postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n'
+        postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n'
         d.setVar('pkg_postinst_kernel-image-' + typelower, postinst)
 
         postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n'
index 8528d646dd332ec7fd38dce1f350a2fbeb81d25a..668f6342b5bf0e65dab24f562491c53edd9f467b 100644 (file)
@@ -70,7 +70,7 @@ pkg_postinst_kernel-devicetree () {
                        DTB_EXT=${DTB##*.}
                        DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
                        DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-                       update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
+                       update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
                done
        done
 }
@@ -83,7 +83,7 @@ pkg_postrm_kernel-devicetree () {
                        DTB_EXT=${DTB##*.}
                        DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'`
                        DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
-                       update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
+                       update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true
                done
        done
 }