summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
Commit message (Collapse)AuthorAgeFilesLines
* kernel.bbclass: Set pkg-config variables for building modulesMunehisa Kamata2024-03-131-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pkg-config workaround has been applied for kernel image building, but not for module building. So pkg-config variables are different between do_compile and do_compile_kernelmodules tasks. It may unnecessary trigger rebuilding of a few host tools at the later task. Especially when CONFIG_DEBUG_INFO_BTF is enabled in the kernel, it may even trigger rebuilding vmlinux at do_compile_kernelmodules due to the rebuilt host tools such as certs/extract-cert or objtool (on x86). This eventually creates an inconsistent set of kernel binaries. Here is the repro steps: - Check out nanbield on x86 - The unexpected rebuild happens on kirkstone or possibly earlier - Ensure that pahole is available (e.g. via meta-oe) - Set KERNEL_DEBUG to "True" to properly set up PAHOLE e.g. $ export KERNEL_DEBUG="True" $ export BB_ENV_PASSTHROUGH_ADDITIONS="${BB_ENV_PASSTHROUGH_ADDITIONS} KERNEL_DEBUG" - Enable CONFIG_DEBUG_INFO_BTF=y e.g. $ bitbake -c menuconfig virtual/kernel -> Kernel hacking -> Compile-time checks and compiler options -> Generate BTF typeinfo - Build the kernel e.g. $ bitbake virtual/kernel The BTF information in the resulting bzImage and kernel modules are inconsistent, because the module's BTF information is generated using the "second" vmlinux that doesn't have the identical BTF to the "first" vmlinux. These modules can't be loaded at runtime due to the BTF mismatch. This also leads to a build-id mismatch between the installed bzImage and vmlinux since the bzImage is created from the first vmlinux, but the installed vmlinux is the second one. $ eu-readelf -n tmp/work/qemux86_64-poky-linux/linux-yocto/6.5.13+git/image/boot/{bzImage*,vmlinux*} | grep "Build ID" Build ID: 4a0d62ee7fef0244950f0f604253729875bea493 Build ID: fb99b3d91399dbe42bf67ddee59e0f5a0c7f74d9 To avoid the unexpected rebuilding that results in such inconsistency, set the same pkg-config variables when building kernel and modules. For kernel 5.19 and above, simply set the HOSTPKG_CONFIG in the make command line. (From OE-Core rev: d88e0fa7c5e6c8252f8f775996f512a37fea4818) Signed-off-by: Munehisa Kamata <kamatam@amazon.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cd2072e5d953af981339427028e19083257e6a92) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* allarch: Fix allarch corner caseRichard Purdie2024-02-221-2/+2
| | | | | | | | | | | | | | | Most of the allarch code is conditional and only set if the recipe remains marked as allarch. The qemu wrapper handling is not handled in the same way however and is unconditional. Move the code to some slightly uglier inline python to allow it to be conditional and match the way the rest of the code works. (From OE-Core rev: 2e206eb9b43c267e939ccb3cdfa62d9666ff5efa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dfd704f1741dccd9a85338c5d45dee4be079064d) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* qemu.bbclass: fix a python TypeErrorMing Liu2024-02-071-1/+1
| | | | | | | | | | | | | | | | QEMU_OPTIONS can be empty which will trigger a exception TypeError: | can only concatenate str (not "NoneType") to str. Fix it by setting a empty string. ALso removed two useless blanks. (From OE-Core rev: 3ccc642bb36373e81d80d41b4f213328c7bfb9cb) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b619197bd52a4a99a9989e7ea6fb7032415b1e42) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* uninative-tarball.xz - reproducibility fixRobert Berger2024-01-311-1/+1
| | | | | | | | | | | | | | added --clamp-mtime --mtime to the tar command see: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15148 (From OE-Core rev: 3dabf663a772b49e2f324ce5e875d6e633384559) Signed-off-by: Robert Berger <Robert.Berger@ReliableEmbeddedSystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2ef7c63871ab4fb62a9cea45a23a78bf9d541e4a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* testimage: Drop target_dumper and most of monitor_dumperRichard Purdie2024-01-041-16/+0
| | | | | | | | | | | | | | | | | | The target_dumper code is basically broken. It has been reading binary files over the text base serial communication and runs at every command failure which makes no sense. Each run might overwrite files from the previous run and the output appears corrupted due to confusion from the binary data. For now, remove the commands and the target dumper code as the command and execution point are problematic. Also remove the same pieces of the monitor code but leave the command list since in theory this can be moved to a more useful place in the code. (From OE-Core rev: 4c7aa982a996b23a4c5100c5a5a9390e26e5fe46) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a24d787987dccc95fdd95b7e85bf525a1c55b285) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* kernel-arch: use ccache only for compilerJavier Tia2024-01-041-3/+3
| | | | | | | | | | | | | | Attempting to use it with other tools is not beneficial, only with the compiler. Confirmation from ccache's maintainer [1]. [1] https://github.com/ccache/ccache/discussions/1346#discussioncomment-7616180 (From OE-Core rev: 4fe3ec1b7e1d034b236816166d58801a4b0e8d70) Signed-off-by: Javier Tia <javier.tia@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 47fa8d81083f1ef594f8fe6fcab3e227e9607b3f) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* sed -i destroys symlinksJoakim Tjernlund2024-01-041-2/+2
| | | | | | | | | | | | | If /etc/passwd is a symlink, sed -i on same file will replace the symlink with a new file. Prevent that by adding --follow-symlinks option to sed (From OE-Core rev: 7b4343a30a02d8f8664ac4c4bc09e5acfb4fa60e) Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 6ec004b2e7b4342465af8e5e6cc66041834821a0) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* testimage: Exclude wtmp from target-dumper commandsRichard Purdie2023-12-221-1/+1
| | | | | | | | | | | | | | wtmp is filled with binary data which the run_serial command can't cope with. Catting this results in confusion of the serial interface and potentially large backlogs of data in the buffers which can hang qemu. Exclude the problematic files from the command. (From OE-Core rev: 1a14503ff5b4bc8192ae1b0d22622b8aefb718be) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 599ac08a6f6fb3f6a89a897c8e06367c63c2f979) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* meson: use correct targets for rust binariesDmitry Baryshkov2023-12-151-2/+2
| | | | | | | | | | | | | Follow the example of rust and cargo classes and pass RUST_HOST_SYS and RUST_BUILD_SYS to rustc's --target argument instead of bare HOST_SYS and BUILD_SYS. (From OE-Core rev: ea5e46a627dc7385c4d7732299618b6392b7a407) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 1471c6c076f544ccd6f0722c82878311199881a7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* kernel-yocto: improve metadata patchingBruce Ashfield2023-12-151-5/+25
| | | | | | | | | | | | | | | | | | | | | | The ability to patch the kernel-yocto metadata was added to support debug and easier test cycles on kernel-cache provided fragments. As such, it was very simple and has limited functionality. That being said, it is an available feature and can be improved to handle patches that fail to apply. The main kernel patching is already handled by the kern-tools, so we extend the patching of the meta-data to same tools and inherit more functinality from the scripts. [YOCTO #15266] (From OE-Core rev: 98d981ba1bf903da441df22f298633bedbd718da) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e867addd6c2f508f7a95e72222e750d37f3d19d8) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* kernel-arch: drop CCACHE from KERNEL_STRIP definitionDmitry Baryshkov2023-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | Building linux-yocto with ccache enabled results in the 'command not found' error, because kernel-yocto.bbclass passes the KERNEL_STRIP as a single value, whic is then interpreted as a command name. ERROR: Fatal errors occurred in subprocesses: [Errno 2] No such file or directory: 'ccache aarch64-linaro-linux-strip': Traceback (most recent call last): File "/home/lumag/Projects/RPB/build-rpb/conf/../../layers/openembedded-core/meta/lib/oe/utils.py", line 288, in run ret = self._target(*self._args, **self._kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Fixes: 03973c8c1c93 ("kernel: Add kernel specific STRIP variable") (From OE-Core rev: 595b2a89d1af01645cea5d4163b100d59c951db6) Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 41f019afc41f800b622c46a6d7cf1beffc97716a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* kernel.bbclass: Use strip utility used for kernel build in do_packageKhem Raj2023-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | os.environ does not pass this down to runstrip() function and in strip_execs() its using STRIP bitbake variable to find the strip utility to use. Since there might be a trailing whitespace in KERNEL_STRIP remove that otherwise python is not able to launch it. e.g. FileNotFoundError: [Errno 2] No such file or directory: 'riscv64-yoe-linux-strip ' This is more evident when STRIP and KERNEL_STRIP are different utilities e.g. when using clang as default toolchain but using gcc+binutils only for kernel build. (From OE-Core rev: e0bd7ce93a75c7ddb6b1c572453c37407e7e32da) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 77497dbdca92ab4d6386a071bc281c42a7e8a14b) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* Revert "bin_package.bbclass: Inhibit the default dependencies"Max Krummenacher2023-11-241-3/+0
| | | | | | | | | | | | | | | | This reverts commit d1d09bd4d7be88f0e341d5fccbfbefeb98d4b727. The commit not only removes the dependencies on the cross compiler but also does not depend on e.g. virtual/${TARGET_PREFIX}compilerlibs and virtual/libc which in turn makes the file-rdeps qa check fail if installing binaries linked against e.g. libc or libstdc++. (From OE-Core rev: 47b436c42ba1ef3b24e8fe48c7ea274b1a53a60e) Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ababf6ceebe360c5f59a57428566c27b7a97a9e6) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* goarch: Move Go architecture mapping to a libraryJoshua Watt2023-11-241-26/+3
| | | | | | | | | | | | | | Other spaces uses the Go architecture definitions as their own (for example, container arches are defined to be Go arches). To make it easier for other places to use this mapping, move the code that does the translation of OpenEmbedded arches to Go arches to a library. (From OE-Core rev: 5e0267aeb7d9f575f270f6856a67ac62ce8a0f71) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3e86f72fc2e1cc2e5ea4b4499722d736941167ce) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* qemuboot: reduce default size of software I/O translation bufferRoss Burton2023-10-091-0/+7
| | | | | | | | | | | | | | With 6.5+ (specifically, if DMA_BOUNCE_UNALIGNED_KMALLOC is set) the SWIOTLB is used, and it defaults to 64MB. This is too much when there's only 256MB of RAM, so request 0 slabs and lets the kernel round up to the appropriate minimum (1MB on aarch64, typically). In virtual hardware there's very little need for these bounce buffers, so the 64MB would be mostly wasted. (From OE-Core rev: 369e768d87b80be9efe76937bfafeddabc35f559) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cmake.bbclass: Add *.cmake to CONFIGURE_FILESPeter Kjellerstedt2023-10-091-1/+1
| | | | | | | | | | This makes do_configure depend on changes to any cmake file when externalsrc is active. (From OE-Core rev: dae2757bf0fea6ae821a28bd6ea9d0232694c177) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* autotools.bbclass: Add *.m4 to CONFIGURE_FILESPeter Kjellerstedt2023-10-061-1/+1
| | | | | | | | | | | This makes do_configure depend on changes to any m4 file when externalsrc is active. (From OE-Core rev: 492559191943c9e2666c3dda1824c5aafbe487d5) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: fix missed override syntax migrationQuentin Schulz2023-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | uboot-extlinux-config allows to specify multiple "labels" (entries in a menu, à-la grub) and each of them have their own values for some fields. Each "base" variable, e.g. UBOOT_EXTLINUX_FDT can be overridden for each label. This is done via the OVERRIDES mechanism based on the label name, e.g. UBOOT_EXTLINUX_FDT:linux if linux is a label. However, OVERRIDES doesn't contain the label globally because it's only necessary in one task. Therefore, the OVERRIDES itself is modified within the task. This means that the sigdata will not be told the dependency on UBOOT_EXTLINUX_FDT:linux, because it cannot know about it. For this reason, we need to explicitly specify which variables this task depends on via vardeps varflag for the task. This was done in the past, but we missed updating it during the override syntax migration so the cache wouldn't get invalidated if someone modifies UBOOT_EXTLINUX_FDT:linux from a configuration file or a bbappend for example. Let's fix this by migrating it to the new syntax. (From OE-Core rev: b4dd9d873508128adbbf5ff6cf0a3df3d2ffbcf6) Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: Add menu title configurationDaniel Semkowicz2023-10-041-2/+6
| | | | | | | | | | | | | Add new UBOOT_EXTLINUX_MENU_TITLE variable that allows configuring the "MENU TITLE" entry. If set to empty, "MENU TITLE" will not be added to the output file. (From OE-Core rev: 23026911142585fde9290e21b07934fc583b6540) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: Uppercase "menu title" entryDaniel Semkowicz2023-10-041-1/+1
| | | | | | | | | | | All other extlinux.conf entries are written to the output file in uppercase. (From OE-Core rev: 6c89654cf37da95aeea07e1645f2cdffe320c8bc) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: Remove repeated space characterDaniel Semkowicz2023-10-041-1/+1
| | | | | | | | (From OE-Core rev: e8a7a8d93c20f966bc2845d23696d01234cbb227) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: Add missing variable descriptionsDaniel Semkowicz2023-10-011-1/+4
| | | | | | | | | | Description of UBOOT_EXTLINUX and UBOOT_EXTLINUX_CONFIG was missing. Describe these two variables in class comment. (From OE-Core rev: fb1c2cae3dbd37ad25d26efb09e80480d49063f9) Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-fitImage: Strip path component from dtbNinad Palsule2023-09-281-0/+5
| | | | | | | | | | | | | | | | | | Machines that have added subdirectires to the KERNEL_DEVICETREE recently, such as arm32 boards that were moved under subdirectories in Linux 6.5, will have that subdirectory in the node name of the FIT. This breaks existing systems that select a configuration in u-boot by it's name. Strip off the directory component from the device tree to preserve compatibility. (From OE-Core rev: 941ba1a132bafa9c9be855fb91fec96d8b06299f) Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Ninad Palsule <ninad@linux.ibm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib_script.bbclass: expand script name as wellMartin Jansa2023-09-281-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * e.g. mozjs from meta-oe contains major version from PV in the script name but currently cannot use a variable there because it would be unexpanded in the varflag name as shown in bitbake -e (lib32-curl included for comparison) env.lib32-curl:# $ALTERNATIVE_TARGET [2 operations] env.lib32-curl-# set oe-core/meta/conf/documentation.conf:66 env.lib32-curl-# [doc] "Used by the alternatives system to create default link locations for duplicated commands." env.lib32-curl-# set multilib_script.bbclass:37 [__anon_40_oe_core_meta_classes_recipe_multilib_script_bbclass] env.lib32-curl-# [curl-config] "${bindir}/curl-config-${MULTILIB_SUFFIX}" env.lib32-curl-# pre-expansion value: env.lib32-curl-# "None" -- env.lib32-mozjs-115:# $ALTERNATIVE_TARGET [2 operations] env.lib32-mozjs-115-# set oe-core/meta/conf/documentation.conf:66 env.lib32-mozjs-115-# [doc] "Used by the alternatives system to create default link locations for duplicated commands." env.lib32-mozjs-115-# set multilib_script.bbclass:37 [__anon_40_oe_core_meta_classes_recipe_multilib_script_bbclass] env.lib32-mozjs-115-# [js${MAJ_VER}-config] "${bindir}/js${MAJ_VER}-config-${MULTILIB_SUFFIX}" env.lib32-mozjs-115-# pre-expansion value: env.lib32-mozjs-115-# "None" -- env.lib32-mozjs-115-escript:# $ALTERNATIVE_TARGET [2 operations] env.lib32-mozjs-115-escript-# set oe-core/meta/conf/documentation.conf:66 env.lib32-mozjs-115-escript-# [doc] "Used by the alternatives system to create default link locations for duplicated commands." env.lib32-mozjs-115-escript-# set multilib_script.bbclass:38 [__anon_41_oe_core_meta_classes_recipe_multilib_script_bbclass] env.lib32-mozjs-115-escript-# [js115-config] "/usr/bin/js115-config-${MULTILIB_SUFFIX}" env.lib32-mozjs-115-escript-# pre-expansion value: env.lib32-mozjs-115-escript-# "None" Otherwise log.do_package shows that apply_update_alternative_renames first renames the js115-config to js115-config.mozjs-115 (default ALTERNATIVE_TARGET suffix is '.${BPN}') and multilibscript_rename later fails: DEBUG: Executing python function apply_update_alternative_renames NOTE: mozjs-115: Rename /usr/bin/js115-config -> /usr/bin/js115-config.mozjs-115 DEBUG: Python function apply_update_alternative_renames finished DEBUG: Executing shell function multilibscript_rename mv: cannot stat 'BUILD/work/mach-oemllib32-linux-gnueabi/lib32-mozjs-115/115.2.0/package/usr/bin/js115-config': No such file or directory WARNING: exit code 1 from a shell command. I wonder if we actually need multilibscript_rename as apply_update_alternative_renames seems to do the rename already. (From OE-Core rev: d07bfddba023a1c92491b261c9f9c25ec1a0ef57) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd-boot-cfg: add .conf suffix to default entry labelCharles-Antoine Couret2023-09-261-1/+1
| | | | | | | | | | | | | | | | | | | Since systemd v245 (commit 6cd12ebcfe459466257ea63022a32515d756e719), systemd-boot expects default entry to have the complete filename as value. LABELS from poky are by default without any suffixes like "boot install", so default entry does not have the .conf suffix as well and systemd-boot is not able to use this information and it's starting in any case the first entry. To be able to start another entry by default, .conf suffix is required. With this change, LABELS variable can still be used by other bootloaders and being used as description field. (From OE-Core rev: 1adf70729dafc9729e665986ad2e2250cbd25c5b) Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* pypi.bbclass: Update the upstream checks to automatically replace '_' with '-'Derek Straka2023-09-221-2/+4
| | | | | | | | | | | | | | For a number of existing packages, the pypi URI contains '-', but the package name (PYPI_PACKAGE) uses '_'. Add a simple replace for the UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX. The change resulted in 19 additional auto-detected upstream checks for python packages meta-python. It did break upstream checks for 3 packages that will be patched shortly: - python3-ipython-genutils - python3-ninja-syntax - python3-wpa-supplicant (From OE-Core rev: f4e2923bfac8a0a5b702ffd2dd957213a6268f6b) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* license/license_image: Fix license file layout to avoid overlapping filesRichard Purdie2023-09-201-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently DEPLOY_DIR/licenses is added to SSTATE_ALLOW_OVERLAP_FILES. This leads to bugs since when one MACHINE_ARCH recipes is cleaned, it removes the files for another which then results in later build failures as license files disappear. The solution is to include SSTAGE_PKGARCH in the path names to the license files. That does mean a search has to be used to find the correct license files for a given PN but that can be done via SSTATE_ARCHS. The implication for other tools is the layout has changed so tools will need to adapt to the new paths. The benefit is no more strange build failures such as from patterns like: MACHINE=qemux86-64 bitbake core-image-minimal MACHINE=genericx86-64 bitbake core-image-minimal MACHINE=qemux86-64 bitbake linux-yocto -c clean MACHINE=genericx86-64 bitbake core-image-minimal -C rootfs [YOCTO #14123] For anyone finding this commit, I'd question how much people should be relying on this code for tooling and suggest the SPDX manifests should be the preferred data format going forward anyway. (From OE-Core rev: 1a4ab9fc26659507e678e87312b514e8ea515673) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib: fix SSTATE_ARCHS for multilib usageRichard Purdie2023-09-201-0/+1
| | | | | | | | | | | | | | When building multilibs, we need to inject the multilib sstate pkgarch into SSTATE_ARCHS so the list forms a complete search path. Add a tweak to do this. PACKAGE_ARCH defaults to TUNE_PKGARCH so this is equivalent and just guards against recipes changing the value which may have other unwanted side effects. (From OE-Core rev: 37126ffc7ccbd3df57ebbd8e581d158f03bb3b4c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fontcache.bbclass: avoid native recipes depending on target fontconfigMartin Jansa2023-09-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | * this caused liberation-font-native to depend on TUNE_PKGARCH target fontconfig because ${MLPREFIX}fontconfig-utils is added to RDEPENDS in anonymous python * the dependency tree for liberation-font-native got much shorter (just quilt-native and liberation-font-native itself): 2 after/pn-buildlist 78 before/pn-buildlist * fixes graphviz-native signature issue as well as detected with sstate-diff-machines.sh $ bitbake-diffsigs \ sstate-after/mako/x86_64-linux/graphviz-native/8.1.0.do_populate_sysroot.sigdata.184d4fd355f1e7a2d7d929ef4b5f62b94e2071df9dd674b2067ec21bfc7bcc1b \ sstate-after/qemux86-64/x86_64-linux/graphviz-native/8.1.0.do_populate_sysroot.sigdata.35da674d2dbc275bac02869dfce4165466315023910bdef65a6026e2cb942a46 Hash for task dependency liberation-fonts-native:do_populate_sysroot changed from 310d3da04ad9abf8ee99997e53d1ffa71c2b7d9d60fb0e8de85171a9ab6a77d3 to 048420ad1410c2b8d95498fc3c11681207335a2c722836f1f3e683cc449814da (From OE-Core rev: 998d4da9d89aea77dc0f2cbac60ea64258331756) Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: remove QEMU_USE_SLIRP variableMikko Rapeli2023-09-141-1/+1
| | | | | | | | | | QEMU_USE_SLIRP is replaced by TEST_RUNQEMUPARAMS with "slirp" and possibly other arguments to runqemu script. (From OE-Core rev: 99fd24f0d9ff79fed389ae5a01c3031d7e7167d0) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: respect target/server IPs when using slirpRoss Burton2023-09-141-3/+6
| | | | | | | | | | | | | | | | | | | We can't hardcode these IPs when using slirp. The target IP will need a port to be specified as this controls what port the SSH connection uses, and when slirp is used it can't bind to port 22. The qemu runner (OEQemuTarget) assumes that the first port forward is the SSH forward, but this may be wrong or a different target may be used. The server IP depends on how the virtual networking is configured. runqemu defaults to 10.0.2.x for the guests so that is a wise default, but that may be configured differently. (From OE-Core rev: 81b304e2558730de285f2773371340fc636a8ed1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* goarch.bbclass: not compatible with riscv32Kai Kang2023-09-141-0/+1
| | | | | | | | | | | | | | It fails to build recipes which inherit goarch.bbclass for qemuriscv32: | ERROR: Nothing PROVIDES 'docker-moby' | docker-moby was skipped: Unsupported CPU architecture: riscv32 So empty COMPATIBLE_HOST for riscv32. (From OE-Core rev: e053e718b07855eacf0c24741ec8a56308f23657) Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: detect slirp from TEST_RUNQEMUPARAMSMikko Rapeli2023-09-121-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also set target and server IP addresses correctly to 127.0.0.1 so that TEST_TARGET_IP and TEST_SERVER_IP don't need to be set manually with slirp. Users run qemu images with slirp networking like this: $ bitbake core-image-minimal $ ../poky/scripts/runqemu slirp slirp networking means that only one TCP port is forwarded from host system to the qemu machine so that ssh into the machine works. ping and other low level networking from host to target machine do not work, but networking from target via host does work. This is much more easy to setup than the bridge networking used by default, which I've never managed to get running on various host machines. To use slirp networking wita qemu and core-image-minimal to run testimage.bbclass tests, add these to local.conf: IMAGE_CLASSES += "testimage" IMAGE_FEATURES += "ssh-server-dropbear" TEST_RUNQEMUPARAMS += "slirp" Then image can be compiled and tested with: $ bitbake core-image-minimal $ bitbake -c testimage core-image-minimal Note that only few of the current oeqa runtime tests work against core-image-minimal, but test results look like: RESULTS: RESULTS - date.DateTest.test_date: PASSED (3.64s) RESULTS - df.DfTest.test_df: PASSED (0.55s) RESULTS - oe_syslog.SyslogTest.test_syslog_running: PASSED (0.56s) RESULTS - oe_syslog.SyslogTestConfig.test_syslog_logger: PASSED (1.88s) RESULTS - oe_syslog.SyslogTestConfig.test_syslog_restart: PASSED (0.93s) RESULTS - pam.PamBasicTest.test_pam: PASSED (2.20s) RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (4.98s) RESULTS - ping.PingTest.test_ping: PASSED (0.05s) RESULTS - ssh.SSHTest.test_ssh: PASSED (1.28s) RESULTS - systemd.SystemdBasicTests.test_systemd_basic: PASSED (0.56s) RESULTS - systemd.SystemdBasicTests.test_systemd_failed: PASSED (1.10s) RESULTS - systemd.SystemdBasicTests.test_systemd_list: PASSED (0.92s) RESULTS - systemd.SystemdJournalTests.test_systemd_boot_time: PASSED (0.56s) RESULTS - systemd.SystemdJournalTests.test_systemd_journal: PASSED (0.54s) RESULTS - apt.AptRepoTest.test_apt_install_from_repo: SKIPPED (0.00s) RESULTS - buildcpio.BuildCpioTest.test_cpio: SKIPPED (0.00s) RESULTS - buildgalculator.GalculatorTest.test_galculator: SKIPPED (0.00s) RESULTS - buildlzip.BuildLzipTest.test_lzip: SKIPPED (0.00s) RESULTS - connman.ConnmanTest.test_connmand_help: SKIPPED (0.00s) RESULTS - connman.ConnmanTest.test_connmand_running: SKIPPED (0.00s) RESULTS - dnf.DnfBasicTest.test_dnf_help: SKIPPED (0.00s) RESULTS - dnf.DnfBasicTest.test_dnf_history: SKIPPED (0.00s) RESULTS - dnf.DnfBasicTest.test_dnf_info: SKIPPED (0.00s) RESULTS - dnf.DnfBasicTest.test_dnf_search: SKIPPED (0.00s) RESULTS - dnf.DnfBasicTest.test_dnf_version: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_exclude: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_install: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_install_dependency: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_install_from_disk: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_install_from_http: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_installroot: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_installroot_usrmerge: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_makecache: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_reinstall: SKIPPED (0.00s) RESULTS - dnf.DnfRepoTest.test_dnf_repoinfo: SKIPPED (0.00s) RESULTS - gcc.GccCompileTest.test_gcc_compile: SKIPPED (0.00s) RESULTS - gcc.GccCompileTest.test_gpp2_compile: SKIPPED (0.00s) RESULTS - gcc.GccCompileTest.test_gpp_compile: SKIPPED (0.00s) RESULTS - gcc.GccCompileTest.test_make: SKIPPED (0.00s) RESULTS - gi.GObjectIntrospectionTest.test_python: SKIPPED (0.00s) RESULTS - go.GoHelloworldTest.test_gohelloworld: SKIPPED (0.00s) RESULTS - kernelmodule.KernelModuleTest.test_kernel_module: SKIPPED (0.00s) RESULTS - ldd.LddTest.test_ldd: SKIPPED (0.00s) RESULTS - logrotate.LogrotateTest.test_logrotate_newlog: SKIPPED (0.00s) RESULTS - logrotate.LogrotateTest.test_logrotate_wtmp: SKIPPED (0.00s) RESULTS - oe_syslog.SyslogTestConfig.test_syslog_startup_config: SKIPPED (0.00s) RESULTS - opkg.OpkgRepoTest.test_opkg_install_from_repo: SKIPPED (0.00s) RESULTS - perl.PerlTest.test_perl_works: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s) RESULTS - python.PythonTest.test_python3: SKIPPED (0.00s) RESULTS - rpm.RpmBasicTest.test_rpm_help: SKIPPED (0.00s) RESULTS - rpm.RpmBasicTest.test_rpm_query: SKIPPED (0.00s) RESULTS - rpm.RpmBasicTest.test_rpm_query_nonroot: SKIPPED (0.00s) RESULTS - rpm.RpmInstallRemoveTest.test_check_rpm_install_removal_log_file_size: SKIPPED (0.00s) RESULTS - rpm.RpmInstallRemoveTest.test_rpm_install: SKIPPED (0.00s) RESULTS - rpm.RpmInstallRemoveTest.test_rpm_remove: SKIPPED (0.00s) RESULTS - rust.RustCompileTest.test_cargo_compile: SKIPPED (0.00s) RESULTS - rust.RustCompileTest.test_rust_compile: SKIPPED (0.00s) RESULTS - scp.ScpTest.test_scp_file: SKIPPED (0.00s) RESULTS - stap.StapTest.test_stap: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_disable_enable_ro: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_status: SKIPPED (0.00s) RESULTS - systemd.SystemdServiceTests.test_systemd_stop_start: SKIPPED (0.00s) RESULTS - weston.WestonTest.test_wayland_info: SKIPPED (0.00s) RESULTS - weston.WestonTest.test_weston_can_initialize_new_wayland_compositor: SKIPPED (0.00s) RESULTS - weston.WestonTest.test_weston_running: SKIPPED (0.00s) RESULTS - weston.WestonTest.test_weston_supports_xwayland: SKIPPED (0.00s) RESULTS - xorg.XorgTest.test_xorg_running: SKIPPED (0.00s) SUMMARY: core-image-minimal () - Ran 70 tests in 22.173s core-image-minimal - OK - All required tests passed (successes=14, skipped=56, failures=0, errors=0) NOTE: recipe core-image-minimal-1.0-r0: task do_testimage: Succeeded NOTE: Tasks Summary: Attempted 1305 tasks of which 1304 didn't need to be rerun and all succeeded. (From OE-Core rev: f4e865062cec06586d8c38c05d86a5b0d727625c) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cmake.bbclass: refactor cmake argsAdrian Freihofer2023-09-101-19/+24
| | | | | | | | | | Make the details of the cmake configure arguments available to d.getVar(). This allows to share them with devtool via tinfoil. (From OE-Core rev: 325fc8523bb5f62cd3754277aa34032cc0884861) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cmake.bbclass: cleanup spaces and tabsAdrian Freihofer2023-09-101-2/+4
| | | | | | | (From OE-Core rev: f1e96bf4ace090ff8ef9d311268ff068a0a3768e) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: Drop ';' delimiter from ROOTFS/IMAGE*COMMAND variablesRichard Purdie2023-09-098-34/+32
| | | | | | | | | | | | | Originally these were shell functions but they have long since been processed by bb.build.exec_func(). Since we no longer need shell syntax, we can drop the ';' delimiters and just use a space separated string. This cleans up the variable and quietly removes any stray ';' that do happen to still make it in. (From OE-Core rev: c3365dfd9ddd7fbe70b62e0f11166e57a8ca6f73) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-target-config: Map rust target to OE targetKhem Raj2023-09-071-0/+2
| | | | | | | (From OE-Core rev: caca883b524a767d970d934744b0f2b0ef743e20) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* goarch.bbclass: Add loongarch64 to go_map_archZang Ruochen2023-09-071-0/+2
| | | | | | | (From OE-Core rev: 97010a9c1b2bfc7ea01441f37c0682bc5cd4349b) Signed-off-by: Zang Ruochen <zangruochen@loongson.cn> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: Add force flag to rm callsRyan Eatmon2023-09-021-2/+2
| | | | | | | | | | | | The latest 6.5 kernels do not appear to create the source file in ${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source so the recipe errors out when trying to remove it. Simple fix is to add the -f (force) flag to the call. (From OE-Core rev: 2e669bf797b15d803e7d6a700e449bdc467a4bcc) Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cml1: Fix KCONFIG_CONFIG_COMMAND not conveyed fully in do_menuconfigJaeyoon Jung2023-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Variable overrides in KCONFIG_CONFIG_COMMAND do not work as expected due to double quote mismatches. The issue is reproducible in an environment where gold is the default linker. Below is an example snippet of run.do_terminal generated by do_menuconfig. do_terminal() { exec sh -c "make menuconfig CC="aarch64-webos-linux-gcc ..." LD="aarch64-webos-linux-ld.bfd ..." ... } Although LD override is set to bfd correctly, it is not passed to make and make menuconfig ends up with messages like: | gold linker is not supported as it is not capable of linking the kernel proper. | scripts/Kconfig.include:56: Sorry, this linker is not supported. (From OE-Core rev: 9c483765db762dbe8020423c8778518612b7e5f7) Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/image_types: Add vfat image typeJoshua Watt2023-08-301-0/+15
| | | | | | | | | | | | | | | Adds support for creating FAT formatted file system images (useful for boot partitions on some SoCs). Note that FAT partitions are limited in what they can represent (no symlinks or device files), so they can't really be used for general purpose root file systems. As such, they are skipped when testing for that purpose. (From OE-Core rev: 440fa508d362b8a449beb1b82dd999e980b753b7) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cmake.bbclass: fix allarch override syntaxChen Qi2023-08-291-4/+4
| | | | | | | | | | The override syntax should be ":allarch" instead of "_allarch". (From OE-Core rev: bea74c9942a3bb4f71aca0f722b4a7306ae52fb4) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipes/classes/scripts: Drop SRCPV usage in OE-CoreRichard Purdie2023-08-241-1/+1
| | | | | | | | Now that SRCPV isn't needed we can simplify things in a few places... (From OE-Core rev: 843f82a246a535c353e08072f252d1dc78217872) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-recipe: add cargo_c.bbclassFrederic Martinsons2023-08-211-0/+41
| | | | | | | | | | | | | This class can be used inside rust recipe to generate a rust library that can be called by C/C++ code. The rust recipe which uses this class has to only replace "inherit cargo" by "inherit cargo_c". (From OE-Core rev: 1e4862db1d6293872b76b62acee1e4a5e2597367) Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bin_package.bbclass: Inhibit the default dependenciesPeter Kjellerstedt2023-08-211-0/+3
| | | | | | | | | | Nothing is being built so there is no need for the cross-compiler. (From OE-Core rev: d1d09bd4d7be88f0e341d5fccbfbefeb98d4b727) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gi-docgen: depend on qemu-usermode MACHINE_FEATURESRoss Burton2023-08-211-3/+4
| | | | | | | | | | gi-docgen uses GObject Introspection, so depends on qemu-usermode working. (From OE-Core rev: 524eab0e39c53ea9006b95c9e08ea1f071f1d1f2) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass:: update do_write_config vardepsRoss Burton2023-08-161-1/+1
| | | | | | | | | Add OBJCOPY and EXEWRAPPER_ENABLED, remove LD as it isn't used anymore. (From OE-Core rev: 920f6cb25c06fde679f641a076a8e17dc36a828e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: add MESON_TARGETRoss Burton2023-08-161-1/+4
| | | | | | | | | | | Add a variable to control what target gets built in do_compile. By default this value is unset so meson builds the default target, but by setting MESON_TARGET a specific target can be built. (From OE-Core rev: bd82ccc819ec90af08216fe780af6a66f1d347b3) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel.bbclass: Use KERNEL_STRIP instead of STRIPKhem Raj2023-08-161-1/+1
| | | | | | | | | | | | | | | | Kernel uses its own variables KERNEL_* instead of general toolchain env variables, therefore use KERNEL_STRIP here explicitly, Problems happen when using llvm-strip as default STRIP in distro settings, since kernel defaults to using gcc, system does not stage llvm/clang toolchain into kernel's staging sysroot and this function ends up with FileNotFoundError: [Errno 2] No such file or directory: 'riscv64-yoe-linux-llvm-strip' (From OE-Core rev: 2db0ef8fe6381c893791ad645748f6e7c8134e5f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-target-config: fix target_features for vfpv3d16Benjamin Bara2023-08-141-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | A build with vfpv3d16 (armv7at2hf-vfpv3d16) tune currently warns: '+d16' is not a recognized feature for this target (ignoring feature) This correlates with the supported target_features for arm[1]. With the now enabled features, rustc might use vdiv.f64 with register d17, which leads to an illegal instruction on the given platform. Therefore, adapt the features s.t. they correspond to the armv7_unknown_linux_gnueabihf target[2]. Additionally, only set the latest supported version of VFP. [1] https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_codegen_ssa/src/target_features.rs#L32 [2] https://github.com/rust-lang/rust/blob/1.70.0/compiler/rustc_target/src/spec/armv7_unknown_linux_gnueabihf.rs#L15 (From OE-Core rev: d79f0a0702b667625e12c9e131932e02cb08bada) Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>