summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
Commit message (Collapse)AuthorAgeFilesLines
* base: Add virtual/cross-XXX recipe specific provider control handlingmaster-nextRichard Purdie9 hours1-2/+2
| | | | | | | | | | | | | | | | | | | Currently, providers are set on a global config basis. This change allows for a select set of providers configured in RECIPE_VIRTUAL_PROVIDERS to be selected on a per recipe basis. This would allow for the selection of virtual/cross-cc as gcc or clang for example. Note that this only works for values in DEPENDS, values in task[depends] flag values need to use the ${PREFERRED_PROVIDER_virtual/xxx} method, as used in this patch in a handful of places. The PROVIDERS are removed from the recipes so that if a version of the dependency accidentally slips through, the build will fail and the user can correct the issue. (From OE-Core rev: c0d87f578ef1ca9ec69f807b1ab45453ae54d406) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/recipes: Switch virtual/XXX-gcc to virtual/cross-cc (and c++/binutils)Richard Purdie9 hours4-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of the base class dependency is to say "yes, I need a C cross compiler" and this was never meant to be gcc specific. Looking at the codebase, whilst we code triplets into this, it does overcomplicate things as there are only ever limited, "target", "sdk" and the class extended versions like mutlilib. After much thought, we can simplify this to virtual/cross-cc and virtual/cross-sdk-cc. This lets us remove the "gcc" specific element as well as removing the over complicated triplet usage. At the same time, change the much less widely used "g++" variant to "c++" for similar reasons and remove the triplet from virtual/XXX-binutils too. Backwards compatibility mappings could be left but are just going to confuse things in future so we'll just require users to update. This simplification, whilst disruptive for any toolchain focused layers, will make improved toolchain selection in the future much easier. Since we no longer have overlapping variables, some code for that can just be removed. The class extension code does need to start remapping some variables but not the crosssdk target recipe names. This patch is in two pieces, this one handles the renaming with the functional changes separate in a second for easier review even if this breaks bisection. (From OE-Core rev: 5335fdd619d8131989787c6075e89c2a52f06c4d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: capture RuntimeError tooMikko Rapeli9 hours1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runqemu can fail with RuntimeError exception: $ git grep RuntimeError meta/lib/oeqa/core/ meta/lib/oeqa/core/target/qemu.py: raise RuntimeError("FAILED to start qemu - check the task log and the boot log") meta/lib/oeqa/core/target/qemu.py: raise RuntimeError("FAILED to start qemu - check the task log and the boot log %s" % (msg)) $ bitbake core-image-base ... /home/builder/src/base/meta-arm/build/../poky/meta/recipes-core/images/core-image-base.bb:do_testimage WARNING: core-image-base-1.0-r0 do_testimage: Target didn't reach login banner in 1000 seconds (10/31/24 14:12:36) WARNING: core-image-base-1.0-r0 do_testimage: Last 25 lines of login console (22962): ... [ 12.676391] EXT4-fs (vda2): mounted filesystem 41dc66e6-d693-46b3-a5d6-a46998500609 r/w with ordered data mode. Quota mode: disabled. [ 13.080423] /dev/disk/by-label/root: Can't open blockdev [ 13.081201] /dev/disk/by-label/root: Can't open blockdev ERROR: There's no '/dev' on rootfs. ... ERROR: core-image-base-1.0-r0 do_testimage: Error executing a python function in exec_func_python() autogenerated: The stack trace of python calls that resulted in this exception/failure was: File: 'exec_func_python() autogenerated', lineno: 2, function: <module> 0001: *** 0002:do_testimage(d) 0003: File: '/home/builder/src/base/meta-arm/build/../poky/meta/classes-recipe/testimage.bbclass', lineno: 122, function: do_testimage 0118: dump-guest-memory {"paging":false,"protocol":"file:%s.img"} 0119:} 0120: 0121:python do_testimage() { *** 0122: testimage_main(d) 0123:} 0124: 0125:addtask testimage 0126:do_testimage[nostamp] = "1" File: '/home/builder/src/base/meta-arm/build/../poky/meta/classes-recipe/testimage.bbclass', lineno: 364, function: testimage_main 0360: orig_sigterm_handler = signal.signal(signal.SIGTERM, sigterm_exception) 0361: try: 0362: # We need to check if runqemu ends unexpectedly 0363: # or if the worker send us a SIGTERM *** 0364: tc.target.start(params=d.getVar("TEST_QEMUPARAMS"), runqemuparams=d.getVar("TEST_RUNQEMUPARAMS")) 0365: import threading 0366: try: 0367: threading.Timer(int(d.getVar("TEST_OVERALL_TIMEOUT")), handle_test_timeout, (int(d.getVar("TEST_OVERALL_TIMEOUT")),)).start() 0368: except ValueError: File: '/home/builder/src/base/meta-arm/build/../poky/meta/lib/oeqa/core/target/qemu.py', lineno: 91, function: start 0087: except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as err: 0088: msg += "Error running command: %s\n%s\n" % (blcmd, err) 0089: msg += "\n\n===== end: snippet =====\n" 0090: *** 0091: raise RuntimeError("FAILED to start qemu - check the task log and the boot log %s" % (msg)) 0092: 0093: def stop(self): 0094: self.runner.stop() Exception: RuntimeError: FAILED to start qemu - check the task log and the boot log ... Summary: 1 task failed: /home/builder/src/base/meta-arm/build/../poky/meta/recipes-core/images/core-image-base.bb:do_testimage log: /home/builder/src/base/meta-arm/build/tmp/work/qemuarm64_secureboot-poky-linux/core-image-base/1.0/temp/log.do_testimage.1578012 If the exception is not cought, cooker processes will be leaked. bitbake commands will connect with the leaked cooker processes which may cause other odd behavior later on. (From OE-Core rev: f7e62bfef239a5525946fabc96dc561949b12757) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package: Add debug_frame supportMathieu Othacehe9 hours1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On ARMv7, the .ARM.extab and .ARM.exidx unwinding sections are not providing support to get full backtraces on C++ exceptions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117941 In addition to those unwinding sections, GCC is providing unwinding instructions in DWARF format for ARMv7 binaries under the .debug_frame section. By instructing 'strip' not to remove the .debug_frame section, one can use libunwind on the .debug_frame section to get full backtraces on C++ exceptions: Unexpected exception caught! Backtrace: 0x4b0c7d: unexpected_handler() + 0x1b 0xb6dded55: __cxxabiv1::__terminate(void (*)()) + 0x3 0xb6ddedb7: std::terminate() + 0x9 0xb6ddf023: __cxa_rethrow + 0x2d 0x4b0c61: uncaught_function() + 0x7 0x4b0c9f: main + 0x11 0xb6c317c7: __libc_start_call_main + 0x41 0xb6c31871: __libc_start_main + 0x5f 0x4b0901: _start + 0x27 Add a 'PACKAGE_KEEP_DEBUG_FRAME' variable to keep the .debug_frame section around. By using libunwind + minidebuginfo, that provides a way for ARMv7 Yocto users to get full backtraces on C++ exceptions, on target. (From OE-Core rev: 35bd7c0c64e558ce8f792e5a23fccd54ce3c533b) Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/ptest-python-pytest: simplify python ptest file overridingDerek Straka42 hours1-8/+14
| | | | | | | | | | | | The complexity of overriding files from the bbclass made the behavior at times hard to follow and predict. This change replaces the default file with a heredoc equivalent that creates a default file if the user does not provide their own version of run-ptest in the SRC_URI. (From OE-Core rev: be3db5f4f1b857b93d08211019d9ff796ec389b6) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-target-config: Update the data layout for x86 , ppc , riscv64 , aarch64 ↵Deepesh Varatharajan42 hours1-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and loongaarch64 targets. ----------------------------------------------------------------------------------------- error: data-layout for target `x86-linux`, `e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128`, differs from LLVM target's `i686-unknown-linux-gnu` default layout, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128` error: data-layout for target `powerpc-linux`, `E-m:e-p:32:32-i64:64-n32`, differs from LLVM target's `powerpc-unknown-linux-gnu` default layout, `E-m:e-p:32:32-Fn32-i64:64-n32` error: data-layout for target `x86_64-poky-linux-gnux32`, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128`, differs from LLVM target's `x86_64-poky-linux-gnux32` default layout, `e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128` ------------------------------------------------------------------------------------------- Rust commits for updating the data layouts: x86: https://github.com/rust-lang/rust/commit/dbff90c2a7c751cf9d6843cd585429beb100c17d x86_64-x32: https://github.com/rust-lang/rust/commit/ec55a05374d89d206be5140a4759af92f1b42f15 aarch64: https://github.com/rust-lang/rust/commit/4d397d33da8aff64419a03694d152c8250916f19 ppc: https://github.com/rust-lang/rust/commit/ad7ea8b7e690e6000006b6fde630a2c8c4385019 riscv64gc: https://github.com/rust-lang/rust/commit/f414715ebfda201f91f80ef9f28d9923d614d1c4 loongaarch64: https://github.com/rust-lang/rust/commit/4a06a5bc7ad259023e4373e794687adfce252dac (From OE-Core rev: 5136176198d4d150afa39b50dc4e879f5b206909) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemu/machine: rename QEMU_EXTRAOPTIONS for consistencyRoss Burton4 days1-2/+2
| | | | | | | | | | | | | | | | | The per-tune qemu options variable is QEMU_EXTRAOPTIONS_${TUNE_PKGARCH}, but this doesn't follow the pattern of all of the other tune-specific variables in the machine configuration which is VARIABLE:tune-[name]. Rename QEMU_EXTRAOPTIONS_${TUNE_PKGARCH} to QEMU_EXTRAOPTIONS:tune-${TUNE_PKGARCH} for consistency. Note that this will mean that BSPs need to update any assignments of this variable. (From OE-Core rev: 7f981d074442b901f7e64dbdb9db851ff31c3733) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/qemu: move QEMU_EXTRAOPTIONS for PPC to the relevant tunesRoss Burton4 days1-9/+0
| | | | | | | | | | Every other architecture has the QEMU_EXTRAOPTIONS assignments in the tune files, so move the PPC ones too. (From OE-Core rev: ba05251c89d8cc243e861886124573c83197e949) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/qemu: use tune to select QEMU_EXTRAOPTIONS, not package architectureRoss Burton4 days1-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | Using the package architecture to select the right qemu options to pass to qemu-user is incorrect, and fails for recipes that set PACKAGE_ARCH to MACHINE_ARCH (as the qemuppc workarounds suggest) because there are not typically any options set for the machine name. Solve this by using TUNE_PKGARCH instead: for the majority of recipes this is the same value, but for machine-specific recipes it remains the same instead of changing to the machine name. This means we can remove the qemuppc workarounds, as they're obsolete. Also update the gcc-testsuite recipe which uses the same pattern to use TUNE_PKGARCH, and generalise the else codepath to avoid needing to update the list of architectures. [ YOCTO #15647 ] (From OE-Core rev: 414b754a6cbb9cc354b1180efd5c3329568a2537) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/nativesdk: also override TUNE_PKGARCHRoss Burton4 days1-0/+1
| | | | | | | | | | | | | | The nativesdk class overrides PACKAGE_ARCH and unsets TUNE_FEATURES, but as recipes might want to look at TUNE_PKGARCH too (for example, when setting QEMU_EXTRAOPTIONS) we should also override that variable. Otherwise, a nativesdk recipe will have the TUNE_PKGARCH of the target, which leads to errors (eg passing mips arguments to an arm qemu). (From OE-Core rev: 05322beb290e1db30bef49b4364f8a8e6e9f7408) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* native: Improve ${PN}-XXX package name handlingRichard Purdie6 days1-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a recipe has something like: RPROVIDES:${PN}-xxx = "yyy" then the current code will turn this into: RPROVIDES:${BPN}-native-xxx = "yyy-native" which can lead to errors. Add in some handling for this special case in the class extension code. The corresponding entry in PACKAGES is correctly remapped, the variables aren't remapped to match though. Note that merging this does trigger new dependencies to be exposed, some of which can't be met or are incorrect. These need to be fixed on a case by case basis. There was also a problem in the existing code when handling anonymous python in PACKAGES since it would pass bizarre package names like "d)}" to the remapping code. This patch changes it to ignore anonymous python since in the native case, this likely isn't wanted anyway. This also then avoids ${PN}-ptest in the native case which was a common dependency problem. (From OE-Core rev: e2fd81e221c25fc21d532e020ddd8aaac0c22ede) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* autotools: remove aclocal --automake-acdir, relocated so knows the right pathRoss Burton6 days1-6/+0
| | | | | | | | | | | | | | A relocated aclocal in the native sysroot has the right paths already: $ cat /work/ross/build/tmp/work/cortexa57-poky-linux/expect/5.45.4/recipe-sysroot-native/usr/bin/aclocal my @automake_includes = ('/work/ross/build/tmp/work/cortexa57-poky-linux/expect/5.45.4/recipe-sysroot-native/usr/share/aclocal-' . $APIVERSION); Thus there is no need to tell aclocal the path explicitly. (From OE-Core rev: 002e03132b8ba1f1b254c8a63ff70db2a5d16518) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* autotools: log when we're removing aclocal.m4Ross Burton6 days1-0/+1
| | | | | | | | | | | | | Some mysterious autotools errors are because upstream has a custom aclocal.m4 that we're deleting it unless we know we're not even running aclocal. There's a case to be made for removing this deletion logic on the grounds that aclocal should know what it is doing, but for now make it clear that we're deleting a file by saying so in the task log. (From OE-Core rev: d6efd938af8a8260ae464edf4388afea73293ec7) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: add support for DTBOsQuentin Schulz8 days1-0/+6
| | | | | | | | | | | | | | | | | | | | Also known as FDTO, DTO or Device Tree Overlay. This adds a new property per label in extlinux.conf for which device tree overlays to apply on top of the base device tree (the one specified in FDT or guessed by the bootloader if only FDTDIR is set). It is a space-separated list of paths to the .dtbo file(s). Note that the base FDT needs to have symbols enabled (DTC_FLAGS needs to have -@ in it) for an overlay to be applicable. This is only applicable for non-FIT setups. (From OE-Core rev: 3ac21b32b5f5616cc7c0641fb3132eec9b27e5b7) Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-extlinux-config.bbclass: simplify FDT/FDTDIR logicQuentin Schulz8 days1-6/+4
| | | | | | | | | | | The three blocks share the same LABEL and KERNEL content, so let's factor that part out. (From OE-Core rev: 544c0f72774e17d1dca4664c0bc21f8281dade5b) Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/ptest-python-pytest: add a new class to consolidate pytest ptest ↵Derek Straka8 days1-0/+31
| | | | | | | | | | | | | | | | | | | | | functionality A large number of python packages leverage the pytest unit test framework for their ptest functionality. Currently, many of the tests have duplicate code for: 1. Installing pytest files 2. Declaring ptest dependencies 3. Script for executing tests (run-ptes) To simplify adding common pytest based ptests, added a new class enabling base functionality. Users can also override the location of the pytest files in addition to using their own version of run-ptest [RP: Minor whitespace tweaks to shell function and missing prepend space] (From OE-Core rev: d66009e608256d42b2d6573d4614a99eb13fd3f1) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gettext: update 0.22.5 -> 0.23.1Alexander Kanavin12 days1-2/+2
| | | | | | | | | | | | | | | | | Drop patches: parallel.patch (obsolete as no .a files are installed) 0001-intl-Fix-build-failure-with-make-j.patch (backport) Gettext no longer installs anything into $libdir/gettext by default but still creates the directory and so it should be packaged. (From OE-Core rev: a414f47009811fa6886e43fd2b4c928a906a65f3) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image/populate_sdk: Support usrmerge in toolchain SDK buildsPhilip Lorenz13 days2-26/+27
| | | | | | | | | | | | | SDKs which aren't built from an image recipe should also come with drop-in symlinks for `/bin`, `/lib` and `/sbin`. Support this by moving the common functionality into `populate_sdk_base` and enabling the symlink creation when the `usrmerge` DISTRO_FEATURE is on. (From OE-Core rev: 8e1e86cc9d5d4e866ff0ab62c8954db0e65c19e6) Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/features_check: Make PARSE_ALL_RECIPES and SOURCE_MIRROR_FETCH booleanRobert Yang2024-12-231-1/+1
| | | | | | | | | | So that value "0" can turn them off. (From OE-Core rev: 1a2afcd0773c5ec5946d1dfc27bde585c52a5724) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: enable fetching kernel metadata using file fetcherChristian Taedcke2024-12-231-5/+8
| | | | | | | | | | | | If no destsuffix parameter is supplied and the file fetcher is used, the folder name (i.e. basepath) is added to the kernel-meta search directories. (From OE-Core rev: e46cc8159136ce96489e10f126405781abfbd52e) Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* populate_sdk_ext: write_local_conf add shutil importMark Hatle2024-12-181-0/+2
| | | | | | | | | | | Add shutil import to resolve error: Exception: NameError: name 'shutil' is not defined, Did you forget to import 'shutil' (From OE-Core rev: b64263a43b4d82f1ebba13815bccb8a8cd3127f9) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/pypi: update the default UPSTREAM_CHECK_URI to use the simple repo APIDerek Straka2024-12-171-3/+17
| | | | | | | | | | | | | | Update the UPSTREAM_CHECK_URI to leverage the simple repo API. The project URLs require javascript which breaks the version checking fetch and subsequent logic. The simple repo API provides similar functionality with a well defined spec which is used by tools such as pip. Also update the UPSTREAM_CHECK_REGEX to be compatible with the information retrieved via the API (From OE-Core rev: 10febb0e8193d15aec8bbf80b849ae6732da3c22) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: do not automatically add Also servicesAdrian Freihofer2024-12-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting a systemd service “Also” does not mean that both services must be in the same package. However, the systemd.bbclass enforces this. Example: a.service: [Install] Also=b.service If a.service is packed in package A, b.service is automatically packed into package A as well. This happens even if b.service is explicitly added to package B using FILES and SYSTEMD_SERVICE variables. The automatic packing of socket files with the corresponding service files is probably a widely used feature of systemd.bbclass. This bahavior does not change. Adding regular service files to a package just because it is another service in the same package that "Also" uses the service is a bug that this commit fixes. (From OE-Core rev: f836d80eb48a2a2f9b1e66980021755cf0ca2a26) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* systemd.bbclass: refactor adding filesAdrian Freihofer2024-12-171-16/+12
| | | | | | | | | | | | | | | The keys variable was intended as an array of keys. But it looks like this has not been used for more than 10 years now. Adding files automatically to packages needs probably anyway very specific code rather than a generic loop. Lets simplify this a bit. Using python code should also not be slower for these usually small files. (From OE-Core rev: 0eda7131bf743719d6586ccd36d99cbe11c88262) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rpm: replace use of rpm2cpio with rpm2archiveAlexander Kanavin2024-12-122-2/+0
| | | | | | | | | | | | | | rpm2cpio has been deprecated upstream, so this prepares for its eventual removal. rpm2archive produces a tar archive which can be uncompressed with tar executable from the host. (From OE-Core rev: ed824d3fb23f0c89d8dfdacb2c4ef0b7c21a5144) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "uboot-sign: fix U-Boot binary with public key"Ryan Eatmon2024-12-091-1/+7
| | | | | | | | | | | | | This reverts commit 0d14e99aa18ee38293df63d585fafc270a4538be. The patch removed logic required for correct handling of UBOOT_SUFFIX=img or UBOOT_SUFFIX=rom. We need to find a better way to handle the fix for [YOCTO #15649]. (From OE-Core rev: 5e82d33451b5662df1e7fe2518a50644d18aa70d) Signed-off-by: Ryan Eatmon <reatmon@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cargo.bbclass: do not install libraries by defaultAlexander Kanavin2024-12-051-3/+5
| | | | | | | | | | | | | | | 'cargo install' only installs executables and examples into the system, and we should follow that. Libraries are vendored into build trees from the crate registry and then baked directly into executables. Neverthless, there's now a condition variable, so individual recipes can opt into installing libraries if there's a use case for it. (From OE-Core rev: 68990af9630da16fc75362ca09046ceab71a1106) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meson.bbclass: enable qemu exe wrapper in nativesdkAlexander Kanavin2024-12-051-2/+9
| | | | | | | | | | | | | | nativesdk builds are cross-builds like target ones, and so meson expectations regarding ability to run binaries are the same: either provide the wrapper, or disable the build time options that need executing target binaries during build time (if such options are made available by upstream). (From OE-Core rev: f210fc1d3db2e71f484bddc0b23ab252c36f4062) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: create-spdx: Fix variable dependenciesJoshua Watt2024-12-051-0/+3
| | | | | | | | | | | | A few variable dependencies were incorrect from the SPDX tasks, which prevented rebuilds from occurring, or caused them to occur when they should not. (From OE-Core rev: 38a5dd136b3a3713e63d23598011efe1c4b0f459) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib: move buildstats.py and rootfspostcommands.py into oeChen Qi2024-12-051-4/+4
| | | | | | | | | | | These two files are the only ones that are left in meta/lib. They logically belong to meta/lib/oe, so move them there. (From OE-Core rev: c65dd0e3e463d6072b9364ac74e1fef0d998068f) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-uboot: Support lzma compressed algorithmJamin Lin2024-11-281-0/+2
| | | | | | | | | | | | | | | | | | | Linux kernel supports to compress its output binary with lzma algorithm and U-Boot support to decompress lzma compressed image. Both xz and lzma algorithms are identical and users can use xz utility with format parameter to compress Image which supports lzma algorithm. Add the following command to support lzma. This command is refer to Linux kernel, https://github.com/torvalds/linux/blob/master/arch/powerpc/boot/wrapper "xz --format=lzma -f -6 linux.bin" (From OE-Core rev: 211178065bdca293c84c41a9a1e79c10df95b6ad) Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rust-target-config: Fix TARGET_C_INT_WIDTH with correct sizeHarish Sadineni2024-11-231-5/+5
| | | | | | | | | | | | | | | | [YOCTO #15600] The TARGET_C_INT_WIDTH value was incorrectly set to 64 instead of 32. It is updated for PPC, Mips, and riscv64 architectures. Discussion links for solution: https://lists.openembedded.org/g/openembedded-core/message/207486 https://lists.openembedded.org/g/openembedded-core/message/207496 (From OE-Core rev: b9df8cd8b29064d115dab3bfd1ea14f94a5c0238) Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* spdx: Fix SPDX tasks not running when code changesJoshua Watt2024-11-232-0/+5
| | | | | | | | | | | | | | | | The SPDX code makes heavy use of python classes. While this works very well, the bitbake dependency parser is unable to understand how to deal with them, and thus changes to the class code do not cause rebuilds to occur. To correct this, add the library files that include SPDX code as file checksums for the SPDX tasks. If this method works well for SPDX, we will look at implementing something similar in the bitbake dependency parser that should allow correct checksums without having to explicitly add them to each class. (From OE-Core rev: 6ac3033b77a0d1f7ab15801c5c65931adede3923) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-sign: fix U-Boot binary with public keyClayton Casciato2024-11-231-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes [YOCTO #15649] The U-Boot binary in the "deploy" directory is missing the public key when the removed logic branch is used. The simple concatenation of the binary and DTB with public key works as expected on a BeagleBone Black. Given: MACHINE = beaglebone-yocto UBOOT_SIGN_KEYNAME = "dev" Post-patch (poky/build/tmp/deploy/images/beaglebone-yocto): $ hexdump -e "16 \"%_p\" \"\\n\"" u-boot-beaglebone-yocto.dtb \ | tr -d '\n' | grep -o 'key-dev' key-dev $ hexdump -e "16 \"%_p\" \"\\n\"" u-boot.img \ | tr -d '\n' | grep -o 'key-dev' key-dev Non-Poky BeagleBone Black testing (Scarthgap): U-Boot 2024.01 [...] [...] Using 'conf-ti_omap_am335x-boneblack.dtb' configuration Verifying Hash Integrity ... sha256,rsa4096:dev+ OK Trying 'kernel-1' kernel subimage [...] (From OE-Core rev: 0d14e99aa18ee38293df63d585fafc270a4538be) Signed-off-by: Clayton Casciato <majortomtosourcecontrol@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-recipe/python_pep517: remove all RECORD filesRoss Burton2024-11-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python modules install metadata into a .dist-info directory, one of which is RECORD, which contains the files that were installed and their checksum[1]. This is typically used by pip to validate the install, or to know what files to remove when the module is uninstalled. This is slightly problematic when we need to do patching of installed .py files in do_install(), as the RECORD file has already been written at that point. However, the RECORD files only really have a use outside of a system- managed environment, which our python packages are. We already have commands to verify and remove modules (opkg, dpkg, rpm) and the RECORD file existing simply allows people to 'sudo pip' and alter the package- managed directories outside of the package manager. This is not a good idea, and some other distros remove the RECORD file to stop this possibility: - Debian[2] - Fedora[3] - Gentoo[4] We can follow for all packages which inherit python_pep517, which is the majority of the Python packages now. [1] https://peps.python.org/pep-0491/#the-dist-info-directory [2] https://salsa.debian.org/python-team/tools/dh-python/-/blob/master/dhpython/fs.py?ref_type=heads#L185 [3] https://src.fedoraproject.org/rpms/pyproject-rpm-macros/blob/rawhide/f/macros.pyproject#_105 [4] https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73c49f3c00415dee99407dabba8d3b22895c9d25 (From OE-Core rev: 917df5ed022f9512473fe0971db48b5253c97b85) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Handle /var/log being volatileRichard Purdie2024-11-211-0/+1
| | | | | | | | When /var/log is volatile, capturing just the symlink isn't useful. Fix this. (From OE-Core rev: 06bb8069b023c6b71f3c7dd87a6c2bebc5820083) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass: change test failure logging from bb.fatal() to bb.error()Mikko Rapeli2024-11-211-2/+2
| | | | | | | | | | | | | | | | | | | | | bb.fatal() exists right away while bb.error() does some cleanup before exiting. Fixes running tests during image build with TESTIMAGE_AUTO multiple times in a row when some of the tests fail: $ killall -9 Cooker ; bitbake -c clean core-image-base ; \ bitbake core-image-base ; \ bitbake core-image-base With bb.fatal() something in cleanup is not done and second image build builds an empty rootfs into .wic image. Workaround is to kill Cooker processes between bitbake calls, or to switch testimage.bbclass from bb.fatal() to bb.error() logging which is done here. (From OE-Core rev: 077bdd26e6c5bd161f082524ceee9e90d56315b5) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cython: swap prefix-mapping patch for an upstream commitRoss Burton2024-11-211-3/+0
| | | | | | | | | | | | | Upstream has solved the absolute path problem differently by taking paths relative to the top of the module. This appears to solve the problem, at least I've not found any cases where it breaks. Drop my patch, and backport the relevant commit from upstream. (From OE-Core rev: 47f7808dd93e50fb3ecddbf980e40e51dd7376cb) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-recipe/cython: handle builds with no .c sourcesRoss Burton2024-11-181-1/+1
| | | | | | | | | | | | | | | | This didn't seem to be possible considering the entire point of Cython is to generate C bindings, but some Python build systems remove the build tree once the wheel has been generated, so we never get to see the sources. As xargs will call the specified command even without any files this results in sed failing. Pass --no-run-if-empty so that this case doesn't result in an error. (From OE-Core rev: f1c1bdb05ea8f79a14a4b53e110889b70881f4d7) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* python_mesonpy: remove cython-specific INSANE_SKIPsRoss Burton2024-11-121-4/+0
| | | | | | | | | | These INSANE_SKIPs are specific to cython and unrelated to mesonpy, so remove them. The new cython.bbclass should resolve the cause. (From OE-Core rev: abe08a3238d162a1bdbc68172307eb3eb127bbb1) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-recipe: add cython classRoss Burton2024-11-121-0/+11
| | | | | | | | | | | | | | | Recipes that use Cython typically also do some bespoke fixup. Add a class to centralise the logic: - Set CYTHON_PREFIX_MAP to stop build paths appearing in generated objects - Strip "Cython Metadata" blocks from generated code that ends up in the -src package (From OE-Core rev: 9752da112b618362d2fe1b61c8939b8410e98553) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uki.bbclass: fix debug print logging levelMikko Rapeli2024-11-121-1/+1
| | | | | | | | | Missing/unknown log level triggers a warning. (From OE-Core rev: ab2d1eeb4cad7ef8791954b36f8123cb35b8c000) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* uboot-sign: fix concat_dtb argumentsClayton Casciato2024-11-121-1/+1
| | | | | | | | | | | | Fixes [YOCTO #15642] Ensure empty argument passed from do_uboot_assemble_fitimage is passed to concat_dtb (From OE-Core rev: b3c473785e5ceef677ff2b77c5fc17f5704c622f) Signed-off-by: Clayton Casciato <majortomtosourcecontrol@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-recipe/core-image: drop debug-tweaks IMAGE_FEATURERoss Burton2024-11-073-14/+15
| | | | | | | | | | | | | | | | | | | Remove the 'debug-tweaks' IMAGE_FEATURE. It sounds friendly and kind to developers, but it results primarily in an image which root can login remotely without a password. This is incredibly useful for local development and testing purposes, but we really want to be explicit that this is what is happening instead of hiding it behind a vague "debug tweaks" statement. To preserve the eixsting behaviour, debug-tweaks should be replaced with these features: allow-empty-password empty-root-password allow-root-login post-install-logging (From OE-Core rev: 2c229f9542c6ba608912e14c9c3f783c3fa89349) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: allow early exit to configuration auditBruce Ashfield2024-11-071-0/+5
| | | | | | | | | | | | | | | | With the ability to tag raw configuration fragments as "hardware", there is a chance that badly behaved fragments throw warnings or cause other issues that are not applicable during development (or you understand the risk). Allow kernel configuration audit to be skipped if KMETA_AUDIT is not set (by default it is), to provide a flag for control over auditing. (From OE-Core rev: a39a1f7cf78ad1ca07438bce634a47e970f25047) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: allow cfg fragments to be specified as requiredBruce Ashfield2024-11-071-1/+4
| | | | | | | | | | | | | | | | | | | | When .scc files are used, a configuration fragment can be declared as "hardware" (required) or "non-hardware" (optional). By default the configuration audit only warns about hardware options. We can extend that default level of auditing to configuration fragments that are on the SRC_URI or in KERNEL_FEATURES by adding the ability to put a specifier after the fragment. i.e. KERNEL_FEATURES:append = 'hardening.config:required' This is particular useful for fragments that are outside of the kernel-cache (in a layer, in a kernel tree, etc) (From OE-Core rev: 0a84a3dd00543adffdef4fcf5381faab2984541e) Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* kernel-yocto: Support in-tree config fragmentsPaul Barker2024-11-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | [This is currently an RFC as it depends on a separate patch to add support for config fragments with .config file extensions in yocto-kernel-tools: https://lists.yoctoproject.org/g/linux-yocto/message/14431] In Linux 6.8, the in-tree rv32_defconfig file for 32-bit RISC-V support was dropped in favour of a Makefile target which combines the RISC-V defconfig with a config fragment '32-bit.config'. So to build for 32-bit RISC-V using the in-tree configuration from an upstream kernel, we need to be able to enable this 32-bit config fragment. We can support this via KERNEL_FEATURES if we add the in-tree arch config directory (arch/${ARCH}/configs) to the search path. While we're here, let's also add the generic config directory (kernel/configs) to the search path so in-tree config fragments such as 'hardening.config' can be used. (From OE-Core rev: e4e50a9a93d606ba5fef8f10f1ec20deaed7ab9c) Signed-off-by: Paul Barker <paul@pbarker.dev> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: support tar.zst SDK_ARCHIVE_TYPEMing Liu2024-10-281-2/+10
| | | | | | | | | | | | | | | | | zst is much faster than the default xz, test result on my Precision 5680 machine: Installing a tar.xz SDK takes 37 seconds while tar.zst only takes 17 seconds. Let's introduce support for tar.zst. Also add a sanity check for supported archive types. (From OE-Core rev: 1d22562a89e91f19b818b8f9bc214be941303980) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes-global/license: Move functions to library codeJoshua Watt2024-10-251-7/+7
| | | | | | | | | | | | | | Moves several of the functions in license.bbclass to be library code New function dependencies were manually verified using bitbake-dumpsigs to ensure that bitbake identified the same dependencies even though they are now in library code (although the new function names mean that the task hashes still change) (From OE-Core rev: 0333e04e353991260c5f67a72f80f3ab9dcf526a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic bootimg-efi.py: change UKI support from wic plugin to uki.bbclassMikko Rapeli2024-10-251-1/+2
| | | | | | | | | | | | | | | | | | | Remove custom wic plugin implementation and use systemd ukify reference implementation when generating UKI images. Fail if users still have create-unified-kernel-image in wic image config. uki.bbclass use is detected from IMAGE_CLASSES variable ("inherit uki" in image recipe) so export that to wic plugins. If UKI is used, then only generate a minimal loader config for systemd-boot which basically just sets a timeout. Also set 5 second timeout by default instead of failing if wic bootloader config is missing. Boot menu is generated at runtime based on UKI binaries found from ESP partition. (From OE-Core rev: 725fed6ea40c7443b5e0e69dc1dd9c38ac814c56) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>