summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)Author
2021-08-25wic: don't forcibly pass -T defaultRoss Burton
This reverts part of oe-core eecbe62555, which was a previous attempt to solve the Y2038 problem. This is now solved centrally in e2fsprogs, so doesn't need to be dealt with in wic. We don't revert the commit entirely, to retain the warning if a filesystem has small inodes. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7e8017208bed98b6c90735cb641fc9d7aedf9140) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-08-09runqemu: Fix typo in error messageMatthias Klein
Signed-off-by: Matthias Klein <matthias@extraklein.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5cc0051d50974e198313f9513b24fd7ae9a96dd4) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-08-09devtool: print a warning on upgrades if PREFERRED_VERSION is setAlexander Kanavin
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0b0f53eed0aadbf45d9eead96ebf7725cc7447e6) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31oe-setup-builddir: update YP docs and OE URLsMichael Opdenacker
This updates the link to the YP docs and proposes to access the OE website through https Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 87686233aeffc639c3f412fd5c4898b32b15013b) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31yocto-check-layer: ensure that all layer dependencies are tested tooNicolas Dechesne
In order to be compliant with the YP compatible status, a layer also needs to ensure that all its dependencies are compatible too. Currently yocto-check-layer only checks the requested layer, without testing any dependencies. With this change, all dependencies are also checked by default, so the summary printed at the end will give a clear picture whether all dependencies pass the script or not. Using --no-auto-dependency can be used to skip that. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 45d59b774b95c91193a8376b83c05291d555e5c8) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31checklayer: rename _find_layer_dependsNicolas Dechesne
What this function does is really to find a layer, not a 'depends'. We are using this function to find a dependent layer, but the name is confusing. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e9b7690ab30d0e7c07471034f6cb89ccc3168a11) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31checklayer: new function get_layer_dependencies()Nicolas Dechesne
Split add_layer_dependencies() into 2 parts. First search for layer dependencies, and then add them to the config. That allows us to call get_layer_dependencies() independently. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 08edf928aac3f2daaa0c256d4c21e56e2db72bff) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31yocto-check-layer: improve missed dependenciesNicolas Dechesne
The first 2 calls to add_layer_dependencies() are here to add all dependencies for the 'layer under test' and the additional layers provided by the users. In both cases, we use misssing_dependencies boolean to indicate if any dependency is missing. But we then never really use missing_dependencies. Instead the script is calling add_layer_dependencies() again (for both the layer under test, and the additional layers) to detect if there are any missing dependency. As a result, we are trying to add again all dependencies, and we can see that from the traces: INFO: Detected layers: INFO: meta-aws: LayerType.SOFTWARE, /work/oe/sources/meta-aws INFO: checklayer: Doesn't have conf/layer.conf file, so ignoring INFO: INFO: Setting up for meta-aws(LayerType.SOFTWARE), /work/oe/sources/meta-aws INFO: Adding layer meta-python INFO: Adding layer meta-oe INFO: Adding layer meta-networking --> INFO: Adding layer meta-python INFO: meta-python is already in /work/oe/poky/master/build-checklayer/conf/bblayers.conf INFO: Adding layer meta-oe INFO: meta-oe is already in /work/oe/poky/master/build-checklayer/conf/bblayers.conf INFO: Adding layer meta-networking INFO: meta-networking is already in /work/oe/poky/master/build-checklayer/conf/bblayers.conf <-- INFO: Getting initial bitbake variables ... The code appears more complex than it should, and we can simply replace the complex if statement by using missing_dependencies, and avoid duplicating the call to add_layer_dependencies(). Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fceb84f7bc472731b8f96ee1ebf0f4485943226c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-31devtool: correctly handle non-standard source tree locations in upgradesAlexander Kanavin
When S is set to a sub-directory of upstream source, the license checks and the bbappend writing (specifically, setting EXTERNALSRC) need to operate on that sub-directory. 'devtool modify' already has similar logic, and it was copied from there and adjusted. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fd77e356d4507405fde352c8bba7d3842518bbdd) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-13runqemu: Remove potential lock races around tap device handlingRichard Purdie
The qemu tap device handling is potentially race ridden. We pass the fd to the main qemu subprocess which is good as it means the lock is held as long as the qemu process exists. This means we shouldn't unlock it ourselves though, only close the file. We also can't delete the file as we have no idea if qemu is still using it. We could try and obtain an exclusive new lock, then the file would be safe to unlink but it doesn't seem worth it. Also fix the same issue in the port lock code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2a87bddabf816d09ec801e33972879e6983627eb) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-07-13devtool: deploy-target: Fix preserving attributes when using --stripFlorian Amstutz
Commit a2db4fa127a3347fc6df31f895fb0b552669119e added ${WORKDIR}/deploy-* to PSEUDO_IGNORE_PATHS. This breaks the --strip mode since ${D} is copied to deploy-target-stripped. Use the directory devtool-deploy-target-stripped instead. [YOCTO #14451] Signed-off-by: Florian Amstutz <florian.amstutz@scs.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 02661f20faf11d0fa2f1874bd423f5d9fa7a31c9) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-06-30Use the label provided when formating a dos partitionjbouchard
Previously the bootimg-pcbios wic plugin was not respecting the --label option provided from the wks file. The plugin was setting the label to 'boot'. With this fix, the --label option is use. If no option are specified, then the default is 'boot'. Signed-off-by: jbouchard <jeanbouch418@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0fd7a73c1bd2486b7a022f0f69bbcb2e0d9cb141) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-06-30devtool upgrade: rebase override-only patches as wellAlexander Kanavin
There's a number of recipes (such as nettle or glib) which were upgraded incorrectly due to rebasing only the default set of patches in main SRC_URI. Native-only or musl-only patches were not handled, causing do_patch fails and overall misery. Unfortunately, this also necessitates aborting any incomplete rebases as devtool needs to be able to return to the original branch to complete the upgrade command. Also, do not add devtool-patched-%version tags, as they are not used anywhere, and it's unclear how to extend them to cover multiple override branches. (From OE-Core rev: 00131cbc969f6a73caffe068fcb983287cbe577f) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 588d04748dd89b5371ca9144666e97ec82dd6204) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-05-07oe-buildenv-internal: add BitBake's library to PYTHONPATHRoss Burton
There are many Python scripts in oe-core that want to use Tinfoil, and right now they have to know where they are to work out where BitBake is likely to be. This is suboptimal as BitBake could be somewhere else, so this approach doesn't scale to other layers at all. Solve this by adding BITBAKEDIR/lib to PYTHONPATH in oe-buildenv-internal, so that Python has BitBake on its search path once the build system is configured. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a48178f6d00e7f97a09f42d5a164204e9dcffa9f) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-05-06pybootchart/draw: Avoid divide by zero errorRichard Purdie
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b71d30aef5dc2c360432c0dd4147859dd303ea48) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-04-26yocto-check-layer: Avoid bug when iterating and autoadding dependenciesRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bf1b467dacf345379cd5d84a1c9b3b0d844d5c91) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-04-23runqemu: Ensure we cleanup snapshot files after image runRichard Purdie
We need to cleanup snapshot files if we make a copy of them to ensure the tmpfs doesn't run out of space. There is already NFS code needing this so make it a generic code path. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a3e0eec5a4785a0c4859455eb10b43aa832e606d) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-04-23oe-time-dd-test.sh: increase timeout to 15 secRandy MacLeod
With the previous timeout of 5 seconds, there would be builds such as: https://autobuilder.yocto.io/pub/non-release/20210417-13/ which produced 17 files with top output with top running 454 times and that's a bit too much data to analyze for each run. By increasing the timeout, we'll find the worse problems first, fix them and then we can decrease the timeout if needed. Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 92b29a09b4c442597d212337b785afb76129ac7c) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-04-23scripts/oe-debuginfod: correct several issuesAlexander Kanavin
Particularly: - nesting subprocess.run() inside subprocess.check_output() does not work at all. How was this tested? - -R and -U options can be combined; no need to separate the invocations based on packaging format - both exception handlers are unnecessary; we can simply print the hint if invocation did not succeed - to run debuginfod from its own sysroot, '-c addto_recipe_sysroot' for elfutils-native must be executed Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9e57bf636ec63e74d56f1ac48b5a27c5b80f1877) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
2021-04-16oe-time-dd-test.sh: provide more information from "top"Sakib Sajal
Improvements: - increase width to 512 - pass -c option to show full command-line Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-16oe-time-dd-test.sh: make executableSakib Sajal
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-06oeqa/runqemu: Support RUNQEMU_TMPFS_DIR as a location to copy snapshot images toRichard Purdie
We have a working theory that IO queues on the autobuilder are impacting runtime testing under qemu, particularly async writes which inice does not influence. We already pass the snapshot option to qemu which copies the image and runs out of the copy. Add in the ability to copy the image to a specificed location which can be a tmpfs. This means that writes to the image would no longer be blocked by other writes to disk in the system. Preliminary tests show that this does improve the qemu errors at the expense of sometimes showing qemu startup timeouts as on a loaded system with a large test image, it can take longer than 120s to copy the image to tmpfs. Having a most consistent failure mode for loaded tests is probably desireable though. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-04-05runqemu: do not stop processing graphical options after nographicAlexander Kanavin
Some options such as egl-headless are fully compatible with it, so there is no need to quit. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-26documentation-audit.sh: Fix typo in specifying LICENSE_FLAGS_WHITELISTKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-23scripts: add oe-time-dd-test.shSakib Sajal
oe-time-dd-test records how much time it takes to write <count> number of kilobytes to the filesystem. It also records the number of processes that are in running (R), uninterruptible sleep (D) and interruptible sleep (S) state from the output of "top" command. The purporse of this script is to find which part of the build system puts stress on the filesystem io and log all the processes. Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-20scripts/verify-bashisms: Update checkbashisms.pl URLPetr Vorel
anonscm.debian.org is not used any more, update the URL. Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-15scripts/contrib/list-packageconfig-flags: Upate for tinfoil API changesRichard Purdie
Update after tinfoil API changes in bitake for REQUIRED_VERSION. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-14bitbake-whatchanged: change ending quote to proper periodRobert P. J. Day
Pretty sure that trailing quote should be a period; it appears to work properly. Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-14devtool: Fix do_kernel_configme taskAlejandro Hernandez Samaniego
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. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alhe@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11runqemu: modify novga to conform to documentationJon Mason
Passing 'novga' only adds '-vga none' to the qemu commandline and does not prevent other vga devices from being added, contrary to the documentation/help. Clean-up the vga logic and add the ability to prevent other vga devices from being added. Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I7ff8f9f3e419ce8bae3f3847d75f9275ca30406a Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11runqemu: correct forcing of ttyS0Jon Mason
Some platforms do not use ttyS* for their serial consoles (e.g., qemuarm and qemuarm64). The hardcoding of this can cause issues. Modify runqemu to use the serial consoles defined in SERIAL_CONSOLES instead of hardcoding. Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I746d56de5669c955c5e29d3ded70c0a4d3171f17 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-11runqemu: add QB_GRAPHICSJon Mason
Add a new runqemu field for VGA devices. Currently, these are being set in QB_OPT_APPEND, which can make them difficult to override if importing the config file into another one. Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I8cb9527954c5b06c083c42fe2466cb3338584b7d Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-10sstate-diff-machines.sh: support rpm, deb and tar package types in analysisDiego Santa Cruz
The sstate-diff-machines.sh script's --analyze option was only supporting ipk packages, this adds rpm, deb and tar packages, checking all the used package types simultaneously. Without this changing sstate between machines would not report an error if the difference occured in packages and ipk packaging was not enabled. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-06runqemu: use "raw" instead of "bin" for ovmfJon Mason
bin is not an acceptable format for qemu and will throw an error is set. The correct format in this case is raw. Signed-off-by: Jon Mason <jon.mason@arm.com> Change-Id: I9d78e356d39ecb15bef886c19870b029d9badd65 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-02scripts/oe-debuginfod: script that fetches package manager directoryDorinda
Added a script that fetches the package manager directory and runs the elfutils-native debuginfod on DEPLOY_DIR Added a check to ensure that PACKAGECONFIG options is set in local.conf Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-03-02scripts/lib/wic/partition.py: do not set FAT sizeAlexander Kanavin
Modern dosfstools automatically determines the appropriate size and will error out if something that doesn't make sense is supplied on the command line. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-26wic: Warn if an ext filesystem affected by the Y2038 problem is usedFlorian Bezdeka
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. Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-23runqemu: Add new option to disable vga emulationKhem Raj
When using nographic, explicitly disabling vga is needed some cases since some qemu firmware (OpenFirmware ) defaults to std vga, and when vga is enabled then it disables output to serial and redirects that to vga which is by design, hwoever we expect the console output to go to serial when using nographic, therefore its important to disable vga with nographic especially on qemu based ppc platforms Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-10oe-pkgdata-util: Check if environment script is initializedDorinda
Tinfoil doesn't behave well if environment is not initialized, this check ensures a proper error log if environment is not initialized. [YOCTO #12096] Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-09wic: debug mode to keep tmp directoryLee Chee Yang
files in wic tmp directory can be usefull for debugging, so do not remove tmp directory when wic create run with debugging mode (-D or --debug). also update wic.Wic.test_debug_short and wic.Wic.test_debug_long to check for tmp directory. [YOCTO#14216] Signed-off-by: Lee Chee Yang <Chee.Yang.Lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-23devtool: Fix file:// fetcher symlink directory structureTomasz Dziendzielski
Add relative path if file is under directory. [YOCTO #13738] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20devtool: Fix source extraction for gcc shared sourceTomasz Dziendzielski
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] Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20wic: Optimise fstab modification for ext2/3/4 and msdos partitionsPaul Barker
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. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20wic: Copy rootfs dir if fstab needs updatingPaul Barker
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] Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20wic: Update pseudo db when excluding content from rootfsPaul Barker
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. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20wic: Ensure internal workdir is not reusedPaul Barker
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. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-20runqemu: Add support for VHD/VHDX rootfsSinan Kaya
Signed-off-by: Sinan Kaya <okaya@kernel.org> Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-16recipetool: create: only add npmsw url if requiredKamel Bouhara
Before adding a npmsw fetcher to a recipe we should first check if the generated shrinkwrap file contains dependencies. Signed-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-15scripts: oe-run-native, fix *-native directoriesAdrian Herrera
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. Signed-off-by: Adrian Herrera <adrian.herrera@arm.com> Change-Id: Iba7acd8bbd7e0beb4d25c984f6af7a4fd21486e6 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-13wic: Allow exec_native_cmd to run HOSTTOOLSPaul Barker
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. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>