summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* pybootchart/draw: Avoid divide by zero errorRichard Purdie2021-05-131-1/+1
| | | | | | | | | | | | | | | When disk stats don't run frequenctly enough, we see divide by zero errors. The code already has a fallback path so ensure we use it for this case too. [YOCTO #14360] (From OE-Core rev: 6c4355cd13ae47c327ddc5e9b66623e44ba5b118) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b71d30aef5dc2c360432c0dd4147859dd303ea48) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Avoid bug when iterating and autoadding dependenciesRichard Purdie2021-05-041-0/+3
| | | | | | | | | | | | | | | | | | | If iterating a layer with multiple components and auto-adding dependencies the tests can break since layers are never removed and order isn't guaranteed to account for that. Fix this by resetting the layer list back to the original list each time before auto-adding the dependencies in each case. This fixes scanning of meta-openembedded in particular where the sublayers may not be added in order of minimal dependency. (From OE-Core rev: 886752b6877438c16b1f27b3b05798498026e645) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bf1b467dacf345379cd5d84a1c9b3b0d844d5c91) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* documentation-audit.sh: Fix typo in specifying LICENSE_FLAGS_WHITELISTKhem Raj2021-04-061-1/+1
| | | | | | | | | | (From OE-Core rev: ca95497a2d29620f84849a8f92b8bd05aae107f8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 410a45639d84a3d69a65133593da32062196dd59) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/verify-bashisms: Update checkbashisms.pl URLPetr Vorel2021-03-281-1/+1
| | | | | | | | | | | | anonscm.debian.org is not used any more, update the URL. (From OE-Core rev: 34e1adf61a84ad2e697112a7582d2d5dba3cd4cb) Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3c89071a2c19a522c1df5919f500b88339ec6294) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake-whatchanged: change ending quote to proper periodRobert P. J. Day2021-03-281-1/+1
| | | | | | | | | | | | | Pretty sure that trailing quote should be a period; it appears to work properly. (From OE-Core rev: f63ae3256cb880564f1b786e4c381ffae5cb58e8) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 579f9ada19bd174bff0002cd6a731d12a1868252) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Fix do_kernel_configme taskAlejandro Hernandez Samaniego2021-03-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The do_kernel_configme task is no longer part of SRCTREECOVEREDTASKS, its been removed from the kernel-yocto.bbclass since b72dbb2e4, but there wasnt a matching patch for devtool for those changes. This patch enables us to invoke the do_kernel_configme task when using a devtool workspace, it also prepends a check for an existing .config file in the source directory and moves it if thats the case, since when using devtool modify a .config is created and do_kernel_configme complains about it, this is not the case when using bitbake since the .config file would be on B instead. Alowing do_kernel_configme to run also fixes the flow where testing a new config fragment from devtool workspace isnt added properly (config queue shows it as ///frg.cfg) and as a side effect it never gets merged into the final config. (From OE-Core rev: 5f27d66b5e3a7bffc23c140edf76fc8fd4cd5b23) Signed-off-by: Alejandro Enedino Hernandez Samaniego <alhe@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 08dcc0e68095dcf2a159546a48b29d40c9aabc0b) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: use "raw" instead of "bin" for ovmfJon Mason2021-03-181-0/+2
| | | | | | | | | | | | | | bin is not an acceptable format for qemu and will throw an error is set. The correct format in this case is raw. (From OE-Core rev: b3cbde17aff693e2d5ba6d61922fca54e75b9f6e) Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I9d78e356d39ecb15bef886c19870b029d9badd65 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cd279aeb986b4676ea8ecb1e7b12c7e29e83460a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Warn if an ext filesystem affected by the Y2038 problem is usedFlorian Bezdeka2021-03-185-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are getting closer and closer to the year 2038 where the 32 bit time_t overflow will happen. While products (= embedded systems) with an expected life time of 15 years are still save the situation may change if your system has to survive the next 20 years. ext2 and ext3 filesystems are always affected by the time overflow, so let's warn the user if these filesystems are still being used. If ext4 is affected depends on the inode size chosen during filesystem creation. At least 256 bytes are necessary to be safe. As ext4 is used very often (and partitions may be created small first and extended later) this might be an issue for many users. Some filesystems created during CI runs were already affected by the Y2038 problem. By using `--mkfs-extraopts "-T default"` we tell mke2fs not to auto-detect the usage type based on the filesystem size. mke2fs will use the default values for tuning parameters instead. The inode size is one of these parameters. (From OE-Core rev: 280bf295a12b49a1d5199d86da6641516df0ce6a) Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit eecbe625558406680121d2a7e84917fea45ea9dc) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-pkgdata-util: Check if environment script is initializedDorinda2021-02-181-0/+3
| | | | | | | | | | | | | | Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized. [YOCTO #12096] (From OE-Core rev: dfa4b0e6cabb870a33627ff5a0b5f413f6edb1e2) Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e88073e16f1b4cfd0f97c81a988640a84adad674) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Fix file:// fetcher symlink directory structureTomasz Dziendzielski2021-02-051-1/+5
| | | | | | | | | | | | | | Add relative path if file is under directory. [YOCTO #13738] (From OE-Core rev: cd9cee29b656e4c8642971cb87154cc4d5fda599) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 19ddacc1b38f9ebb86a9359963ccc3c707f7125e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Fix source extraction for gcc shared sourceTomasz Dziendzielski2021-02-051-4/+26
| | | | | | | | | | | | | | | If do_patch task is disabled then prepare do_configure dependencies to fetch external sources and create symlink to ${S} in devtool workspace. [YOCTO #13036] (From OE-Core rev: 1685e470f0dc49c1b857ffd869407f3396c55d31) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9e47319bfe62d289b90f7545a64dbdc1cbde7f1d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Optimise fstab modification for ext2/3/4 and msdos partitionsPaul Barker2021-02-032-8/+28
| | | | | | | | | | | | | | | | | | | | | The fix for [Yocto #13994] required the rootfs directory to be copied (using hardlinks if possible) when modifying the fstab file under wic. We can optimise this copy away for filesystems where we have the tools to modify the contents of the partition image after it is created. For ext2/3/4 filesystems we have the debugfs tool and for msdos/vfat filesystems we have the mcopy tool. So for any of these filesystems we skip the modification of the fstab file in the rootfs directory (and skip the associated copy unless it is otherwise necessary) and update the contents of fstab directly in the partition image. (From OE-Core rev: 1988d07b65ad38bdf8fac8615f11fb6536a75806) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5fb8ae0e9159597d7eaa9307a3a8543800bf9405) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Copy rootfs dir if fstab needs updatingPaul Barker2021-02-033-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, wic updates the /etc/fstab in the rootfs to include details of additional partitions described in the selected wks file. If this modification is performed in place, other tasks which create an image file from the rootfs directory (e.g. do_image_tar and do_image_ext4) will pick up the modified fstab file which would not be appropriate for those images as they do not include the additional partitions described in the wks file. wic does undo modifications to the fstab file once it has finished creating the filesystem image, however this leaves open a race condition if one of the other tasks reads the contents of the fstab file from the rootfs directory between the point where wic modifies the fstab file and the point where wic restores the files original content. This could be solved by adding a lockfile for tasks which use the rootfs directory to ensure that no other such task is reading the rootfs directory while do_image_wic is running. This would serialize several do_image_* tasks and result in slower builds, especially for large images. Another drawback of this solution is that it is hard to selectively optimise - adding lockfiles to do_image_* tasks would result in these tasks always being serialized even if no fstab modification will take place. An alternative solution is to copy the rootfs directory when fstab needs to be modified. The code to do this in wic already exists as it is needed when including or excluding content in the rootfs. This still results in an impact on build times but the copy uses hardlinks if possible (so little data is actually copied) and we can make selective optimisations to improve things. The rootfs copy will only take place if fstab modification is required (or if it was already needed to include or exclude rootfs content). We can also follow up with further optimisations after this commit. So this second solution is chosen. Fixes [Yocto #13994] (From OE-Core rev: 9414007dd73ffd41d1e9c68bae152e8cbb3c28a2) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ce682a73b7447652f898ce1d1d0416a456df5416) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --change-directory argumentRicardo Ribalda Delgado2021-02-034-3/+26
| | | | | | | | | | | | | | | | | | | | | | This option allows to specify which part of a rootfs is going to be included, the same way the -C argument on tar. Thanks to this option we can make sure the permissions and usernames on the target partition are respected, and also simplify the creation of splitted partitons, not neeting to invoke external vars or using .wks.in files. Eg: part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/    part /etc --source rootfs --fstype=ext4 --change-directory=etc Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: d17b03e49b09f1a2db3642823522ac39e7c3c301) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2265d089a58e1f78f26d623ee667c420cb1c3bd4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Update pseudo db when excluding content from rootfsPaul Barker2021-02-031-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | To exclude content from the rootfs, wic makes a copy (using hardlinks if possible) of the rootfs directory and associated pseudo db, then removes files & directories as needed. However if these files and directories are removed using the python functions os.remove and shutil.rmtree, the copied pseudo db will not be updated correctly. For files copied from the original rootfs, if hardlinks were used successfully when copying the rootfs this should mean that the relevant inodes can't be reused and so the risk of pseudo aborts should be avoided. However, this logic doesn't apply for directories (as they can't be hardlinked) or for files added via the '--include-path' argument (as they weren't present in the original rootfs) and so there remains some risk of inodes being reused and the pseudo db becoming corrupted. To fix this, use the 'rm' command under pseudo when removing files & directories from the copied rootfs to ensure that the copied pseudo db is updated. (From OE-Core rev: 5bfdebe05a4eed1df29b2ad7c3871d323646cc50) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d5db7e268947f0392c2126137571a44acd29ccd6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Ensure internal workdir is not reusedPaul Barker2021-02-031-1/+11
| | | | | | | | | | | | | | | | | If a path is specified for the internal wic working directory using the -w/--workdir argument then it must not already exist. Re-using a previous workdir could easily result in rootfs and intermediate files from a previous build being added to the current image. (From OE-Core rev: fb884fb9e5eef1c322ae7c196aa19bd32dcf6897) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e40c8d4109024ff704c5ce40d98050ca7f34dd5) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit 5dcdb76f89c2e5bbc383e2921589482cd1c51491) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Allow exec_native_cmd to run HOSTTOOLSPaul Barker2021-02-031-2/+5
| | | | | | | | | | | | | | This allows programs from HOSTTOOLS (e.g. 'install', 'rm', 'mv', etc) to be more easily executed by wic. Without this change only programs from an actual *-native recipe built by bitbake can be executed by wic. (From OE-Core rev: 7acb39f02b8160600d1508da114e98dd1c3e76ed) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8eb186acdecfbb3151c9a0ab148358e3fe5cce39) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add workdir argumentPaul Barker2021-02-032-1/+3
| | | | | | | | | | | | | | | This allows the path for the temporary workdir used by wic to be set when running wic from bitbake or directly from the command line. (From OE-Core rev: 447643eebff00715bd9717ebcb75edb20fc69778) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e7314ac3a3cab89de93c932e8efc75de0feb0a7) Signed-off-by: Steve Sakoman <steve@sakoman.com> (cherry picked from commit a2308800b7eb5215982db7269d74d6292075f19f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Pass canonicalized paths in PSEUDO_IGNORE_PATHSPeter Kjellerstedt2021-02-031-1/+11
| | | | | | | | | | (From OE-Core rev: 4117e497650a0d8e7709439385c926d58a7d9aca) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 55618cbd58d6784a82e773f323723be6f722232f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Handle new PSEUDO_IGNORE_PATHS variableRichard Purdie2021-02-031-5/+7
| | | | | | | | | | | | Adjust wic to correctly handle the new PSEUDO_IGNORE_PATH variable and avoid inode corruption issues. (From OE-Core rev: 16fbe45f2e0e7621139ae26ace59889a91fceda2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 13500f5234361385c365c7c35e83f99435500481) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Avoid creating invalid pseudo directoryRicardo Ribalda Delgado2021-02-031-7/+8
| | | | | | | | | | | | | | | | | | | If the source of the rootfs is not a bitbake cooked image, or it is not pointing to the root of one, we call pseudo again, which will produce a new pseudo folder at rootfs/../pseudo Eg: part /etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: b4393f56069801c014e736100dcdeab77e549f08) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 799a24ae78655f7a3eda7456b1a0ffaf3e43ec16) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix multi images .wks with bitbakeRicardo Ribalda Delgado2021-02-031-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | In order to support .wks files with multiple images inside bitbake we need to explicitly set the pseudo database in use. Eg: If we try this .mks: part / --source rootfs --ondisk sda --fstype=ext4 part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4 The username for all the files under /export will be set to the runner of bitbake (usually UID 1000). Before we run wic, we need to make sure that the pseudo database will be flushed, and contains all the data needed. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 63bebeaf60757967b47cae1e24aa61ec5bcbd61b) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dde90a5dd2b22a539095d1bac82acc15c6380ac8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix permissions when using exclude or include pathRicardo Ribalda Delgado2021-02-032-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parameters include_path or exclude_path are passed to the rootfs plugin, it will copy the partition content into a folder and make all the modifications there. This is done using copyhardlinktree(), which does not take into consideration the content of the pseudo folder, which contains the information about the right permissions and ownership of the folders. This results in a rootfs owned by the user that is running the wic command (usually UID 1000), which makes some rootfs unbootable. This bug can be easily triggerd with the following .wks part / --source rootfs --fstype=ext4 --exclude-path=home And this sequence: $ wic create test-permissions -e core-image-minimal -o test/ $ sudo mount test/test-permissions-202004080823-sda.direct.p1 /mnt $ ls -la /mnt/etc/shadow To fix this we copy the content of the pseudo folders to the new folder and modify the pseudo database using the "pseudo -B" command. If the rootfs is not a rootfs generated by bitbake a warning is shown making the user aware that the permissions on the target might not match what he expects. WARNING: /tmp/test/../pseudo folder does not exist. Usernames and permissions will be invalid Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 9ea7162e9efc29beacdf1c8f4ec98f4895dd5df6) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fd739c15cdba221d9d497d3402b7d929c0be2ca4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/bitbake.conf: Enable pseudo path filteringRichard Purdie2021-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pretty big change to the way pseudo operates when used in OpenEmbedded. Normally, pseudo monitors and logs (adds to its database) any file created or modified whilst in a fakeroot environment. There are large numbers of files we simply don't care about the permissions of whilst in that fakeroot context, for example ${S}, ${B}, ${T}, ${SSTATE_DIR}, the central sstate control directories, This change uses new functionality in pseudo to ignore these directory trees, resulting in a cleaner database with less chance of "stray" mismatches if files are modified outside pseudo context. It also should reduce some overhead from pseudo as the interprocess round trip to the server is avoided. There is a possible complication where some existing recipe may break, for example, we found a recipe which was writing to "${B}/install" for "make install" in do_install and since we listed ${B} as not to be tracked, there were errors trying to chown root for files in this location. This patch fixes a few corner cases in OE-Core when used with this new ignore list: * The archiver directory matched a "${WORKDIR}/deploy*" pattern so was renamed to something else since that directory does need its root permissions * The ${S} and ${B} ignoring is conditional on them being different to ${WORKDIR} * package_write_* task output (the debs/rpms/ipks) are now owned by the build user so we don't want the file ownership information in the hashequiv outhash calculation even if they are built under pseudo. * The fontcache postinstall intercept is run under qemu outside of pseudo context so delete files it may delete up front where pseudo can see this. * SSTATE_DIR is in PSEUDO_PATHS_IGNORE, which is in FAKEROOTENV which is cached by bitbake. We therefore need to trigger reparsing if this changes, which means SSTATE_DIR can be in BB_HASHBASE_WHITELIST but not BB_HASHCONFIG_WHITELIST. Rework the variables to handle this. This otherwise breaks some of our sstate tests in oe-selftest. * Ignore the temp directory wic uses for rebuilding rootfs. (From OE-Core rev: 61f8cf0940f8b05e9399a062eddb8055ea69bc5e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad8f5532ffaead9a5ad13e1034fe9e5e1b7979f4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: oe-run-native, fix *-native directoriesAdrian Herrera2021-01-211-1/+1
| | | | | | | | | | | | | | | | | | This fixes a crash with "find" when running a native tool and *-native directories do not exist under the binary directory in the sysroot. This happened because the directory wildcard was passed as part of the root directory. The directory wildcard is now passed by "-name", which returns an empty result if no matching directory. (From OE-Core rev: d5cb96e3b5501b7349d075c47636902c9ce1c49c) Signed-off-by: Adrian Herrera <adrian.herrera@arm.com> Change-Id: Iba7acd8bbd7e0beb4d25c984f6af7a4fd21486e6 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f6c90ed0ad24b7d4f892e22e088b1578824eb1d3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix typoDaniel Ammann2021-01-131-1/+1
| | | | | | | | | | (From OE-Core rev: 42f2312ec723c8e6559cd344e4afee4bbdaf9f41) Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9ab4c4571d899d2eefcd2fc53af0851863f29008) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/direct/kparser: ensure fsuuid for vfat and msdos align with formatLee Chee Yang2021-01-092-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | vfat/msdos filesystem should have fsuuid in format 0xYYYYYYYY where "0x" in front follow with 8 hexadecimal number in uppercase. In wic, when using custom fsuuid for vfat/msdos partition in wks, it is able to set the value in any length, with or without leading "0x". This can cause fsuuid missaligned when fstab updates, fstab expect exactly 10 character fsuuid for vfat/msdos partition and all in uppercase. if custom fsuuid for vfat/msdos is set, check the length and format, error if it exceed the format size. Amend it so it is align with format 0xYYYYYYYY. This is done before image create and fstab update to ensure the fsuuid are same in all followup process. if custom fsuuid length less than expected, fill in "0". [YOCTO #14161] (From OE-Core rev: 974e09f3460a27c85a599d8269e3dea66df5ddd2) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d9686ae511ef10a504becfd81bfe296b788e1456) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: remove unused variableRoss Burton2020-12-181-1/+0
| | | | | | | | | | | | This variable isn't used at all. (From OE-Core rev: 7317bc23d55dfd0068910e3d8524a284cc2bacd5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9676ee24d190b144cb50be6ebde3990644a6df2a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* update_udev_hwdb: clean hwdb.binMingli Yu2020-11-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Steps to reproduce: echo "IMAGE_INSTALL_append = \" udev-hwdb lib32-udev-hwdb\"" >> conf/local.conf When install both udev-hwdb and lib32-udev-hwdb as above, there comes below do_populate_sdk error: $ bitbake core-image-sato -c populate_sdk ERROR: Task (/path/core-image-sato.bb:do_populate_sdk) failed with exit code '134' NOTE: Tasks Summary: Attempted 5554 tasks of which 0 didn't need to be rerun and 1 failed. $ cat /path/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r5/pseudo/pseudo.log [snip] inode mismatch: '/path/tmp/work/qemux86_64-poky-linux/core-image-sato/1.0-r5/sdk/image/usr/local/oecore-x86_64/sysroots/core2-64-poky-linux/lib/udev/hwdb.bin' ino 427383040 in db, 427383042 in request. [snip] It is because both udev-hwdb and lib32-udev-hwdb will generate ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/lib/udev/hwdb.bin during do_populate_sdk and it triggers pseudo error. So clean hwdb.bin before generate hwdb.bin to avoid conflict to fix the above do_populate_sdk error. (From OE-Core rev: 10413cf013ae5a92ef12f33dab8e67f0bfb0ae25) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c7472925feb53ce92c1799feba2b7a9104e3f38f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-build-perf-report: Ensure correct data is shown for multiple branch optionsRichard Purdie2020-10-221-2/+2
| | | | | | | | | | | | If --branch and --branch2 are the same, there is extra confusing data plotted onto the graph. Only do that if the branches are actually different. (From OE-Core rev: e2240d0a93a9a2932506a356315ad6702ecee9b6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c263d810b7eb47ee90f2adeb5ab6decf7332bec2) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-build-perf-report: Allow operation with no buildstatsRichard Purdie2020-10-221-1/+1
| | | | | | | | | | | If buildstats is missing, avoid a backtrace. (From OE-Core rev: a518443e6799d56b899536d853282182eff4822a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 23c4b21f947c7aae1303ca6526fc5aaaa9fc7bb8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add 512 Byte alignment to --offsetJoshua Watt2020-10-062-10/+18
| | | | | | | | | | | | | | | | Allows the --offset argument to use the "s" or "S" suffix to specify that it is reporting the number of 512 byte sectors. This is required for some SoCs where the mask ROM looks for an item at a sector that isn't aligned to a 1KB boundary. (From OE-Core rev: b9296bdeaacc1dce97aac9c9bf0d70555bb36646) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 938595d1dc4abaf5f7f3a7900add3f0492b805d0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix error message when reporting invalid offsetJoshua Watt2020-10-061-1/+1
| | | | | | | | | | | | | The error message was reporting the calculated offset instead of the current offset, which made it confusing. (From OE-Core rev: 0ff25797126772f40e357a2f3cf81eccf659adaf) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2be775cfe1b49ce3889b5dc326e2b67a9667f18a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix --extra-space argument handlingJoshua Watt2020-10-061-1/+1
| | | | | | | | | | | | | | 467f84e12b ("wic: Add --offset argument for partitions") broke the --extra-space argument handling in wic. Fix the option and add a unit test for the argument. (From OE-Core rev: 62a7a10c31bcf133cbd99d4de928f15a30e45ab1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 87722a92c18f94917c8f70afc8cd0763462a5c25) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --offset argument for partitionsJoshua Watt2020-10-063-20/+42
| | | | | | | | | | | | | | | | | | | | | | | Add support for an --offset argument when defining a partition. Many SoCs require that boot partitions be located at specific offsets. Prior to this argument, most WKS files were using the --align attribute to specify the location of these fixed partitions but this is not ideal because in the event that the partition couldn't be placed in the specified location, wic would move it to the next sector with that alignment, often preventing the device from booting. Unlike the --align argument, wic will fail if a partition cannot be placed at the exact offset specified with --offset. Changes in V2: * Fixed a small typo that prevented test_fixed_size_error from passing (From OE-Core rev: 897aaff8961f7fe83634a3b0b94e19b43aea5857) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 467f84e12b96bc977d57575023517dd6f8ef7f29) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/oe-build-perf-report: Use python3 from the environmentRichard Purdie2020-09-231-1/+1
| | | | | | | | | This means ot matches the rest of the system rather than causing confusing errors where multiple python versions are mixed. (From OE-Core rev: 95d5005828b0d32d610874986fcc298b12347079) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-publish-sdk: fix layers init via sshAdrian Freihofer2020-09-171-1/+1
| | | | | | | | | | | | | | Escaping does not work in my use case. It must be escaped for python, ssh and shell as well as for different versions of echo. Let's try it a little less elegant, but hopefully more reliable. (From OE-Core rev: cdbc9bf63b3e1354800032d0dd530949bafb7032) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5cc1ae332eb6b05d83802c8d64ab2767c7079412) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Add a hook to allow it to reniceRichard Purdie2020-09-171-0/+5
| | | | | | | | | | | | | | We have an issue where qemu is being starved of resources on our autobuilders. We can't raise its priority without special capacilties, therefore add a hook which if present can allow this to happen using an executable "~/runqemu-renice". (From OE-Core rev: 829443b3fafa000e330c06ebb144641bd2d20ad1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 141a3c9ce93bc3d526303021ecf0460c6e9fea8a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: Fix size calculation for hard linksMichael Tretter2020-09-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | If a package contains hard links to a file, the file size is added for each hard link instead of once for the file. Therefore, the calculated size may be much larger than the actual package size. For example, the mesa-megadriver package contains several hard links to the same library. Keep track of the inode numbers when listing the files that are installed and use the actual size only for the first occurrence of an inode. All further hard links to the same inode are added to the file list, but accounted with size 0. All file names need to be added to the file list, because the list is used for preserving the files/hard links on the target. (From OE-Core rev: 85b1e835572d184cfff86a87fced8673d1d40a7c) Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 17e92572278980d1a7f06de9d72c68baf57698f1) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: misc: Add /bin to the list of searchpathsVijai Kumar K2020-09-101-2/+3
| | | | | | | | | | | | | /bin is also a valid path where one can find executables. Add that to the search path. (From OE-Core rev: 2427c872baf1be5ab9e9fcc0a17ee3b267db0edd) Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ca0a6025351cb2135e87cecf828633cf12aa34c6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: expand SRC_URI when guessing recipe update modeMartin Jansa2020-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * I have recipes which use variable inside SRC_URI, e.g.: ROS_BRANCH ?= "branch=release/melodic/swri_nodelet" SRC_URI = "git://github.com/swri-robotics-gbp/marti_common-release;${ROS_BRANCH};protocol=https" and devtool modify works fine, but devtool finish fails with: $ devtool finish --force-patch-refresh swri-nodelet meta-ros/meta-ros1-melodic/ ... Traceback (most recent call last): File "/OE/openembedded-core/scripts/devtool", line 334, in <module> ret = main() File "/OE/openembedded-core/scripts/devtool", line 321, in main ret = args.func(args, config, basepath, workspace) File "/OE/openembedded-core/scripts/lib/devtool/standard.py", line 2082, in finish updated, appendfile, removed = _update_recipe(args.recipename, workspace, rd, args.mode, appendlayerdir, wildcard_version=True, no_remove=False, no_report_remove=removing_original, initial_rev=args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh) File "/OE/openembedded-core/scripts/lib/devtool/standard.py", line 1737, in _update_recipe mode = _guess_recipe_update_mode(srctree, rd) File "/OE/openembedded-core/scripts/lib/devtool/standard.py", line 1721, in _guess_recipe_update_mode params = bb.fetch.decodeurl(uri)[5] File "/OE/bitbake/lib/bb/fetch2/__init__.py", line 390, in decodeurl raise MalformedUrl(url, "The URL: '%s' is invalid: parameter %s does not specify a value (missing '=')" % (url, s)) bb.fetch2.MalformedUrl: The URL: 'git://github.com/swri-robotics-gbp/marti_common-release;${ROS_BRANCH};protocol=https' is invalid: parameter ${ROS_BRANCH} does not specify a value (missing '=') let it expand the SRC_URI before trying to decode it. (From OE-Core rev: 2de84e6e767d4c3e517d7413a37700bf1991a460) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3535cfdbf3d77f550b804276f957acf859da484f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Show an error for conflicting graphics optionsRichard Purdie2020-09-021-0/+4
| | | | | | | | | | | | | | The autobuilder managed to pass the nographic option with "sdl gl" due to a problem elsewhere. It would have been useful for runqemu to have errored rather than passing conflicting options to qemu. Add an error for this invalid usecase. (From OE-Core rev: e62c8207fa47ff4e325529ea84e0d51710deaa3c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 377a6ffbcba0d3c5ede470c989756c4d1636873f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: Check gtk or sdl option is passed together with gl or gl-es options.Vasyl Vavrychuk2020-08-271-1/+2
| | | | | | | | | | | | | | runqemu help reports that gtk or sdl option is needed with gl or gl-es option. But if user forgot to add gtk or sdl option, then gl or gl-es options were silently skipped. (From OE-Core rev: bec0a45393d968251059f5075add2cf633aecd1a) Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d1e93d4bf013bb0c48032bfda43f77c5aba9ecf) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* checklayer: check layer in BBLAYERS before testLee Chee Yang2020-08-072-1/+22
| | | | | | | | | | | | | | | | | | | | | layer under test should absent from BBLAYERS when running yocto-check-layer. This allow to get signatures before layer under test. There are existing steps to add the layer under test to BBLAYERS after getting initial signatures. add steps to check for layer under test in BBLAYERS before running any test, skip test for the layer if the layer under test exist in BBLAYERS. [YOCTO #13176] (From OE-Core rev: a10ff925584406e563edfb4042b44c3e8ea57ce3) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit be02e8dbfb0d1decce125322f9f1e11a649756c0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Fall back to standard copy when no way to get the block mapKevin Hao2020-07-311-1/+27
| | | | | | | | | | | | | | | | | For some filesystems, such as aufs which may be used by docker container, don't support either the SEEK_DATA/HOLE or FIEMAP to get the block map. So add a FileNobmap class to fall back to standard copy when there is no way to get the block map. [Yocto #12988] (From OE-Core rev: 66f9db48bb9d59f08492f0515bc08b6b039aa03f) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7934ed49179242f15b413c0275040a3bb6b68876) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Drop the unused get_unmapped_ranges()Kevin Hao2020-07-311-36/+2
| | | | | | | | | | | | This method is not used by any code, so drop it. (From OE-Core rev: 19078f9540c455ccddb6f2986b96562a8186ec35) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6513fd9302b9989f97fc9d95e76e06ad5d266774) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Drop the unused block_is_unmapped()Kevin Hao2020-07-311-17/+0
| | | | | | | | | | | | This method is not used by any code, so drop it. (From OE-Core rev: 14cbfc04f4a9da5baba6267daefd54a12a04d56e) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fb62a15349597ee026c67a0bb0a6ca2cc9bfe420) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/recipetool/create.py: fix regex stringsTim Orling2020-07-221-5/+5
| | | | | | | | | | | | | | Python now expects regex strings to be prepended with r. Silence pylint/autopep8 and similar warnings by identifying these regex patterns as... regex patterns. (From OE-Core rev: f8a5db7a6072ddb1be96405fc8b44f595275206d) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0eae98a369d80340e48dc690d09a1364cde97973) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: default to empty string, if LIC_FILES_CHKSUM is not availableBjarne Michelsen2020-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | [Bug 13971] https://bugzilla.yoctoproject.org/show_bug.cgi?id=13971 A recipe using LICENSE=CLOSED would normally not have LIC_FILES_CHKSUM set. If LIC_FILES_CHKSUM was not set, it would cause `devtool upgrade` to fail. This fixes the issue by defaulting to an empty string if LIC_FILES_CHKSUM is not found. [YOCTO #13971] (From OE-Core rev: 9c7f3281884c50dbd05e2966e2409255c127ebfa) Signed-off-by: Bjarne Michelsen <bjarne_michelsen@hotmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 95e112f0f465868e98285509ea0d1a624a439ac2) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* checklayer: parse LAYERDEPENDS with bb.utils.explode_dep_versions2()Nicolas Dechesne2020-07-021-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | LAYERDEPENDS is a string of this format: "DEPEND1 (optional version) DEPEND2 (optional version) ..." However when we parse LAYERDEPENDS in _get_layer_collections() we parse it as a simple string, and if any optional versions are there the 'depends' field is wrong. For example, running yocto-check-layer might result in such errors: ERROR: Layer meta-python depends on (>= and isn't found. ERROR: Layer meta-python depends on 12) and isn't found. Let's use bb.utils.explode_dep_versions2() to parse LAYERDEPENDS, and create a string that contains all dependencies, effectively skipping/ignoring any optional versions. [YOCTO #13957] (From OE-Core rev: 819f41906197bb712af37349c0865002bfbd7c9b) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f81f07afc200fe06c5c06ea81a4f8a3a43436faf) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>