summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* runqemu: respect IMAGE_LINK_NAMEMartin Jansa2023-04-141-18/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * when searching for qemuboot.conf * don't assume that IMAGE_LINK_NAME is always <rootfs>-<machine> (with <rootfs>-<machine>.qemuboot.conf) * runqemu: use IMAGE_LINK_NAME set by testimage.bbclass or query with bitbake -e * testimage.bbclass was setting DEPLOY_DIR which I don't see used anywhere else, so I assume it was supposed to be DEPLOY_DIR_IMAGE as mentioned in corresponding runqemu code, do the same with IMAGE_LINK_NAME variable * add virtual/kernel as bitbake -e target in run_bitbake_env to make sure IMAGE_LINK_NAME is defined (kernel-artifact-names.bbclass inherits image-artifact-names.bbclass as well) * improve .qemuboot.conf search 1st search for file matching the rootfs and only when not found try again with .rootfs suffix removed [YOCTO #12937] (From OE-Core rev: 82b7a8d5e81d766d0a5c2d0fef0f4c13a8f80c31) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 716eb55bb963db7b02d985849cb025898aabc855) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* Revert "runqemu: Add workaround for APIC hang on pre 4.15 kernels on qemux86"Khem Raj2023-04-141-5/+0
| | | | | | | | | | | | | | | | | This reverts commit 82e67b82ea8e12aa0b7b9db1d84fec0436dec71b. It was commited as part of https://bugzilla.yoctoproject.org/show_bug.cgi?id=12301 for kernels < 4.15, as of now oldest builder kernel we have is 4.15 on ubuntu 18.04 so we should not require this workaround. Moreover, this fixes an smp problem with qemux86 where no matter what -smp <x> option is used, qemu always starts with single core. (From OE-Core rev: 3479caf1eb1a67c53722ca774bfd94145b3669b5) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit fa8a7c0608fc800c48d0ff1cd832ad63c51eeab1) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* filemap.py: enforce maximum of 4kb block sizeAndrew Geissler2023-04-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The logic in this script validates that the length of data sections are evenly divisible by the block size. On most systems the block size is 4KB and all is good. Some systems though, such as ppc64le, have a block size larger then 4KB. For example on a POWER9 based ppc64le system, the block size is 64KB. This results in this script failing with errors like this when building wic images: |440, in _do_get_mapped_ranges | assert extent_len % self.block_size == 0 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | AssertionError In this case the data section size was 268KB and the block size was 64KB, resulting in the above assert failure. Resolves https://bugzilla.yoctoproject.org/show_bug.cgi?id=15075 (From OE-Core rev: 303cc9ce3a9d7ca85542f12ebfda27eeb449e73b) Signed-off-by: Andrew Geissler <geissonator@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1e23b803af6991fc20e4a4e88a0ef0541399e722) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/lib/buildstats: handle top-level build_stats not being completeRoss Burton2023-04-041-0/+1
| | | | | | | | | | | | | | | | | | If we try to parse a buildstats directory which was either aborted or is still being built then the top-level build_stats file doesn't contain an elapsed value which causes an exception: UnboundLocalError: local variable 'elapsed' referenced before assignment Default both start and elapsed to 0 so that the parse succeeds. (From OE-Core rev: 6c9ca2f2de98c84d11beccbfde7c1e26cb25dfb6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 701d985aa8f2e9c2b9c0736fa25b424f3701889e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* pybootchart: Fix extents handling to account for cpu/io/mem pressure changesRichard Purdie2023-03-251-0/+6
| | | | | | | | | | | | The previous addition of pressure values to the chart didn't fix the extents function which meant the bottom of the chart was cut off. Fix that. (From OE-Core rev: abbeea66297cfaf77bca9550400be37b39486b57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cc8cef69e717e08f80d10f775f0fffc644267b59) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* pybootchartui: Fix python syntax issueRichard Purdie2023-03-251-1/+1
| | | | | | | | | | | | | | Fix: scripts/pybootchartgui/pybootchartgui/parsing.py:134: SyntaxWarning: "is" with a literal. Did you mean "=="? if pid is 0: (From OE-Core rev: ea87507b74effff0521e72c6484e7d6107e5786e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c9a6511ae618035b8efad01646e37ba28ce1e3f8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/resulttool: fix typo breaking resulttool log --ptestRoss Burton2023-03-251-1/+1
| | | | | | | | | | | | | ptestresult_get_log() looked for a key called 'ptestresuls.sections', which should be 'ptestresult.sections' (From OE-Core rev: dc5097e6692ff123a48d9af749f4e66b58056b04) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7c8c9f7283e54bf8b1521fbaad7dceb66a8fcdbb) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/upgrade: do not delete the workspace/recipes directoryAlexander Kanavin2023-03-251-3/+0
| | | | | | | | | | | | | | If it exists, there is no need to delete it, and if it does not, devtool prints an ugly traceback. (From OE-Core rev: bb350782ba1a66f1cf0d3e043000f5e1535cf961) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit af82e59e8f08369aabd5fa6eb43022982d4e59a7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: kill qemu if it hangsMikko Rapeli2023-03-061-9/+15
| | | | | | | | | | | | | | qemu doesn't always behave well and can hang too. kill it with force if it was still alive. Move clean up commands into cleanup() function. (From OE-Core rev: 9047a07bc8a8c440cb30c6bb49710362eae41330) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 079c2935d2f585ce49e1c7daab2155fcf0094c48) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/buildstats: handle tasks that never finishedRoss Burton2023-03-061-6/+27
| | | | | | | | | | | | | If a task is aborted the buildstats file isn't complete, so calculate when the build finished and use that as a end time. (From OE-Core rev: 51e5e085400bb818d43ad82ffcf8548665bbd1d0) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 23ebaec476dc46aebe5997f025661137f3e341bd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix usage of fstype=none in wicPavel Zhukov2023-03-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | This allows to specify partition with fstype=none in the wks file to have partition created but without following mkfs. The none fstype is in the list already but the usage is not documented. Example; part /data --ondisk mmcblk0 --fstype=none --align 4096 --fixed-size 512 will create a partition, filesystem may be created manualy on the host or target and data will be preserved if the device is reflashed using same wks. Works with bmaptool and probably does not work with dd. Use case is persistent filesystem/data between reflashing of the image. (From OE-Core rev: 5f7239eebe61aabbd3dbf4e6e1cf703c71273a35) Signed-off-by: Pavel Zhukov <pavel@zhukoff.net> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 351cb64da37aa43113e5192605d04436652aa3b8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove True option to getVar and getVarFlag calls (again)Martin Jansa2023-02-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | * True is default since 2016 and most layers were already updated not to pass this parameter where not necessary, e.g. oe-core was updated couple times, first in: https://git.openembedded.org/openembedded-core/commit/?id=7c552996597faaee2fbee185b250c0ee30ea3b5f Updated with the same regexp as later oe-core update: https://git.openembedded.org/openembedded-core/commit/?id=9f551d588693328e4d99d33be94f26684eafcaba with small modification to replace not only d.getVar, but also data.getVar as in e.g.: e.data.getVar('ERR_REPORT_USERNAME', True) and for getVarFlag: sed -e 's|\(d\.getVarFlag \?\)( \?\([^,()]*, \?[^,()]*\), \?True)|\1(\2)|g' \ -i $(git grep -E 'getVarFlag ?\( ?([^,()]*), ?([^,()]*), ?True\)' \ | cut -d':' -f1 \ | sort -u) (From OE-Core rev: f12fcb8a3f3d11c981c223569f8f40ec705c837a) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 26c74fd10614582e177437608908eb43688ab510) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: process local files only for the main branchAlexander Kanavin2023-01-151-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devtool modify/upgrade are not currently equipped to handle conditional local files in SRC_URI, and provide only the main no-override set in a workspace under source/component/oe-local-files/ (this is done via meta/classes/devtool-source.bbclass). On the other hand, updating the changes from workspace into a recipe is run iteratively against all overrides; this works for patches (as they all are directed into their own override branches in the workspace git source tree), but breaks down when trying to match local files in a workspace against local files in overridden SRC_URI lists, resulting in bad recipe breakage. (there's an additional twist here: existing code has a guard against this but the guard relies on metadata in workspace .bbappend that is only there in modify operations, but not upgrades. This commit replaces the guard with a general check that will work everywhere). Implementing multiple sets of local files is significant work; let's for now simply not touch local files in recipes except when on the no-override variant. Also, adjust the selftest cases to include conditional local files in sample recipes, so the situation is covered by the tests. (From OE-Core rev: b2dfb2fe86de887d0239078ded0a4f9e8c677d83) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3a8654b860fa98f94e80c3c3fff359ffed14bbe7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool/upgrade: correctly handle recipes where S is a subdir of upstream treeAlexander Kanavin2023-01-062-18/+19
| | | | | | | | | | | | | | | | | 'devtool modify' writes additional settings to workspace .bbappend so that this can be handled correctly, but 'devtool upgrade' does not. This adds the missing settings. In particular, local files should not anymore mysteriously disappear from SRC_URIs on upgrades. (From OE-Core rev: 31a778f1a6a77ee9b44b3fd995046bf6dd0af835) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 0817aa5537a8d7cc9591c53dfaa1d225f4c327f7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Allow OE-Core to be testedRichard Purdie2022-12-235-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | For unknown reasons we've never seemingly run the check layer script against OE-Core itself. This isn't entirely straightforward as the core layer is a bit of a special case, we can't for example compare signatures against ourselve and we can't remove core from bblayers.conf. Core does have distro, machine and software components too, in the case of distro, our fallback default settings. Whilst the qemu machines could be split into a seperate layer directory, core wouldn't then parse at all standalone due to the lack of any machine so it seems a bit pointless to do that. These changes tweak the script to handle core's special cases, specifically to allow distro and machine directories and to account for the README placed a directory level higher than other layers. (From OE-Core rev: 4efc5ec83bc97e5731284ef3879f89fda4b8ef0b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit ba312ed228507d05f280aeb96819d671b01400b8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* combo-layer: add sync-revs commandRoss Burton2022-12-231-4/+23
| | | | | | | | | | | | | | | | When starting to use combo-layer, or if someone else is using it too, the local last_revision may be incorrect. This command will forcibly update the last_revision config values to the latest SHA on the remote branch that is tracked. (From OE-Core rev: 8c681c9e56065fac26088b4d2c7f22c09088a9b5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2bb5d12ecd1b0273983f7c05699f34dd64b11c25) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* combo-layer: dont use bb.utils.renameRoss Burton2022-12-231-1/+1
| | | | | | | | | | | | | | | Bitbake may not be configured, and bb isn't imported anyway. Instead just use os.rename(), and take the filename from the file object instead of duplicating logic. (From OE-Core rev: acc824693463a06c77951ce913dbd356e48f711e) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 528f4fb3683d048537604e4562ea758968060d62) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* combo-layer: remove unused importRoss Burton2022-12-231-1/+0
| | | | | | | | | | (From OE-Core rev: ae6c752a7056b956e83a6ff1c351bdaa1c53a7fd) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ebfab6c3034d41252d19c6e1a0ba79072aa51146) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/buildstats: fix parsing of trees with reduced_proc_pressure directoriesRoss Burton2022-12-231-2/+2
| | | | | | | | | | | | | | | | The /proc/pressure support in buildstats is creating directories in the buildstats tree called reduced_proc_pressure, which confuses the parsing logic as that cannot be parsed as a name-epoc-version-revision tuple. Explicitly skip this directory to solve the problem. (From OE-Core rev: a764aa876342724fc3520a3e97389c8678f18681) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 24f0331f0b7e51161b1fa43d4592b491d2037fe9) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: convert-overrides: Allow command-line customizationsJoshua Watt2022-12-231-46/+57
| | | | | | | | | | | | | | | | Adds argument parsing to the conversion script so that the fields that the script uses to do conversions can be customized on the command line. The intention is to allows easier customization without having to fork the script, and allow automated checking on 3rd party layers via CI without false positives (From OE-Core rev: 3e3e787d5501911604b8e194ff99cc0c54f93045) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit b9551f9180bf9f13fb1c480b5b7892fdc831ffcd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: make ext2/3/4 images reproducibleSergei Zhmylev2022-11-241-5/+24
| | | | | | | | | | | | | | | | Ext2/3/4 FS contains not only mtime, but also ctime, atime and crtime. Currently, all the files are being added into the rootfs image using mkfs -d functionality which affects all the timestamps excluding mtime. This patch ensures these timestamps inside the FS image equal to the SOURCE_DATE_EPOCH if it is set. (From OE-Core rev: e0dc0f4a153f75d14d50d5bc91edb93fac93cd25) Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 75d2dd0ea7790db2e8ee921784ca373abff2df65) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: swap partitions are not added to fstabciarancourtney2022-11-141-1/+1
| | | | | | | | | | | | - Regression in 7aa678ce804c21dc1dc51b9be442671bc33c4041 (From OE-Core rev: 8fdb75c0f0f7458305ccae657cf2722520e00572) Signed-off-by: Ciaran Courtney <ciaran.courtney@activeenergy.ie> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit f1243572ad6b6303fe562e4eb7a9826fd51ea3c3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: honor the SOURCE_DATE_EPOCH in case of updated fstabSergei Zhmylev2022-11-093-2/+10
| | | | | | | | | | | | | | | In case user requested to build a binary repeatable package, it's required to honor the SOURCE_DATE_EPOCH environment variable. So forcefully set mtime inside all the routines which modify fstab in case it is updated. (From OE-Core rev: 4d3f43fe06186b6580395a161fdbc4470b8aab62) Signed-off-by: Sergei Zhmylev <s.zhmylev@yadro.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 99719a3712a88dce8450994d995803e126e49115) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Fix gl-es argument from causing other arguments to be ignoredJoshua Watt2022-11-041-1/+1
| | | | | | | | | | | | | The code to parse arguments was inadvertently skipping all arguments in the elif block after gl-es if it was specified on the command line. (From OE-Core rev: dd1dcfada1fa46ecb8227c2852769b35026875d3) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 718bb8d56f6a24c86e67830a7d13af54df2ebb4e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Do not perturb script environmentJoshua Watt2022-11-041-12/+14
| | | | | | | | | | | | | | | | | | | | | | | Instead of changing the script environment to affect the child processes, make a copy of the environment with modifications and pass that to subprocess. Specifically, when dri rendering is enabled, LD_PRELOAD was being passed to all processes created by the script which resulted in other commands (e.g. stty) exiting with a failure like: /bin/sh: symbol lookup error: sysroots-uninative/x86_64-linux/lib/librt.so.1: undefined symbol: __libc_unwind_link_get, version GLIBC_PRIVATE Making a copy of the environment fixes this because the LD_PRELOAD is now only passed to qemu itself. (From OE-Core rev: 91c2449d4e873b2cec8777d71e218a12f899669d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 2232599d330bd5f2a9e206b490196569ad855de8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-check-sstate: force build to run for all targets, specifically ↵Ross Burton2022-10-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | populate_sysroot Since the commit "populate_sdk_base/images: Drop use of 'meta' class and hence do_build dependencies"[1], builds of images or SDKs don't recursively depend on the top-level do_build target. This is typically a good thing: images just depend on the packages themselves and those dependencies already exist, but they don't need each recipes sysroot to be populated. However, eSDK generation is partly done via the script oe-check-sstate, which does a 'dry-run' build of the target and collates all of the sstate that is used. With this commit the sstate that is used is a fraction of what would be needed in the SDK, specifically there are no sysroots populated during the build, so there are no sysroots in the SDK. This is obviously a problem, as the entire point of an eSDK is to contain a sysroot. Resolve this problem by forcing bitbake to run the build task for all targets, so that all potentially needed sstate is collated. [YOCTO #14626] [1] https://github.com/openembedded/openembedded-core/commit/41d7f1aa2cc9ef5dba4db38435402d4c9c0a63e1 Tested-by: Andrej Valek <andrej.valek@siemens.com> (From OE-Core rev: 1b62344f919b5122f048b6409d09386d7d6dd3cd) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-check-sstate: cleanupRoss Burton2022-10-251-6/+2
| | | | | | | | | | | The scriptutils import isn't used, there's no need to run bitbake in a shell environment, and invoke bitbake as a list instead of a string. (From OE-Core rev: 663aa284adf312eb5c8a471e5dbff2634e87897d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install-buildtools: support buildtools-make-tarball and update to 4.1Paul Eggleton2022-10-251-4/+16
| | | | | | | | | | | | Support installing buildtools-make-tarball that is built in version 4.1 and later for build hosts with a broken make version. Also update the default version values to 4.1. (From OE-Core rev: 5d539268d0c7b8fad1ba9352c7f2d4b81e78b75c) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-setup-builddir: do not read TEMPLATECONF from templateconf.cfgAlexander Kanavin2022-09-291-11/+3
| | | | | | | | | | | | | | | | | | | Also, write to it only if it does not already exist. As discussed here[1], reading from templateconf.cfg serves no purpose: it exists only if the build directory has already been initialized, and so the scripts will not change anything in the build directory anyway. My adjustment is to keep the file however; it is useful as a pointer to the original template, which can be utilized by config management tools in the future. [1] https://lists.openembedded.org/g/openembedded-architecture/topic/template_handling_in_oe_core/93968540 (From OE-Core rev: bcfaeb8ed503ce1a5add3ec882f0e0c3bccfd3d2) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "wic/plugins/images/direct: Allow changes in fstab on rootfs"Ross Burton2022-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Commit 20d43a2 allows changes in fstab for the / mount. However, if the fstab contains / already then this results in two entries for / in the fstab, which is confusing and results in systemd producing errors on boot: systemd-fstab-generator[11101]: Failed to create unit file /run/systemd/generator/-.mount, as it already exists. Duplicate entry in /etc/fstab? Wic should be extended to support merging mount points in fstab, but as we're about to release revert the patch that introduced this change as it hasn't been in a release yet, and the issue which prompted the patch in the first place can be revisited post-release. [ YOCTO #14865 ] (From OE-Core rev: 4a7b3ef0a69b7e08030519b712a6fe4dd199c571) 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>
* create-pull-request: don't switch the git remote protocol to git://Martin Jansa2022-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Many git repos prefer https:// nowadays and many removed support for git://. This breaks the script when using github.com even when selected remote is ssh (git@github.com:openembedded/...), it will re-write it to git:// before calling git pull-request causing: openembedded-core $ scripts/create-pull-request -u github -b jansa/artifacts -o pull-kernel NOTE: Assuming local branch HEAD, use -l to override. fatal: unable to connect to github.com: github.com[0: 140.82.121.3]: errno=Connection timed out warn: No match for commit ea003bd026aa24bb4c8b7562f44ed6512e921259 found at git://github.com/shr-distribution/oe-core warn: Are you sure you pushed 'jansa/artifacts' there? ERROR: git request-pull reported an error (From OE-Core rev: 64c466920b808c35d1ac87b47cf438bc79becea7) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: display host uptime when startingAlexandre Belloni2022-09-121-0/+6
| | | | | | | | | | | In order to be able to debug issues on the host that have an impact on the guest, it is useful to get the uptime of the host while starting so we can match with the events in dmesg. Also include the uptime when cleaning up. (From OE-Core rev: 2d96499823f7de6e16a461426491e015ba63c1ec) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-setup-builddir: do not suggest local.conf as a source of examplesAlexander Kanavin2022-09-091-2/+1
| | | | | | | | | | | | This holds true for the default core/poky template, but not anything else. Eventually there will be fragments and associated tooling. (From OE-Core rev: 3e4015d54e91ce4d312964b036784576a4b22566) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-setup-builddir: Always update templateconf.cfgPeter Kjellerstedt2022-09-081-3/+1
| | | | | | | | | | | | | | | | | | | | | The intent of the templateconf.cfg file is to cache the value of $TEMPLATECONF. To do this, it needs to be updated in case TEMPLATECONF is manually specified. Before, the following commands: TEMPLATECONF=foo . oe-init-build-env TEMPLATECONF=bar . oe-init-build-env . oe-init-build-env would cause the templates in foo to be used for the last source of oe-init-build-env, while afterwards, bar is used as expected. (From OE-Core rev: 37c122dfdac03a98bf2bf8c8f7676ec25136d402) 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>
* oe-setup-builddir: Keep templateconf.cfg relative if $TEMPLATECONF isPeter Kjellerstedt2022-09-081-2/+5
| | | | | | | | | | | | | | | | Before commit 7b96dc80 (scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is set up), the path written to templateconf.cfg was relative if $TEMPLATECONF was relative, but afterwards it became absolute. Restore the original behavior of saving the relative path to templateconf.cfg. (From OE-Core rev: 49e75009780a09873dc3987ae1c40f2ac95bc667) 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>
* oe-setup-builddir: Avoid shellcheck warningsPeter Kjellerstedt2022-09-081-9/+9
| | | | | | | | | | | | | | | This avoid the following warnings: * SC2086: Double quote to prevent globbing and word splitting. * SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. * SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. * SC2236: Use -n instead of ! -z. (From OE-Core rev: a5aa5065d5ebe9f320cb1415c6ff4d5d5772f630) 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>
* oe-setup-builddir: Simplify error handlingPeter Kjellerstedt2022-09-081-18/+11
| | | | | | | | (From OE-Core rev: 670f255bf639ca19a396ee67ec7d78094da2f576) 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>
* oe-setup-builddir: Correct when validation of the templates dir is runPeter Kjellerstedt2022-09-081-5/+5
| | | | | | | | | | | | The validation of the templates directory is supposed to be run as long as $TEMPLATECONF is defined, but it was only done if the directory did not exist. (From OE-Core rev: dcca9ee6f06e9eacd6507f57bd0a5012ea343aa9) 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>
* scripts/oe-setup-builddir: make environment variable the highest priority ↵Alexander Kanavin2022-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | source for TEMPLATECONF This sets the following order: 1. TEMPLATECONF set in the unix environment (for example as a prefix to '. oe-init-build-env'). 2. If empty then $BUILDDIR/conf/templateconf.cfg 3. If absent then $OEROOT/.templateconf (oe-init-build-env sets OEROOT to where it is, which is poky or oe-core). I believe this is more logical and consistent with common practice; it also avoids situations where the user is stuck with cryptic errors because templateconf.cfg contains something invalid and that something cannot be overridden from command line. (From OE-Core rev: 7296c42b8c58e6e08f4210eb7b51d852b1ee950e) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-setup-builddir: write to conf/templateconf.cfg after the build is ↵Alexander Kanavin2022-09-031-4/+4
| | | | | | | | | | | | | set up This was done before any of the sanity checks or actual setup, which resulted in templateconf.cfg always getting written out, whether it would be valid or not, and the user becoming stuck with it. (From OE-Core rev: 7b96dc80298af6f669c885056a80a48bdd50e547) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/files/layers.schema.json: drop the layers propertyAlexander Kanavin2022-09-021-10/+0
| | | | | | | | | | | | | | | | | This is a leftover from one of the RFC iterations, where the property contained available machines, distros and templates. As all of those were dropped from the final version, there is no reason to list the layers either anymore. Normally this would be a backwards incompatible change, but as the layer setup itself was just merged, I think we can do a quick fixup :-) (From OE-Core rev: 64a774de0e154ef81f20853fec903b17d9985a72) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-setup-builddir: migrate build/conf/templateconf.cfg to new ↵Alexander Kanavin2022-09-021-0/+6
| | | | | | | | | | | | | | template locations This is done only for default oe-core/poky templates; for anything else the locations themselves need to be migrated first, and there is no way to tell where they would be. (From OE-Core rev: 9da0dd350a451676e3d4a1f09f90ec0234047ab7) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-setup-layers: add a script that restores the layer configuration ↵Alexander Kanavin2022-09-011-0/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from a json file This script can be used directly from poky or oe-core, or can be copied directly into alayer or any other repository - it is self-suffucient and requires only python3 and git on the host where it will run. It is also copied by the bitbake-layers layers-setup plugin together with the json, unless requested otherwise. 1. How to restore the layers from the saved configuration: a) Clone the bootstrap layer or some other repository to obtain the json config and the setup script that can use it. (use 'bitbake-layers create-layer-setup' from the previous commit to create them) b) Running with default options: (note: this will work to update an existing checkout as well) alex@Zen2:/srv/work/alex/my-build$ meta-alex/setup-layers Note: not checking out source meta-alex, use --force-bootstraplayer-checkout to override. Setting up source meta-intel, revision 15.0-hardknott-3.3-310-g0a96edae, branch master Running 'git init -q /srv/work/alex/my-build/meta-intel' Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/meta-intel' in /srv/work/alex/my-build/meta-intel Running 'git fetch -q origin || true' in /srv/work/alex/my-build/meta-intel Running 'git checkout -q 0a96edae609a3f48befac36af82cf1eed6786b4a' in /srv/work/alex/my-build/meta-intel Setting up source poky, revision 4.1_M1-372-g55483d28f2, branch akanavin/setup-layers Running 'git init -q /srv/work/alex/my-build/poky' Running 'git remote remove origin > /dev/null 2>&1; git remote add origin git://git.yoctoproject.org/poky' in /srv/work/alex/my-build/poky Running 'git fetch -q origin || true' in /srv/work/alex/my-build/poky Running 'git remote remove poky-contrib > /dev/null 2>&1; git remote add poky-contrib ssh://git@push.yoctoproject.org/poky-contrib' in /srv/work/alex/my-build/poky Running 'git fetch -q poky-contrib || true' in /srv/work/alex/my-build/poky Running 'git checkout -q 11db0390b02acac1324e0f827beb0e2e3d0d1d63' in /srv/work/alex/my-build/poky 2. Command line options: alex@Zen2:/srv/work/alex/my-build$ meta-alex/setup-layers -h usage: setup-layers [-h] [--force-bootstraplayer-checkout] [--destdir DESTDIR] [--jsondata JSONDATA] A self contained python script that fetches all the needed layers and sets them to correct revisions optional arguments: -h, --help show this help message and exit --force-bootstraplayer-checkout Force the checkout of the layer containing this file (by default it is presumed that as this script is in it, the layer is already in place). --destdir DESTDIR Where to check out the layers (default is /srv/work/alex/my-build). --jsondata JSONDATA File containing the layer data in json format (default is /srv/work/alex/my-build/meta-alex/setup-layers.json). (From OE-Core rev: 58f94471675aef9ac6d15637ac5d8e69cc304c7a) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-setup-builddir: add a check that TEMPLATECONF is validAlexander Kanavin2022-09-011-0/+5
| | | | | | | | | | | | | | specifically that ../../layer.conf exists, and that second-from-last component in the path is 'templates'. This requires tweaking template.conf creation in eSDK bbclass, as we need to ensure that the path in it is valid, and exists (which may not be the case if the SDK is poky-based). (From OE-Core rev: c6f2b57be8893ee58f20cc29d8ec3a5a6edf7c07) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/runqemu.README: fix typos and trailing whitespacesUlrich Ölmann2022-08-311-8/+8
| | | | | | | (From OE-Core rev: 217b00d378f359689613ca4c0666bb2eed040f69) Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: do not leave behind source trees in workspace/sourcesAlexander Kanavin2022-08-211-3/+13
| | | | | | | | | | | | | | | | | | | | These are typically auto-extracted with modify/upgrade from recipes and can be easily recreated. On the rare occasions where they need to be reused, they are still available under workspace/attic (which is already used for old recipes and appends), so nothing gets lost. This avoids the annoyance of devtool refusing to proceed because there is a previous source tree in workspace/sources. For independent source trees behave as before: do nothing. Adjust the test that previously deleted those trees by hand. (From OE-Core rev: 9bfb95d070d68d5ab5adfe0ea096f5fbf9cad8b0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add 'none' fstype for custom imageJeongBong Seo2022-08-122-1/+5
| | | | | | | | | | | | | | | | | It's not possible to set the label (of gpt entry) normally when I want to use non-listed fstype as a rawcopy. Example) part ? --source rawcopy --ondisk mmcblk0 --label mypart --sourceparams file=mypart.raw To resolve this problem, this patch addes a 'none' fstype and ignore do_image_label on rawcopy (that actually set the partition label.) (From OE-Core rev: 949cf797eb54f3d22a093910087e937633ce9b23) Signed-off-by: JeongBong Seo <jb.seo@lge.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Update for class changesRichard Purdie2022-08-121-1/+1
| | | | | | (From OE-Core rev: 0ea8afd4f9599469d1a23824c451c62eabb76660) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: Add copyright statements to files without oneRichard Purdie2022-08-1232-3/+71
| | | | | | | | | | Where there isn't a copyright statement, add one to make it explicit. Also drop editor config lines where they were present and add license identifiers as MIT if there isn't one. (From OE-Core rev: deb3ccec53e0bd63bc4235cf2b0d3fc781687361) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* relocate_sdk.py: ensure interpreter size error causes relocation to failPaul Eggleton2022-08-081-2/+8
| | | | | | | | | | | | | | If there is insufficent space to change the interpreter, we were printing an error here but the overall script did not return an error code, and thus the SDK installation appeared to succeed - but some of the binaries will not be in a working state. Allow the relocation to proceed (so we still get a full list of the failures) but error out at the end so that the installation is halted. (From OE-Core rev: c5a9a448e462d3e5457e8403c5a1a54148ecd224) Signed-off-by: Paul Eggleton <paul.eggleton@microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>