summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/bootimg-efi.py
Commit message (Collapse)AuthorAgeFilesLines
* wic: bootimg-efi: Make kernel image installation configurableKareem Zarka2023-12-041-3/+4
| | | | | | | | | | | | | | | | | | | | | The issue with installing the kernel image to both rootfs and boot partition is that some systems rely on the kernel image in rootfs and not in the boot partition. This leads to duplication of the kernel image, which can cause unnecessary storage usage. This patch provides a solution to the problem by adding a new parameter "install-kernel-into-boot-dir" to the wic kickstart file. If this parameter is set to 'true', the plugin will install the kernel image to the boot partition. If the parameter is set to 'false', the plugin will skip installing the kernel image, avoiding duplication. (From OE-Core rev: d3599afe5f604ea5afd9411e114934dcb52b2d48) Signed-off-by: Kareem Zarka <kareem.zarka@huawei.com> Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: Stop hardcoding VMA offsetsAlexandre Belloni2023-08-091-14/+49
| | | | | | | | | | | | | | | | Section VMA's are currently hardcoded. This doesn't work anymore starting with systemd-boot v254. Follow the actually solution to this which is documented here: https://wiki.archlinux.org/title/Unified_kernel_image#Manually This is also used by dracut. Later on, we may want to switch to ukify instead but this is not ready yet. (From OE-Core rev: 3abf99a6c6bde2fb8770f54dba609b35f6c6ee5a) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image_types: Fix reproducible builds for initramfs and UKI imgFrieder Paape2023-06-061-0/+2
| | | | | | | | | | | | | | | | | | | I've encountered issues reproducing initramfs and UKI image builds, which will be fixed with this patch. 1. initramfs There's a symbolic link to /sbin/init, which is appended to the cpio archive after creation. The links timestamp needs to be static and the cpio append command needs the '--reproducible' flag to produce deterministic outcomes. 2. Unified Kernel Image '--preserve-dates' is required for a static 'Time/Date' entry. I've added '--enable-deterministic-archives' although in my case this didn't change anything. (From OE-Core rev: fd027729bafb4e085ba0949e38e724f3a8cad102) Signed-off-by: Frieder Paape <frieder@konvera.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: if fixed-size is set then use that for mkdosfsRandolph Sapp2023-04-271-0/+7
| | | | | | | | | | | | | | | This is a bit of a compatibility issue more than anything. Some devices get upset if the FAT file system contains less blocks than the partition. The fixed-size argument is currently respected by the partition creation step but not by the file system creation step. Let's make it so the file system respects this value as well. (From OE-Core rev: 38e1a235f5eceade7c871f96dc97f6c384384c7b) Signed-off-by: Randolph Sapp <rs@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix populating of IMAGE_EFI_BOOT_FILES with uefi-kernelPavel Zhukov2023-02-261-1/+1
| | | | | | | | | | | | | | | | wic plugin crashed if IMAGE_EFI_BOOT_FILES is not empty and uefi-kernel loader specified because of preliminary return from the function. [Yocto #15033] Fixes: | File "/mnt/builds/yocto/sources/scripts/lib/wic/plugins/source/bootimg-efi.py", line 371, in do_prepare_partition | for src_path, dst_path in cls.install_task: | ^^^^^^^^^^^^^^^^ | AttributeError: type object 'BootimgEFIPlugin' has no attribute 'install_task'. Did you mean: 'do_install_disk'? (From OE-Core rev: a6372f70f31b39ce9867b705d02205621d7a8685) Signed-off-by: Pavel Zhukov <pavel@zhukoff.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: implement --include-pathMaxim Uvarov2022-10-261-0/+5
| | | | | | | | | | | | --include-path can be used for placing files on ESP, like dtbs. (From OE-Core rev: 46ca73f504b0792766dc4d4bbad38beb04ef4ed0) Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add UEFI kernel as UEFI stubMaxim Uvarov2022-10-261-0/+24
| | | | | | | | | | | | | | | | | | | Linux kernel can be compiled as UEFI stub and loaded directly with UEFI firmware without grub or other UEFI shell. Tested with wic file: bootloader --ptable gpt --timeout=0 --append="rootwait" part /boot --source bootimg-efi --sourceparams="loader=uefi-kernel" \ --ondisk sda --fstype=vfat --label bootfs \ --active --align 1024 --use-uuid part / --source rootfs --fstype=ext4 --label rootfs \ --align 1024 --exclude-path boot/ --use-label (From OE-Core rev: b18025fc8a2dad963b6f4b697e24455f2511b279) Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: Add support for loading devicetree filesJan Kiszka2022-08-021-7/+31
| | | | | | | | | | | | | | | | | | | | For device tree using systems, add support to set a custom devices tree during UEFI boot. This requires to copy the DTB file to the boot partition and to add the respective loader entries to the configuration files. Both grub and systemd-boot support only loading a specific device tree. Therefore refuse to work if the 'dtb' parameter contains more than one entry. Out of scope for now are overlays (only supported by systemd-boot). (From OE-Core rev: c5a14f39a6717a99b510cb97aa2fb403d4b98d99) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> [Luca: rebased on commit 98e9d435b278 ("wic/bootimg-efi: use cross objcopy when building unified kernel image")] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: Factor out some common bitsJan Kiszka2022-08-021-25/+21
| | | | | | | | | | | | | | | | The paths for configuring grub and systemd-boot have some common bits around copying the initrd files. This will even grow when adding dtb support. Factor this out into a class function. Along this, avoid evaluating 'create-unified-kernel-image' multiple times in do_configure_systemdboot and suppress a bogus warning about "Ignoring missing initrd" when it is turned on. (From OE-Core rev: c700cfd88473b9ed4e12a6620fb089f41bd95a9e) Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: use cross objcopy when building unified kernel imageRoss Burton2022-08-021-13/+12
| | | | | | | | | | | | | | We can't rely on the host objcopy knowing how to process target binaries, so use the cross objcopy in the sysroot instead. Also construct the command argument-by-argument as the format expression was getting unwieldy. (From OE-Core rev: 0264aeedbf21e9e7a104243c11b3b57f00e38bda) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@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>
* wic/bootimg-efi: IMAGE_EFI_BOOT_FILES variable added to separate bootimg-efi ↵Khairul Rohaizzat Jamaluddin2020-09-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | and bootimg-partition Due to recent changes in bootimg-efi to include IMAGE_BOOT_FILES, when both bootimg-partition and bootimg-efi occur in a single .wks and IMAGE_BOOT_FILES are defined, files listed in IMAGE_BOOT_FILES will be duplicated in both partition. Since IMAGE_BOOT_FILES are crucial for bootimg-partition, but optional for bootimg-efi, hence allowing bootimg-efi to have the option to ignore it. The new variable, IMAGE_EFI_BOOT_FILES, was added to help handle this issue. Its basic usage is the same as IMAGE_BOOT_FILES. Usage example: ${IMGDEPLOYDIR}/${IMAGE_BASENAME}-${MACHINE}.ext4;rootfs.img \ This commit is also squashed with the updated testcase to cover for this change. [YOCTO #14011] (From OE-Core rev: 945339e06b273df1935cfd784f548ef57e0b7f4c) Signed-off-by: Khairul Rohaizzat Jamaluddin <khairul.rohaizzat.jamaluddin@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: add support for kernel with initramfs bundledChee Yang Lee2019-07-171-6/+12
| | | | | | | | | | | | | | | | | | | | 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>
* wic/bootimg-efi: allow multiple initrdChee Yang Lee2019-06-191-6/+16
| | | | | | | | | | | | | | | Allow plugin bootimg-efi to configure with multiple initrd through source parameter. Uses ; to separate each initrd. e.g: --sourceparams="loader=${EFI_PROVIDER},initrd=initrd1;initrd2" (From OE-Core rev: c7b0823f9ab6a9959aaa809b8c3f70d199feb64d) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/plugins: kernel image refer to KERNEL_IMAGETYPEChee Yang Lee2019-06-111-6/+15
| | | | | | | | | | replaced hardcoded kernel image with KERNEL_IMAGETYPE. set kernel image to "bzImage" incase KERNEL_IMAGETYPE not set. (From OE-Core rev: 88a9fef761c5e67b2964fedc85a7e8ad37067564) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: add label source parameterChee Yang Lee2019-05-301-4/+15
| | | | | | | | | | | | | Add new source parameter label to allow custom boot.conf/grub.cfg label, so far it's hardcoded to "Boot". Default label to "Boot" for systemd-boot and blank for grub-efi when source parameter label are not set. (From OE-Core rev: 7a0aab1aa31e66e6bc94c04c2f6c1043b64a8967) Signed-off-by: Chee Yang Lee <chee.yang.lee at intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi: replace hardcoded volume name with labelChee Yang Lee2019-05-151-2/+4
| | | | | | | | | | | volume name should refer to --label in .wks. Replace the hardcoded volume name with label. set "ESP" as default name when no lable specified. (From OE-Core rev: 5621aceaf39ef0dc097b16c83e73b9882c987a7c) Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib+scripts: Convert to SPDX license headersRichard Purdie2019-05-091-15/+1
| | | | | | | | | | | | | | | | | | | | | | | This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: add a title source parameterMing Liu2018-11-161-2/+4
| | | | | | | | | | | | | | | | | | Sometimes the users might want to change the title showing on UEFI booting screen, so far it's hard-coded to 'boot'. There is not a easy way to customize it in current design, I tried firstly with '--configfile', but that does not work with --use-uuid, since the later option will generate a UUID and write it to boot config, only when the former option is not enabled. So a new source parameter 'titile' is added in this patch, it defaults to 'boot' to be consistent with the original title. (From OE-Core rev: 37e16188ef3b1b328eb18b3e459c051c9c9f0332) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/bootimg-efi.py: recognize initrd when using grubAnuj Mittal2018-06-041-2/+18
| | | | | | | | | | | | Make sure that we're able to use the initrd value specified in the wks file when using grub-efi bootloader with bootimg-efi wic plugin. Fixes [YOCTO #12689] (From OE-Core rev: f1d5bb1f21e11714357aff4ae7e52421e3756c5a) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Introduce --fsuuid and have --use-uuid make use of UUID tooTom Rini2017-12-181-1/+2
| | | | | | | | | | | | | | First, allow for wic to be given a filesystem UUID to be used when creating a filesystem. When not provided, wic will generate the UUID to be used. Next, when --use-uuid is passed, we update the fstab to mount things via UUID (and if not found, then use PARTUUID) as UUID is more portable. (From OE-Core rev: 9256b8799495634ee8aee5d16ff71bd6e6e25ed4) Signed-off-by: Tom Rini <trini@konsulko.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: flatten directory structureEd Bartosh2017-06-231-2/+2
| | | | | | | | | | | Moved misc.py from wic/utils/ to wic/ Removed wic/utils directory (From OE-Core rev: df906f3caa0721756f5ed48fa657e62e05ae2aa3) 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: use kernel_dir to find systemd-efi bootloaderEd Bartosh2017-03-241-1/+1
| | | | | | | | | | | | | | Fixed test failure caused by using bootimg_dir path instead of kernel_dir to find systemd-efi bootloader: FAIL: test_systemd_bootdisk (oeqa.selftest.wic.Wic) ... FileNotFoundError: [Errno 2] No such file or directory: 'tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/recipe-sysroot/usr/share' (From OE-Core rev: 552bd782d9ffe275b8fc7d7cb0b9aaceb51888c3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use kernel_dir instead of bootimg_dirEd Bartosh2017-03-231-7/+7
| | | | | | | | | | | | | | | bootimg_dir is usually set to the value of STAGING_DATADIR and kernel_dir - to the value of DEPLOY_DIR_IMAGE, so usage of kernel_dir is more logical in bootimg-efi, bootimg-partition and rawcopy plugins. Replaced usage of bootimg_dir to kernel_dir in 3 above mentioned plugins that use DEPLOY_DIR_IMAGE as a default artifact location. (From OE-Core rev: 48a5d67d7cafdeac821e6f35bea380521ef017d5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: don't set creator.bootimg_dir in pluginsEd Bartosh2017-03-231-2/+0
| | | | | | | | | | | Changing bootimg_dir in plugins is a dangerous hack as this value comes from wic command line and can be used by multiple plugins. (From OE-Core rev: 2457ea5338f7309316b474562b4723e8cb09286d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move WicError to lib/wic/__init__.pyEd Bartosh2017-03-041-1/+1
| | | | | | | | | | Removed unused exceptions from error.py Moved definition of WicError to lib/wic/__init__.py (From OE-Core rev: 15442d072bb6d93bd9b941726f93262503053da5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: raise WicError in wic pluginsEd Bartosh2017-03-041-20/+12
| | | | | | | | | Replaced sys.exit with raising WicError in wic plugins. (From OE-Core rev: 92e8c81c941597eb2b4b61d5c28833e4826888f8) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use wic logger in wic source pluginsEd Bartosh2017-03-041-24/+36
| | | | | | | | | Replaced msger with wic logger in wic source plugins. (From OE-Core rev: 19a868e9ad12fb27a7f713685d12f3d310fd6961) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: direct: remove set_bootimg_dir setterEd Bartosh2017-02-151-1/+1
| | | | | | | | | | Removed java-like setter set_bootimg_dir. It's more pythonic to access public attributes directly. (From OE-Core rev: c2a6ca4883ea59e6492ad3b4aa0e9bc358b87fed) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: code cleanupEd Bartosh2017-02-021-7/+7
| | | | | | | | | | | Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] (From OE-Core rev: 5fa7768bfb4b6d464c6a812822b0665f52e7bea4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move oe/misc.py one level upEd Bartosh2017-02-021-2/+2
| | | | | | | | | | | | Flattened directory structure: moved wic/utils/oe/misc.py -> wic/utils/misc.py [YOCTO #10619] (From OE-Core rev: 392532a2748ff2e6412eeb79163662b5168611ce) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move 2 APIs to wic.engineEd Bartosh2017-02-021-1/+1
| | | | | | | | | | | | Moved find_canned and get_custom_config APIs to engine module. Removed empty wic.utils.misc module. [YOCTO #10619] (From OE-Core rev: 10e9afac46575d3f557b7cb505daa31ce9ce85fa) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Look for image artifacts in a common locationTom Zanussi2017-01-311-10/+29
| | | | | | | | | | | | | | | | Rather than have each image type look for artifacts in image-specific locations, move towards having them look for artifacts in a common location, in this case DEPLOY_DIR_IMAGE Use the existing deploy.bbclass to have the bootloaders put their binaries in DEPLOY_DIR_IMAGE and then wic will find them and place them in the image (From OE-Core rev: 1c8acea91e775b1b6f8b25e774aaba3e790fc59b) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* gummiboot: Remove/change gummiboot references with systemd-bootAlejandro Hernandez2017-01-091-12/+10
| | | | | | | | | | | | | | | After systemd-boot was introduced, its been tested for a while with no major issues being found until now, this patch completely replaces all gummiboot instances with systemd-boot ones, taking the next step into cleaning up systemd-boot/gummiboot. [YOCTO #10332] (From OE-Core rev: f9a61d3400ad9068a6d83b8eb6aefe3098c58e68) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: make sure that partition size is always an integer in internal processingMaciej Borzecki2016-11-151-1/+1
| | | | | | | | | | | | The size field of Partition class is expected to be an integer and ought to be set inside prepare_*() method. Make sure that this is always the case. (From OE-Core rev: a37838f995ae642b0b8bdd47a605a264fb3bf200) Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add systemd-boot option in EFI boot image pluginJianxun Zhang2016-07-201-3/+5
| | | | | | | | | | | | | | | | | | | | | The new systemd-boot enabled in OE is the old gummiboot merged into systemd project. Our intention is to replace gummiboot with systemd-boot in OE once every feature based on gummiboot is supported with systemd-boot. Before we can purge gummiboot, we temporarily keep both of the two bootloaders supported. Patch doesn't do replacement for every "gummi" occurrence. We think cleaning can be done in background after we disable people to use gummiboot, so we just keep change small and safe this time. (From OE-Core rev: daa5f8b886408eb6a17898b18ac97d5a0d76d2cc) Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* image-live, image-vm, wic: Remove fs size workaroundJussi Kukkonen2016-06-031-6/+0
| | | | | | | | | | | | Since mtools has been patched to live with filesystems with sizes not divisible by sectors-per-track, we no longer need to try to set the size based on our guess of the sectors-per-track dosfstools is going to use. (From OE-Core rev: 334e32af88b310ff1ed950d127a6dedeb460f8d0) Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: bootimg-efi: include startup.nsh if it's availableChristopher Larson2016-05-301-0/+5
| | | | | | | | | | | | | We want the system to boot on its own, rather than the user having to manually input the correct file at the EFI prompt. [YOCTO #9556] (From OE-Core rev: aa215c12d729c001ad3b8b98a7e203a9ad192211) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: do not remove build dir in source pluginsEd Bartosh2016-01-201-2/+0
| | | | | | | | | | | | | | | | | | Interesting bug was found during implementation of 'include' parser command. Build directory was removed in do_configure_partition method of bootimg- source plugins. This can cause removal of previously prepared partition images if /boot partition is mentioned after other partitions in .ks file. Moved work directory removal to direct.py before processing partitions. (From OE-Core rev: ba98262573cf1600e0d477317f51d488b5f8c4bd) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: removed unused importsEd Bartosh2016-01-191-1/+1
| | | | | | | | | | Removed imports of wic.kickstart from plugins as they're not used in the code. (From OE-Core rev: 33d8784470c506fabcf9627e754628cdea61dd07) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of 2 gettersEd Bartosh2016-01-181-2/+2
| | | | | | | | | | Used partitions and configfile bootloader attributes instead of using getters get_bootloader_file and get_partitions. (From OE-Core rev: d34dd190e1da00ca8c9b2cb0adba15b9f0de2920) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of set_size and set_source_file settersEd Bartosh2016-01-181-2/+2
| | | | | | | | | | Used size and source_file attributes instead of using setters. It's more pythonic, clear an consistent. (From OE-Core rev: 7cf236047fa5d0d947fd214181c9a63ccb2509ac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of get_timeout getterEd Bartosh2016-01-181-12/+6
| | | | | | | | | | | | | | | | Used bootloader.timeout instead of kickstart.get_timeout getter. Accessing attributes instead of getting them with getters is more pythonic, shorter and readable. It also more consistent as most of partition and bootloader attributes are used this way. This change also takes care of appendLine bootloader attribute: it's renamed to bootloader.append attribute provided by new parser. (From OE-Core rev: 8088caeff5bf4ee9279b47a69c9f1e5537909601) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: adjust code for new data structureEd Bartosh2016-01-181-1/+1
| | | | | | | | | | | | New data structure is less nested than old one. Adjusted bootloader and partitions fields: self.ks.handler.bootloader -> self.ks.bootoader self.ks.handler.partitions -> self.ks.partitions (From OE-Core rev: b46da0731e3f7016d0ab2a67967f07c7e199f219) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Allow to use a custom config for bootloadersMariano Lopez2015-12-091-18/+49
| | | | | | | | | | | | | | | | This change will allow to use a user defined file as the configuration for the bootloaders (grub, gummiboot, syslinux). The config file is defined in the wks file with the "configfile" option in the bootloader line. [YOCTO #8728] (From OE-Core rev: d56546b0f312fd042b1a7df3bef97ac1c9b6a5b4) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix short variable namesEd Bartosh2015-09-031-13/+13
| | | | | | | | | | | | Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". (From OE-Core rev: 872cb0d5d79b26f34e6b35d7be8870d245021be4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix pylint warning unused-variableEd Bartosh2015-09-031-6/+0
| | | | | | | | | Removed or reworked code with unused variables. (From OE-Core rev: 3644b9f5ca25dfc61d4f5eda0f073c8a879b492b) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Code cleanup: unused importsEd Bartosh2015-07-021-1/+0
| | | | | | | | | Fixed pylint warning unused-import (From OE-Core rev: e77fda5fb6cb0a35308e4620ca4602715a471fbe) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add missing docstrings to plugin classesEd Bartosh2015-06-231-0/+5
| | | | | | | | | | | | Docstings from plugin classes are used as part of output of 'wic help plugins'. Adding them makes help page more informative. (From OE-Core rev: d4414b45c81ab539f75a7bb16fc6412c30dfc45f) 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>