summaryrefslogtreecommitdiffstats
path: root/meta/classes
AgeCommit message (Collapse)Author
2021-06-17cross-canadian: correct the location of pkg-config filesAlexander Kanavin
layout_libdir has not been defined for many years. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-14kernel.bbclass: fix do_sizecheck() comparisonAndrea Adami
The routine do_sizecheck() was historically needed by legacy devices with limited flash memory. The lowest extreme is probably with Zaurus collie having exactly 1024*1024 = 1048576 bytes for the kernel partition. In the years the KERNEL_IMAGE_MAXSIZE has been converted to kilobytes thus rounded so we have now KERNEL_IMAGE_MAXSIZE_collie = "1024". The effect is that now the check fails because we hit curiously this | WARNING: This kernel zImage (size=1024(K) > 1024(K)) is too big for... even though zImage is 1047288 bytes (kernel + kexecboot-klibc-initramfs). Fix this case using test -gt (greater) instead of -ge (greater or equal). Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-11image_types: add zsync conversionsRoss Burton
Add image conversion types to create zsync[1] metadata. Use .zsync if the image is already compressed and .gzsync if zsync should compress the image itself. The required tool, zsync-curl, has been submitted to meta-oe. [1] http://zsync.moria.org.uk Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-07recipes-bsp/u-boot: Allow deploying the u-boot DTBAlistair Francis
Use ??= assignment for UBOOT_DTB_BINARY because it is set using ?= in fitImage bbclass as well, using ?= will preempt that Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-03classes/reproducible_build: Use atomic rename for SDE fileJoshua Watt
If an existing source date epoch file was found during do_unpack, it was deleted and a new one would be written in its place. This causes a race with check-before-use code in get_source_date_epoch_value. Resolve the problem by making do_unpack write the new source date epoch to a temporary file, then do an atomic rename to ensure it's always present, and change the check-before-use code to use a EAFP exception instead of checking for file existence. [YOCTO #14384] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-03Remove Clutter and CoglRoss Burton
Clutter and Cogl are not used by anything in oe-core, and in Gnome are legacy components so are only used by a few applications. The recipes have already been moved to meta-gnome so they can now be removed from oe-core. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-03classes/buildhistory: Add option to strip path prefixJoshua Watt
Adds an option to strip a prefix from the paths reported in buildhistory. This makes it easier to compare task signatures in the build history when the builds were done from different directories. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-06-01native.bbclass: Do not remove "-native" in the middle of recipe namesPeter Kjellerstedt
For dependencies such as "${PN}-foo", when modifying them for native recipes, it is expected that they become "${BPN}-foo-native" rather than "${BPN}-native-foo-native". This was previously done by removing all occurences of "-native" from the dependency before adding "-native" at the end. However, this fails for a recipe such as "crate-native-tls" that happens to contain the string "-native" in the middle of the name. Solve this by simply replacing ${PN} with ${BPN} in the name instead before adding "-native" at the end Also simplify adding "-native" to the end of names the recipe provides. In this case it is not necessary to replace ${PN} with ${BPN} as the recipes are expected to use ${BPN}-foo in the first place. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-31Add support for erofs filesystemsRichard Weinberger
Since Linux 5.4 a new read-only filesystem is available, erofs. Compared to squashfs it offers much better read performance with and without compression enabled. It suppports two optional compressors, lz4 and lz4hc. >From the mkfs.erofs man page: EROFS is a new enhanced lightweight linux read-only filesystem with modern designs (eg. no buffer head, reduced metadata, inline xattrs/data, etc.) for scenarios which need high-performance read-only requirements, e.g. Android OS for smartphones and LIVECDs. It also provides fixed-sized output compression support, which improves storage density, keeps relatively higher compression ratios, which is more useful to achieve high performance for embedded devices with limited memory since it has unnoticable memory overhead and page cache thrashing. This commit adds support for three new filesystem targets: erofs: erofs without compression erofs-lz4: erofs with lz4 compresssion enabled erofs-lz4hc: erofs with lz4hc compression enabled Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-28icecc: Demote "could not get ICECC_CC" warning to noteDouglas Royds
For many components, it is perfectly correct not to have gcc or g++ in the PATH, notably when INHIBIT_DEFAULT_DEPS is set. We were getting a flood of warnings when icecc was enabled, eg: WARNING: base-files-3.0.14-r89.tait.8.6 do_configure: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: base-files-3.0.14-r89.tait.8.6 do_compile: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: base-files-3.0.14-r89.tait.8.6 do_install: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: busybox-inittab-1.33.0-r0 do_configure: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: busybox-inittab-1.33.0-r0 do_compile: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: busybox-inittab-1.33.0-r0 do_install: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: linux-libc-headers-3.14-r0 do_configure: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: linux-libc-headers-3.14-r0 do_compile: Cannot use icecc: could not get ICECC_CC or ICECC_CXX WARNING: linux-libc-headers-3.14-r0 do_install: Cannot use icecc: could not get ICECC_CC or ICECC_CXX Demote this message to a "NOTE". It still appears in log.do_configure and friends: NOTE: Cannot use icecc: could not get ICECC_CC or ICECC_CXX Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-28Revert "icecc: Don't use icecc when INHIBIT_DEFAULT_DEPS is set"Douglas Royds
Although this silenced the warnings, it also turned off icecc for gcc-cross and friends, binutils-cross, and importantly, the linux kernel. This reverts commit 0315aabeff8e6483b737d0e23d6841f1394ad3c8. [YOCTO #13863] Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-27image-live.bbclass: order do_bootimg after do_rootfsGuillaume Champagne
do_bootimg expects IMGDEPLOYDIR to exist, since it stores its artifacts there. Therefore, do_bootimg should run after do_rootfs because IMGDEPLOYDIR is created before do_rootfs runs since IMGDEPLOYDIR is contained in do_rootfs' [cleandirs] varflag. When do_bootimg depends on ${PN}:do_image_${LIVE_ROOTFS_TYPE}, do_bootimg is correctly ordered after do_rootfs because do_image_${FSTYPE} tasks are added after do_image and do_image itself is added after do_rootfs. However, when do_bootimg doesn't depend on ${PN}:do_image_${LIVE_ROOTFS_TYPE} (introduced by: 96f47c39f1d17f073243913d524bde84add41d8f), do_bootimg can run before do_rootfs, thus before IMGDEPLOYDIR is created. To avoid this situation, do_bootimg is now explicitly ordered after do_rootfs. Signed-off-by: Guillaume Champagne <champagne.guillaume.c@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-27package_rpm: pass XZ_THREADS to rpmRoss Burton
By default RPM uses the number of cores as the number of threads to use, which can result in quite antisocial memory usage. As we control the macros for compression anyway, we can pass XZ_THREADS to limit the number of threads if needed. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-25gnomebase: trim the SRC_URI directory from the backAlexander Kanavin
Rather than take the first two components, drop the last one at the end. This makes it compatible with both old and new gnome version schemes. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-25uboot-sign/kernel-fitimage: split generate_rsa_keys taskMing Liu
Currently generate_rsa_keys tasks are being executed parallelly in kernel and uboot's task list, and both of them are calling openssl to generate rsa keys in same path, this can lead to race condition. Let's split it to kernel_generate_rsa_keys and uboot_generate_rsa_keys. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-25kernel-fitimage.bbclass: drop unit addresses from bootscr sectionsMing Liu
In commit 6047be9f: [ kernel-fitimage: Don't use unit addresses on FIT ] It had dropped unit addresses from FIT image but missed on bootscr part. Drop unit addresses from bootscr sections in this patch. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-22kernel-fitimage.bbclass: fix a wrong conditional checkMing Liu
It should check if "${UBOOT_SIGN_ENABLE}" equals to "1" instead of checking if "${UBOOT_SIGN_ENABLE}" is not empty since it could be "0". Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-21baremetal-image: Fix post process command rootfs_update_timestampAlejandro Hernandez Samaniego
When running: execute_pre_post_process(d, d.getVar(ROOTFS_POSTPROCESS_COMMAND)) rootfs_update_timestamp is run, which assumes that rootfs/${sysconfdir} is already created (usually done through the do_rootfs task on linux). This causes the build to fail if ${sysconfdir} does not exist. This may be overlooked if debug-tweaks is enabled since some other commands are added, one of which creates the required path (see postinst_enable_logging). See [1] for more info: [1] https://github.com/aehs29/meta-freertos/issues/4 Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-21sstate: Ignore sstate signing keyDaniel McGregor
What key is used to sign sstate artefacts should not affect the hash of the object, otherwise everyone would need to use the same signing key. Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-18Revert "cml1.bbclass: Return sorted list of cfg files"Richard Purdie
This reverts commit dee41e92f0efac7e453597bed4b4c02f867e3aa9. This patch breaks cases where some config files make changes to earlier ones, ordering is important. The reproducibility issue in busybox was elsewhere. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-18kernel-yocto: provide debug / summary information for metadataBruce Ashfield
It was mentioned that when developing a BSP, the information about what definition was used, or what fragments have been applied is not obvious and requires looking at the code. With this change, we can trigger a full summary of the meta data gathering phase when KCONF_AUDIT_LEVEL > 0. Sample output follows: NOTE: do_kernel_metadata: for summary/debug, set KCONF_AUDIT_LEVEL > 0 NOTE: kernel meta data summary for qemux86-64 (standard): NOTE: ====================================================================== NOTE: BSP entry point / definition: /build/tmp/work/qemux86_64-poky-linux/linux-yocto/5.10.34+gitAUTOINC+bca3bfbc74_85c17ad073-r0/kernel-meta/bsp/common-pc-64/common-pc-64-standard.scc NOTE: Fragments from SRC_URI: /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/xt-checksum.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/ebtables.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/vswitch.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/lxc.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/docker.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/cgroup-hugetlb.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/xen.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/kubernetes.scc NOTE: KERNEL_FEATURES: features/nfsd/nfsd-enable.scc features/debug/printk.scc features/kernel-sample/kernel-sample.scc features/netfilter/netfilter.scc cfg/virtio.scc features/drm-bochs/drm-bochs.scc cfg/sound.scc cfg/paravirt_kvm.scc features/scsi/scsi-debug.scc features/gpio/mockup.scc features/aufs/aufs-enable.scc cfg/fs/flash_fs.scc cfg/virtio.scc NOTE: Final scc/cfg list: /build/tmp/work/qemux86_64-poky-linux/linux-yocto/5.10.34+gitAUTOINC+bca3bfbc74_85c17ad073-r0/kernel-meta/bsp/common-pc-64/common-pc-64-standard.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/xt-checksum.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/ebtables.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/vswitch.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/lxc.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/docker.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/cgroup-hugetlb.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/xen.scc /poky/meta-virtualization/recipes-kernel/linux/linux-yocto/kubernetes.scc features/nfsd/nfsd-enable.scc features/debug/printk.scc features/kernel-sample/kernel-sample.scc features/netfilter/netfilter.scc cfg/virtio.scc features/drm-bochs/drm-bochs.scc cfg/sound.scc cfg/paravirt_kvm.scc features/scsi/scsi-debug.scc features/gpio/mockup.scc features/aufs/aufs-enable.scc cfg/fs/flash_fs.scc cfg/virtio.scc Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-18mklibs: remove recipes and classAlexander Kanavin
This is not enabled or tested by default, and has never been ported to python 3 upstream[1], which means it doesn't work at all with plain poky. If you need it, please put it in a separate layer and/or modernize to work with py3. https://salsa.debian.org/installer-team/mklibs/-/blob/master/src/mklibs Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-16sstate: Handle manifest 'corruption' issueRichard Purdie
Under certain build patterns, warnings about missing manifests can appear. These are real issues where the manifest was removed and shouldn't have been. Martin Jansa was able to find a reproducer of: MACHINE=qemux86 bitbake zlib-native echo 'PR = "r1"' >> meta/recipes-core/zlib/zlib_1.2.11.bb MACHINE=qemux86-64 bitbake zlib-native MACHINE=qemux86 bitbake zlib-native <the zlib-native manifest is now removed along with the sysroot-components contents> The code maintains a per machine list of stamps but a per PACAGE_ARCH list of stamp/manifest/workdir mappings. The latter is only appended to for speed with the assumption that once stamps are gone, the code wouldn't trigger. The code only ever appends to the mapping list (for speed/efficency under lock) meaning that multiple entries can result where the stamp/workdir differs due to version changes but the manifest remains the same. By switching MACHINE part way through the build, the older stamp is referenced and the manifest is incorrectly removed as it matches an now obsolete entry in the mapping file. There are two possible fixes, one is to rewrite the mapping file every time which means adding regexs, iterating and generally complicating that code. The second option is to only use the last mapping entry in the file for a given manifest and ignore any earlier ones. This patch implments the latter. Also drop the stale entries if we are rewriting it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-14npm.bbclass: Allow nodedir to be overridden by NPM_NODEDIRMike Crowe
Node modules may need to be built against multiple Node versions. Setting nodedir in the NPM configuration stops older ways of doing this, such as setting npm_config_target and npm_config_disturl, from working. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-14meson.bbclass: split python routines into a separate classAlexander Kanavin
This allows reusing them in nativesdk-meson without copy-pasting code. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13image.bbclass: fix comment "pacackages" -> "packages"Robert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13qemu: Set SMP to 4 cpus for arm/x86 onlyRichard Purdie
Only qemux86* and qemuarm* support SMP with our current configurations so rework qemu SMP enabling to account for that and only use it on the architectures where it works. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-13qemu: use 4 cores in qemu guestsAlexander Kanavin
Each of the cores is mapped to a thread on the host, this should speed up things inside qemu which can take advantage of that. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-12baremetal-helloworld: Enable RISC-V 64 portAlejandro Hernandez Samaniego
Add support for MACHINE=qemuriscv64. $ runqemu nographic KERNEL: [tmp/deploy/images/qemuriscv64/baremetal-helloworld-image-qemuriscv64.bin] MACHINE: [qemuriscv64] FSTYPE: [bin] runqemu - INFO - Running tmp/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qemu-system-riscv64 Hello OpenEmbedded on RISC-V 64! Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-11ptest: add a test for orphaned ptests, and restore ones found by itAlexander Kanavin
Particularly, numactl, numpy and libseccomp are disabled for now due to failures or lack of qemu support. The rest have been verified to pass quickly. [RP: Fix multilib recipe handling] Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-09gi-docgen: add a recipe and classAlexander Kanavin
This seems to be the gtk-doc successor, and gnome projects such as pango and gdk-pixbuf have started transitioning to it. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-06classes/lib/scripts: Use bb.utils.rename() instead of os.rename()Devendra Tewari
Incremental build in Docker fails with: OSError: [Errno 18] Invalid cross-device link when source and destination are on different overlay filesystems. Rather than adding fallback code to every call site, use a new wrapper in bitbake which detects this case and falls back to shutil.move which is slower but will handtle the overlay docker filesystems correctly. [YOCTO #14301] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-06sanity.bbclass: mention CONNECTIVITY_CHECK_URIS in network failure messageMichael Opdenacker
This expands the error message when a network failure is detected. It happens that some ISPs or networks block the default example.com domain. Therefore, instead of disabling network access, it lets the user know how to modify the test URL. Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-06classes/image: Use xargs to set file timestampsJoshua Watt
Instead of having find directly invoke touch for each file in the root file system, pass a list to xargs for batching. This significantly reduces the number of times the touch program is invoked and speeds up the do_image task time: PKG TASK ABSDIFF RELDIFF CPUTIME1 -> CPUTIME2 my-image do_image -45.3s -94.2% 48.1s -> 2.8s Cumulative cputime: -44.3s -92.3% 00:48.1 (48.1s) -> 00:03.7 (3.7s) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-03cml1.bbclass: Return sorted list of cfg filesKhem Raj
Since these files are passed to merge_config.sh its better to use a sorted list, so we can be sure that this list is always fed in same order irrespective of python versions on host Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-01reproducible_build.bbclass: Enable -Wdate-timeKhem Raj
This will help identifying packages using __TIME__, __DATE__ and __TIMESTAMP__ macros in code, its a warning from the compiler and the packages which use -Werror will break the build with this and where they don't we will atleast have a warning in the build logs Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-27buildstats.bbclass: collect data in the same file.Sakib Sajal
Previously "at interval" and "on failure" logs were collected in separate files. Collect both types of logging in the same file for better analysis. Introduced new variable which allows different set of commands to be run by the different logging, interval or failure. The variables are BB_LOG_HOST_STAT_CMDS_INTERVAL and BB_LOG_HOST_STAT_CMDS_FAILURE respecteviely. Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-27license_image.bbclass: Fix symlink to generic license filesReto Schneider
Link to the canonical filename of a license as only this one exists. Fixes commit 670fe71dd18ea675f35581db4a61fda137f8bf00 [license_image.bbclass: use canonical name for license files]. Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-27license_image.bbclass: Detect broken symlinksReto Schneider
Find and report symlinks which point to a non-existing file. Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-27qemurunner: Add support for qmp commandsSaul Wold
This adds support for the Qemu Machine Protocol [0] extending the current dump process for Host and Target. The commands are added in the testimage.bbclass. Currently, we setup qemu to stall until qmp gets connected and sends the initialization and continue commands, this works correctly. If the UNIX Socket does not exist, we wait an timeout to ensure to socket file is created. With this version, the monitor_dumper is created in OEQemuTarget but then set in OESSHTarget as that's where we get the SSH failure happens. Python's @property is used to create a setter/getter type of setup in OESSHTarget to get overridden by OEQemuTarget. By default the data is currently dumped to files for each command in TMPDIR/log/runtime-hostdump/<date>_qmp/unknown_<seq>_qemu_monitor as this is the naming convenstion in the dump.py code. We use the qmp.py from qemu, which needs to get installed in the recipe-sysroot-native of the target image. [0] https://github.com/qemu/qemu/blob/master/docs/interop/qmp-spec.txt Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-24kernel-yocto.bbclass: chdir to ${WORKDIR} for do_kernel_checkoutKai Kang
It chdirs to ${S} at the beginning of task do_kernel_checkout. Then it removes ${S} when it still resides in ${S}. It may fail to run the task do_kernel_checkout when bitbake is called by third-part wrapper script. So chdir to ${WORKDIR} by default for do_kernel_checkout. And it will chdir to ${S} afterwards in task do_kernel_checkout. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-24cmake.bbclass: remove ${B} before cmake_do_configureKai Kang
It is fallible to remove ${B} in directory ${B} itself. And it does fail when call bitbake by third-party wrapper script. Use flag 'cleandirs' to remove ${B} first if build out of source tree. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-20sanity: Further improve directory sanity testsRichard Purdie
Add tests to ensure COREBASE/TMPDIR doon't contain ".." as this causes hard to understand build failures. Also rework the code to test TMPDIR and COREBASE for all the patterns since they may be set differently and one may contain problematic characters. [YOCTO #14111] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18sanity: Add error check for '%' in build pathRichard Purdie
It has been reported that '%' characters in build paths break with python exceptions, probably due to confusion with python string escaping. Whilst it is probably fixable, showing the user a human readable error is better given it doesn't work. [YOCTO #14282] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18insane: clean up some more warning messagesRoss Burton
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18cpan-base: set default UPSTREAM_CHECK_REGEXKonrad Weihmann
as cpan release versions are almost always follow an a.b version scheme, it's better to filter out beta releases such as a.b.c. Use the first resource fetched from https://cpan.metacpan.org as base for calculating the needed regex. In case nothing can be calculated fall back to nothing. Add this to cpan-base to enable it for new & old style cpan integration. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18cross-canadian: Whitelist "mingw32" as TARGET_OSAnatol Belski
If a recipe inherits cross-canadian and contains "nativesdk" in BBCLASSEXTEND and meta-mingw is included and multiconfig is enabled, bitbake will generate the correspending recipe. As meta-mingw sets SDK_OS to "mingw32", that's what TARGET_OS will be set to as well. Thus, currently such a recipe won't pass the check and fail with a message: Building cross-candian for an unknown TARGET_SYS (x86_64-mysdk-mingw32), please update cross-canadian.bbclass Even when building an SDK targeting Linux, but the mentioned conditions are met, bitbake will try to generate the corresponding recipe and fail. As the described combination seems valid, including "mingw32" into the whitelist unconditionally as a fix is suggested. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18externalsrc: Detect code changes in submodulesDouglas Royds
Further to 50ff9afb39, only detect code changes in submodules that are subdirectories of the EXTERNALSRC directory. The (undocumented) git submodule--helper returns a path for each submodule relative to the top of the repo. Don't add submodules that are not within our source subtree. [YOCTO #14333] Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18Revert "externalsrc: Detect code changes in submodules"Douglas Royds
This reverts commit 4525310d49d115a37705f04ac5c03d639e5e8f8c. Further to 50ff9afb39, only detect code changes in submodules that are subdirectories of the EXTERNALSRC directory. The (undocumented) git submodule--helper returns a path for each submodule relative to the top of the repo. Don't add submodules that are not within our EXTERNALSRC subtree. If we unpack one git repo inside another, like this: SRC_URI = "git://${GIT_SERVER}/repo1;name=repo1;destsuffix=repo1 \ git://${GIT_SERVER}/repo2;name=repo2;destsuffix=repo1/repo2 \ " Git status reports, for repo1: Untracked files: (use "git add <file>..." to include in what will be committed) repo2/ If we run `devtool modify` on this recipe, do_patch runs with: PATCHTOOL = "git" PATCH_COMMIT_FUNCTIONS = "1" The `patch_task_postfunc` (patch.bbclass, line 82) runs a `git add .` on the top-level repo1, leaving the checkout in an invalid state. The following git warning does not appear in the log: $ git add . warning: adding embedded git repository: repo2 hint: You've added another git repository inside your current repository. hint: Clones of the outer repository will not contain the contents of hint: the embedded repository and will not know how to obtain it. hint: If you meant to add a submodule, use: hint: hint: git submodule add <url> repo2 hint: hint: If you added this path by mistake, you can remove it from the hint: index with: hint: hint: git rm --cached repo2 hint: hint: See "git help submodule" for more information. $ git submodule status fatal: no submodule mapping found in .gitmodules for path 'repo2' No further git submodule commands can be run on the checkout. We could enhance the `patch_task_postfunc` to look for any embedded git checkouts and add them as submodules, but this seems unnecessary complexity for an obscure edge-case. Although the git repo is left in an invalid state with respect to the submodules, it still serves the purpose required by devtool: To take further commits, and generate patch files from them. We are still able to run these commands to examine any submodules, where git submodule--helper reports paths relative to the top of the checkout: $ git ls-files --stage | grep ^160000 160000 5feee12d6e974dd8c0614cf5b593380b046439a5 0 repo2 $ git submodule--helper list 160000 5feee12d6e974dd8c0614cf5b593380b046439a5 0 repo2 When a recipe sets EXTERNALSRC to a subdirectory of the git checkout, we test for the existence of the reported submodule paths within the EXTERNALSRC directory. The latest versions of git submodule--helper accept a path to a subdirectory and correctly report no submodules within that subdirectory. Regrettably, we still support git versions that don't accept a path to a subdirectory. [YOCTO #14333] Signed-off-by: Douglas Royds <douglas.royds@taitradio.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-18archiver: Fix typosDaniel Ammann
Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>