summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
AgeCommit message (Collapse)Author
2020-09-28kernel.bbclass: ensure symlink_kernsrc task gets run even with externalsrcRasmus Villemoes
Commit c5dfc2586b41 (kernel.bbclass: run do_symlink_kernsrc before do_patch) fixed a race between do_symlink_kernsrc and do_populate_lic. However, I missed the fact that when externalsrc.bbclass is in use, the do_patch task doesn't exist, meaning that do_symlink_kernsrc now doesn't get run at all, breaking the build. We need this task to run regardless of whether do_patch exists or not, so reinstate the configure->symlink_kernsrc dependency explicitly. Fixes: c5dfc2586b41 (kernel.bbclass: run do_symlink_kernsrc before do_patch) Reported-by: Chanho Park <parkch98@gmail.com> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: use camelCase notation for bash variables in do_deployMartin Jansa
* to match other variables there like deployDir imageType [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: eliminate (initramfs_)symlink_name variablesMartin Jansa
* they are used only once, we can use the value directly * notice that .bin extension isn't part of the variable values [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-16kernel.bbclass: use bash variables like imageType, base_name without {}Martin Jansa
* just to make sure it looks like bash variable not bitbake variable in run.do_* scripts [YOCTO #12937] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-28kernel.bbclass: Move away from calling package_get_auto_prMark Hatle
...instead we call read_subpackage_metadata. Calling package_get_auto_pr *should* result in the same PKGV AUTOINC replacement. However, it will also end up changing PKGR differently then do_package as the BB_TASKHASH used will be for the wrong task. Generally this won't cause any real-world issue, but it could cause problems. Moving to read_subpackage_metadata ensures that the values used in do_package will be read in and used for kernel deployment. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26kernel.bbclass: Remove do_install[prefunc] no longer neededMark Hatle
Prior work has refactored the do_install task multiple times, and any references to PKGV and PKGR (even indirect ones) have been removed. Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-26kernel.bbclass: run do_symlink_kernsrc before do_patchRasmus Villemoes
There's a race between do_symlink_kernsrc and do_populate_lic, since the latter is ordered "after do_patch"; so the two may run in parallel. In some cases, that actually causes do_populate_lic to fail if it happens to look for a license file somewhere under ${S} in the short window after shutil.move and before the symlink has been created. Fix that by simply ordering symlink_kernsrc before do_patch. Any task that pokes around in ${S} looking for files should be ordered after do_patch, so this should also fix similar latent races with other ad hoc tasks. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-13kernel.bbclass: Configuration for environment with HOSTCXXZhang Qiang
When compiling xilinx-zynq board linux-kernel-dev(v5.8) if "GCC_PLUGINS=y", The following error will appear: "HOSTCXX -fPIC scripts/gcc-plugins/arm_ssp_per_task_plugin.o fatal error: gmp.h: No such file or directory" the GCC_PLUGINS depend on return result of gcc-plugin.sh execution however in gcc-plugin.sh use HOSTCC to detect the feature of GNU extension of gcc, this will result that HOSTCC can compile the file successfully, but HOSTCXX is used in the actual compilation process. Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-08kernel.bbclass: make dependency on lzop-native conditionalTimon Ulrich
a native lzop is only needed when an lzo compressed initramfs is actually present Signed-off-by: Timon Ulrich <t.ulrich@anapur.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-08kernel.bbclass: add gzip-native to do_deploy dependenciesMatt Madison
When a modules tarball is created during kernel_do_deploy, the tarball is compressed using gzip, but gzip-native is not a dependency so the build host's gzip is being used for this. Using gzip-native will, by default, use pigz instead of single-threaded gzip, making this task less of a bottleneck for builds with a large modules package. Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-05classes/kernel: Use a copy of image for kernel*.rpm if fs doesn't support ↵Yanfei Xu
symlinks Some filesystems don't support symlink, then you will get failure when you install or update the kernel rpm package. Now we use a copy of image for these filesystems instead of symlink. Suggested-by: Bruce Ashfield <bruce.ashfield@gmail.com> Suggested-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-07-05kernel.bbclass: add lz4 dependency and fix the call to lz4Timon Ulrich
If the initramfs image is type lz4, then a native lz4 is needed. Additionally an output filename needs to be specified when calling lz4, otherwise STDOUT will be used implicitly. Signed-off-by: Timon Ulrich <t.ulrich@anapur.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-30deploy.bbclass: Clean DEPLOYDIR before do_deployDaniel Klauer
do_deploy should clean up ${DEPLOYDIR} before running, just like do_install cleans up ${D} before running. This reduces the risk of DEPLOYDIR being accidentally contaminated by files from previous runs, possibly even with different config, in case of incremental builds. It is convenient to have this in deploy.bbclass, so it doesn't have to be duplicated in every recipe, considering for example meta-freescale, which has 23 affected recipes. All recipes using deploy.bbclass (grep -r 'inherit .*deploy') in poky, meta-openembedded and meta-freescale look like they either benefit from this or are at least not affected negatively by it. The only exception I've noticed was uboot-sign.bbclass, which was however fixed by the previous patch. Signed-off-by: Daniel Klauer <daniel.klauer@gin.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-28kernel.bbclass: Fix Module.symvers supportLili Li
Starting from v5.8-rc1 commit 269a535ca931 (modpost: generate vmlinux.symvers and reuse it for the second modpost"), kernel will generate new vmlinux.symvers instead of dumping all the vmlinux symbols into Module.symvers in the first pass. Error log: 'run.do_shared_workdir.16614' failed with exit code 1: DEBUG: cp: cannot stat 'Module.symvers': No such file or directory This change will check the file Module.symvers existence before copying it. Signed-off-by: Lili Li <lili.li@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-22linux-modules.tgz: fix file permissions to rootLi Wang
the files of linux-modules should be same permissions with rootfs.tar.bz2, because it is a part of rootfs when used to install. Signed-off-by: Li Wang <li.wang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-15kernel/reproducibility: kernel modules need SOURCE_DATE_EPOCH exportBruce Ashfield
If CONFIG_IKHEADERS is set to =m, then reproducibility issues creep into the modules build, since the variables we are setting for the main kernel build are not present. Since the source code must be available for a possibly git query on the timestamp, there didn't seem to be an easy way to move the environment variable setting to a common routine. As such, we duplicate the block of code that exports the required variables for reproducible builds. There is a maintenance risk to this, but any issues should be easy enough to catch. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-14classes/kernel: Generate reproducible kernel module tarballJoshua Watt
If reproducible binaries are requested, generate the kernel modules tarball in a reproducible way. Namely, sort the tarball contents, clamp the mtime to the source date epoch, compress the archive with a consistent compression level (9), and don't include the name and timestamp in the compressed file. [YOCTO #12719] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-10kernel.bbclass: fix SOURCE_DATE_EPOCH for non-git kernel buildsChristopher Clark
The source directory is not always a git repository, so when querying git for data to set SOURCE_DATE_EPOCH, specify ${S}/.git as the git directory to prevent retrieving incorrect data from any parent directory. Fixes the following errors with the prior logic when building a kernel that is not obtained from a git repository: 1. With TMPDIR set to a directory outside any git repository on a mounted filesystem, reproducible builds fail in do_compile with this git error: fatal: not a git repository (or any parent up to mount point <abspath>) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). aborting before the error handling logic. 2. With TMPDIR located within a subdirectory of a git repository, the SOURCE_DATE_EPOCH timestamp would be that of said repository rather than that of the kernel. Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-06classes/kernel.bbclass: Fix parsing errorsJoshua Watt
legitimize_package_name wants the actual value of KERNEL_REVISION, so use d.getVar() to fetch it as is done elsewhere in the file. Failing to do so can result it weird errors at parsing time. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-04kernel.bbclass: set LD in KERNEL_CONFIG_COMMAND to fix 5.4+ builds when gold ↵Martin Jansa
is enabled * with 5.4 kernel the do_configure fails when gold is enabled (with ld-is-gold in DISTRO_FEATURES) * bfd is already being set in KERNEL_LD: kernel-arch.bbclass:KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}" but KERNEL_LD is currently respected only by do_compile and do_compile_kernel modules and new kernel which contains a check for gold in Kbuild: https://lore.kernel.org/lkml/alpine.DEB.2.21.1907161434260.1767@nanos.tec.linutronix.de/ more details: https://lore.kernel.org/r/CAMe9rOqMqkQ0LNpm25yE_Yt0FKp05WmHOrwc0aRDb53miFKM+w@mail.gmail.com will fail during the configuration even when gold wouldn't be used to build it in the end, add LD setting to KERNEL_CONFIG_COMMAND to prevent premature error when configuring scripts/kconfig/conf --olddefconfig Kconfig scripts/Kconfig.include:39: gold linker 'x86_64-oe-linux-ld' not supported make[2]: *** [/OE/build/oe-core/tmp-glibc/work-shared/qemux86-64/kernel-source/scripts/kconfig/Makefile:73: olddefconfig] Error 1 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-30kernel: Make symbol link to vmlinux.64 in boot directoryVasyl Gomonovych
Some mips 64 bit platforms use vmlinux.64 image name Make a symbol link to vmlinux.64 in arch/mips/boot/ Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06Revert "kernel.bbclass: adjust a condition checking"Jason Wessel
This reverts commit 6676411fccff2d331878e4ca1f9411aafb056a80. This revert restores the original code and adds a comment. The commit that was reverted broke a number of wic templates and tools which rely on the initramfs creation dependency and the case where the INITRAMFS_IMAGE_BUNDLE is not set. If an end user does not want the INITRAMFS_IMAGE generated, it should be set to "". [ Issue: LIN1019-1791 ] Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-29kernel.bbclass: fix installation of modules signing certificatesDmitry Eremin-Solenikov
If one has provided external key/certificate for modules signing, Kbuild will skip creating signing_key.pem and will write only signing_key.x509 certificate. Thus we have to check for .x509 file existence rather than .pem one. Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-11kernel.bbclass: Make task clean depend on cleaning of make-mod-scriptsHaiqing Bai
The package 'make-mod-scripts' creates files in 'kernel-build-artifacts/include/config' which are removed by 'cleanall/cleansstate' of 'virtual/kernel'. And this causes the below error while building out of tree kernel module: ERROR: Kernel configuration is invalid. include/generated/autoconf.h or include/config/auto.conf are missing. Run 'make oldconfig && make prepare' on kernel src to fix it. Suggested-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-31kernel: package modules.builtin.modinfoBruce Ashfield
As of commit 898490c010b [moduleparam: Save information about built-in modules in separate file] (kernels v5.2-rc1+), modules.builtin.modinfo is generated as part of the kernel build process. We package it along with the other module artifacts, so it can be used by scripts/other build steps. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-16kernel.bbclass: adjust a condition checkingMing Liu
do_bundle_initramfs does not have to depend on ${INITRAMFS_IMAGE}:do_image_complete if INITRAMFS_IMAGE_BUNDLE is not set. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-04-23kernel.bbclass: convert base_do_unpack_append() to a taskSteven Hung (洪于玉)
<pre> when&#32;externalsrc&#32;is&#32;enabled&#32;and&#32;the&#32;&#39;do_unpack&#39;&#32;task&#32;is&#32;deleted, building&#32;kernel&#32;module&#32;fail Signed-off-by:&#32;Steven&#32;Hung&#32;(&#27946;&#20110;&#29577;)&#32;&lt;Steven.Hung@mediatek.com&gt; Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-01kernel: add objtool to shared workdir when CONFIG_UNWINDER_ORC is setJustin Bronder
Based on: https://patchwork.openembedded.org/patch/148047/ When x86_64 enables CONFIG_UNWINDER_ORC [ORC (Oops Rewind Capability) unwinder for unwinding kernel stack traces], objtool is required to generate the required information. If we don't copy objtool to the shared workdir, out-of-tree modules cannot generate object files. For instance, meta-skeleton/hello-mod fails with: | make[3]: *** No rule to make target 'tools/objtool/objtool', needed by ... Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25kernel: Ensure an initramfs is added if configuredRichard Purdie
If ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE_NAME}.cpio does not exist, nor any of the compressed variants, nothing is copied to kernel build's ./usr directory. The code does not fail, but silently proceeds without a bundled initramfs. Change to fail and tell the user something is wrong. Also, if an initramfs is found, contrary to the comments, it does not stop at the first uncompressed/compressed cpio image found. Instead it keeps processing all so the last is used. Fix this to behave as per the comments. [YOCTO #12909] (Patch by Leon Woestenberg) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-14meta: Fix Deprecated warnings from regexsRichard Purdie
Fix handling of escape characters in regexs and hence fix python Deprecation warnings which will be problematic in python 3.8. Note that some show up as: """ meta/classes/package.bbclass:1293: DeprecationWarning: invalid escape sequence \.   """ where the problem isn't on 1293 in package.bbclass but in some _prepend to a package.bbclass function in a different file like mesa.inc, often from do_package_split() calls. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-07kernel.bbclass: Fix incorrect deploying of fitimage.initramfsManjukumar Matha
When kernel-fitimage and initramfs is enabled using INITRAMFS_IMAGE_BUNDLE = "1", kernel do_deploy tries to deploy fitImage.initramfs with following error | install: cannot stat 'arch/arm64/boot/fitImage.initramfs': No such file or directory Skip deploying fitimage.initramfs, since fitimage does not create fitimage.initramfs Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08kernel: don't assign the build user/hostFederico Sauter
The KBUILD_BUILD_USER and KBUILD_BUILD_HOST variables were assigned at the kernel class level, which made it impossible to override them in the local configuration. By setting only the default values of those variables in the kernel class, it is now possible to override them as expected. Signed-off-by: Federico Sauter <federico.sauter@ableton.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-09kernel: use olddefconfig as the primary target for KERNEL_CONFIG_COMMANDBruce Ashfield
As was warned by commit 312ee68752fa [kconfig: announce removal of oldnoconfig if used], oldnoconfig has been removed from the 4.20 kernel. So we switch our default mode to olddefconfig. commit fb16d8912 [kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias] introduced olddefconfig in the 3.10 kernel, we shuffle oldnoconfig to the fallback target. The fallback mode allows kernels between 3.10 and the currently listed oldest kernel of 3.2 to continue to configure. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-25kernel.bbclass: allow custom KERNEL_IMAGEDESTIoan-Adrian Ratiu
Some distros want to install the kernel in a custom location other than /boot and have it properly packaged, so it's useful to use a weaker assignment. Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-22kernel.bbclass: Avoid iterating over KERNEL_IMAGETYPES twiceAlex Kiernan
During deploy we iterate over KERNEL_IMAGETYPES twice, with no consumer of our changes in the interim. Collapse these two loops into one. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-09-22kernel: Fix modules tarball generation with usrmergeAlex Kiernan
When usrmerge is enabled the kernel modules aren't under /lib, but /usr/lib; ensure we fetch the modules from the correct location so we don't have a tarball which consists of a single symlink. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-09-22Revert "kernel.bbclass: do not deploy fitImage; kernel-fitimage.bbclass does ↵Alex Kiernan
that." This reverts commit 65cded55fa96b1ba72149a31689c081ac27af7f7. The fitImage deployed here is the one generated in kernel-fitimage.bbclass, whereas the one deployed by kernel-fitimage.bbclass is a raw image, so we need the one deployed here keeping. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-09-12kernel.bbclass: do not deploy fitImage; kernel-fitimage.bbclass does that.Leon Woestenberg
kernel-fitimage.bbclass replaces an occurance of "fitImage" in KERNEL_IMAGETYPE_FOR_MAKE by an image type that is buildable for the architecture (such as zImage). The kernel-fitimage.bbclass packs that image as sub-image in a flattened image tree image (fitImage) and deploys this fitImage along with the image tree source file (.its). kernel-fitimage.bbclass does not alter KERNEL_IMAGETYPES, which thus also contains "fitImage", which kernel.bbclass will also deploy redundantly with different naming. The result is a dual deployment with slightly different naming, each with a set of symlinks. The solution chosen is to have fitImage deployment be handled by kernel-fitimage.bbclass, and have kernel.bbclass ignore fitImage types during deployment. Signed-off-by: Leon Woestenberg <leon@sidebranch.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21kernel.bbclass: rename type variable to imageTypeMartin Jansa
* to avoid confusion with "type" command in shell Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21kernel-artifact-names.bbclass, kernel.bbclass: remove prefix and extension ↵Martin Jansa
from MODULE_TARBALL_* variables * for consistency with other artifacts variables, include only the version string, not the actual name or extension * changing .tgz to something else in the MODULE_TARBALL_NAME variable only wouldn't make much sense because then kernel.bbclass still calls "tar -cvzf" to create it Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-08-21kernel*.bbclass: rename *_SYMLINK_NAME variables to *_LINK_NAME and ↵Martin Jansa
*_BASE_NAME to *_NAME * for consistency with IMAGE_NAME and IMAGE_LINK_NAME and to avoid confusion with IMAGE_BASENAME (which is the actual name of the artifact, e.g. PN while KERNEL_IMAGE_BASE_NAME was only the version suffix) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10kernel.bbclass: move variables for kernel artifacts names to separate bbclassMartin Jansa
* this makes it easier to access these variables from some other bbclass e.g. sdcard_image-rpi.bbclass in meta-raspberry where we need to know how some files in deploy are named, but we cannot inherit kernel.bbclass as it's used in image recipe not kernel recipe * alternatively we can move these to bitbake.conf like similar image variables are: meta/conf/bitbake.conf:IMAGE_BASENAME = "${PN}" meta/conf/bitbake.conf:IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}" meta/conf/bitbake.conf:IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}" Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10kernel.bbclass: use the consistent naming schema for initramfsMartin Jansa
* use INITRAMFS_BASE_NAME and INITRAMFS_SYMLINK_NAME variables, like other kernel artifacts are using * use "${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}" instead of "${PV}-${PR}-${MACHINE}-${DATETIME}" to be consistent with other files * allow to modify default symlink name with INITRAMFS_SYMLINK_NAME instead of currently used: initramfs_symlink_name=${type}-initramfs-${MACHINE} Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-10kernel-devicetree.bbclass: Fix and simplify instalation of DTB filesMartin Jansa
* add 2 new variables: KERNEL_DTB_BASE_NAME KERNEL_DTB_SYMLINK_NAME instead of reusing KERNEL_IMAGE_SYMLINK_NAME and than expecting that default value ${MACHINE} was being used in e.g.: DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` * install normal DTB files only once even if there is multiple entries in KERNEL_IMAGETYPE_FOR_MAKE and don't prefix them with the type of the kernel image, use the KERNEL_IMAGETYPE_FOR_MAKE as a prefix only when installing them bundled with kernel or initramfs image. * deploy the files from ${D}/${KERNEL_IMAGEDEST}/ instead of kernel build directory, so that we don't need to call DTB_PATH=`get_real_dtb_path_in_kernel "${DTB}"` again in do_deploy * create all links in do_deploy task, because default KERNEL_DTB_BASE_NAME like KERNEL_IMAGE_BASE_NAME contains PKGR and PKGR is different in do_install and do_deploy, because kernel.bbclass calls meta/classes/kernel.bbclass:do_install[prefuncs] += "package_get_auto_pr" meta/classes/kernel.bbclass:do_deploy[prefuncs] += "package_get_auto_pr" * the filenames are a bit different, but with separate variable it should be easier for other bbclasses which use these DTB files to find them correctly, just use either the cannonical name $dtb_base_name.$dtb_ext or $dtb_base_name-${KERNEL_DTB_SYMLINK_NAME}.$dtb_ext because PKGR (and other PKG* variables) might be different in your task and kernel.do_deploy task. * fix DTB files being deployed with incorrect filenames when KERNEL_IMAGE_SYMLINK_NAME isn't set to ${MACHINE}, e.g. instead of the default: -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 07:41 deploy/images/raspberrypi3-64/Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/Image-lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo lrwxrwxrwx 2 bitbake bitbake 64 Nov 20 07:41 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-1-4.9.59+git0+e7976b2aff-r0.2-lirc-rpi-20171120043031.dtbo I was getting: -rw-r--r-- 2 bitbake bitbake 1348 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi.dtbo lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/Image-linux-raspberrypi-lirc-rpi-master-20171120102653.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo lrwxrwxrwx 2 bitbake bitbake 37 Nov 20 10:28 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> Image-linux-raspberrypi-lirc-rpi.dtbo and e.g. sdcard_image-rpi.bbclass from meta-raspberrypi: https://github.com/agherzan/meta-raspberrypi/blob/37e4e18f4a745ce8dc11f7e40a29da0859ff13c6/classes/sdcard_image-rpi.bbclass was failing in: mcopy -i ${WORKDIR}/boot.img -s ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb ::${DTB_BASE_NAME}.dtb because ${KERNEL_IMAGETYPE}-${DTB_BASE_NAME}.dtb doesn't exist in my build, due to DTB_SYMLINK_NAME=`echo ${symlink_name} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"` not replacing whole "${KERNEL_IMAGE_SYMLINK_NAME}" (read ${MACHINE}) with just ${DTB_BASE_NAME} * with this change applied the deploy dir looks like this: -rw-r--r-- 2 bitbake bitbake 1.4K Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo lrwxrwxrwx 2 bitbake bitbake 74 Nov 20 15:49 deploy/images/raspberrypi3-64/lirc-rpi-raspberrypi3-64.dtbo -> lirc-rpi-1-4.9.59+git0+e7976b2aff-r0.8-raspberrypi3-64-20171120154716.dtbo and works correctly even with DISTRO using different naming scheme * the sdcard_image-rpi.bbclass still needs to be modified, I've provided updated version here: https://github.com/agherzan/meta-raspberrypi/pull/159 * mpc8315e-rdb.conf MACHINE in meta-yocto-bsp also needs small fix: https://lists.yoctoproject.org/pipermail/poky/2018-July/011436.html Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28kernel: Set SOURCE_DATE_EPOCH to kernel git timestamp if not setAlex Kiernan
If SOURCE_DATE_EPOCH is unset (in addition to the existing "0" behaviour) parse out the top most commit timestamp from the kernel tree to use as the timestamp. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-08kernel: specify dependencies for compilation for config tasksBruce Ashfield
With recent kernels (i.e. 4.17+) the configuration phase of the kernel will check for capabilities/options of the compiler for CVE and other mitigation support. For a general kernel, we want to ensure that CC is fully defined when the config targets are invoked (so the proper compiler will be checked). For linux-yocto, we also need to specify the compiler/tools dependencies for the configme task since it executes before configure and hence the main kernel build DEPENDS will not always be in the sysroot before it executes. Without those dependencies the kernel will be incorrectly configured (i.e. bison is missing) or the configuration will fail the mitigation tests. [YOCTO #12757] Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22kernel.bbclass: avoid duplicates in KERNEL_IMAGETYPE_FOR_MAKEAndre McCurdy
Currently if KERNEL_IMAGETYPES contains both vmlinux and vmlinux.gz, KERNEL_IMAGETYPE_FOR_MAKE will end up containing two copies of vmlinux, which will result in two calls to "make vmlinux" from kernel_do_compile(). Avoid duplicating vmlinux in KERNEL_IMAGETYPE_FOR_MAKE plus some minor non-functional updates to formatting and comments. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-05-09kernel: Permit overriding of KERNEL_IMAGETYPE_FOR_MAKEMike Crowe
Commit a1690131691507bbf5853540229b3ad775b836bf removed the ability of recipes to set KERNEL_IMAGETYPE_FOR_MAKE. Fix that by letting recipes continue to set their own KERNEL_IMAGETYPE_FOR_MAKE if they so wish. They may have been doing so for a while, and don't want to have their carefully-selected value trampled on by kernel.bbclass. This may be required if the recipe itself wants to build one type of kernel, but post-process it into a different type, rather like the vmlinux->vmlinux.gz support provided by kernel.bbclass. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-04-03kernel.bbclass: improve reproducibilityJonathan Liu
Set KBUILD_BUILD_VERSION=1 to avoid build version being incremented on every build. It is visible in the output of "cat /proc/version" after the hash character. Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-03-20kernel.bbclass: set HOSTLDFLAGS in KCONFIG_CONFIG_COMMANDCalifornia Sullivan
Kernel v4.14 and newer contain the following in their Makefile: HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS) HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) This breaks our menuconfig, because it can no longer find ncurses if its not on the host machine. This can be seen in linux-yocto-dev, for example: [clsulliv@clsulliv build]$ bitbake virtual/kernel -c menuconfig GEN ./Makefile HOSTLD scripts/kconfig/mconf /home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -lncurses /home/clsulliv/yocto/poky/build/tmp/hosttools/ld: cannot find -ltinfo collect2: error: ld returned 1 exit status make[3]: *** [scripts/Makefile.host:99: scripts/kconfig/mconf] Error 1 make[2]: *** [/home/clsulliv/yocto/poky/build/tmp/work-shared/intel-corei7-64/kernel-source/Makefile:504: menuconfig] Error 2 make[1]: *** [Makefile:146: sub-make] Error 2 make: *** [Makefile:24: __sub-make] Error 2 Command failed. Press any key to continue... Fix this by setting HOSTLDFLAGS to ${BUILD_LDFLAGS} in our 'make menuconfig' command. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>