summaryrefslogtreecommitdiffstats
path: root/meta/classes/image_types_wic.bbclass
AgeCommit message (Collapse)Author
2020-08-27image_types_wic: Add ASSUME_PROVIDED to WICVARSVijai Kumar K
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-19classes/image_types_wic: Reorder do_flush_pseudodbRicardo Ribalda
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") Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26wic: Fix multi images .wks with bitbakeRicardo Ribalda Delgado
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> Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-15wic: Honor APPENDKevin Hao
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] Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10wic: Preserve intermediate filesPaul Barker
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. Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-31classes/image_types_wic: Depend on do_image_complete tasksJoshua Watt
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. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-08image_types_wic.bbclass: Copy the .wks and .env files to deploy image dirJason Wessel
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 Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-26image_types_wic: add syslinux-native dependency conditionalNaveen Saini
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] Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-07-17wic: add support for kernel with initramfs bundledChee Yang Lee
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. Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04image_types_wic: add do_image_wic before do_image_completeMing Liu
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. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-12-21image_types_wic.bbclass: Ensure '-c image_wic' worksOtavio Salvador
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> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-26wic: remove systemd-boot for x32Saul Wold
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. Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25classes: drop image dependencies on TOPDIR variablePaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27image_types_wic: add dependency to e2fsprogs-nativeEd Bartosh
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-17image_types_wic: set default WKS_FILE_DEPENDSEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-17wic: get rid of using wic-toolsEd Bartosh
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-03isoimage-isohybrid: don't use TRANSLATED_TARGET_ARCHEd Bartosh
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) 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>
2017-03-21image_types_wic.bbclass: tighten dependency to help do_rm_work_allPatrick Ohly
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. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-03-04wic: add WKS_FILE_DEPENDS variableEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-23image_types_wic: fix expansion errorEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05image_types_wic: remove dependency to do_bootimgEd Bartosh
Removing task dependency do_wic -> do_bootimg as wic doesn't depend on hddimg/booimg anymore. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-02-05image: rename image-wic -> image_types_wicEd Bartosh
Make name of the wic image type class consistent with existing naming scheme for image types. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>