summaryrefslogtreecommitdiffstats
path: root/scripts/lib
Commit message (Collapse)AuthorAgeFilesLines
* wic/plugins/rootfs: Fix permissions when splitting rootfs folders across ↵Felix Moessbauer2022-05-081-1/+4
| | | | | | | | | | | | | | | | | | partitions This patches makes locating the file database containing the file and folder usernames and permissions more reliable. In addition to locating it relative to the partition directory, we also try to locate it relative to the IMAGE_ROOTFS. Prior to this patch, the database was not found when using --rootfs-dir=${IMAGE_ROOTFS}/<x> in the WIC script, leading to erronous file permissions and ownership. (From OE-Core rev: 09e18ee246da8b56f446c4db548fb9c7e895142b) Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add dependencies for erofs-utilsSean Anderson2022-04-271-0/+1
| | | | | | | | | | | | In order to build erofs filesystems, wic must have the erofs-utils package installed into its sysroot. Fixes: 30375ce97 ("Add support for erofs filesystems") (From OE-Core rev: 68e364340c439a1341d37c3f7a2b0e6aad8e1e56) Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: do not use PARTLABEL for msdos partition tablesHenning Schild2022-04-221-1/+1
| | | | | | | | | | | | | | | When using "msdos" partition tables and "--label" but not "--use-uuid" one can generate images which will not find their root, because PARTLABEL does not work for "msdos". Fix that by simply not going the PARTLABEL path in case of "msdos". Fixes: 2fb247c5ecf0 ("wic: support rootdev identified by partition label") (From OE-Core rev: 9ea1a838b946020e026edc032039552b723fcaa4) Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Do not use mutable default arguments in PythonStefan Herbrechtsmeier2022-04-191-2/+2
| | | | | | | | | | | | | | | | | Remove mutable default arguments in Python because they can lead to all sorts of nasty and horrible bugs. https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/ Revert `recipetool: Change default paramter fallback_licenses of function split_pkg_licenses from None to []` and instead check fallback_licenses before use. (From OE-Core rev: 99dee60b8db557f54783bf0f61098587badc683c) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/scripts: Improve internal variable namingSaul Wold2022-03-101-1/+1
| | | | | | | | | Update internal variable names to improve the terms used. (From OE-Core rev: f408068e5d7998ae165f3002e51bc54b380b8099) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/devtool: Further SPDX identifier cleanupsRichard Purdie2022-03-022-40/+40
| | | | | | | | | | | | Some of these are hard to know what to do with since the original source files for the checksum aren't present. The safe option is to use "-only" as often the main license is ambiguous and the source files themselves determine the "or-later" possibility. The "-only" option therefore is realistically what we need to use in this code. (From OE-Core rev: 2b0cbafc7854de0308a624b17b8aaba704b031d5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Use SPDX license identifiersPeter Kjellerstedt2022-03-013-50/+50
| | | | | | | | | | | | There are still a couple of cases where the license may be set as, e.g., "GPL" or "GPL-2.0" since there is not enough information to decide the actual SPDX license. It is then assumed that the developer will have to correct the information. (From OE-Core rev: e7df51f8d2361e9fe2d67669d2e17f0a5d01004e) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python: Add support for more known licensesPeter Kjellerstedt2022-03-011-1/+17
| | | | | | | | | | Add all OSI approved licenses from https://pypi.org/classifiers/. Also add support for Other/Proprietary (Proprietary) and Public Domain (PD). (From OE-Core rev: 99ef134d1019e5b98b845cf71f3eb39871218f9d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/scripts: Change BB_ENV_EXTRA_WHITE -> BB_ENV_PASSTHROUGH_ADDITIONSRichard Purdie2022-02-212-2/+2
| | | | | | | | After the change to bitbake, update the references in OE-Core to match the updates. (From OE-Core rev: 193affb9f28b0116c3fd619834f145326fee08c5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: add ability to perform tests from a global bbclassDenys Dmytriyenko2022-02-212-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful when needing to test layer's recipes, where this special bbclass can define a global python function that gets called on each recipe parsing during "bitbake -S none world" signature dump and be able to fail layer's check accordingly. First test being added is to detect recipes skipping "installed-vs-shipped" QA check. As "installed-vs-shipped" is a packaging QA check, it happens very late in the build process and failing it could mean some potential issues with packaging, especially when recipe uses BBCLASSEXTEND="nativesdk" and resulting package is used in an SDK. In OE-Core failing this QA check leads to an error, but other layers can suppress it or change it to a warning. Detecting weird packaging problems with SDKs is quite difficult and time consuming. Also, waiting for the actual "installed-vs-shipped" packaging QA check to fail means that all recipes in the layer under test have to run through all standard tasks in the build chain, equivalent to a multi-hour world-build. Hence yocto-check-layer takes a shortcut and only detects a mere attempt at skipping "installed-vs-shipped" QA check in the INSANE_SKIP list during initial parsing when dumping the signature information for the layer. (From OE-Core rev: e8baa75535fc888f1d768b23a0140475e832c910) Signed-off-by: Denys Dmytriyenko <denis@denix.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: explicitly set main or master branches in upgrades when availableAlexander Kanavin2022-02-211-7/+8
| | | | | | | | | | | | | In particular this resolves devtool's inability to pick a branch when the same tagged commit is avaiable in main and in a release maintenance branch. Thanks to Peter Kjellerstedt for the suggestion. (From OE-Core rev: bcb21ee2760a2c76039412a56c6cda43fbf96fd0) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rawcopy: Add support for packed imagesStefan Herbrechtsmeier2022-02-161-1/+28
| | | | | | | | | | | | | | | Add support for packed images to wic rawcopy handler do minimize disk usage in deploy directory and reuse of packed images between wic and swupdate. Add `unpack` to sourceparams to unpack an bz2, gz and xz archives. Example: part / --source rawcopy --sourceparams="file=core-image-minimal-qemu.ext4.gz,unpack" (From OE-Core rev: 4c97d25791389ece041565981ba3207ce9949a1a) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: partition: Support valueless keys in sourceparamsStefan Herbrechtsmeier2022-02-161-1/+1
| | | | | | | | | | Accept valueless keys in sourceparams without equals sign (=) to match the comment and support Boolean entries. (From OE-Core rev: 052a9b0f7d2ee5c284cf1b4f1f45caed0489221a) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scriptutils: Fix handling of srcuri urlsRichard Purdie2022-02-121-0/+1
| | | | | | | | | | | Bitbake is now requiring there be a call to get_srcrev() when urls contain floating revisions. This breaks some recipetool workflows since it is running these queries to determine those revisions. Add a PV entry which triggers that call to avoid the errors. (From OE-Core rev: bdaf0c798da21f9c15d9cb30ab4258a3c75c8bbf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: deploy-target: Remove stripped binaries in pseudo contextFlorian Amstutz2022-02-071-1/+1
| | | | | | | | | | | deploy-target may fail the second time with "pseudo abort" because devtool-deploy-target-stripped is deleted outside of pseudo's fakeroot context. (From OE-Core rev: 2338a33b690b0bbe279cde3f73764911b239cb50) Signed-off-by: Florian Amstutz <florian.amstutz@scs.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: check for duplicate layers when finding layersRoss Burton2022-02-051-0/+21
| | | | | | | | | | | | | | | | | | | detect_layers() is very greedy and if it recurses into poky or bitbake it will find the test suite layers, such as bitbake/lib/layerindexlib/tests/testdata/layer4. This is a dummy layer which claims to be openembedded-layer, so if the real openembedded-layer is a dependency then layer4 may be used instead, which will cause errors: initially because it's only compatible with Sumo, but later because it doesn't contain any recipes. Add a check that the set of layers we've found doesn't contain any duplicate collection names with different patterns, and abort if that is the case as the test will be non-deterministic. (From OE-Core rev: 0df4bae4ec67d38442620fa08c839528b425e2a8) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Fix circular reference in SRC_URISaul Wold2022-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a new recipe.bb file for a binary, don't use BP which includes the version information, instead use BPN which is just the name base Package Name. Since PB is not specified, it takes the default: PV = "1.0+git${SRCPV}" But SRCPV is defined in terms of the SRC_URI, which leads to infinite recursion (traceback below). Here are the pertinent variables which cause the recursion: SRC_URI = "git://github.com/lvc/abi-dumper;protocol=https;subdir=${BP}" BP = "${BPN}-${PV}" PV = "1.0+git${SRCPV}" SRCPV = "${@bb.fetch2.get_srcrev(d)}" def get_srcrev(d, method_name='sortable_revision'): # ... trimmed scms = [] fetcher = Fetch(d.getVar('SRC_URI').split(), d) # ... trimmed [YOCTO #14040] (From OE-Core rev: 3b8d43fc53ee13d39abc3b2a1f706a97fcf752aa) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: sdk-update: Remove an unnecessary \n from SSTATE_MIRRORSPeter Kjellerstedt2022-02-031-1/+1
| | | | | | | | | | | Since commit 044fb04d in bitbake (fetch2: Allow whitespace only mirror entries) there is no need to separate the entries in SSTATE_MIRRORS with "\n". (From OE-Core rev: 6e66ec3cd201d32d3d97df2222f41bb8c475fb69) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool/create_buildsys_python.py: less distutilsTim Orling2022-01-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 'distutils' is deprecated in Python 3.10 with removal in Python 3.12 (~October 2023). Replace 'distutils.command.build_py' with 'setuptools.command.build_py'. To avoid an AttributeError, we call super().__init__() which provides the missing 'distribution' attribute. However, for some reason, __init__() in 'setuptools.command.build_py.build_py' class requires a 'dist' positional argument which must be a 'Distribution' instance. It is not clear why 'distutils.command.build_py.build_py' class does not require this. There is still a check which decides to inherit setuptools3 vs distutils3 that will need to be refactored when we add pyproject.toml and setup.cfg support for more modern PEP 517 packaging. Once distutils3.bbclass is dropped, any recipe inheriting distutils3 will throw a parsing error. The plan is to move distutils*.bbclasses to meta-python. However if meta-python is not in bblayers, the parsing error would still occur. [YOCTO #14610] (From OE-Core rev: 619a3eb1266459daf16e10386113e9201fbf9cf5) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts: Update to use exec_module() instead of load_module()Richard Purdie2022-01-052-4/+11
| | | | | | | | | This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions. (From OE-Core rev: 655cd3f614d736416eab0d708b7c49674bf5c977) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Separate licenses with & operatorStefan Herbrechtsmeier2021-12-201-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate licenses with & operator since it should be satisfied most use cases and it is a reasonable assumption that all the licenses apply. Furthermore flat, split and sort the licenses to minimize license string changes. Separate package licenses with & operator: -LICENSE:${PN} = "MIT ISC" +LICENSE:${PN} = "ISC & MIT" Respect | and brackets in LICENSE: -LICENSE = "BSD-3-Clause & (ISC & | & MIT)" +LICENSE = "BSD-3-Clause & (ISC | MIT)" Sort licenses: -LICENSE = "MIT & BSD-3-Clause & ISC" +LICENSE = "BSD-3-Clause & ISC & MIT" Remove duplicates: -LICENSE = "MIT & ISC & MIT" +LICENSE = "ISC & MIT" (From OE-Core rev: 60a84ecc53d20118c5e7f86dd3e3cafbfed1cf0a) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Sort output of guess_license function to be deterministicStefan Herbrechtsmeier2021-12-201-1/+1
| | | | | | | | | | Sort the output of guess_license function by license file to be deterministic and to support self-testing. (From OE-Core rev: ff2a7520813b3f775f96879d1905222e08b8c83f) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Set master branch only as fallbackStefan Herbrechtsmeier2021-12-091-8/+7
| | | | | | | | | | | | | The commit 'meta/scripts: Manual git url branch additions (dc53fe75cc)' sets the branch= parameter too early to master and thereby breaks the -B/--srcbranch option. ERROR: branch= parameter and -B/--srcbranch option cannot both be specified - use one or the other (From OE-Core rev: 34ece8030e7a6a100b5e3e7b94e6c786c0e199a6) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Relax README case checksJoshua Watt2021-12-041-2/+2
| | | | | | | | | | Relaxes the case requirements for checks in the README file so that word like "Maintainer" and "Patch" are allowed (From OE-Core rev: fdedf94d406ad3da85cb45d43ef87d3fdc8c14d4) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: disregard checks if referencing another README fileJon Mason2021-12-041-1/+6
| | | | | | | | | | | | | It is permissible to have a layer's README reference another README. If this is the case, avoid other checks. Do this by checking for the word README (case insensitive) in the README file. This might be too permissive, but follows the pattern of looking for exact words (like "patch" or "maintainer") in READMEs. (From OE-Core rev: 443c73d638519d6a7ea44d1c0e80d76306687ddc) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* yocto-check-layer: Add additional README checksDhruva Gole2021-12-031-0/+6
| | | | | | | | | | | | | | This adds: - Test case to review if the README file specifies the maintainer. - Test case to review if the README file specifies the word patch. - Test case to review if the README file contains an email address. [YOCTO #11131] (From OE-Core rev: 5d4937bce191b7e22b807c0595d4845c88ecc560) Signed-off-by: Dhruva Gole <goledhruva@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: extend curl detection when creating recipesRoss Burton2021-12-031-1/+2
| | | | | | | | | If a configure.ac uses LIBCURL_CHECK_CONFIG it wants curl. (From OE-Core rev: 16e830ca1352cee61e4ae4b98b1203f849bf71f3) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: handle GitLab URLs like we do GitHubRoss Burton2021-12-031-1/+1
| | | | | | | | | | GitHub URLs are automatically transformed to git: fetches, so handle GitLab URLs too. (From OE-Core rev: 651fb951819840fe122458ddbd852ee6c7ec0455) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/checklayer/common.py: Fixed a minor grammatical errorDhruva Gole2021-12-011-1/+1
| | | | | | | (From OE-Core rev: 8ea17456ae5318ed7a3b4c8f75c8441456d8b979) Signed-off-by: Dhruva Gole <goledhruva@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: support rootdev identified by partition labelSchmidt, Adriaan2021-11-241-0/+2
| | | | | | | | | | We already support specifying the rootfs by PARTUUID. This adds general support for letting the kernel find the rootfs by PARTLABEL. (From OE-Core rev: 2fb247c5ecf057bb96649a3c0234794b4991c050) Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use shutil.whichMingli Yu2021-11-212-5/+5
| | | | | | | | | | | | | | | | | Use shutil.which to find the executable instead to silence the below warning: $ cat tmp/work/intel_x86_64-poky-linux/core-image-base/1.0-r5/temp/log.do_image_wic [snip] DEBUG: Executing shell function do_image_wic /path/layers/oe-core/scripts/wic:27: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import spawn INFO: Creating image(s)... [snip] [RP: Added conversion for missed function reference] (From OE-Core rev: 3966cbf5c8a2dbc3a4f0f3eefdbeeb83f522bf87) Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/wic/help.py: Update Fedora Kickstart URLsJon Mason2021-11-111-2/+2
| | | | | | | | | | The URLs describing Kickstart are no longer valid and do not redirect to the correct location. Update them with the correct location. (From OE-Core rev: e5ac75f93c8128b0761af5fee99e8603ddd1657d) Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Use os.rename instead of bb.utils.renameKhem Raj2021-11-101-1/+1
| | | | | | | | | | | | | | | This is not invoked with bitbake context as a result bb.utils is not visible when this function is called during image creation and builds fail e.g. NameError: name 'bb' is not defined (From OE-Core rev: df9dca9fe4dd1abfe5f3986389a8e8ff524da5d7) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Joshua Watt <JPEWhacker@gmail.com> Cc: Devendra Tewari <devendra.tewari@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/scripts: Manual git url branch additionsRichard Purdie2021-10-301-0/+3
| | | | | | | | | | Following the scripted conversion adding branches to git:// SRC_URI entries, add the remaining references, mainly in the selftests and recipetool. (From OE-Core rev: 5340c0d688036c1be6c938f05d8a8c1e3b49ec38) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Simplify common source files skip in guess_licenseStefan Herbrechtsmeier2021-10-231-1/+2
| | | | | | | | (From OE-Core rev: 189c0297632968900715d7a4a5edcdf3a56e25f5) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Rework crunch_license to recognize more variantsStefan Herbrechtsmeier2021-10-141-24/+97
| | | | | | | | (From OE-Core rev: 6c70f5bd2acd036c21be5b03df89d3a8f381a822) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: npm: Use README as license fallbackStefan Herbrechtsmeier2021-10-141-1/+51
| | | | | | | | | | | | Use the README as license fallback if a license file is missing. Use the linenumbers parameter of get_license_md5sums function to determine the license text inside the README. (From OE-Core rev: eff85c86f36673a1cb5a5dc8c66598e0dc457374) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: npm: Do not add package.json files to LIC_FILES_CHKSUMStefan Herbrechtsmeier2021-10-141-10/+0
| | | | | | | | | | | The package.json files doesn't contain any licenses. The name of the license doesn't comply the license requirements of most liceneses. (From OE-Core rev: 194df9c240378b6befeb10183889093ec7bb4d5f) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Add support for linenumbers to licenses.csvStefan Herbrechtsmeier2021-10-141-4/+8
| | | | | | | | | | | | Add support for linenumbers (begin and end lines) to licenses.csv. Add an optional linenumbers parameter to get_license_md5sums to support different use cases. (From OE-Core rev: d5c4979669f125e73c24dcc73fa3c4f3787bbb62) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Add logger info for missing license entriesStefan Herbrechtsmeier2021-10-141-0/+3
| | | | | | | | (From OE-Core rev: 0548a5d8eeee682a6e250ddc1886279f52747db2) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: ignore empty license filesStefan Herbrechtsmeier2021-10-141-2/+3
| | | | | | | | (From OE-Core rev: a00720344d1996db9e4afff1c974b3158fb8dae7) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Change default paramter fallback_licenses of function ↵Stefan Herbrechtsmeier2021-10-141-1/+1
| | | | | | | | | | split_pkg_licenses from None to [] (From OE-Core rev: ab06305bf9a8ee2250aae8043e37119df2fbfc15) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Skip common source files in guess_licenseStefan Herbrechtsmeier2021-10-141-0/+2
| | | | | | | | (From OE-Core rev: a930d39787dd77e10dfa7b7297af5fa04ca731ea) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Move license md5sums into CSV filesStefan Herbrechtsmeier2021-10-142-37/+52
| | | | | | | | (From OE-Core rev: 631f6b7d1856e0e4f2313703fa1162d05e5deea6) Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: Add Unified Kernel Image optionKristian Klausen2021-10-041-10/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "A unified kernel image is a single EFI PE executable combining an EFI stub loader, a kernel image, an initramfs image, and the kernel command line. [...] Images of this type have the advantage that all metadata and payload that makes up the boot entry is monopolized in a single PE file that can be signed cryptographically as one for the purpose of EFI SecureBoot."[1] This commit adds a create-unified-kernel-image=true option to the bootimg-efi plugin for creating a Unified Kernel Image[1] and installing it into $BOOT/EFI/Linux/ with a .efi extension per the the Boot Loader Specification[1][2]. This is useful for implementing Secure Boot. systemd-boot is the only mainstream bootloader implementing the specification, but GRUB should be able to boot the EFI binary, this commit however doesn't implement the necessary changes to the GRUB config generation logic to boot the Unified Kernel Image. [1] https://systemd.io/BOOT_LOADER_SPECIFICATION/#type-2-efi-unified-kernel-images [2] https://systemd.io/BOOT_LOADER_SPECIFICATION/ (From OE-Core rev: b0573f240525df561ddef6e47cb285b217d38487) Signed-off-by: Kristian Klausen <kristian@klausen.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scriptutils.py: Add check before deleting pathChandana kalluri2021-10-011-1/+2
| | | | | | | | | | | | | | | | | | | Add a check before deleting path when using recipetool commands to avoid the following type of errors: Traceback (most recent call last): File "<workdir>/sources/core/scripts/lib/scriptutils.py", line 218, in fetch_url shutil.rmtree(path) File "/usr/local/lib/python3.7/shutil.py", line 476, in rmtree onerror(os.lstat, path, sys.exc_info()) File "/usr/local/lib/python3.7/shutil.py", line 474, in rmtree orig_st = os.lstat(path) FileNotFoundError: [Errno 2] No such file or directory: '<workdir>/build/tmp/work/recipetool-usg7o81n/work/recipe-sysroot' ERROR: Command 'script -e -q -c "recipetool --color=always create --devtool -o /tmp/devtool5sq_op37 'file:///<SRCTREE>' -x <workdir>/build/workspace/sources/devtoolsrcxc1b9zjq -N test" /dev/null' failed (From OE-Core rev: b6aa8b47e023004ffd6958d1cec18c2d9c95d77b) Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic:direct.py: ignore invalid mountpoints during fstab updateMarkus Volk2021-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | wic fstab-update creates invalid entries for partitons that are not supposed to be mounted from userspace eg u-boot partitions. The following lines were added to fstab on a rock-pi-4: /dev/mmcblk1p1 loader1 vfat defaults 0 0 /dev/mmcblk1p2 reserved1 vfat defaults 0 0 /dev/mmcblk1p3 reserved2 vfat defaults 0 0 /dev/mmcblk1p4 loader2 vfat defaults 0 0 /dev/mmcblk1p5 atf vfat defaults 0 0 /dev/mmcblk1p6 /boot vfat defaults 0 0 With this patch only valid entries should be added /dev/mmcblk1p6 /boot vfat defaults 0 0 (From OE-Core rev: 7aa678ce804c21dc1dc51b9be442671bc33c4041) Signed-off-by: MarkusVolk <f_l_k@t-online.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Drop useless classRichard Purdie2021-09-231-4/+0
| | | | | | | | | | | | | | | This class was added by me back in 2007 and has changed one for a whitespace issue since. It only has two lines and neither are particularly useful, one was replaced by the nopackages class, the other adding recursive dependencies also is now mainly problematic adding tons of unneeded dependencies. The name is hard to understand and the class doesn't have a clear purpose. Drop it. Remove the references in devtool (which may be the one reason to keep it around but in my view still not worth it). (From OE-Core rev: 6e2cbfc561dac89bf9183d24d90e52f7d9117826) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: keep rootfs_size as integerAlexander Kanavin2021-09-191-1/+1
| | | | | | | | | | | | | | The corrected line accidentally converted it to float, which causes problems later on with python 3.10: | File "/home/alex/development/poky/scripts/lib/wic/partition.py", line 278, in prepare_rootfs_ext | os.ftruncate(sparse.fileno(), rootfs_size * 1024) | TypeError: 'float' object cannot be interpreted as an integer (From OE-Core rev: d1d260dd2d196d10379ed9e238bcb34f39f3a3b7) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: correct collections vs collections.abc deprecationAlexander Kanavin2021-09-191-1/+2
| | | | | | | | | collections.abc is available since 3.3 and doesn't need special handling. (From OE-Core rev: 01152c9410ba00274c8415a5d914dc33dfd0cf46) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>