summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* nativesdk-intercept: Fix bad intercept chgrp/chown logicEilís 'pidge' Ní Fhlannagáin2024-11-022-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Running either of these ends up corrupting the os.execv args. If we run: ./scripts/nativesdk-intercept/chown -R foo:foo bar The loop here ends up missing the conversion of foo:foo to root:root because it sees sys.argv[0] and assumes that it's the user:group argument and that we should convert that. We end up a os.execv(path, args) that have the following args: ['root:root', '-R', 'foo:foo', 'bar'] As os.execv ignores args[0], we can just populate it with sys.argv[0] and then loop through sys.argv[1:]. As both chgrp and chown would have either flags and USER[:GROUP] next, this fixes the issue. (Backported from OE-Core rev: 2a75f647ec7696d353f4b09099d777ba53f34d36) (From OE-Core rev: ed009b5d58914582c0770222115fc5c5a16bf16d) Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/install-buildtools: Update to 4.0.21Aleksandar Nikolic2024-10-071-3/+3
| | | | | | | | | Update to the 4.0.21 release of the 4.0 series for buildtools. (From OE-Core rev: e6170a6c9ea419d2fdc4e4ceb04c8a399b4a3b43) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* install-buildtools: fix "test installation" stepAleksandar Nikolic2024-10-071-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Test installation" step fails with some harmless error messages (see [1]). This can however make a user think that the buildtools have not been installed correctly. Two reasons for the error messages: - some envvars in the environment-setup-<arch>-pokysdk-linux file start and end with double quotes (e.g., PATH) and are as such written into python os.environ. This leads that their usage is not valid later when testing the installation. This patch removes the double quotes before writing, if they are present. - if installation directory (install_dir), given through the option --directory, is given as a relative path, checking if the path to a tool (e.g., gcc) in buildtools starts it will always fail. This patch converts the install_dir variable to an absolute path. [1] ERROR: Something went wrong: tar not found in ./build-tools ERROR: Something went wrong: installation failed (From OE-Core rev: 69dfedfa7ee8cf1666e1292ef25028b978131fe0) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e4eb0b14ecf9bd2fba13260441c9d86eb348f41e) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* install-buildtools: remove md5 checksum validationAleksandar Nikolic2024-10-071-17/+10
| | | | | | | | | | | | | | | No need to validate with the md5 checksum, as the file is not even uploaded to the Yocto release webpage (the download never failed due to a wrong indentation of an else statement). For validation purposes, use the sha256 checksum only. (From OE-Core rev: b331769084996ffeb74007fe6ca7e385edd7a577) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b740d2f9d40aef1e18c022d1e82b4fb2c5c1fc22) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* install-buildtools: support buildtools-make-tarball and update to 4.1Paul Eggleton2024-10-071-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: 5348a4999e19bcd002c7d4558067a38870e172d2) 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> (cherry picked from commit 5d539268d0c7b8fad1ba9352c7f2d4b81e78b75c) Signed-off-by: Aleksandar Nikolic <aleksandar.nikolic@zeiss.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* runqemu: keep generating tap devicesKonrad Weihmann2024-09-271-10/+14
| | | | | | | | | | | | | | | | | | | | | in case there is no tap device the script tries to generate a new one. The new device is then unguarded for a moment, so the newly generated device could be acquired by a different instance or user, before it is locked to the instance with acquire_taplock. To fix that keep generating new tap devices in case the lock can't be acquired up to 5 times. If no tap device can be locked it fails in the existing error handling (From OE-Core rev: 23876576d054ebbab9b02c0012782aa56feda123) (From OE-Core rev: 5215635442949a62f502e839ddf1f12e790e5e37) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts: python 3.12 regexAdrian Freihofer2024-03-019-38/+38
| | | | | | | | | | | | | | | | | | | | | | | All the regexes throw a warning like this: WARNING: scripts/lib/recipetool/create_buildsys.py:140: SyntaxWarning: invalid escape sequence '\s' proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE) Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. (From OE-Core rev: 63998f13d5263ce19a60ed3fba1ac8b6f23558e3) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* runqemu: add qmp socket supportRoss Burton2024-03-011-0/+11
| | | | | | | | | | | | | | | | | Add support for qmp sockets and defaults to unix:qmp.sock if unspecified (From OE-Core rev: 31de620e9d899b93c6e982d3a563bbf618ce79c6) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 380631797f0d63124a8c21efa93ab672dbd79283 Qemu throws many warnings without qmp and many runtime tests fail without this patch also on kirkstone. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/runqemu: fix regex escape sequencesTrevor Gamblin2024-03-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | When invoking runqemu with Python 3.12, the following warning is encountered: |SyntaxWarning: invalid escape sequence '\.' This is because the interpreter scans the string before it is processed by the regex module, and it interprets the backslash as part of an escape sequence, but not a standard one. This will be registered as an error rather than a warning in future Python versions. To avoid the it, simply add an extra backslash so that Python doesn't misinterpret the string, while the regex parser still sees an escaped '.' character. (From OE-Core rev: 2f8982ef4c903f43867da56fcfd080a6556daa8b) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Backported from master: 0e8a4142bb90a92d175df6b2537d24a372356f98 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* recipetool/create_buildsys_python: use importlib instead of impChris Laplante2024-03-011-3/+2
| | | | | | | | | | | | | | | | 'imp' was deprecated in Python 3.4 and removed in 3.12. The piece of importlib we use has been around since 3.3. (From OE-Core rev: b9dcdf2346bb24866c5f3db96a3f79eba20e4662) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cherry-picked from master: 457f0dad87b4e45a53865b5ad2c150215bd74019 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* runqemu: direct mesa to use its own drivers, rather than ones provided by ↵Alexander Kanavin2024-02-281-24/+10
| | | | | | | | | | | | | | | | | | host distro With mesa 23.0, it is not longer possible to use the host drivers, as mesa upstream has added strict checks for matching builds between drivers and libraries that load them. Add a check and a hint to runqemu so that there is a helpful error when there is no native/nativesdk opengl/virgl support. (From OE-Core rev: 5103ce67741782e43612f495bcc851c6509b734b) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit f0946844df7270fe368858d8929e6b380675b78b) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* pybootchartgui: fix 2 SyntaxWarningsMartin Jansa2024-01-211-2/+2
| | | | | | | | | | | | | | | scripts/pybootchartgui/pybootchartgui/draw.py:820: SyntaxWarning: "is not" with a literal. Did you mean "!="? if (OPTIONS.show_pid or OPTIONS.show_all) and ipid is not 0: scripts/pybootchartgui/pybootchartgui/draw.py:918: SyntaxWarning: "is not" with a literal. Did you mean "!="? if i is not 0: (From OE-Core rev: ebd61290a644a6d9f2b3701e0e7ea050636da76c) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit 8d996616f0ca57220d939a41ca9ba6d696ea2a4f) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* wic: fix wrong attempt to create file system in upartitioned regionsMarkus Niebel2023-09-231-1/+1
| | | | | | | | | | | | | | | | | | The kickstart parser defaults fstype to "vfat". This leads to an attempt to create an empty file system even for regions configured with "--no-table" if used without fstype when no --sourceparams given. The fix tests for fstype "none" or no_table in Partition prepare method. This will omit the file system creation an the potential error for small region with --no-table option. (From OE-Core rev: af9f392a5e259b681077f25fa263965714a73a05) Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit db771a4cd36bf291a8b68edfd905e03243f2c8b3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* resulttool/report: Avoid divide by zeroRichard Purdie2023-09-231-1/+4
| | | | | | | | | | Avoid a divide by zero traceback if unfortunate test counts are encountered. (From OE-Core rev: b95c6a5278d44fddfbaea45cc78324f1e099187c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c5aeea53dfacb53dedb8445cb3523dc3a8cb6dca) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/create-pull-request: update URLs to git repositoriesMichael Opdenacker2023-09-231-5/+2
| | | | | | | | | | | | Also remove the git.pokylinux.org URL, no longer used. (From OE-Core rev: c88343380bd6a66f6e18637170c53b003594af7a) Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 47b88d143c2fc61ce0e03b7eb3a9dbcffadbf5b1) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* resulttool/resultutils: allow index generation despite corrupt jsonMichael Halstead2023-08-261-1/+5
| | | | | | | | | | | | | non-release indexes will continue to generate when test output is corrupted. (From OE-Core rev: 9467528e89d44a016a4c1e509a3a7da56ea20f74) Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1a9157684a6bff8406c9bb470cb2e16ee006bbe9) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* rpm2cpio.sh: update to the last 4.x versionAlberto Planas2023-08-191-10/+20
| | | | | | | | | | | | | | | | | openSUSE RPMs are compressing the RPM payload using zstd, that correspond to the magic ID 0x28, 0xb5, 0x2f. This patch update the script to the last version from the rpm project, and add support to this compression format, and extract the cpio payload using the "unzstd" binary. (From OE-Core rev: 9c0d66e693aa7ab8b3f2a3c68764e4ab6159c085) Signed-off-by: Alberto Planas <aplanas@suse.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3aba44a75dd565b192f7328f2a0150a313de3cc1) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/rpm2cpio.sh: Use bzip2 instead of bunzip2Pavel Zhukov2023-08-191-1/+1
| | | | | | | | | | | | | bzip2 is in HOSTTOOLS already and used in few other places already. This fixes bin_package class for RPM packages without adding bunzip2 to HOSTTOOLS. (From OE-Core rev: ed4e4290a73b3fa0df9530a511f992e236e8ae9f) Signed-off-by: Pavel Zhukov <pavel@zhukoff.net> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit eb3ec7469fff857c819332371ad1d586f43c79c3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* recipetool: Fix inherit in created -native* recipesYoann Congal2023-08-021-0/+4
| | | | | | | | | | | | native and nativesdk classes are special and must be inherited last : put them at the end of the gathered classes to inherit. (From OE-Core rev: 2c92780236b25205af0dcf75de2d2ede14132152) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a6614fd800cbe791264aeb102d379ba79bd145c2) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* wic: Add dependencies for erofs-utilsHeiko Thole2023-07-211-0/+1
| | | | | | | | | In order to build erofs filesystems, wic must have the erofs-utils package installed into its sysroot. (From OE-Core rev: c349c7fcb299b123824da9a13ee58222a6cbf9ec) Signed-off-by: Heiko Thole <heiko.thole@entwicklung.eq-3.de> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* pybootchartgui: show elapsed time for each taskMauro Queiros2023-07-211-0/+5
| | | | | | | | | | | | | | | | | | Currently, finding the elapsed time of each task in buildtimes.svg is a manual effort of checking the top axis and finding and subtracting the end and start time of the task. This change adds the elapsed time for each task, so that manual effort of comparing start/end time is avoided. (From OE-Core rev: b2678422b411ccbd19a7b198c872b92077567391) Signed-off-by: Mauro Queiros <Mauro.Queiros@criticaltechworks.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3efebd3404de548f0757863da237f2d18ce60013) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* devtool: Fix the wrong variable in srcuri_entryCharlie Wu2023-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | devtool crashes when running "update-recipe" and append changes on the recipe. "$ devtool update-recipe -a <layer> <recipe>" Traceback (most recent call last): ... File "/ovss/ovss_quanta/poky/scripts/lib/devtool/standard.py", line 1636, in srcuri_entry return 'file://%s%s' % (basepath, paramstr) ^^^^^^^^ NameError: cannot access free variable 'basepath' where it is not associated with a value in enclosing scope The input variable 'fname' should have the same meaning as the variable 'basepath'. Modify the 'fname' to 'basepath' and solve the issue. (From OE-Core rev: 1487bdda6b443480e9ce45d8b8527ad61c2a50a4) Signed-off-by: Charlie Wu <chiachiwu@google.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit c3231756bbc2cb5641204414ad3670d7f8607ed3) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/runqemu: allocate unfsd ports in a way that doesn't race or clash ↵Alexander Kanavin2023-07-121-11/+8
| | | | | | | | | | | | | | | | | | | | with unrelated processes There is already a neat check_free_port() function for finding an available port atomically, so use that and make two additional tweaks: - no need to allocate two separate ports; per unfsd documentation they can be the same - move lockfile release until after unfsd has been shut down and the port(s) used has been freed [YOCTO #15077] (From OE-Core rev: 343510b33650c88367f95e8d8322fae92ae901ca) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dee96e82fb04ea99ecd6c25513c7bd368df3bd37) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/runqemu: split lock dir creation into a reusable functionAlexander Kanavin2023-07-121-16/+13
| | | | | | | | | (From OE-Core rev: 2ada5f426e71e3873ba8c47dd925d8cfc103524b) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 004d6bcb067ecf1d796801fa43a98820c4efd3c7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* image_types: Fix reproducible builds for initramfs and UKI imgFrieder Paape2023-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | I've encountered issues reproducing initramfs and UKI image builds, which will be fixed with this patch. 1. initramfs There's a symbolic link to /sbin/init, which is appended to the cpio archive after creation. The links timestamp needs to be static and the cpio append command needs the '--reproducible' flag to produce deterministic outcomes. 2. Unified Kernel Image '--preserve-dates' is required for a static 'Time/Date' entry. I've added '--enable-deterministic-archives' although in my case this didn't change anything. (From OE-Core rev: 0d8890f7c1fbea5036acefa3031dcd442b316725) Signed-off-by: Frieder Paape <frieder@konvera.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fd027729bafb4e085ba0949e38e724f3a8cad102) Signed-off-by: Steve Sakoman <steve@sakoman.com>
* oe-depends-dot: Handle new format for task-depends.dotRusty Howell2023-07-121-1/+20
| | | | | | | | | | | | | | The .dot file created by `bitbake -g` changed formats a while ago, which broke oe-depends-dot. Also add some useful examples to the --help output. (From OE-Core rev: e53842ea6c14ed8e97252626e3ae0d3cf4580fbc) Signed-off-by: Rusty Howell <rustyhowell@gmail.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* wic/bootimg-efi: if fixed-size is set then use that for mkdosfsRandolph Sapp2023-05-101-0/+7
| | | | | | | | | | | | | | | This is a bit of a compatibility issue more than anything. Some devices get upset if the FAT file system contains less blocks than the partition. The fixed-size argument is currently respected by the partition creation step but not by the file system creation step. Let's make it so the file system respects this value as well. (From OE-Core rev: d16301ccdfb97bf126738262eec594008c282df1) Signed-off-by: Randolph Sapp <rs@ti.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
* scripts/lib/buildstats: handle top-level build_stats not being completeRoss Burton2023-04-111-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: 19815bb76e414a1c1fd8d31a84492d72dd29205e) 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>
* pybootchartui: Fix python syntax issueRichard Purdie2023-03-281-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: 2429ae83400af67b1cff2adb406ec84b3147ed5e) 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-281-1/+1
| | | | | | | | | | | | | ptestresult_get_log() looked for a key called 'ptestresuls.sections', which should be 'ptestresult.sections' (From OE-Core rev: 213ed03f5a15be639a97dca6f5bbf810f7ac2eb5) 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-281-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: 4ad488d2453525b7196e6d2406ac526412e3c560) 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-091-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: 929e7679c1d9b21ac5130a9cbc83c415fb9f63f5) 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-091-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: ffce2744f5833d1c30db7f50443503b3c1a1d119) 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-091-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: 9af61442c8bc2e0b447706734cb90b3f4bcb2d6b) 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: de7bf6689a19dc614ce4b39c84ffd825bee1b962) 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> (cherry picked from commit 24a86d0c55ee89ae0dc77975e1d0ee02898d2289) 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: 4760fac939a6204e3cb7dcd3699cd9a2508f9dee) 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: 22f210f9f4dfc9e13fdc229147fd1677db5a35ec) 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: 2d0641df27196ad029d95c52fb790122b2db3f9f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> 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: ba24231de6a3826558c9fcd403b075fc6772fffa) 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: 87543ed6550f7e78b3ddcfed0ef088bea932ba57) 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: 240c7dcad2f2e25efa269618c3bd6c549289207e) 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: 96cf8b322f4cdec31175cc2c1082e9e3bc488118) 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-131-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: b4afe3c1aaf5e8296e410ef01960f48a09dd717c) 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: da2c64b3158c58eb0a484d3acbdf0419df2d34e8) 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-201-1/+1
| | | | | | | | | | | | - Regression in 7aa678ce804c21dc1dc51b9be442671bc33c4041 (From OE-Core rev: 397676b3ad152b209916b152f1b77e772a2af14b) 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-103-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: 2671667f33d0eac1425db3fc4dff56d4eed1eb3c) 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-091-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: 45356f2ef90e4b67b890ca745513fafa32a469cf) 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> (cherry picked from commit dd1dcfada1fa46ecb8227c2852769b35026875d3) 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-091-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: 74911cf7ea703c54920a6c58c344a22a46398b02) 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-11-091-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: c6b8543fbd0e840483cbcdca93116cc9c994a9f2) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1b62344f919b5122f048b6409d09386d7d6dd3cd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-check-sstate: cleanupRoss Burton2022-11-091-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: 4b9946bd3961679048e1460bdfc74b286c386feb) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 663aa284adf312eb5c8a471e5dbff2634e87897d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>