summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2022-01-11qemuboot/runqemu: fully form the ip= kernel parameterAlexander Kanavin
New systemd is actually parsing this in systemd-network-generator and fails if it is not fully formed. 'off' means 'static ip, do nothing': https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-05scripts: Update to use exec_module() instead of load_module()Richard Purdie
This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-01-04scripts/buildhistory-diff: drop use of distutilsTim Orling
The use of distutils.version.LooseVersion to check for GitPython > 0.3.1 is not really needed anymore since any supported distribution has at least 1.0.0 (centos-7 via epel7, debian-9, ubuntu-16.04) If we want to reinstate this check, alternatives would be to require python3-packaging on all hosts and use packaging.version.Version or use an imported LooseVersion in bb.version. [YOCTO #14610] Signed-off-by: Tim Orling <timothy.t.orling@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-20recipetool: Separate licenses with & operatorStefan Herbrechtsmeier
Separate licenses with & operator since it should be satisfied most use cases and it is a reasonable assumption that all the licenses apply. Furthermore flat, split and sort the licenses to minimize license string changes. Separate package licenses with & operator: -LICENSE:${PN} = "MIT ISC" +LICENSE:${PN} = "ISC & MIT" Respect | and brackets in LICENSE: -LICENSE = "BSD-3-Clause & (ISC & | & MIT)" +LICENSE = "BSD-3-Clause & (ISC | MIT)" Sort licenses: -LICENSE = "MIT & BSD-3-Clause & ISC" +LICENSE = "BSD-3-Clause & ISC & MIT" Remove duplicates: -LICENSE = "MIT & ISC & MIT" +LICENSE = "ISC & MIT" Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-20recipetool: Sort output of guess_license function to be deterministicStefan Herbrechtsmeier
Sort the output of guess_license function by license file to be deterministic and to support self-testing. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-17runqemu: additional setting to force software rendering with sdl 2.0.18Alexander Kanavin
Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-09recipetool: Set master branch only as fallbackStefan Herbrechtsmeier
The commit 'meta/scripts: Manual git url branch additions (dc53fe75cc)' sets the branch= parameter too early to master and thereby breaks the -B/--srcbranch option. ERROR: branch= parameter and -B/--srcbranch option cannot both be specified - use one or the other Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-09runqemu: check the qemu PID has been set before kill()ing itRoss Burton
If runqemu is killed, check that we have a valid PID for the qemu before sending a kill() to it. [ YOCTO #14651 ] Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-04yocto-check-layer: Relax README case checksJoshua Watt
Relaxes the case requirements for checks in the README file so that word like "Maintainer" and "Patch" are allowed Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-04yocto-check-layer: disregard checks if referencing another README fileJon Mason
It is permissible to have a layer's README reference another README. If this is the case, avoid other checks. Do this by checking for the word README (case insensitive) in the README file. This might be too permissive, but follows the pattern of looking for exact words (like "patch" or "maintainer") in READMEs. Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-03yocto-check-layer: Add additional README checksDhruva Gole
This adds: - Test case to review if the README file specifies the maintainer. - Test case to review if the README file specifies the word patch. - Test case to review if the README file contains an email address. [YOCTO #11131] Signed-off-by: Dhruva Gole <goledhruva@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-03recipetool: extend curl detection when creating recipesRoss Burton
If a configure.ac uses LIBCURL_CHECK_CONFIG it wants curl. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-03recipetool: handle GitLab URLs like we do GitHubRoss Burton
GitHub URLs are automatically transformed to git: fetches, so handle GitLab URLs too. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-01scripts/checklayer/common.py: Fixed a minor grammatical errorDhruva Gole
Signed-off-by: Dhruva Gole <goledhruva@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-26native/cross: Add ar wrapper for determinismJacob Kroon
Add a wrapper around ar calls for native/cross recipes. This wrapper adds the -D option so that deterministic archives are built for native/cross output. This improves the changes of hash equivalence matches and hence build artefact reuse. We don't need this in the target case since we compile binutils-cross with an option making this the default. We need a wrapper since we need to remove the "u" option and replace it with "D" but also allow things like "--version" to continue to work too. Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-26nativesdk: Handle chown/chgrp calls in nativesdk do_install tasksRichard Purdie
We disable the useradd code for nativesdk targets since we don't support postinstalls or multiple users in those cases. This means any usage of chown/chgrp inside do_install tasks won't work and would have to be conditional. Rather than require all recipes to do that, add intercepts of the calls and map those to root/root user/groups. We can't just ignore them as some calls are used to remove host contamination from the host user ID so they need to be made, just as root. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-24wic: support rootdev identified by partition labelSchmidt, Adriaan
We already support specifying the rootfs by PARTUUID. This adds general support for letting the kernel find the rootfs by PARTLABEL. Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-21wic: use shutil.whichMingli Yu
Use shutil.which to find the executable instead to silence the below warning: $ cat tmp/work/intel_x86_64-poky-linux/core-image-base/1.0-r5/temp/log.do_image_wic [snip] DEBUG: Executing shell function do_image_wic /path/layers/oe-core/scripts/wic:27: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import spawn INFO: Creating image(s)... [snip] [RP: Added conversion for missed function reference] Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-21scripts/lnr: removeRoss Burton
lnr is a script that implements the same behaviour as 'ln --relative --symlink', as at the time of creation --relative was only available in coreutils 8.16 onwards which was too new for the older supported distros. Now, however, everyone has a new enough coreutils, so we can remove this script. All users of lnr should be replaced with ln --relative --symbolic. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-13runqemu: support rootfs mounted roAdrian Freihofer
Optionally allow to set QB_KERNEL_ROOT to e.g. "/dev/vda ro" to mount the rootfs reay-only in Qemu. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11scripts/lib/wic/help.py: Update Fedora Kickstart URLsJon Mason
The URLs describing Kickstart are no longer valid and do not redirect to the correct location. Update them with the correct location. Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11scripts/oe-package-browser: Handle no packages being builtRichard Purdie
Give the user a proper error message if there aren't packages built, rather than a less friendly traceback. [YOCTO #14619] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11scripts/oe-package-browser: Fix after overrides changeRichard Purdie
After the overrides change, the format of pkgdata changed and this usage of configparser no longer works. This change is a bandaid to make things work but the pkgdata format isn't very similar to ini files so this may need to be reimplmented in a better way in the long run. [YOCTO #14619] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-11convert-srcuri.py: use regex to check space in SRC_URIKai Kang
There may be none, one or more spaces including tab before backslash in SRC_URI. Use regex to check and update. It helps to avoid malformed uri such as recipe open-iscsi-user in meta-openstack: SRC_URI = "git://github.com/open-iscsi/open-iscsi.git;protocol=https ;branch=master \ And help to check more recipes such as concurrent-ruby in the same layer: SRC_URI = "git://github.com/ruby-concurrency/concurrent-ruby.git;protocol=https;tag=v1.1.6\ Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-10wic: Use os.rename instead of bb.utils.renameKhem Raj
This is not invoked with bitbake context as a result bb.utils is not visible when this function is called during image creation and builds fail e.g. NameError: name 'bb' is not defined Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Joshua Watt <JPEWhacker@gmail.com> Cc: Devendra Tewari <devendra.tewari@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03runqemu: work without SERIAL_CONSOLES being definedJon Mason
Not all machine definitions need to have SERIAL_CONSOLES defined, but runqemu currently will fail with the following script error if not present: Traceback (most recent call last): File "/builder/meta-arm/poky/scripts/runqemu", line 1604, in main config.setup_final() File "/builder/meta-arm/poky/scripts/runqemu", line 1446, in setup_final self.setup_serial() File "/builder/meta-arm/poky/scripts/runqemu", line 1381, in setup_serial self.kernel_cmdline_script += ' console=%s' %entry.split(';')[1] IndexError: list index out of range To get around this issue, add a sanity check to runqemu to avoid the parsing of SERIAL_CONSOLES if empty. Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-11-03scripts/convert-srcuri: Update SRC_URI conversion script to handle github ↵Richard Purdie
url changes Github are dropping support for git:// protocol fetching. Update the script to learn about corner cases found in the previous conversion and support remapping the github urls as needed too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30meta/scripts: Manual git url branch additionsRichard Purdie
Following the scripted conversion adding branches to git:// SRC_URI entries, add the remaining references, mainly in the selftests and recipetool. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30meta: Add explict branch to git SRC_URIsRichard Purdie
There is uncertainty about the default branch name in git going forward. To try and cover the different possible outcomes, add branch names to all git:// and gitsm:// SRC_URI entries. This update was made with the script added to contrib in this patch which aims to help others convert other layers. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-30runqemu: unbreak non-gl displaysAlexander Kanavin
Correct two issues: 1. Looking for dri.pc is only needed when gl is enabled. 2. virtio-vga-gl works only when gl is enabled via -display, otherwise virtio-vga needs to be selected. Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-23recipetool: Simplify common source files skip in guess_licenseStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-15sstate: Fixes for eSDK generation after zstd switchRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14scripts/autobuilder-worker-prereq-tests: jinja2 checkMichael Halstead
Ensure the jinja2 module is available during bringup. Signed-off-by: Michael Halstead <mhalstead@linuxfoundation.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14sstate: Switch to ZStandard compressor supportHenry Kleynhans
This patch switches the compressor from Gzip to ZStandard for ssate cache files. Zstandard compression provides a significant improvement in decompression speed as well as improvement in compression speed and disk usage over the 'tgz' format in use. Furthermore, its configurable compression level offers a trade-off between time spent compressing sstate cache files and disk space used by those files. The reduced disk usage also contributes to saving network traffic for those sharing their sstate cache with others. Zstandard should therefore be a good choice when: * disk space is at a premium * network speed / resources are limited * the CI server can sstate packages can be created at high compression * less CPU on the build server should be used for sstate decompression Signed-off-by: Henry Kleynhans <hkleynhans@fb.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14runqemu: add DEPLOY_DIR_IMAGE replacement in QB_OPT_APPENDJon Mason
Add the ability to replace DEPLOY_DIR_IMAGE with that path in QB_OPT_APPEND. This allows for anything present in DEPLOY_DIR_IMAGE to be passed into the qemu parameters. This is especially useful if you want to run multiple flash images (as -bios only allows for one). Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Rework crunch_license to recognize more variantsStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: npm: Use README as license fallbackStefan Herbrechtsmeier
Use the README as license fallback if a license file is missing. Use the linenumbers parameter of get_license_md5sums function to determine the license text inside the README. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: npm: Do not add package.json files to LIC_FILES_CHKSUMStefan Herbrechtsmeier
The package.json files doesn't contain any licenses. The name of the license doesn't comply the license requirements of most liceneses. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Add support for linenumbers to licenses.csvStefan Herbrechtsmeier
Add support for linenumbers (begin and end lines) to licenses.csv. Add an optional linenumbers parameter to get_license_md5sums to support different use cases. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Add logger info for missing license entriesStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: ignore empty license filesStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Change default paramter fallback_licenses of function ↵Stefan Herbrechtsmeier
split_pkg_licenses from None to [] Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Skip common source files in guess_licenseStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-14recipetool: Move license md5sums into CSV filesStefan Herbrechtsmeier
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-11devpyshell: rename to pydevshellMichael Opdenacker
For consistency with "pydevshell" which is also used. This addresses [YOCTO #14531] Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2021-10-11runqemu: correct vga-virtio option to keep virgl enabledAlexander Kanavin
qemu 6.1 has (perhaps unintentionally) disabled virgl in -vga virtio: https://gitlab.com/qemu-project/qemu/-/issues/586 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-01wic/bootimg-efi: Add Unified Kernel Image optionKristian Klausen
"A unified kernel image is a single EFI PE executable combining an EFI stub loader, a kernel image, an initramfs image, and the kernel command line. [...] Images of this type have the advantage that all metadata and payload that makes up the boot entry is monopolized in a single PE file that can be signed cryptographically as one for the purpose of EFI SecureBoot."[1] This commit adds a create-unified-kernel-image=true option to the bootimg-efi plugin for creating a Unified Kernel Image[1] and installing it into $BOOT/EFI/Linux/ with a .efi extension per the the Boot Loader Specification[1][2]. This is useful for implementing Secure Boot. systemd-boot is the only mainstream bootloader implementing the specification, but GRUB should be able to boot the EFI binary, this commit however doesn't implement the necessary changes to the GRUB config generation logic to boot the Unified Kernel Image. [1] https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images [2] https://systemd.io/BOOT_LOADER_SPECIFICATION/ Signed-off-by: Kristian Klausen <kristian@klausen.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-01scriptutils.py: Add check before deleting pathChandana kalluri
Add a check before deleting path when using recipetool commands to avoid the following type of errors: Traceback (most recent call last): File "<workdir>/sources/core/scripts/lib/scriptutils.py", line 218, in fetch_url shutil.rmtree(path) File "/usr/local/lib/python3.7/shutil.py", line 476, in rmtree onerror(os.lstat, path, sys.exc_info()) File "/usr/local/lib/python3.7/shutil.py", line 474, in rmtree orig_st = os.lstat(path) FileNotFoundError: [Errno 2] No such file or directory: '<workdir>/build/tmp/work/recipetool-usg7o81n/work/recipe-sysroot' ERROR: Command 'script -e -q -c "recipetool --color=always create --devtool -o /tmp/devtool5sq_op37 'file:///<SRCTREE>' -x <workdir>/build/workspace/sources/devtoolsrcxc1b9zjq -N test" /dev/null' failed Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-26wic:direct.py: ignore invalid mountpoints during fstab updateMarkus Volk
wic fstab-update creates invalid entries for partitons that are not supposed to be mounted from userspace eg u-boot partitions. The following lines were added to fstab on a rock-pi-4: /dev/mmcblk1p1 loader1 vfat defaults 0 0 /dev/mmcblk1p2 reserved1 vfat defaults 0 0 /dev/mmcblk1p3 reserved2 vfat defaults 0 0 /dev/mmcblk1p4 loader2 vfat defaults 0 0 /dev/mmcblk1p5 atf vfat defaults 0 0 /dev/mmcblk1p6 /boot vfat defaults 0 0 With this patch only valid entries should be added /dev/mmcblk1p6 /boot vfat defaults 0 0 Signed-off-by: MarkusVolk <f_l_k@t-online.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-23meta: Drop useless classRichard Purdie
This class was added by me back in 2007 and has changed one for a whitespace issue since. It only has two lines and neither are particularly useful, one was replaced by the nopackages class, the other adding recursive dependencies also is now mainly problematic adding tons of unneeded dependencies. The name is hard to understand and the class doesn't have a clear purpose. Drop it. Remove the references in devtool (which may be the one reason to keep it around but in my view still not worth it). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>