summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
* devtool: __init__: simplify replace_from_fileChris Laplante2025-09-181-19/+8
| | | | | | | | | | Mostly just remove some useless helper functions (From OE-Core rev: b27b1083f59cf0a268e9b141568119f257002d13) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: __init__: small cleanupsChris Laplante2025-09-181-8/+1
| | | | | | | | | | | | | + Remove unused exec_fakeroot method, which wouldn't work anyway since it doesn't pass kwargs correctly. + Fix a None comparison (From OE-Core rev: bff3a3d9f8fa695fa05d91419d995de4c8009d9b) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: __init__: cleanup imports, including a missing 'import errno'Chris Laplante2025-09-181-2/+8
| | | | | | | | (From OE-Core rev: 9be824a14ea61ea97d717d25058231f9f09f07a0) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add --extra-space back for compatibilityRoss Burton2025-09-151-1/+1
| | | | | | | | | | | | | | | | | The --extra-space argument was renamed to --extra-filesystem-space to be clear what space is being added to, but this breaks existing wic files. Add back --extra-space as an alias for --extra-file-system-space so that existing wks files don't fail. [1] oe-core 39d10137b86 ("wic: rename wks flag --extra-space to --extra-filesystem-space") (From OE-Core rev: 1d2a714fbe96fa3115fafb1d4d29667b6ae4a881) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: partition.py: fix help stringTrevor Woerner2025-09-111-1/+1
| | | | | | | | | | | | | | | | The help suggests invoking 'wic help source-plugins' for information on how to add a new plugin, this results in: usage: wic help [-h] {plugins,overview,kickstart,create,ls,cp,rm,write,list} ... wic help: error: argument help_topic: invalid choice: 'source-plugins' (choose from 'plugins', 'overview', 'kickstart', 'create', 'ls', 'cp', 'rm', 'write', 'list') The proper command is 'wic help plugins'. (From OE-Core rev: 7e5c7633a3cb7f1718f40ba63ecc30bb8ea07928) Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rename wks flag --extra-space to --extra-filesystem-spacePierre-Loup GOSSE2025-09-083-21/+22
| | | | | | | | | | | | | Makes a clear distinction with --extra-partition-space flag. (From OE-Core rev: 39d10137b86ebb6d1f20c36ae50a7771e6c76251) Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr> CC: Alexander Kanavin <alex.kanavin@gmail.com> CC: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add --extra-partition-space option to set unused spacePierre-Loup GOSSE2025-09-083-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, the content of the partition is filled by the filesystem without leaving any unused free space. The --extra-space flag adds extra space to the filesystem size, not to the partition. Unused free space after the filesystem can be useful for some cases, such as encrypting a partition at runtime. With --extra-partition-space 32M, we ensure that the last 32M of the partition is unused: this space does not contain filesystem data and can store the LUKS2 header. The implementation sets a difference between the partition and filesystem size: - With --fixed-size, the extra part space is removed from the filesystem size. - Otherwise (with or without --size flag), the extra part space is added to the partition size. (From OE-Core rev: 22fd1702aedf40257aa53963b62b5ef1bbd2818a) Signed-off-by: Pierre-Loup GOSSE <pierre-loup.gosse@smile.fr> CC: Alexander Kanavin <alex.kanavin@gmail.com> CC: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_go: Tidy up a bitChristian Lindeberg2025-09-081-36/+34
| | | | | | | | | | | There is no need for a temporary Go module cache after moving generation of module dependency include files to go-mod-update-modules.bbclass. (From OE-Core rev: 376ce22b3ba5286eda54d9f9bb1c4cd7f54ff9e7) Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix --overhead-factor and --extra-space checksDiego Sueiro2025-08-251-2/+2
| | | | | | | | | | | | If --overhead-factor and --extra-space are passed with =FOO the check fails. Fix this by checking parsed.overhead_factor and parsed.extra_space instead. (From OE-Core rev: 46c24b67d4e9d28e7216a7394090d807cf879fa7) Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: add help and usage commentsVincent Davis Jr2025-08-141-1/+42
| | | | | | | | | | | Adds comments underneath class declaration defining plugin usage and potential optional variables to set. (From OE-Core rev: 6a8c350f595255b6febfdbc5af668286ccb973df) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: include grub as an optional bootloaderVincent Davis Jr2025-08-141-6/+36
| | | | | | | | | | | | | | | | | | | | | | Commit adds in support for installation of both grub and syslinux using newly added grub functions. Due to the bootimg_biosplusefi source_params['loader'] had to be named source_params['loader-bios'] so not to create conflict in the wics plugin. Commits also adds ability to set and or not set source_params. If source_params set check for both * syslinux * grub if not set default to using syslinux as bootloader. (From OE-Core rev: 5caf6fe32aa4655f46fb7b490a22778c59b2efc0) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: add funcs to configure booting with grubVincent Davis Jr2025-08-141-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Functions added, but not executed during wic image creation include: _get_staging_libdir * Finds target lib directory if for some reason STAGING_LIBDIR isn't set. _do_configure_grub * Will search for a grub configuration passed via bootloader --configfile. If not found build a default one which searches for partition that contains the given the kernel name via grub search module. _do_prepare_grub 1. Sets default values for GRUB_MKIMAGE_FORMAT_PC and GRUB_PREFIX_PATH if none specified. Both variables are required by grub-mkimage. * GRUB_MKIMAGE_FORMAT_PC is used to define target platform. * GRUB_PREFIX_PATH is used to define which directory grub config and modules are going to reside in. 2. Generates grub config to embed into core.img. This config is used to search for partition containing grub config. 3. Creates a custom core.img or grub stage 1.5 with an embedded grub config. 4. Copies all the target built grub modules into GRUB_PREFIX_PATH directory. 5. Creates boot partition _do_install_grub 1. dd target platform specific boot.img to the first 0-440 bytes of the resulting wic image. dd grub stage 1 to wic image. If this wics plugin is used with GPT as partition table format and grub selected as bootloader it's more than likely for grub hybrid booting because bootimg_efi plugin should and more than likely will be used in that case. So, boot.img may be dd regardless if partition table format is GPT or MBR. 2. dd custom core.img (grub stage 1.5) with embedded configuration to the resulting wic image starting at byte 512 up to sizeof(core.img). 3. Both boot.img and core.img are required for legacy bios boot. See grub Wiki for more details on boot.img and core.img. https://en.wikipedia.org/wiki/GNU_GRUB Commit also imports python modules required by the above implemented functions. (From OE-Core rev: 27c56962f47303cf49a4cf641e85239e4d7779b5) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: cleanup prepare and install syslinux funcsVincent Davis Jr2025-08-141-14/+11
| | | | | | | | | | | | | | | | | | | This commit: 1. Removes unrequired function params from * _do_prepare_syslinux * _do_install_syslinux Reason is that they aren't required by the function. 2. Moves finding of resulting wic image back into do_install_disk task. As the same code may be leverage to install other bootloaders to the resulting disk. (From OE-Core rev: 27e3fc1ef5304278254d2288ffc99e1757dd4053) Signed-off-by: Vincent Davis Jr. <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: cleanup _do_configure_syslinux functionVincent Davis Jr2025-08-141-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit: 1. Removes all unrequired function parameters. The part parameter was kept due to it's potential future usage in _do_configure_syslinux function. part.fstype specifically may be used with the rootfstype kernel paramater. 2. Sets a default timeout to 500 if bootloader --timeout not specified. To avoid 'None' being placed as the value in resulting configuartion file. 3. Sets a default kernel parameter string if bootloader --append not specified. This also helps avoid 'None' being places as the value in resulting configuration file. 4. Replace all instances of cr_workdir, "/hdd/boot" with variable hdddir as it's set at the top of the function. No, need to re-implement what the variable is already defined to store. (From OE-Core rev: 5e17a1cf73d0542e0c7ec9333aaf20bbc45df8de) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: seperate bootloader config creationVincent Davis Jr2025-08-141-13/+18
| | | | | | | | | | | | | | | | | | | Most bootloaders that will be included in this wics plugin will require a configuration file to define kernel params, execute custom modules, or enable the ability to select one of multiple boot entries. Create a seperate generic function to facilitate finding if a bootloader config file passed through bootloader --configfile flag. So, that other functions that are used to create/install a bootloader boot configuration file can leverage the function. (From OE-Core rev: 7944e29eb6ab7b80ad3847686dd780100623b196) Signed-off-by: Vincent Davis Jr. <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: move syslinux funcs to end of fileVincent Davis Jr2025-08-141-39/+39
| | | | | | | | | | | | | | | | | | | | | | | This commit moves the seperated syslinux creation functions from their current position to end of file in the order 1. _do_configure_syslinux 2. _do_prepare_syslinux 3. _do_install_syslinux This is to prepare for inclusion of other bootloaders. It also makes reading through the wics plugin much easier if you group bootloader specific partition creation functions together and place them at the bottom of the file versus leaving them in their current position. (From OE-Core rev: 9034dd23e4240536a37a2290f2f2dd48d9bddd29) Signed-off-by: Vincent Davis Jr. <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bootimg_pcbios: move syslinux install into seperate functionsVincent Davis Jr2025-08-141-0/+27
| | | | | | | | | | | | | | | | | | | | | | Current oe-core bootimg_pcbios wics plugin only supports installing syslinux directly into the resulting wic image. This commit seperates syslinux installation from class BootimgPcbiosPlugin(SourcePlugin) override functions in preparation of supporting the installation of other bootloaders to the resulting wics plugin such as: * grub * extlinux Being moved now to make it easier to include future bootloaders. (From OE-Core rev: 78addc3a7c2f036e8932305368acd6090937b62d) Signed-off-by: Vincent Davis Jr <vince@underview.tech> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix upgrade for recipes with git submodulesTobias Pistora2025-08-141-2/+2
| | | | | | | | | | | | | Fixes [YOCTO #15943] Fixes invalid path argument while calling "git rev-list" from submodule folders. Replaced the local __run() wrapper function with _run() at "git rev-list" command calls. (From OE-Core rev: c1839a24f08a87984d475d23f37a7c923d424267) Signed-off-by: Tobias Pistora <pistora.tobias@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Handle workspaces for multiconfigJoshua Watt2025-07-071-0/+2
| | | | | | | | | | | If a multiconfig recipe is passed to devtool, find the correct workspace name by removing the multiconfig prefix (From OE-Core rev: 42c0c25428be329101a920d31c5fa8cf1e04ee38) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Antonin Godard <antonin.godard@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_go: proxy module fetching to go-mod-update-modulesRoss Burton2025-07-011-116/+36
| | | | | | | | | | Now that the go-mod-update-modules class exists, this Go handler can create a stub recipe and then proxy the module handling to the class. (From OE-Core rev: 0aa406d0582d32399c48dfa78f24adc75696112c) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe/licenses: move tidy_licenses from recipetoolRoss Burton2025-07-011-10/+1
| | | | | | | | | | This function, to tidy a license string, is useful outside of recipetool so move it to oe.license. (From OE-Core rev: 9d57b53169bc60b281510c49e54123941a17a8f5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create_go: Use gomod fetcher instead of go mod vendorChristian Lindeberg2025-07-011-622/+99
| | | | | | | | | | Use the go-mod bbclass together with the gomod fetcher instead of the go-vendor bbclass. (From OE-Core rev: 42b46ab3b92a4f011592e8efcedead075731b8bd) Signed-off-by: Christian Lindeberg <christian.lindeberg@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: allow recipe create handlers to specify bitbake tasks to runRoss Burton2025-07-011-0/+5
| | | | | | | | | | | | | | When creating a recipe there can be cases where there is a class that does some of the recipe creation (such as cargo-update-recipe-crates). To avoid duplication of code, look for run_task assignments in the extravalues dictionary returned by the handler, and if it is set then call that task after writing the recipe. (From OE-Core rev: 629184de671cf7b86fe95fcce788dffcc3a4da8a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: Support creating extra files named after the recipePeter Kjellerstedt2025-07-011-1/+2
| | | | | | | (From OE-Core rev: ea26eb8e4a00a63700a95c2c848272b170154294) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/devtool: calculate source paths relative to UNPACKDIRAlexander Kanavin2025-06-205-14/+14
| | | | | | | | | | | | | | | | | | | | Now that recipes default to S in UNPACKDIR, recipetool and devtool should do the same. There was some discussion about changing devtool to simply setting UNPACKDIR via bbappend to a workspace and running unpack task directly; currently it has a bunch of convoluted path calculations, substitutions, moving source trees around and and special casing (devtool-source.bbclass in particular is an unpleasant hack). This should definitely be done; but right now we can simply tweak existing code which at least doesn't make it worse. (From OE-Core rev: c326ca8aeb2bf0f7719e43921d10efd5dedc7b2a) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: remove S in recipes that fetch from git via setting ↵Alexander Kanavin2025-06-202-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BB_GIT_DEFAULT_DESTSUFFIX Removing all the S = ${WORKDIR}/git assignments works because BB_GIT_DEFAULT_DESTSUFFIX is set to match S from bitbake.conf (which itself is set to match typical tarball releases). A few recipes are setting S to a sub-directory of the git tree and need to be adjusted accordingly. bzip2 recipe is fetching a tarball and separately cloning tests; adjust the recipe to put the latter into 'bzip2-tests', instead of 'git'. devupstream.bbclass no longer needs to rewrite S, and is adjusted accordingly. Adjust scripts/lib/recipetool/append.py to not hardcode 'git' as unpack destination. Adjust kernel-yocto.bbclass to use the git unpack variable instead of hardcoding 'git' (there's also removal of repetition of string constants and a correction of workdir/unpackdir mismatch in one of the if-else branches). Ensure build-appliance-image recipe does not use 'git' as checkout directory for poky repo, but rather explicitly name it 'poky'. Ensure reproducible.py code that looks for git repositories does not hardcode 'git' but uses the destination set by BB_GIT_DEFAULT_DESTSUFFIX. Ensure recipetool does not write out unneeded S settings into newly created recipes that fetch from git. Adjust selftest to not hardcode 'git' as unpack directory. (From OE-Core rev: f80c07019ddadaf9c5fb890faabfda7920ecd15e) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Avoid problems with "-" characters in plugin namesRichard Purdie2025-06-163-1/+8
| | | | | | | | | | | | | | | Remap "-" characters in plugin names to "_" so wic plugins can be extended using standard python class inheritance. This change means wic files can be incrementally updated over time to the correct name rather than breaking everything. Actual plugin module files will need to be renamed as done in previous patches. Also remove a double call to get_plugins() which isn't needed. (From OE-Core rev: 6d9c76196ffad39e628aff76d53d6ecbb517cfa1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Update after plugin name changesRichard Purdie2025-06-1614-43/+43
| | | | | | | | Update the plugin names to account for the "-" to "_" plugin name change. (From OE-Core rev: afa1b5c9f6ed17c021e37a54d0d6abee50a60bf9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: plugins source bootimage/isoimage rename to allow be importedAnibal Limon2025-06-165-0/+0
| | | | | | | | | Python not support importing modules with - so change to _. (From OE-Core rev: 2de444fc3ef450f45f8f93403544e8f7461657b0) Signed-off-by: Anibal Limon <anibal@limonsoftware.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: pluginbase ensure layer order when load pluginsAnibal Limon2025-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support extensions on wic plugins, the load order needs to be grauntee matching BBLAYERS variable. Fix cases when try to import a plugin from another layer, example of the case to fix, ``` Traceback (most recent call last): File "/workspaces/ls/linux/layers/openembedded-core/scripts/wic",line 547, in <module> sys.exit(main(sys.argv[1:])) ^^^^^^^^^^^^^^^^^^ ... File "/workspaces/ls/linux/layers/openembedded-core/scripts/lib/wic/ engine.py", line 137, in list_source_plugins plugins = PluginMgr.get_plugins('source') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspaces/ls/linux/layers/openembedded-core/scripts/lib/wic/ pluginbase.py", line 73, in get_plugins spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 940, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/workspaces/ls/linux/limonsoftware/bsp/scripts/lib/wic/plugins/ source/bootimg_rpi_autoboot_partition.py", line 1, in <module> from wic.plugins.source.bootimg_partition import BootimgPartitionPlugin ModuleNotFoundError: No module named 'wic.plugins.source.bootimg_partition' ``` (From OE-Core rev: 16c8251e5272510ad96613b8c6623550c5a72a34) Signed-off-by: Anibal Limon <anibal@limonsoftware.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: use oe.license_finderRoss Burton2025-06-163-262/+3
| | | | | | | | | Delete the now redundant code, and import oe.license_finder instead. (From OE-Core rev: 8bba98be5c87dd6749e5cc95e9553dffc23ada73) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: ide-sdk code remove twxs.cmakeAdrian Freihofer2025-06-161-1/+0
| | | | | | | | | | | | | | | Do no longer recommend the twxs.cmake VSCode plugin. There is now a language server built into the ms-vscode.cmake-tools plugin as well. >From Release notes 1.20.53 https://marketplace.visualstudio.com/items/ms-vscode.cmake-tools/changelog Add notification suggesting users to uninstall twxs.cmake now that we have built-in Language Services. Follow this advice. (From OE-Core rev: 83d3465a0536a2ffa9c2b6f042051881ec055f5a) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/scriptutils: silence warning about S not existing in emptysrcRoss Burton2025-06-051-1/+4
| | | | | | | | | | | | | This function creates an emptysrc recipe, but S points to a directory that doesn't exist and bitbake warns about this. As it is under the temporary working directory which will be deleted later, create it to silence the warning. (From OE-Core rev: 103cc8fa8a09b8e1fadeb0c8dde5f99eb9c24243) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create: show more of the license path when it can't be identifiedRoss Burton2025-06-051-1/+1
| | | | | | | | | | | | | | If there are multiple source trees in a project (incredibly common with go-mod, for example) then the relative path of the LICENSE file from the source tree could just be "LICENSE", which is not useful when there are tens of files across the recipe with that name. Show the parent directory name too, to clarify which file is unknown. (From OE-Core rev: 9679f4055ad5a077c6b06aa6125cee4e8fa93471) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic bootimg-efi.py: fail build if no binaries installedMikko Rapeli2025-06-021-0/+7
| | | | | | | | | | | | | With systemd-boot, some builds included correct EFI bootloader binaries and some not. Thus some builds booted and some not. Check that some boot binary was installed so that build fails if none were installed. (From OE-Core rev: 93fad905b9d5f5cee89408901e4be1630955ab75) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake.conf/pseudo: Switch from exclusion list to inclusion listRichard Purdie2025-05-121-4/+4
| | | | | | | | | | | | | | | | | Currently, pseudo tracks all files referenced within its presence unless they're listed in an exclusion list. The exclusion list has grown to be fairly unwieldy. This patch swaps PSEUDO_IGNORE_PATHS for PSEUDO_INCLUDE_PATHS which in theory should be easier and more explicit to maintain. This change does drop many directories from pseudo coverage including /home and /tmp. There may be adapatations needed for recipes/classes using pseudo in specific ways. (From OE-Core rev: 2502da81709f25de499277b28d33c915638c45f6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* efi-uki-bootdisk.wks.in: reduce ESP boot partition sizeMikko Rapeli2025-04-291-1/+1
| | | | | | | | | | | | | | | This sample ESP partition is used mostly for testing purposes. It's not expected to host multiple UKI binaries for example. Thus reduce size from 500 Mb to size of needed boot binaries 72 Mb plus around 20% free space 88Mb. This is enough for all test cases and fits to RAM when using PMEM memory based block device on real target boards with just a few Gb of RAM. (From OE-Core rev: 7a4b90ef3815aa227236ec9b95540233db8ac3b3) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: do not ignore ROOTFS_SIZE if the rootfs is modifiedTrevor Woerner2025-04-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the *.wks file contains a "--source rootfs" then lib/wic/plugins/source/rootfs.py will be invoked to generate (what is assumed to be) the rootfs partition. If the rootfs partition needs to be tweaked or modified, the "rootfs.py" plugin will make a copy of the filesystem and then perform the changes on that copy. In other words, if the "--source rootfs" line of the *.wks file also contains any of: --exclude-path --include-path --change-directory --use-label (i.e. modify etc/fstab) then the rootfs will be copied first, then the copy is modified. If, for example, the unmodified IMAGE_ROOTFS is: .../tmp/work/qemuarm64_secureboot-oe-linux/core-image-base/1.0/rootfs then the copy would be made at: .../tmp/work/qemuarm64_secureboot-oe-linux/core-image-base/1.0/tmp-wic/rootfs${LINENO} where ${LINENO} is the line number where this "--source rootfs" line appears in the *wks file. When it comes time to make an actual partition of a specific filesystem type, lib/wic/partition.py::prepare_rootfs() is called. It is in this function that wic figures out if any extra size needs to be added. The bitbake variable used to specify the ultimate rootfs size is ROOTFS_SIZE, and since this variable is only valid for the rootfs (and not any other partitions), the code also verifies that the partition being created is ${IMAGE_ROOTFS}: rsize_bb = get_bitbake_var('ROOTFS_SIZE') rdir = get_bitbake_var('IMAGE_ROOTFS') if rsize_bb and rdir == rootfs_dir: <use rsize_bb> else: <calculate the partition size using "du -ks $p"> As noted above, if lib/wic/plugins/source/rootfs.py has made a copy, then the "rdir == rootfs_dir" clause will fail and the code will assume this partition is not a rootfs since the strings do not compare equal. Therefore, in order to determine if this is a rootfs, retain the existing "rdir == rootfs_dir" comparison, but also add another one to check whether or not this is a wic-generated copy of the rootfs. STEPS TO REPRODUCE: - start with the following *wks file: bootloader --ptable gpt part /boot --size=100M --active --fstype=ext4 --label boot part / --source rootfs --fstype=ext4 --label root - and the following extra variable in conf/local.conf: IMAGE_ROOTFS_EXTRA_SPACE = "500000" - build an image - run it in qemu $ runqemu slirp nographic serial - verify the root partition has extra space: root@qemuarm64-secureboot:~# df -h Filesystem Size Used Available Use% Mounted on /dev/root 721.5M 67.4M 600.6M 10% / devtmpfs 477.7M 0 477.7M 0% /dev tmpfs 40.0K 0 40.0K 0% /mnt tmpfs 489.3M 92.0K 489.2M 0% /run tmpfs 489.3M 68.0K 489.2M 0% /var/volatile /dev/vda1 120.4M 19.9M 91.4M 18% /boot - modify the "/" line of the *wks file to be: part / --source rootfs --fstype=ext4 --label root --exclude-path boot/ - build image when it fails: root@qemuarm64-secureboot:~# df -h Filesystem Size Used Available Use% Mounted on /dev/root 73.4M 41.9M 25.8M 62% / devtmpfs 477.7M 0 477.7M 0% /dev tmpfs 40.0K 0 40.0K 0% /mnt tmpfs 489.3M 92.0K 489.2M 0% /run tmpfs 489.3M 68.0K 489.2M 0% /var/volatile /dev/vda1 120.4M 19.9M 91.4M 18% /boot after this fix: root@qemuarm64-secureboot:~# df -h Filesystem Size Used Available Use% Mounted on /dev/root 721.5M 47.4M 620.6M 7% / devtmpfs 477.7M 0 477.7M 0% /dev tmpfs 40.0K 0 40.0K 0% /mnt tmpfs 489.3M 92.0K 489.2M 0% /run tmpfs 489.3M 68.0K 489.2M 0% /var/volatile /dev/vda1 120.4M 19.9M 91.4M 18% /boot Doing the math we see that the /boot partition is ~20MB and in the first image the / partition contains this ~20MB in addition to the rest of the rootfs. This ~20MB is completely wasted since it is used in the / partition, but then the /boot partition is mounted on top of it, making the /boot directory of / inaccessible. After the fix the / partition has an additional ~20MB since the /boot portion is excluded. Fixes [YOCTO #15555] (From OE-Core rev: 1c690aa046ebca13d7b29de50d42b5d8a4a8486c) Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: expect success for test_patches_upstream_statusGyorgy Sarvari2025-04-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | When the Upstream-Status tag for patches became mandatory, the test verifying the presence of this tag was made to not fail the layer compatibility tests, in order to allow time for the maintainers to adapt to this change. This was two years before this commit. Since then the layer compatibility script shows a cryptic "unexpected success" result for this test, which of course becomes clear once one checks the code and commit history, but it is a nuisance still, which shouldn't be needed to understand the result. This commit removes the the related annotation so the compatibility check will pass or fail with a clear message - in hope that 2 years was enough for active maintainers to adjust their patches. (From OE-Core rev: 64175a41f48fce69a5205000865cc3b8648476f7) Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildperf: Tweak tooltip positioning for usabilityRichard Purdie2025-03-281-2/+2
| | | | | | | | | | The tooltop contains a key hyperlink to make the graphs usable. Make it easier to click on the link by removing the space between the data point and the tooltip. (From OE-Core rev: a090076e42eb9b41da55fc01ccbbb68f9b8a8cb8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildperf: Avoid step usage in performance line graphsRichard Purdie2025-03-281-2/+0
| | | | | | | | | | | | | When using steps in the line chart, you have to look long and hard to understand if the data is the lower or upper point on the step. Whilst not as pretty, the sloped line charts are more accurate so switch to those as the transition points are important and the main reason for the charts. (From OE-Core rev: 60cc8cf421c0b04f774fd42a415f275ad457bcdf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/devtool: sort the recipes that need to be upgraded togetherRoss Burton2025-03-281-1/+1
| | | | | | | | | | Sort the list of recipes for a more visually pleasing display, and to make it easier to compare output from multiple runs. (From OE-Core rev: 561e1996d655147199dc1601b5cba0512042de6b) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: reset: Escape command line input used in regular expressionPeter Kjellerstedt2025-03-201-1/+1
| | | | | | | | | | | | | | | | | | | Running, e.g., `devtool reset sdbus-c++` would result in the following error: re.error: multiple repeat at position 35 This was due to the ++ in the recipe name, which would be treated as an incorrect regular expression in _reset(). Use re.escape() to make sure all characters in the recipe name are treated literally. (From OE-Core rev: 6e73bd9b3e6d529752db93879f2c0ed53873dd1a) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: Do not create annotated tags if tag.gpgSign is setPeter Kjellerstedt2025-03-192-5/+5
| | | | | | | | | | | | | If tag.gpgSign is configured in Git's configuration, then creating the devtool-base tag will fail (if Git's core.editor is not configured) or it will hang (when trying to open the editor). This is beacause tag.gpgSign causes git tag to create annotated tags. To avoid this, specify --no-sign as argument to git tag. (From OE-Core rev: f96e955b29aad6a9e0b20f8e9a4987ace3808c91) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: Support + symbol in filenamesIgor Opaniuk2025-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Allow the '+' symbol as a valid character in filenames listed in the IMAGE_EFI_BOOT_FILES variable. The '+' symbol might be used to support boot counting for boot entries, as described in the UAPI Boot Loader Specification [1]: The boot counting data is stored in the name of the boot loader entry. A boot loader entry file name may contain a plus (+) followed by a number. This may optionally be followed by a minus (-) followed by a second number. The dot (.) and file name suffix (conf or efi) must immediately follow. Boot counting is enabled for entries which match this pattern. Example: IMAGE_EFI_BOOT_FILES:append = " entry.conf;loader/entries/entry+3.conf" [1] https://uapi-group.org/specifications/specs/boot_loader_specification/#boot-counting (From OE-Core rev: 3f25822281eb9423ff86105eaebb0bed48663648) Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/buildperf: Add chart tabs for commit count/timeNinette Adhikari2025-02-092-23/+156
| | | | | | | | | | | | | | | | | We triggered a test of an older revision to narrow down when performance changed. The issue is that git's timestamps are granular to 1s. We'll usually merge a set of commits at the same time so they will all have the same timestamp for a block of them. This means that even if we use the commit date, all the points can't be distinguished on the graph. The author date doesn't work either as the commits are not merged in author date order. To solve this this patch adds the commit_count chart as a separate tab next to the start_time chart (From OE-Core rev: b263edd33f6c895238d81ef148c0445fcd0aa268) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: simplify get_staging_kverChris Laplante2025-02-011-8/+6
| | | | | | | | | | | The goal is to make this more Pythonic, as it was a little cryptic the first time I looked at it. (From OE-Core rev: 80285b0f9b716ebad87a2feb08f12f87d70c27e3) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: fix unbound variable usageChris Laplante2025-02-011-2/+7
| | | | | | | | (From OE-Core rev: 90efa31f36eaea910b979c128da719e1ae61e00d) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: fix typo in variableChris Laplante2025-02-011-1/+1
| | | | | | | | (From OE-Core rev: 9b24dae60573c5e798f1a2f49338f3e4ecbe8859) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: standard: cleanup imports; stop relying on transitive bb importsChris Laplante2025-02-012-18/+24
| | | | | | | | (From OE-Core rev: 8457e24f60a9a84e0f1cfc4a28a39989534fa7de) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>