summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* wic: fix typoDaniel Ammann2020-08-061-1/+1
| | | | | | | (From OE-Core rev: 9ab4c4571d899d2eefcd2fc53af0851863f29008) Signed-off-by: Daniel Ammann <daniel.ammann@bytesatwork.ch> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* checklayer: check layer in BBLAYERS before testLee Chee Yang2020-07-272-1/+22
| | | | | | | | | | | | | | | | | | layer under test should absent from BBLAYERS when running yocto-check-layer. This allow to get signatures before layer under test. There are existing steps to add the layer under test to BBLAYERS after getting initial signatures. add steps to check for layer under test in BBLAYERS before running any test, skip test for the layer if the layer under test exist in BBLAYERS. [YOCTO #13176] (From OE-Core rev: be02e8dbfb0d1decce125322f9f1e11a649756c0) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: Add support for IMAGE_BOOT_FILESKhasim Mohammed2020-07-251-0/+60
| | | | | | | | | | | | | | | List of files defined using IMAGE_BOOT_FILES are installed into the boot partition when preparing an image using the wic tool with the bootimg-efi source plugin. The code snippet introduced is taken as is from bootimg-partition.py Change-Id: I8dbb6b4e7c24870f587a6f31e6ae4a87d7033782 Issue-Id: PLATFORMS-3134 (From OE-Core rev: a44ab3a4ee5b3c57812909c6194456f299d6ba7f) Signed-off-by: Khasim Syed Mohammed <khasim.mohammed@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Fall back to standard copy when no way to get the block mapKevin Hao2020-07-181-1/+27
| | | | | | | | | | | | | | For some filesystems, such as aufs which may be used by docker container, don't support either the SEEK_DATA/HOLE or FIEMAP to get the block map. So add a FileNobmap class to fall back to standard copy when there is no way to get the block map. [Yocto #12988] (From OE-Core rev: 7934ed49179242f15b413c0275040a3bb6b68876) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Drop the unused get_unmapped_ranges()Kevin Hao2020-07-181-36/+2
| | | | | | | | | This method is not used by any code, so drop it. (From OE-Core rev: 6513fd9302b9989f97fc9d95e76e06ad5d266774) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/filemap: Drop the unused block_is_unmapped()Kevin Hao2020-07-181-17/+0
| | | | | | | | | This method is not used by any code, so drop it. (From OE-Core rev: fb62a15349597ee026c67a0bb0a6ca2cc9bfe420) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/lib/recipetool/create.py: fix regex stringsTim Orling2020-07-121-5/+5
| | | | | | | | | | | Python now expects regex strings to be prepended with r. Silence pylint/autopep8 and similar warnings by identifying these regex patterns as... regex patterns. (From OE-Core rev: 0eae98a369d80340e48dc690d09a1364cde97973) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: default to empty string, if LIC_FILES_CHKSUM is not availableBjarne Michelsen2020-07-081-2/+2
| | | | | | | | | | | | | | | | | | [Bug 13971] https://bugzilla.yoctoproject.org/show_bug.cgi?id=13971 A recipe using LICENSE=CLOSED would normally not have LIC_FILES_CHKSUM set. If LIC_FILES_CHKSUM was not set, it would cause `devtool upgrade` to fail. This fixes the issue by defaulting to an empty string if LIC_FILES_CHKSUM is not found. [YOCTO #13971] (From OE-Core rev: 95e112f0f465868e98285509ea0d1a624a439ac2) Signed-off-by: Bjarne Michelsen <bjarne_michelsen@hotmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* checklayer: parse LAYERDEPENDS with bb.utils.explode_dep_versions2()Nicolas Dechesne2020-06-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | LAYERDEPENDS is a string of this format: "DEPEND1 (optional version) DEPEND2 (optional version) ..." However when we parse LAYERDEPENDS in _get_layer_collections() we parse it as a simple string, and if any optional versions are there the 'depends' field is wrong. For example, running yocto-check-layer might result in such errors: ERROR: Layer meta-python depends on (>= and isn't found. ERROR: Layer meta-python depends on 12) and isn't found. Let's use bb.utils.explode_dep_versions2() to parse LAYERDEPENDS, and create a string that contains all dependencies, effectively skipping/ignoring any optional versions. [YOCTO #13957] (From OE-Core rev: f81f07afc200fe06c5c06ea81a4f8a3a43436faf) Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: If using a vmtype image do not add the -no-reboot flagJason Wessel2020-06-281-1/+3
| | | | | | | | | | | | | | | | | | | | There is no way to use runqemu and turn off the no-reboot flag with a command line argument. If someone really wants it back it can be added with the qemuparams="" argument. Also if you use the "halt -p" from user space, the qemu will exit when it is complete. It is impossible to test self deploying image with runqemu if you cannot reboot the device. One might argue that you can run runqemu in a loop, but that defeats the purpose of having a wrapper around a tool that already does what is needed in the first place. For the vmtype images, the -no-reboot flag should not be added. (From OE-Core rev: 6d07a72356f9a8ea76b6cda9159d3ca4743028d9) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/install-buildtools: Handle new format checksum filesRichard Purdie2020-06-251-1/+1
| | | | | | | | | Autobuilder generated checksum files only have a single space between the sum and the filename, tweak it to account for this. (From OE-Core rev: d1e71bf5b399372166eb40bb0d99c8fb52231600) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/install-buildtools: Update to 3.2 M1 buildtoolsRichard Purdie2020-06-251-4/+4
| | | | | | | | | | | This fixes issues with openssl certs not working properly which meant error reporting to an error report server was failing. Also, all our downloads are now standarised on "sha256sum" so adjust for that. (From OE-Core rev: bc8b44e19a05f499f5cef049eedbed1fede2e765) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemu: uprev v4.2.0 -> v5.0.0Sakib Sajal2020-06-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major update after v4.2. Changes: - os_find_datadir() was changed after the v4.2 release causing v5.0 to not find the bios and not boot the image. Fix is sent to upstream qemu. See: qemu/find_datadir.patch - v5.0 binary had host contamination for dynamically linked libraries, "--extra-ldflags='${LDFLAGS}'" in EXTRA_OECONF resolved the issue - bluetooth code was removed: qemu.git$ git show 1d4ffe8dc7 hence removed PACKAGECONFIG[bluez] - -show-cursor qemu option is now deprecated, updated scripts/runqemu to use updated option instead - added PACKAGECONFIG definitions - added qemu-ptest to conf/distro/include/ptest-packagelists.inc - increased support for ARM architecture, cpu and board - removed patches merged upstream and refreshed existing ones Testing: Build core-image-minimal against the machines in openembedded-core/meta/conf/machine and succesfully booted with qemu v5.0 Ran qemu-ptest on x86-64 and arm64 with identical results: PASS: 1166 SKIP: 0 FAIL: 0 (From OE-Core rev: ee9ec9e344541c1ccd9b9b8e3b8c1e00d008ad85) Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: fix typoPaul Eggleton2020-06-231-2/+2
| | | | | | | | | specifiy -> specify (From OE-Core rev: 194555aae3f1f10468c1800c93bd17c54ce217c8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: create: fix SRCBRANCH not being passed to paramsTuomas Salokanto2020-06-171-0/+1
| | | | | | | | | | | | When explicitly passing a branch using --srcbranch in 'devtool add' or 'recipetool create', the branch name is not included in the params of bb.fetch2.encodeurl and default 'master' branch is used instead. (From OE-Core rev: 0424df825f1e509faf6cd44403c0736bb91b57c3) Signed-off-by: Tuomas Salokanto <tuomas.salokanto@gmail.com> Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildhistory-collect-srcrevs: sort directoriesDaniel McGregor2020-06-171-0/+1
| | | | | | | | | | | | | | In order to allow consistent output of buildhistory-collect-srcrevs sort the list of directories returned by os.walk. Otherwise the list of SRCREVs is returned in an unspecified order. We save the output of this command on build, so it creates smaller diffs between builds. (From OE-Core rev: 3d7cb207ad4ec3cd5a3064147d3c9b5a1730d0fb) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix error message when reporting invalid offsetJoshua Watt2020-06-161-1/+1
| | | | | | | | | | The error message was reporting the calculated offset instead of the current offset, which made it confusing. (From OE-Core rev: 2be775cfe1b49ce3889b5dc326e2b67a9667f18a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* graph-tool: add filter subcommandPaul Eggleton2020-06-161-0/+43
| | | | | | | | | | Add a filter subcommand to filter a task-depends.dot graph produced by bitbake -g down to just a subset of targets/tasks. (From OE-Core rev: a14b274b56676ff0ba55a4048169ad60c9514994) Signed-off-by: Paul Eggleton <paul.eggleton@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* graph-tool: switch to argparsePaul Eggleton2020-06-161-32/+27
| | | | | | | | | argparse makes this a lot easier to extend. (From OE-Core rev: c751ef8fdc111d1c967029cea7a3ed0f88ce851b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.microsoft.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install-buildtools: add option to disable checksum validationRoss Burton2020-06-161-3/+5
| | | | | | | | | | | The --check option turns on checksum validation, but it defaults to 'on' so is pointless. Add a corresponding --no-check option to turn off validation. (From OE-Core rev: bf902a810f98f55dd9e8cb9e6c6b0903f9902157) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install-buildtools: remove hardcoded x86-64 architectureRoss Burton2020-06-161-8/+10
| | | | | | | | | | Remove all instances of the hardcoded 'x86_64' and replace with the current host platform. (From OE-Core rev: 52dc6f671ff67a1149be7ef4c65126ea3c907a3d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* install-buildtools: fail if an error occursRoss Burton2020-06-161-0/+2
| | | | | | | | | | Several failure paths were displaying an error message but not returning, so the install process continued and failed further. (From OE-Core rev: b00e28735b64a781707441ec6187dd7f9240d97a) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* recipetool: Fix list concatenation when using editAlex Kiernan2020-06-151-1/+1
| | | | | | | | | | | | | | | | | | If there are multiple appends, ensure we concatenate compatible things: Traceback (most recent call last): File "/home/akiernan/poky/scripts/recipetool", line 111, in <module> ret = main() File "/home/akiernan/poky/scripts/recipetool", line 100, in main ret = args.func(args) File "/home/akiernan/poky/scripts/lib/recipetool/edit.py", line 38, in edit return scriptutils.run_editor([recipe_path] + appends, logger) TypeError: can only concatenate list (not "tuple") to list (From OE-Core rev: 4c1e74bdf4922519d168434afd69c9bebcb9bd82) Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix --extra-space argument handlingJoshua Watt2020-06-121-1/+1
| | | | | | | | | | | 467f84e12b ("wic: Add --offset argument for partitions") broke the --extra-space argument handling in wic. Fix the option and add a unit test for the argument. (From OE-Core rev: 87722a92c18f94917c8f70afc8cd0763462a5c25) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --offset argument for partitionsJoshua Watt2020-06-043-20/+42
| | | | | | | | | | | | | | | | | | | | Add support for an --offset argument when defining a partition. Many SoCs require that boot partitions be located at specific offsets. Prior to this argument, most WKS files were using the --align attribute to specify the location of these fixed partitions but this is not ideal because in the event that the partition couldn't be placed in the specified location, wic would move it to the next sector with that alignment, often preventing the device from booting. Unlike the --align argument, wic will fail if a partition cannot be placed at the exact offset specified with --offset. Changes in V2: * Fixed a small typo that prevented test_fixed_size_error from passing (From OE-Core rev: 467f84e12b96bc977d57575023517dd6f8ef7f29) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: use -f and don't use --exclude-standard when adding files to workspaceMartin Jansa2020-06-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * I see a case where a tarball contains .gitignore and bunch of files which are normally ignored in git, but still included in the tarball (e.g. configure script next to configure.ac) * when devtool is creating a git repo in workspace it won't include these files from tarball in the initial devtool-base commit, because git ls-files won't list them * but then the first .patch file (without git headers) when applied with GitApplyTree._applypatch() will add all these still ignored files to a commit which used to only modify some files, because it's using -f: # Add all files shellcmd = ["git", "add", "-f", "-A", "."] output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) at least in this case it would be better to add all ignored files in the initial devtool-base commit and then --force-patch-refresh will just include the small modification as before instead of adding unrelated files, just because they were initially ignored - this behavior will also match with the do_patch task in the actual build where the .gitignore is ignored when unpacking some tarball * my use-case is fixed in setup_git_repo, but similar function is in devtool upgrade, I've changed it there as well (From OE-Core rev: 06a24a615549af3550302a56ea08147000a608f3) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/log: Add ability to dump ltp logs as well as ptestRichard Purdie2020-05-272-15/+28
| | | | | | | | | Currently only ptest logs are accessible with the log command, this adds support so the ltp logs can be extracted too. (From OE-Core rev: 64a2121a875ce128959ee0a62e310d5f91f87b0d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* resulttool/report: Remove leftover debuggingRichard Purdie2020-05-271-1/+0
| | | | | | | | | I've long since wondered why there was some odd output in result reports, remove the leftover debug which was causing it. (From OE-Core rev: 66e96bf70753933714ff8edcc13a1f35a052656f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* checklayer: Skip layers without a collectionJoshua Watt2020-05-241-0/+3
| | | | | | | | | | | | As in other places in the file, skip layers that don't define a collection when searching for a layer to resolve a dependency. Fixes KeyError exceptions when attempting to access the layer collections later (From OE-Core rev: 26090a2861ebe21224aaf89d7be0c0a89ca58e48) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: do not write md5sums into upgraded recipesAlexander Kanavin2020-05-211-2/+2
| | | | | | | | | | | | This will drop them md5sums from recipes that still have them, and will not re-add them for recipes where they're already removed. [RP: Added fix for the test recipe] (From OE-Core rev: 1609e77a4db04a4c01cbbff17261cd57e8f816ee) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib_header_wrapper: Drop using __MHWORDSIZEKhem Raj2020-05-181-15/+2
| | | | | | | | | | This is not needed as __WORDSIZE already represents same value and is directly defined in wordsize.h, this simplifies the multlib headers (From OE-Core rev: 3a6ba47ede9b1d66f6cb58a776255047a5d069ab) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib_header: Fall back to worsize form libc for bpf targetKhem Raj2020-05-181-3/+1
| | | | | | | | | | Setting bpf to use 64bit for wordlength is not right, it happens to work perhaps becuase the targets its being run on are 64bit inherently (From OE-Core rev: 6d8c7e3426a74b1bc4752d508f68548480955853) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* multilib_header_wrapper.h: Remove pragma onceKhem Raj2020-05-181-2/+0
| | | | | | | | | | This was a bandaid to avoid include recursion caused by multilibbed wordsize.h (From OE-Core rev: 7496c8fd4b2d9a69ee764f196abaec6172be2f02) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: force software x11 renderer for SDL when GL is not in useAlexander Kanavin2020-05-121-0/+3
| | | | | | | | | | | | | If libsdl is configured with opengl enabled, it will try to use GL renderers to open a window even if qemu doesn't use virgl. Setting the environment variable forces a software X11 renderer, which is the same one used when libsdl has opengl switched off. This avoids needlessly loading the GL libraries and drivers from the host. (From OE-Core rev: 73b75f5ff6c0b5333898fa340f4d9e2e5111fdef) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/tiny/ksize: Fix for more recent kernelsjan2020-05-091-3/+3
| | | | | | | | | | | | | | In the past kernel built object files were named 'built-in.o'. Nowadays it is 'built-in.a'. The script is modified to work with both. I expect it will not happen that there are built-in.a and built-in.o files in the same kernel. (From OE-Core rev: facc8a5859d95c416aff8313bec3f3a6d5ef5fec) Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: set host DRI driver path for all instances of virgl usageAlexander Kanavin2020-05-071-15/+22
| | | | | | | | | | | | | | | | Falling through to host GL stack via epoxy chrpath hack was found to be problematic in case of SDL particularly (because it does not actually use epoxy, and does its own dlopen()). So let's just use the mesa-native libraries everywhere, but instruct them to load DRI drivers from the host. NVidia's proprietary blob users have to take care of themselves, I'm afraid. (From OE-Core rev: 2125920828eba7bab1afc977d5e9bccb124078e5) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rootfs: Combine path_validation in one functionRicardo Ribalda Delgado2020-04-261-22/+19
| | | | | | | | | | | Combine all the common path validation in a function to avoid code duplication. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: ebd12b10d17db0b4176b0188407d7e9b8420eab1) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: root: Add an opt. destination on include-pathRicardo Ribalda Delgado2020-04-263-11/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow specifying an optional destination to include-path and make the option aware of permissions and owners. It is very useful for making a partition that contains the rootfs for a host and a target Eg: / -> Roofs for the host /export/ -> Rootfs for the target (which will netboot) Although today we support making a partition for "/export" this might not be compatible with some upgrade systems, or we might be limited by the number of partitions. With this patch we can use something like: part / --source rootfs --fstype=ext4 --include-path core-image-minimal-mtdutils export/ --include-path hello on the .wks file. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: e8c21c6ebaebde88151697381bdb2452f1171090) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: misc: Do not find for executables in ASSUME_PROVIDEDRicardo Ribalda Delgado2020-04-261-2/+12
| | | | | | | | | | | Executables like tar won't be available on the native sysroot, as they are part of the ASSUME_PROVIDED variable. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 2f574d535f8665b26dab65c14668cf8fc7b751c0) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Avoid creating invalid pseudo directoryRicardo Ribalda Delgado2020-04-261-7/+8
| | | | | | | | | | | | | | | | If the source of the rootfs is not a bitbake cooked image, or it is not pointing to the root of one, we call pseudo again, which will produce a new pseudo folder at rootfs/../pseudo Eg: part /etc --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/home --fstype=ext4 Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 799a24ae78655f7a3eda7456b1a0ffaf3e43ec16) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Continue if excluded_path does not existRicardo Ribalda Delgado2020-04-261-1/+3
| | | | | | | | | | | | | | | | | If an excuded path does not exist, continue without an error. This allows to seamleasly reuse .wks among different projects. Eg: part / --source rootfs --fstype=ext4 --exclude-path=opt/private_keys Where /opt/private_keys in only populated by some of the image.bb files. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 2dbd692b8e563cf991fb4ae1ef6129fda0d7e3c4) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --change-directory argumentRicardo Ribalda Delgado2020-04-264-3/+26
| | | | | | | | | | | | | | | | | | | This option allows to specify which part of a rootfs is going to be included, the same way the -C argument on tar. Thanks to this option we can make sure the permissions and usernames on the target partition are respected, and also simplify the creation of splitted partitons, not neeting to invoke external vars or using .wks.in files. Eg: part / --source rootfs --ondisk sda --fstype=ext4 --exclude-path=etc/    part /etc --source rootfs --fstype=ext4 --change-directory=etc Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 2265d089a58e1f78f26d623ee667c420cb1c3bd4) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix multi images .wks with bitbakeRicardo Ribalda Delgado2020-04-261-6/+3
| | | | | | | | | | | | | | | | | | | | | In order to support .wks files with multiple images inside bitbake we need to explicitly set the pseudo database in use. Eg: If we try this .mks: part / --source rootfs --ondisk sda --fstype=ext4 part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4 The username for all the files under /export will be set to the runner of bitbake (usually UID 1000). Before we run wic, we need to make sure that the pseudo database will be flushed, and contains all the data needed. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: dde90a5dd2b22a539095d1bac82acc15c6380ac8) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix permissions when using exclude or include pathRicardo Ribalda Delgado2020-04-262-6/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parameters include_path or exclude_path are passed to the rootfs plugin, it will copy the partition content into a folder and make all the modifications there. This is done using copyhardlinktree(), which does not take into consideration the content of the pseudo folder, which contains the information about the right permissions and ownership of the folders. This results in a rootfs owned by the user that is running the wic command (usually UID 1000), which makes some rootfs unbootable. This bug can be easily triggerd with the following .wks part / --source rootfs --fstype=ext4 --exclude-path=home And this sequence: $ wic create test-permissions -e core-image-minimal -o test/ $ sudo mount test/test-permissions-202004080823-sda.direct.p1 /mnt $ ls -la /mnt/etc/shadow To fix this we copy the content of the pseudo folders to the new folder and modify the pseudo database using the "pseudo -B" command. If the rootfs is not a rootfs generated by bitbake a warning is shown making the user aware that the permissions on the target might not match what he expects. WARNING: /tmp/test/../pseudo folder does not exist. Usernames and permissions will be invalid Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: fd739c15cdba221d9d497d3402b7d929c0be2ca4) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* scripts/install-buildtools: bump to 3.1 release by defaultTim Orling2020-04-261-3/+3
| | | | | | | | | | By default, use the extended buildtools installer from the Yocto Project 3.1 "dunfell" release. (From OE-Core rev: abd9bf4428e024f4fbcabd75235965769c03f2db) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use Filesystem UUID when expand swap partitionLee Chee Yang2020-04-261-2/+3
| | | | | | | | | | | | | | | | | part.get("uuid") return the Partition UUID from the partition table instead of Filesystem UUID. This lead to swap partition UUID not match/change when wic write expand swap partition. change it to read the filesystem UUID using blkid. The output from blkid should looks like this: wic-partvzhiwq3s: LABEL="swap1" UUID="04e55c19-3f3f-4491-9e32-44eea8daa827" VERSION="1" TYPE="swap" USAGE="other" [YOCTO #13313] (From OE-Core rev: 683297eefebe83f848daad9927871242ab28ef91) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* buildall-qemu: automate build testing for qemu MACHINEsTrevor Gamblin2020-04-241-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | buildall-qemu simplifies the process of build testing an upgraded or patched recipe by cycling through the build steps for each available qemu target, with desired LIBC specified by the user as an option (defaulting to both glibc and musl if no option is provided). While building, a log file with the name "<recipe>-buildall.log" is written, containing a PASS or FAIL line upon completion of the build for each architecture. For now, qemu targets are not selectable (i.e. the recipe is built for all qemu targets found in meta/conf/machine), but this functionality can be added in the future along with other useful options. The log file created by buildall-qemu also includes some basic system info (e.g. build start time, hostname, host OS, host kernel). Since it is not guaranteed that tools such as lsb_release will be available on the host (it isn't by default on my Fedora machine), this information is collected manually. Additionally, the previous run's log is retained for comparison by renaming it in the format <recipe>-buildall.log.old once a new set of builds is triggered for the same recipe. We've seen multiple variations of this concept in use as one-liners and as bash functions in dotfiles, so it seemed appropriate to submit it in script form to oe-core for everyone to use. Sample log output: BUILDALL-QEMU LOG FOR aspell START TIME: 2020-02-11_19:50:02 HOSTNAME: yow-tgamblin-fedora2 HOST OS: Fedora 31 (Server Edition) HOST KERNEL: 5.4.10-200.fc31.x86_64 =============== BUILD RESULTS: [glibc] PASS: qemuarmv5 PASS: qemux86 PASS: qemuppc PASS: qemumips64 PASS: qemux86-64 PASS: qemumips PASS: qemuarm PASS: qemuarm64 PASS: qemuriscv64 [musl] PASS: qemuarmv5 PASS: qemux86 PASS: qemuppc PASS: qemumips64 PASS: qemux86-64 FAIL: qemumips FAIL: qemuarm FAIL: qemuarm64 FAIL: qemuriscv64 =============== PASSED: 14 FAILED: 4 (From OE-Core rev: ee64b7db6651df4ed419e3d2649b4fb2f2faf830) Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* runqemu: add QB_ROOTFS_EXTRA_OPT parameterKonrad Weihmann2020-04-241-3/+8
| | | | | | | | | | | | | | | | | | | | | Content of the optional parameter will be appended to the rootfs-device in the qemu configuration, in case QB_ROOTFS_OPT is not specified. By default this is empty. Example use cases are: Defining 'readonly' when using squashfs, so multiple instances of qemu can share the same base image, something that cannot be done by just specifying 'snapshot'. Defining 'bootindex=0' which helps to get past the EFI shell in ovmf-binary. This also enables the use case of running WIC images with EFI bootloader through the testimage.bbclass. (From OE-Core rev: e9b8c194636cb5505774a2a71bf54450580dd5b8) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "wic: Fix permissions when using exclude or include path"Richard Purdie2020-04-071-19/+3
| | | | | | | | | This reverts commit 36993eea89d1c011397b7692b9b8d61b499d0171. After discussion on the mailing list it was felt these changes were not ready yet. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "wic: Add --embed-rootfs argument"Richard Purdie2020-04-074-31/+1
| | | | | | | | | This reverts commit efdcf94801f6abe8e4099e324d9a3deccd8d4384. After discussion on the mailing list it was felt these changes were not ready yet. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>