diff options
author | David Vincent <freesilicon@gmail.com> | 2016-12-20 10:53:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-12-22 08:50:17 +0000 |
commit | de807c78203aa6714987261f4d18e16de926dbcb (patch) | |
tree | 14c1a355a347754e34bce9486b1f141b7098c9c7 /meta | |
parent | 01fe67b1b367bb1d2936a0810f1249a76adf305f (diff) | |
download | poky-de807c78203aa6714987261f4d18e16de926dbcb.tar.gz |
kernel: Fix symlinks
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.
(From OE-Core rev: c7bc46b9bc29dd0953ab8d63b50fa105bb66892e)
Signed-off-by: David Vincent <freesilicon@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/kernel.bbclass | 6 | ||||
-rw-r--r-- | meta/recipes-kernel/linux/linux-dtb.inc | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass index fa598cff7f..3630042dbd 100644 --- a/meta/classes/kernel.bbclass +++ b/meta/classes/kernel.bbclass | |||
@@ -45,10 +45,11 @@ python __anonymous () { | |||
45 | 45 | ||
46 | for type in types.split(): | 46 | for type in types.split(): |
47 | typelower = type.lower() | 47 | typelower = type.lower() |
48 | imagedest = d.getVar('KERNEL_IMAGEDEST') | ||
48 | 49 | ||
49 | d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower) | 50 | d.appendVar('PACKAGES', ' ' + 'kernel-image-' + typelower) |
50 | 51 | ||
51 | d.setVar('FILES_kernel-image-' + typelower, '/boot/' + type + '-${KERNEL_VERSION_NAME}') | 52 | d.setVar('FILES_kernel-image-' + typelower, '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME}') |
52 | 53 | ||
53 | d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower) | 54 | d.appendVar('RDEPENDS_kernel-image', ' ' + 'kernel-image-' + typelower) |
54 | 55 | ||
@@ -56,9 +57,8 @@ python __anonymous () { | |||
56 | 57 | ||
57 | d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') | 58 | d.setVar('ALLOW_EMPTY_kernel-image-' + typelower, '1') |
58 | 59 | ||
59 | imagedest = d.getVar('KERNEL_IMAGEDEST') | ||
60 | priority = d.getVar('KERNEL_PRIORITY') | 60 | priority = d.getVar('KERNEL_PRIORITY') |
61 | postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + '/' + imagedest + '/' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' | 61 | postinst = '#!/bin/sh\n' + 'update-alternatives --install /' + imagedest + '/' + type + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} ' + priority + ' || true' + '\n' |
62 | d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) | 62 | d.setVar('pkg_postinst_kernel-image-' + typelower, postinst) |
63 | 63 | ||
64 | postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' | 64 | postrm = '#!/bin/sh\n' + 'update-alternatives --remove' + ' ' + type + ' ' + type + '-${KERNEL_VERSION_NAME} || true' + '\n' |
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc index 8528d646dd..668f6342b5 100644 --- a/meta/recipes-kernel/linux/linux-dtb.inc +++ b/meta/recipes-kernel/linux/linux-dtb.inc | |||
@@ -70,7 +70,7 @@ pkg_postinst_kernel-devicetree () { | |||
70 | DTB_EXT=${DTB##*.} | 70 | DTB_EXT=${DTB##*.} |
71 | DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'` | 71 | DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'` |
72 | DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | 72 | DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` |
73 | 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 | 73 | update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.${DTB_EXT} ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true |
74 | done | 74 | done |
75 | done | 75 | done |
76 | } | 76 | } |
@@ -83,7 +83,7 @@ pkg_postrm_kernel-devicetree () { | |||
83 | DTB_EXT=${DTB##*.} | 83 | DTB_EXT=${DTB##*.} |
84 | DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'` | 84 | DTB_BASE_NAME=`basename ${DTB} | awk -F "." '{print $1}'` |
85 | DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` | 85 | DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` |
86 | update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} /boot/devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true | 86 | update-alternatives --remove ${DTB_BASE_NAME}.${DTB_EXT} devicetree-${DTB_SYMLINK_NAME}.${DTB_EXT} ${KERNEL_PRIORITY} || true |
87 | done | 87 | done |
88 | done | 88 | done |
89 | } | 89 | } |