summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types_wic.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* classes/image_types_wic: Reorder do_flush_pseudodbRicardo Ribalda2021-02-101-1/+1
| | | | | | | | | | | | | | | | | | When IMAGE_FSTYPES contains more types than wic, it can happen than the pseudo database is not flushed properly. This can be solved by changing the order of when do_flush_pseudodb is launched. Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13898 Fixes: dde90a5dd2b2 ("wic: Fix multi images .wks with bitbake") (From OE-Core rev: 8f218fbcd1810d677b6b702cdb98a30e30598000) Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 445b0a9544b55735496bbb23dbff3399b3b9e9a4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: Move wic working directoryPaul Barker2021-02-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default the wic working directory is placed under the output directory. When invoking wic under bitbake, the wic output directory is added to PSEUDO_PATHS_IGNORE to avoid issues with files being removed from outside a pseudo environment (see oe-core commit ad8f5532ff). However, wic will copy the rootfs directory into its working directory if it needs to add or remove content before creating a filesystem image. This copy of the rootfs directory must be tracked by pseudo in order to keep the permissions correct in the resulting image. So we can't have the wic working directory under a path in PSEUDO_PATHS_IGNORE unless we like broken permissions. To fix this the new '-w' argument to wic is used to move the working directory away from the output directory. Note that wic deletes the temporary working directory automatically when it finishes creating an image so users won't normally see the 'tmp-wic' directory under WORKDIR. Fixes [Yocto #14129] (From OE-Core rev: 57012ccc911b9a5c901809bc19592cf40c15db8e) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4d07169499c47fa9dc759e6f81843416a6dc25c5) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Allow exec_native_cmd to run HOSTTOOLSPaul Barker2021-02-031-1/+1
| | | | | | | | | | | | | | This allows programs from HOSTTOOLS (e.g. 'install', 'rm', 'mv', etc) to be more easily executed by wic. Without this change only programs from an actual *-native recipe built by bitbake can be executed by wic. (From OE-Core rev: 7acb39f02b8160600d1508da114e98dd1c3e76ed) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 8eb186acdecfbb3151c9a0ab148358e3fe5cce39) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Handle new PSEUDO_IGNORE_PATHS variableRichard Purdie2021-02-031-1/+1
| | | | | | | | | | | | Adjust wic to correctly handle the new PSEUDO_IGNORE_PATH variable and avoid inode corruption issues. (From OE-Core rev: 16fbe45f2e0e7621139ae26ace59889a91fceda2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 13500f5234361385c365c7c35e83f99435500481) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix multi images .wks with bitbakeRicardo Ribalda Delgado2021-02-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | In order to support .wks files with multiple images inside bitbake we need to explicitly set the pseudo database in use. Eg: If we try this .mks: part / --source rootfs --ondisk sda --fstype=ext4 part /export --source rootfs --rootfs=core-image-minimal-mtdutils --fstype=ext4 The username for all the files under /export will be set to the runner of bitbake (usually UID 1000). Before we run wic, we need to make sure that the pseudo database will be flushed, and contains all the data needed. Cc: Paul Barker <pbarker@konsulko.com> (From OE-Core rev: 63bebeaf60757967b47cae1e24aa61ec5bcbd61b) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dde90a5dd2b22a539095d1bac82acc15c6380ac8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* base/bitbake.conf: Enable pseudo path filteringRichard Purdie2021-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a pretty big change to the way pseudo operates when used in OpenEmbedded. Normally, pseudo monitors and logs (adds to its database) any file created or modified whilst in a fakeroot environment. There are large numbers of files we simply don't care about the permissions of whilst in that fakeroot context, for example ${S}, ${B}, ${T}, ${SSTATE_DIR}, the central sstate control directories, This change uses new functionality in pseudo to ignore these directory trees, resulting in a cleaner database with less chance of "stray" mismatches if files are modified outside pseudo context. It also should reduce some overhead from pseudo as the interprocess round trip to the server is avoided. There is a possible complication where some existing recipe may break, for example, we found a recipe which was writing to "${B}/install" for "make install" in do_install and since we listed ${B} as not to be tracked, there were errors trying to chown root for files in this location. This patch fixes a few corner cases in OE-Core when used with this new ignore list: * The archiver directory matched a "${WORKDIR}/deploy*" pattern so was renamed to something else since that directory does need its root permissions * The ${S} and ${B} ignoring is conditional on them being different to ${WORKDIR} * package_write_* task output (the debs/rpms/ipks) are now owned by the build user so we don't want the file ownership information in the hashequiv outhash calculation even if they are built under pseudo. * The fontcache postinstall intercept is run under qemu outside of pseudo context so delete files it may delete up front where pseudo can see this. * SSTATE_DIR is in PSEUDO_PATHS_IGNORE, which is in FAKEROOTENV which is cached by bitbake. We therefore need to trigger reparsing if this changes, which means SSTATE_DIR can be in BB_HASHBASE_WHITELIST but not BB_HASHCONFIG_WHITELIST. Rework the variables to handle this. This otherwise breaks some of our sstate tests in oe-selftest. * Ignore the temp directory wic uses for rebuilding rootfs. (From OE-Core rev: 61f8cf0940f8b05e9399a062eddb8055ea69bc5e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad8f5532ffaead9a5ad13e1034fe9e5e1b7979f4) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: Add ASSUME_PROVIDED to WICVARSVijai Kumar K2020-09-021-1/+2
| | | | | | | | | | | | | | | Add ASSUME_PROVIDED to WICVARS so that wic can use that when running on bitbake environment. This fixes the below build failure in do_image_wic when --include-path is used in wks file. (From OE-Core rev: 105f352abab0a57d6d3a6cf3d75ba4d895e3c254) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 04068ff19d2c18c3b915aab6832ad4b48affa07f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Honor APPENDKevin Hao2020-02-151-1/+1
| | | | | | | | | | | | | | | | | | APPEND is used to add additional parameters to kernel by features, such as read-only-rootfs. So we should honor this variable when we compose the kernel parameter in wic. I know we also can resolve this kind of issue by using the .wks.in template introduced by commit 42e870c5ed4b ("image_types.bbclass: support template .wks.in files for wic"), but the APPEND is needed by all the wks, it would seems pretty ridiculous to me to change all the .wks to .wks.in and then foist the APPEND into them. So the APPEND is definitely deserved to export to the wic directly. [Yocto #12809] (From OE-Core rev: 18981b8a457104391dfd94938c247eac04e4ed50) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Preserve intermediate filesPaul Barker2020-01-101-3/+4
| | | | | | | | | | | | | | | | | | | | When debugging issues or trying to add new features in wic it's useful to examine the intermediate files created by the tool such as images of the individual partitions. Previously these files were created in a subdirectory of IMGDEPLOYDIR and, deleted by wic itself and then the working subdirectory completely removed at the end of IMAGE_CMD_wic. Instead we should work in a staging directory named build-wic and leave behind intermediate files for analysis if necessary. This has the added benefit of allowing individual partition images to be preserved by adding commands to IMAGE_CMD_wic_append() in an image recipe if needed. This is useful where an update system requires exact sized and pre-formatted partition images for deployment. (From OE-Core rev: 07b6b284204e912b5d08bdd0ca51b766ab7dd9c1) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/image_types_wic: Depend on do_image_complete tasksJoshua Watt2020-01-011-0/+1
| | | | | | | | | | | | | | | | | do_image_wic now depends on the do_image_complete tasks from all it's dependencies. This allows images recipes specified in WKS_FILE_DEPENDS (for example, if a machine wants to put a initrd into a boot partition) to correctly trigger rebuilds for the wic image. Note that recrdeptask can't be used as was done for do_deploy because this would cause circular task dependency errors. This shouldn't be necessary anyway if the dependencies specified in WKS_FILE_DEPENDS are complete. (From OE-Core rev: 4b93115a0c6f8686e7a21b992751626844c301d5) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic.bbclass: Copy the .wks and .env files to deploy image dirJason Wessel2019-08-121-1/+10
| | | | | | | | | | | | | | | | | | | | | | When using a .wks.in file, the only place that the generated .wks file exists in the tmp/work area. A copy should be left behind in the deploy directory so that you can easily run the wic tool to re-generate or modify a new image without running bitbake. Custom .wks.in files can reference any number of bitbake variables, so it is important to save the result. below is an example of using the generated .wks file in the deploy area. The full name of my generated .wks file was core-image-minimal-ostree-uboot-ab.wks, but since you usually only have a single .wks file per image you can use a wild card like: cd tmp*/deploy/images/* wic create --vars . -e core-image-minimal -s -m core-image-minimal-*.wks (From OE-Core rev: 42293d75404486e20db9f7a80d0d1756887b576d) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: add syslinux-native dependency conditionalNaveen Saini2019-07-261-1/+2
| | | | | | | | | | | | | | | Add syslinux-native dependency only for IA host machines. Able to build wic image successfully for below template which uses legacy bios(syslinux): https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/scripts/lib/wic/canned-wks/directdisk-gpt.wks [YOCTO #13276] (From OE-Core rev: 7e2ee2b59319e1d2c185d65de47cc8f5c048dd03) Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add support for kernel with initramfs bundledChee Yang Lee2019-07-171-1/+4
| | | | | | | | | | | | | | | | | | | | when INITRAMFS_IMAGE_BUNDLE and INITRAMFS_IMAGE are set, wic should look for kernel with initramfs image bundled. Include required variable MACHINE, INITRAMFS_IMAGE_BUNDLE, INITRAMFS_IMAGE, INITRAMFS_LINK_NAME and KERNEL_IMAGETYPE in WICVARS. No longer require default value for variable kernel as KERNEL_IMAGETYPE is not optional variable and included in WICVARS. image_types_wic to inherit kernel-artifact-names to obtain default INITRAMFS_LINK_NAME when INITRAMFS_IMAGE_BUNDLE are set. update wic.Wic2.test_image_env test case to filter optional variable INITRAMFS_LINK_NAME, INITRAMFS_IMAGE and INITRAMFS_IMAGE_BUNDLE. (From OE-Core rev: bac984fbb2d5ad5d13ba3275c8a3e878d8753c58) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: add do_image_wic before do_image_completeMing Liu2018-05-041-0/+1
| | | | | | | | | | | | | | | We have some tasks depending on image's do_image_complete task, and we are also using WKS files to generate partitioned images, but now there is lacking a inter dependency between do_image_wic and do_image_complete, so we have to depend on both of them. Fixed by adding the dependency. (From OE-Core rev: e3a25f06f2cde701415f4130a43c9b3895d42f10) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic.bbclass: Ensure '-c image_wic' worksOtavio Salvador2017-12-211-0/+3
| | | | | | | | | | | | | | | | The 'wic' image may use files which has been deployed (e.g in do_deploy) for some partitions that may need to be copied in a specific partition or filesystem (e.g a bootloader). When using 'bitbake <image> -c image_wic', from a clean build, the contents of do_deploy must also be available so we need to ensure all do_deploy of the image dependencies has been complete. Reported-by: Fabio Berton <fabio.berton@ossystems.com.br> (From OE-Core rev: f387c28640cbb209b8a8ed5734b21c754d9f7663) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: remove systemd-boot for x32Saul Wold2017-09-261-0/+1
| | | | | | | | | | | | | | Currently systemd-boot actually incorporates libgcc, since the systemd-boot needs to be built with 64bit instructions it can not use the x32 based libgcc. Use the new override to ensure it gets overriden, linux-gnux32 could not be used because x86-64 has higher priority. (From OE-Core rev: 6046b9a3d76738c459ad76f5296e7b0a54c0b2e0) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes: drop image dependencies on TOPDIR variablePaul Eggleton2017-09-251-1/+1
| | | | | | | | | | | | | | We don't need a dependency on this variable changing, and having one causes locked signature warnings during eSDK installation if you have INITRAMFS_IMAGE_* set (since TOPDIR will always be different between the eSDK and the environment in which it was built). Relates to [YOCTO #12102]. (From OE-Core rev: 073610af04be326f9245ca91714526b390fb72cd) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: add dependency to e2fsprogs-nativeEd Bartosh2017-07-271-1/+1
| | | | | | | | | | | | | | | Added e2fsprogs-native to the list of default dependencies for wic (WKS_FILE_DEPENDS_DEFAULT) as all fs-related utilities have to be in this list. Thanks to Patrick Ohly for noticing this. [YOCTO #11817] (From OE-Core rev: b1d9f5ba5d75c6e4dae10d9d9b2c03fd3099721d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: set default WKS_FILE_DEPENDSEd Bartosh2017-07-171-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default set of dependencies used via wic-tools is not used anymore as wic images don't depend on wic-tools. Set of packages required to produce wic image depends on the content of the .wks file, so WKS_FILE_DEPENDS variable should be used to provide correct list of dependencies when WKS_FILE variable is set. As WKS_FILE_DEPENDS is not used in many existing recipes yet we need to provide default value for it to ensure that removal of wic-tool dependency doesn't cause image build failures. Initialized WKS_FILE_DEPENDS with the set of dependencies previously brought by wic-tool. This is done to provide compatibility and to avoid breakages of existing image recipes that rely on current set of dependencies. Note: This is a temporary solution for transition period. After some time the list will be either reduced or removed. Recommended solution is to use WKS_FILE_DEPENDS in image recipes together with WKS_FILE to specify dependencies. (From OE-Core rev: 01fc31854f7da6b3a4546121f809875c35bbf0e0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of using wic-toolsEd Bartosh2017-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | At the moment, when building images with IMAGE_FSTYPES=wic one ends up depending on wic-tools and thus syslinux and grub-efi even when not using those at all. Ideally, building an image with wic should only build the tools and components really needed. The problem is that "wic-tools" is needed also for the manual invocations of wic, in which case everything that might be needed has to be built in advance. Replaced dependency on wic-tools with dependency to a much shorter set of tools that wic uses almost for any image: 'parted', 'gptfdisk', 'dosfstools' and 'mtools'. [YOCTO #11552] (From OE-Core rev: 33ca15b94dbe7204c556c4b5526edd529f6d85f4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* isoimage-isohybrid: don't use TRANSLATED_TARGET_ARCHEd Bartosh2017-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | isoimage-isohybrid plugin fails with this error when trying to find initrd image: initrd = glob.glob('%s/%s*%s.%s' % (initrd_dir, image_name, target_arch, image_type))[0] IndexError: list index out of range as it uses TRANSLATED_TARGET_ARCH value as part of the image. This approach stopped to work due to changes in oe core code. initrd file name is made using MACHINE variable. wic can't get value of this variable as it's not included into bitbake -e output. Used basename of deploy dir as MACHINE value to fix the breakage. (From OE-Core rev: cfbb3cc1279ea88ca3e2867f8a409c5120aa1f05) (From OE-Core rev: e26fa1c34c33ffdc678f8073dade0126aff08b40) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic.bbclass: tighten dependency to help do_rm_work_allPatrick Ohly2017-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | Depending on wic-tools:do_build pulls a lot of additional, indirect dependencies into the image sysroot during do_image_wic as soon as rm_work.bbclass is active, because then we have do_build->do_rm_work_all->[all dependencies]. One of those dependencies is libgcc-initial, which clashes with libgcc itself, leading to errors in extend_recipe_sysroot like this: Exception: FileExistsError: [Errno 17] File exists: '.../tmp/sysroots-components/corei7-64/glibc-initial/usr/include/fstab.h' -> '.../tmp/work/intel_corei7_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/include/fstab.h' As the image recipe only needs the sysroot of wic-tools and does not need to wait for the build of wic-tools to finish, depending on do_populate_sysroot is the better choice and happens to avoid the problem above. (From OE-Core rev: a678f54e710e46b3cf674ffa41d6432b22effbdf) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add WKS_FILE_DEPENDS variableEd Bartosh2017-03-041-0/+2
| | | | | | | | | | | This variable should be used to specify dependencies that will be added to DEPENDS only if wic image build is 'active' i.e. when 'wic' is in IMAGE_FSTYPES. (From OE-Core rev: 243ccd6b8b389231f6c4a8e251c2bd6b2cf6eaad) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: fix expansion errorEd Bartosh2017-02-231-1/+1
| | | | | | | | | | | | | | | | | | | Variable WKS_SEARCH_PATH was not fully expanded when used directly in this expression: WKS_FULL_PATH = "${@wks_search('${WKS_FILES}'.split(), '${WKS_SEARCH_PATH}') or ''}" This caused expansion error: bb.data_smart.ExpansionError: Failure expanding variable WKS_FULL_PATH, .... which triggered exception SyntaxError: invalid syntax (WKS_FULL_PATH, line 1) Calling d.getVar instead of directly referencing variables should fix the issue. (From OE-Core rev: 20f8fddd28fe46d7e694804de3d894cdf9f7c636) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types_wic: remove dependency to do_bootimgEd Bartosh2017-02-051-5/+0
| | | | | | | | | | | Removing task dependency do_wic -> do_bootimg as wic doesn't depend on hddimg/booimg anymore. (From OE-Core rev: af52d878940babb88bc8a2650e8c0115b6ccaf9f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image: rename image-wic -> image_types_wicEd Bartosh2017-02-051-0/+120
Make name of the wic image type class consistent with existing naming scheme for image types. (From OE-Core rev: 4aab1b77d5f9403cbb3fae790069ef54821491fb) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>