bitbake.conf, kernel*.bbclass: include IMAGE_VERSION_SUFFIX only in the _LINK_NAME variables and change it to hard link
RFC PATCH 1/1 bitbake.conf, kernel*.bbclass: include IMAGE_VERSION_SUFFIX only in the _LINK_NAME variables and change it to hard link
* just RFC, the part for images isn't finished yet and there is still some issue with DATETIME when kernel artifacts are used from sstate, this is just to validate the idea behind [YOCTO #12937] before finishing the implementation (it's already finished and used by various LGE builds, but having simpler way of doing it directly in oe-core mighe be useful for others).
* move IMAGE_VERSION_SUFFIX from _NAME variables to _LINK_NAME that way e.g. kernel.do_deploy can be reused from sstate to provide "version-less" artifacts and then very fast do_deploy_links task just adds links with consistent suffixes
* create hard links instead of symlinks, so that whatever version the filename says is really there
* some IMAGE_FSTYPES might need the "version-less" IMAGE_NAME file to be removed first or they might either append or update the content of the image instead of creating new image file from scratch - I have seen this only with one proprietary format we generate with our own tool, so hopefully this isn't very common
* this is basically the mechanism are using in webOS with WEBOS_IMAGE_NAME_SUFFIX which is for official builds set from jenkins job and then all artifacts (images as well as corresponding kernel files) have the same version string, the implementation "from outside" is a bit tricky as shown in webOS OSE, the variable modifications:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/conf/distro/include/webos.inc#L65
and then various bbclasses to hook do_webos_deploy_fixup task creating the hardlinks for possible artifacts:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/webos_deploy.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/kernel.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e44a132d01297ff478248/meta-webos/classes/image.bbclass
so hopefully with all these changes in oe-core other project can achieve the same just by setting one variable IMAGE_VERSION_SUFFIX
[YOCTO #12937]
--- meta/classes/kernel-artifact-names.bbclass | 4 +-- meta/classes/kernel.bbclass | 40 ++++++++++++++++------ meta/conf/bitbake.conf | 4 +-- 3 files changed, 33 insertions(+), 15 deletions(-)
meta/classes/kernel-artifact-names.bbclass +2 -2
@@ -1,5 +1,5 @@ -KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}" -KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}" +KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}" +KERNEL_ARTIFACT_LINK_NAME ?= "${KERNEL_ARTIFACT_NAME}${IMAGE_VERSION_SUFFIX}" KERNEL_IMAGE_NAME ?= "${KERNEL_ARTIFACT_NAME}" KERNEL_IMAGE_LINK_NAME ?= "${KERNEL_ARTIFACT_LINK_NAME}"
meta/classes/kernel.bbclass +29 -11
@@ -667,25 +667,18 @@ kernel_do_deploy() { fi for imageType in ${KERNEL_IMAGETYPES} ; do - base_name=${imageType}-${KERNEL_IMAGE_NAME} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} $deployDir/${base_name}.bin - symlink_name=${imageType}-${KERNEL_IMAGE_LINK_NAME} - ln -sf ${base_name}.bin $deployDir/${symlink_name}.bin - ln -sf ${base_name}.bin $deployDir/${imageType} + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType} $deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin + ln -sf ${imageType}-${KERNEL_IMAGE_NAME}.bin $deployDir/${imageType} done if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then mkdir -p ${D}${root_prefix}/lib tar -cvzf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz -C ${D}${root_prefix} lib - ln -sf modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz fi if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then for imageType in ${KERNEL_IMAGETYPES} ; do - initramfs_base_name=${imageType}-${INITRAMFS_NAME} - initramfs_symlink_name=${imageType}-${INITRAMFS_LINK_NAME} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${initramfs_base_name}.bin - ln -sf ${initramfs_base_name}.bin $deployDir/${initramfs_symlink_name}.bin + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${imageType}-${INITRAMFS_NAME}.bin done fi }
@@ -695,7 +688,32 @@ do_deploy[prefuncs] += "package_get_auto_pr" addtask deploy after do_populate_sysroot do_packagedata -EXPORT_FUNCTIONS do_deploy +kernel_do_deploy_links() { + deployDir="${DEPLOY_DIR_IMAGE}" + if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then + deployDir="${DEPLOY_DIR_IMAGE}/${KERNEL_DEPLOYSUBDIR}" + mkdir "$deployDir" + fi + + for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf $deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin $deployDir/${imageType}-${KERNEL_IMAGE_LINK_NAME}.bin + done + + if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then + ln -vf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz $deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz + fi + + if [ ! -z "${INITRAMFS_IMAGE}" -a "${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then + for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf ${imageType}-${INITRAMFS_NAME}.bin ${imageType}-${INITRAMFS_LINK_NAME}.bin + done + fi +} +do_deploy_links[prefuncs] += "package_get_auto_pr" + +addtask deploy_links after do_deploy before do_build + +EXPORT_FUNCTIONS do_deploy do_deploy_links # Add using Device Tree support inherit kernel-devicetree
meta/conf/bitbake.conf +2 -2
@@ -447,8 +447,8 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" IMAGE_BASENAME = "${PN}" IMAGE_VERSION_SUFFIX = "-${DATETIME}" IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME" -IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" -IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_LINK_NAME = "${IMAGE_NAME}${IMAGE_VERSION_SUFFIX}" # This option allows for a percentage overage of the actual image size rather than a # fixed extra space, this is space needed for initial startup and basic operations.
Signature · 1 line
2.17.1
✗ patchtest: failure for bitbake.conf, kernel*.bbclass: include IMAGE_VERSION_SUFFIX only in the _LINK_NAME variables and change it to hard link
== Series Details ==
Series: bitbake.conf, kernel*.bbclass: include IMAGE_VERSION_SUFFIX only in the _LINK_NAME variables and change it to hard link
Revision: 1
URL : https://patchwork.openembedded.org/series/14258/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:
* Patch [RFC] bitbake.conf, kernel*.bbclass: include IMAGE_VERSION_SUFFIX only in the _LINK_NAME variables and change it to hard link Issue Commit shortlog is too long [test_shortlog_length] Suggested fix Edit shortlog so that it is 90 characters or less (currently 119 characters)
If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
Hi Martin,
In the commit message you say a lot about what you've changed but not so much about why the changes are important and the advantages they bring.
There are tradeoffs, for example symlinks make it clear which artefact they're really pointing at, hardlinks hide that fact, you need to go and look at inode numbers to figure out which of several artefacts one might be pointing at. I'm not sure that is an improvement.
I'm also slightly concerned that we need to bypass sstate control, the whole intent there was to ensure that output is reproducible and consistently restored. Adding in a new task means do_build target usage will work but any of the code that has do_deploy as a dependency (e.g. an recrdep) will now also need to consider do_deploy_links. For that reason alone, I'm not sure we can do this.
Cheers,
Richard
Quoted 173 lines · Martin Jansa
* just RFC, the part for images isn't finished yet and there is still some issue with DATETIME when kernel artifacts are used from sstate, this is just to validate the idea behind [YOCTO #12937] before finishing the implementation (it's already finished and used by various LGE builds, but having simpler way of doing it directly in oe-core mighe be useful for others).
* move
IMAGE_VERSION_SUFFIXfrom_NAMEvariables to_LINK_NAMEthat way e.g. kernel.do_deploy can be reused from sstate to provide "version-less" artifacts and then very fastdo_deploy_linkstask just adds links with consistent suffixes
* create hard links instead of symlinks, so that whatever version the filename says is really there
* someIMAGE_FSTYPESmight need the "version-less"IMAGE_NAMEfile to be removed first or they might either append or update the content of the image instead of creating new image file from scratch - I have seen this only with one proprietary format we generate with our own tool, so hopefully this isn't very common
* this is basically the mechanism are using in webOS withWEBOS_IMAGE_NAME_SUFFIXwhich is for official builds set from jenkins job and then all artifacts (images as well as corresponding kernel files) have the same version string, the implementation "from outside" is a bit tricky as shown in webOS OSE, the variable modifications:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/conf/distro/include/webos.inc#L65
and then various bbclasses to hookdo_webos_deploy_fixuptask
creating
the hardlinks for possible artifacts:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/webos_deploy.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/kernel.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/image.bbclass
so hopefully with all these changes in oe-core other project can achieve the same just by setting one variableIMAGE_VERSION_SUFFIX[YOCTO #12937]
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel-artifact-names.bbclass | 4 +-- meta/classes/kernel.bbclass | 40 ++++++++++++++++-- ---- meta/conf/bitbake.conf | 4 +-- 3 files changed, 33 insertions(+), 15 deletions(-)meta/classes/kernel-artifact-names.bbclass +0
-1@@ -1,5 +1,5 @@ -KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
meta/classes/kernel-artifact-names.bbclass +2
-1-KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}" +KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}" +KERNEL_ARTIFACT_LINK_NAME ?="${KERNEL_ARTIFACT_NAME}${IMAGE_VERSION_SUFFIX}"
KERNEL_IMAGE_NAME?= "${KERNEL_ARTIFACT_NAME}"KERNEL_IMAGE_LINK_NAME?= "${KERNEL_ARTIFACT_LINK_NAME}"meta/classes/kernel.bbclass +0
-2@@ -667,25 +667,18 @@ kernel_do_deploy() { fi for imageType in ${KERNEL_IMAGETYPES} ; do - base_name=${imageType}-${KERNEL_IMAGE_NAME} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}$deployDir/${base_name}.bin
meta/classes/kernel.bbclass +0
-2- symlink_name=${imageType}-${KERNEL_IMAGE_LINK_NAME} - ln -sf ${base_name}.bin$deployDir/${symlink_name}.bin
meta/classes/kernel.bbclass +1
-1- ln -sf ${base_name}.bin $deployDir/${imageType} + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}$deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin
meta/classes/kernel.bbclass +1
-0+ ln -sf ${imageType}-${KERNEL_IMAGE_NAME}.bin$deployDir/${imageType}
meta/classes/kernel.bbclass +0
-0done if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e'^CONFIG_MODULES=y$' .config); then
meta/classes/kernel.bbclass +0
-0mkdir -p ${D}${root_prefix}/lib tar -cvzf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz -C ${D}${root_prefix} lib
meta/classes/kernel.bbclass +0
-1- ln -sf modules-${MODULE_TARBALL_NAME}.tgz$deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz
meta/classes/kernel.bbclass +0
-0fi if [ ! -z "${INITRAMFS_IMAGE}" -ax"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
meta/classes/kernel.bbclass +0
-1for imageType in ${KERNEL_IMAGETYPES} ; do - initramfs_base_name=${imageType}-${INITRAMFS_NAME}
meta/classes/kernel.bbclass +0
-1- initramfs_symlink_name=${imageType}-${INITRAMFS_LINK_NAME}
meta/classes/kernel.bbclass +0
-1- install -m 0644${KERNEL_OUTPUT_DIR}/${imageType}.initramfs
$deployDir/${initramfs_base_name}.binmeta/classes/kernel.bbclass +0
-1- ln -sf ${initramfs_base_name}.bin$deployDir/${initramfs_symlink_name}.bin
meta/classes/kernel.bbclass +1
-0+ install -m 0644${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${imageType}- ${INITRAMFS_NAME}.bin
meta/classes/kernel.bbclass +9
-1done fi }@@ -695,7 +688,32 @@ do_deploy[prefuncs] += "package_get_auto_pr" addtask deploy after do_populate_sysroot do_packagedata -EXPORT_FUNCTIONS do_deploy +kernel_do_deploy_links() { + deployDir="${DEPLOY_DIR_IMAGE}" + if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then + deployDir="${DEPLOY_DIR_IMAGE}/${KERNEL_DEPLOYSUBDIR }" + mkdir "$deployDir" + fi + + for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf $deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin $deployDir/${imageType}-
${KERNEL_IMAGE_LINK_NAME}.binmeta/classes/kernel.bbclass +3
-0+ done + + if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e'^CONFIG_MODULES=y$' .config); then
meta/classes/kernel.bbclass +1
-0+ ln -vf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz$deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgz
meta/classes/kernel.bbclass +3
-0+ fi + + if [ ! -z "${INITRAMFS_IMAGE}" -a"${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
meta/classes/kernel.bbclass +2
-0+ for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf ${imageType}-${INITRAMFS_NAME}.bin${imageType}-${INITRAMFS_LINK_NAME}.bin
meta/classes/kernel.bbclass +8
-0+ done + fi +} +do_deploy_links[prefuncs] += "package_get_auto_pr" + +addtask deploy_links after do_deploy before do_build + +EXPORT_FUNCTIONS do_deploy do_deploy_links # Add using Device Tree support inherit kernel-devicetreemeta/conf/bitbake.conf +2
-2@@ -447,8 +447,8 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" IMAGE_BASENAME = "${PN}" IMAGE_VERSION_SUFFIX = "-${DATETIME}" IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME" -IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" -IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_LINK_NAME = "${IMAGE_NAME}${IMAGE_VERSION_SUFFIX}" # This option allows for a percentage overage of the actual imagesize rather than a
# fixed extra space, this is space needed for initial startup and basic operations.Signature · 1 line
2.17.1
The reason is that for our builds we set the IMAGE_VERSION_SUFFIX based on jenkins job number which creates them (or you can
imagine IMAGE_VERSION_SUFFIX being set to something like "release-2.6").
With current metadata we have 2 options:
1) keep IMAGE_VERSION_SUFFIX as is, but don't vardepexclude the build number (DATETIME in the default value)
But this causes e.g. kernel.do_deploy signature to be changed and whole do_deploy task re-executed (instead of reused from sstate if it's the same except the output files names), which in turn causes whole kernel to be rebuilt in every build, because to run do_deploy we need do_install etc (and these builds are usually using rm_work and TMPDIR is empty before each job).
2) leave IMAGE_VERSION_SUFFIX as is, but rename the artifacts after the build
When the image artifact says "image-release-2.6.img" and kernel image from the same build says "uImage-release-2.5.bin" (because kernel wasn't modified at all since previous release), people will be confused. This is what we were seeing in CI which was usually sending just the image, but then for some new MACHINEs we needed to send kernel artifact separately and sometimes the artifact wasn't found with expected name. Then we changed the build number (aka IMAGE_VERSION_SUFFIX) to be included in do_deploy signatures which lead to 1) and kernel rebuilds every time
To solve both, we've added webos_deploy_fixup tasks (in many places) which just adds the hardlinks with expected filenames (so that other systems just using the artifacts doesn't need to know anything about internal issues with sstate reuse, nor needing external script to rename things after the build).
Hardlinks are better than symlinks in this case, because you don't want to have symlink
image-release-2.5.img -> image.img
still in the deploy directory after you do another build which creates new image.img and new symlink
image-release-2.6.img -> image.img
If someone downloads image-release-2.5.img "too late" he will get 2.6 version instead.
Hardlinks don't have this issue and yes the need to check the inode numbers might be confusing to some, but when do you really care where does it point? In our use-case we always care only about the *"release-2.5"* and the artifacts without the version string are considered as intermediate files created by the build or "whatever version was built last in this build directory", pretty much the same as version-less symlinks in current build (which are easy to resolve when looking at the filesystem, but exposing those symlinks for download e.g. over HTTP hides where it points completely.
I'm not sure I understand your concern about bypassing sstate control, we still want to reuse kernel.do_deploy and image.do_image_complete. Just with additional very fast intentionally not-covered-by-sstate task before do_build to create consistent names.
Quoted 197 lines · Richard Purdie
Hi Martin,
In the commit message you say a lot about what you've changed but not so much about why the changes are important and the advantages they bring.
There are tradeoffs, for example symlinks make it clear which artefact they're really pointing at, hardlinks hide that fact, you need to go and look at inode numbers to figure out which of several artefacts one might be pointing at. I'm not sure that is an improvement.
I'm also slightly concerned that we need to bypass sstate control, the whole intent there was to ensure that output is reproducible and consistently restored. Adding in a new task means
do_buildtarget usage will work but any of the code that hasdo_deployas a dependency (e.g. an recrdep) will now also need to considerdo_deploy_links. For that reason alone, I'm not sure we can do this.Cheers,
Richard
Quoted 173 lines · Martin Jansa
* just RFC, the part for images isn't finished yet and there is still some issue with DATETIME when kernel artifacts are used from sstate, this is just to validate the idea behind [YOCTO #12937] before finishing the implementation (it's already finished and used by various LGE builds, but having simpler way of doing it directly in oe-core mighe be useful for others).
* move
IMAGE_VERSION_SUFFIXfrom_NAMEvariables to_LINK_NAMEthat way e.g. kernel.do_deploy can be reused from sstate to provide "version-less" artifacts and then very fastdo_deploy_linkstask just adds links with consistent suffixes
* create hard links instead of symlinks, so that whatever version the filename says is really there
* someIMAGE_FSTYPESmight need the "version-less"IMAGE_NAMEfile to be removed first or they might either append or update the content of the image instead of creating new image file from scratch - I have seen this only with one proprietary format we generate with our own tool, so hopefully this isn't very common
* this is basically the mechanism are using in webOS withWEBOS_IMAGE_NAME_SUFFIXwhich is for official builds set from jenkins job and then all artifacts (images as well as corresponding kernel files) have the same version string, the implementation "from outside" is a bit tricky as shown in webOS OSE, the variable modifications:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/conf/distro/include/webos.inc#L65
and then various bbclasses to hookdo_webos_deploy_fixuptask
creating
the hardlinks for possible artifacts:
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/webos_deploy.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/kernel.bbclass
https://github.com/webosose/meta-webosose/blob/a35e81622aae1066591e
44a132d01297ff478248/meta-webos/classes/image.bbclass
so hopefully with all these changes in oe-core other project can achieve the same just by setting one variableIMAGE_VERSION_SUFFIX[YOCTO #12937]
Signed-off-by Martin Jansa <[email protected]>--- meta/classes/kernel-artifact-names.bbclass | 4 +-- meta/classes/kernel.bbclass | 40 ++++++++++++++++-- ---- meta/conf/bitbake.conf | 4 +-- 3 files changed, 33 insertions(+), 15 deletions(-)meta/classes/kernel-artifact-names.bbclass +0
-1@@ -1,5 +1,5 @@ -KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"
meta/classes/kernel-artifact-names.bbclass +2
-1-KERNEL_ARTIFACT_LINK_NAME ?= "${MACHINE}" +KERNEL_ARTIFACT_NAME ?= "${PKGE}-${PKGV}-${PKGR}-${MACHINE}" +KERNEL_ARTIFACT_LINK_NAME ?="${KERNEL_ARTIFACT_NAME}${IMAGE_VERSION_SUFFIX}"
KERNEL_IMAGE_NAME?= "${KERNEL_ARTIFACT_NAME}"KERNEL_IMAGE_LINK_NAME?= "${KERNEL_ARTIFACT_LINK_NAME}"meta/classes/kernel.bbclass +0
-2@@ -667,25 +667,18 @@ kernel_do_deploy() { fi for imageType in ${KERNEL_IMAGETYPES} ; do - base_name=${imageType}-${KERNEL_IMAGE_NAME} - install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}$deployDir/${base_name}.bin
meta/classes/kernel.bbclass +0
-2- symlink_name=${imageType}-${KERNEL_IMAGE_LINK_NAME} - ln -sf ${base_name}.bin$deployDir/${symlink_name}.bin
meta/classes/kernel.bbclass +1
-1- ln -sf ${base_name}.bin $deployDir/${imageType} + install -m 0644 ${KERNEL_OUTPUT_DIR}/${imageType}$deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin
+ ln -sf ${imageType}-${KERNEL_IMAGE_NAME}.bin
$deployDir/${imageType}done if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e'^CONFIG_MODULES=y$' .config); then
mkdir -p ${D}${root_prefix}/lib tar -cvzf $deployDir/modules-
${MODULE_TARBALL_NAME}.tgz -C ${D}${root_prefix} lib
- ln -sf modules-${MODULE_TARBALL_NAME}.tgz
$deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgzfi if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then for imageType in ${KERNEL_IMAGETYPES} ; do- initramfs_base_name=${imageType}-
${INITRAMFS_NAME}
- initramfs_symlink_name=${imageType}-
${INITRAMFS_LINK_NAME}
- install -m 0644
${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${initramfs_base_name}.bin
- ln -sf ${initramfs_base_name}.bin
$deployDir/${initramfs_symlink_name}.bin
+ install -m 0644
${KERNEL_OUTPUT_DIR}/${imageType}.initramfs $deployDir/${imageType}- ${INITRAMFS_NAME}.bin
done
fi
}meta/classes/kernel.bbclass +9
-1@@ -695,7 +688,32 @@ do_deploy[prefuncs] += "package_get_auto_pr" addtask deploy after do_populate_sysroot do_packagedata -EXPORT_FUNCTIONS do_deploy +kernel_do_deploy_links() { + deployDir="${DEPLOY_DIR_IMAGE}" + if [ -n "${KERNEL_DEPLOYSUBDIR}" ]; then + deployDir="${DEPLOY_DIR_IMAGE}/${KERNEL_DEPLOYSUBDIR }" + mkdir "$deployDir" + fi + + for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf $deployDir/${imageType}-${KERNEL_IMAGE_NAME}.bin $deployDir/${imageType}-
${KERNEL_IMAGE_LINK_NAME}.binmeta/classes/kernel.bbclass +3
-0+ done + + if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e'^CONFIG_MODULES=y$' .config); then
+ ln -vf $deployDir/modules-${MODULE_TARBALL_NAME}.tgz
$deployDir/modules-${MODULE_TARBALL_LINK_NAME}.tgzmeta/classes/kernel.bbclass +3
-0+ fi + + if [ ! -z "${INITRAMFS_IMAGE}" -a"${INITRAMFS_IMAGE_BUNDLE}" = "1" ]; then
meta/classes/kernel.bbclass +2
-0+ for imageType in ${KERNEL_IMAGETYPES} ; do + ln -vf ${imageType}-${INITRAMFS_NAME}.bin${imageType}-${INITRAMFS_LINK_NAME}.bin
meta/classes/kernel.bbclass +8
-0+ done + fi +} +do_deploy_links[prefuncs] += "package_get_auto_pr" + +addtask deploy_links after do_deploy before do_build + +EXPORT_FUNCTIONS do_deploy do_deploy_links # Add using Device Tree support inherit kernel-devicetreemeta/conf/bitbake.conf +2
-2@@ -447,8 +447,8 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" IMAGE_BASENAME = "${PN}" IMAGE_VERSION_SUFFIX = "-${DATETIME}" IMAGE_VERSION_SUFFIX[vardepsexclude] += "DATETIME" -IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}" -IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}" +IMAGE_LINK_NAME = "${IMAGE_NAME}${IMAGE_VERSION_SUFFIX}" # This option allows for a percentage overage of the actual imagesize rather than a
# fixed extra space, this is space needed for initial startup and basic operations. -- 2.17.1