summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@microsoft.com>2021-12-20 13:58:22 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-22 23:11:45 +0000
commita2eb528b63b0c53daab31308a6afdcb605ac5f40 (patch)
tree24196b0b8d4e4894b06ba25449aa95d7ece8983c /meta/classes
parent3cb504cebafcbf6490c049efb5acd8e2fa4e95ec (diff)
downloadpoky-a2eb528b63b0c53daab31308a6afdcb605ac5f40.tar.gz
classes/kernel*: allow disabling symlink creation
Allow setting any of the *_LINK_NAME variables to empty string in order to disable creating symlinks for kernel artifacts, as you can already for filesystem images with IMAGE_LINK_NAME. Additionally, for the image type named symlinks, add a KERNEL_IMAGETYPE_SYMLINK boolean variable which you can set to 0 to disable those symlinks as well. (From OE-Core rev: d7341f1f22c32ff6cc95d7127f26f87d7fc9c6bd) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/kernel-artifact-names.bbclass1
-rw-r--r--meta/classes/kernel-devicetree.bbclass20
-rw-r--r--meta/classes/kernel-fitimage.bbclass16
-rw-r--r--meta/classes/kernel.bbclass16
4 files changed, 39 insertions, 14 deletions
diff --git a/meta/classes/kernel-artifact-names.bbclass b/meta/classes/kernel-artifact-names.bbclass
index a65cdddb3e..e1d943b2d5 100644
--- a/meta/classes/kernel-artifact-names.bbclass
+++ b/meta/classes/kernel-artifact-names.bbclass
@@ -11,6 +11,7 @@ KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}"
11 11
12KERNEL_IMAGE_NAME ?= "${KERNEL_ARTIFACT_NAME}" 12KERNEL_IMAGE_NAME ?= "${KERNEL_ARTIFACT_NAME}"
13KERNEL_IMAGE_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}" 13KERNEL_IMAGE_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}"
14KERNEL_IMAGETYPE_SYMLINK ?= "1"
14 15
15KERNEL_DTB_NAME ?= "${KERNEL_ARTIFACT_NAME}" 16KERNEL_DTB_NAME ?= "${KERNEL_ARTIFACT_NAME}"
16KERNEL_DTB_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}" 17KERNEL_DTB_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}"
diff --git a/meta/classes/kernel-devicetree.bbclass b/meta/classes/kernel-devicetree.bbclass
index a50ea4fb67..c8aaf7458f 100644
--- a/meta/classes/kernel-devicetree.bbclass
+++ b/meta/classes/kernel-devicetree.bbclass
@@ -83,21 +83,29 @@ do_deploy:append() {
83 dtb_base_name=`basename $dtb .$dtb_ext` 83 dtb_base_name=`basename $dtb .$dtb_ext`
84 install -d $deployDir 84 install -d $deployDir
85 install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext 85 install -m 0644 ${D}/${KERNEL_IMAGEDEST}/$dtb_base_name.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext
86 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext 86 if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then
87 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext 87 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name.$dtb_ext
88 fi
89 if [ -n "${KERNEL_DTB_LINK_NAME}" ] ; then
90 ln -sf $dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext $deployDir/$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext
91 fi
88 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do 92 for type in ${KERNEL_IMAGETYPE_FOR_MAKE}; do
89 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then 93 if [ "$type" = "zImage" ] && [ "${KERNEL_DEVICETREE_BUNDLE}" = "1" ]; then
90 cat ${D}/${KERNEL_IMAGEDEST}/$type \ 94 cat ${D}/${KERNEL_IMAGEDEST}/$type \
91 $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \ 95 $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
92 > $deployDir/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin 96 > $deployDir/$type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
93 ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \ 97 if [ -n "${KERNEL_DTB_LINK_NAME}" ]; then
94 $deployDir/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin 98 ln -sf $type-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \
99 $deployDir/$type-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin
100 fi
95 if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then 101 if [ -e "${KERNEL_OUTPUT_DIR}/${type}.initramfs" ]; then
96 cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \ 102 cat ${KERNEL_OUTPUT_DIR}/${type}.initramfs \
97 $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \ 103 $deployDir/$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext \
98 > $deployDir/${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin 104 > $deployDir/${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin
99 ln -sf ${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \ 105 if [ -n "${KERNEL_DTB_LINK_NAME}" ]; then
100 $deployDir/${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin 106 ln -sf ${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_NAME}.$dtb_ext.bin \
107 $deployDir/${type}-${INITRAMFS_NAME}-$dtb_base_name-${KERNEL_DTB_LINK_NAME}.$dtb_ext.bin
108 fi
101 fi 109 fi
102 fi 110 fi
103 done 111 done
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
index 8718ce7e16..11dce67400 100644
--- a/meta/classes/kernel-fitimage.bbclass
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -722,22 +722,30 @@ kernel_do_deploy:append() {
722 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then 722 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
723 echo "Copying fit-image.its source file..." 723 echo "Copying fit-image.its source file..."
724 install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its" 724 install -m 0644 ${B}/fit-image.its "$deployDir/fitImage-its-${KERNEL_FIT_NAME}.its"
725 ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}" 725 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
726 ln -snf fitImage-its-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${KERNEL_FIT_LINK_NAME}"
727 fi
726 728
727 echo "Copying linux.bin file..." 729 echo "Copying linux.bin file..."
728 install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin 730 install -m 0644 ${B}/linux.bin $deployDir/fitImage-linux.bin-${KERNEL_FIT_NAME}.bin
729 ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}" 731 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
732 ln -snf fitImage-linux.bin-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-linux.bin-${KERNEL_FIT_LINK_NAME}"
733 fi
730 fi 734 fi
731 735
732 if [ -n "${INITRAMFS_IMAGE}" ]; then 736 if [ -n "${INITRAMFS_IMAGE}" ]; then
733 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..." 737 echo "Copying fit-image-${INITRAMFS_IMAGE}.its source file..."
734 install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its" 738 install -m 0644 ${B}/fit-image-${INITRAMFS_IMAGE}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its"
735 ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" 739 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
740 ln -snf fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.its "$deployDir/fitImage-its-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
741 fi
736 742
737 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then 743 if [ "${INITRAMFS_IMAGE_BUNDLE}" != "1" ]; then
738 echo "Copying fitImage-${INITRAMFS_IMAGE} file..." 744 echo "Copying fitImage-${INITRAMFS_IMAGE} file..."
739 install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin" 745 install -m 0644 ${B}/arch/${ARCH}/boot/fitImage-${INITRAMFS_IMAGE} "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin"
740 ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}" 746 if [ -n "${KERNEL_FIT_LINK_NAME}" ] ; then
747 ln -snf fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_NAME}.bin "$deployDir/fitImage-${INITRAMFS_IMAGE_NAME}-${KERNEL_FIT_LINK_NAME}"
748 fi
741 fi 749 fi
742 fi 750 fi
743 fi 751 fi
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 0df24ac910..57990bd3b9 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -769,8 +769,12 @@ kernel_do_deploy() {
769 for imageType in ${KERNEL_IMAGETYPES} ; do 769 for imageType in ${KERNEL_IMAGETYPES} ; do
770 baseName=$imageType-${KERNEL_IMAGE_NAME} 770 baseName=$imageType-${KERNEL_IMAGE_NAME}
771 install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType $deployDir/$baseName.bin 771 install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType $deployDir/$baseName.bin
772 ln -sf $baseName.bin $deployDir/$imageType-${KERNEL_IMAGE_LINK_NAME}.bin 772 if [ -n "${KERNEL_IMAGE_LINK_NAME}" ] ; then
773 ln -sf $baseName.bin $deployDir/$imageType 773 ln -sf $baseName.bin $deployDir/$imageType-${KERNEL_IMAGE_LINK_NAME}.bin
774 fi
775 if [ "${KERNEL_IMAGETYPE_SYMLINK}" = "1" ] ; then
776 ln -sf $baseName.bin $deployDir/$imageType
777 fi
774 done 778 done
775 779
776 if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then 780 if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
@@ -783,7 +787,9 @@ kernel_do_deploy() {
783 TAR_ARGS="$TAR_ARGS --owner=0 --group=0" 787 TAR_ARGS="$TAR_ARGS --owner=0 --group=0"
784 tar $TAR_ARGS -cv -C ${D}${root_prefix} lib | gzip -9n > $deployDir/modules-${MODULE_TARBALL_NAME}.tgz 788 tar $TAR_ARGS -cv -C ${D}${root_prefix} lib | gzip -9n > $deployDir/modules-${MODULE_TARBALL_NAME}.tgz
785 789
786 ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz 790 if [ -n "${MODULE_TARBALL_LINK_NAME}" ] ; then
791 ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz
792 fi
787 fi 793 fi
788 794
789 if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then 795 if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
@@ -793,7 +799,9 @@ kernel_do_deploy() {
793 fi 799 fi
794 initramfsBaseName=$imageType-${INITRAMFS_NAME} 800 initramfsBaseName=$imageType-${INITRAMFS_NAME}
795 install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType.initramfs $deployDir/$initramfsBaseName.bin 801 install -m 0644 ${KERNEL_OUTPUT_DIR}/$imageType.initramfs $deployDir/$initramfsBaseName.bin
796 ln -sf $initramfsBaseName.bin $deployDir/$imageType-${INITRAMFS_LINK_NAME}.bin 802 if [ -n "${INITRAMFS_LINK_NAME}" ] ; then
803 ln -sf $initramfsBaseName.bin $deployDir/$imageType-${INITRAMFS_LINK_NAME}.bin
804 fi
797 done 805 done
798 fi 806 fi
799} 807}