summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/ksparser.py
AgeCommit message (Collapse)Author
2023-09-02wic: Add gpt-hybrid partition layoutJoshua Watt
Add support for formatting a disk with a hybrid MBR & GPT partition scheme. In this scheme, the primary partitioning method is GPT, but a valid MBR header is also written than can point to a subset of the GPT partitions on the disk (any partitions marked with the `--mbr` flag will be included in this MBR). The primary purpose of this method is to allow for SoCs that can only find a bootloader in an MBR partition to use GPT once the bootloader is running. As an example, older versions of the Raspberry Pi firmware can only parse MBR partitions to find a kernel (or other bootloader like u-boot), but once those have booted GPT partitions can be used. In addition to the partitions annotated with the `--mbr`, a "protective" GPT partition of type 0xEE is added, as the existence of such a partition is the indication to tooling that this a hybrid MBR and that the GPT partition table should be parsed instead. (From OE-Core rev: e50e4c2a5ada6947b3503ca4d8e9c30d359e8a5d) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-25wic: Add argument --hidden to default imagerLeon Anavi
Add argument --hidden to avoid MS Windows prompting to format partition after flashing to a USB stick, SD card on another media. Set Bit 0 (RequiredPartition) to mark that the partition is required for the platform to function on GUID Partition Table (GPT). The new argument simplifies setting RequiredPartition on GPT through a WKS file and the default imager plugin. Otherwise, without this feature, to achieve the same result a new imager plugin has to be implemented and set in WIC_CREATE_EXTRA_ARGS. (From OE-Core rev: 7a111ff58d7390b79e2e63c8059f6c25f40f8977) Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12wic: add 'none' fstype for custom imageJeongBong Seo
It's not possible to set the label (of gpt entry) normally when I want to use non-listed fstype as a rawcopy. Example) part ? --source rawcopy --ondisk mmcblk0 --label mypart --sourceparams file=mypart.raw To resolve this problem, this patch addes a 'none' fstype and ignore do_image_label on rawcopy (that actually set the partition label.) (From OE-Core rev: 949cf797eb54f3d22a093910087e937633ce9b23) Signed-off-by: JeongBong Seo <jb.seo@lge.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-05-16wic: added fspassno parameter to partitionClaudius Heine
The `fspassno` parameter allows to overwrite the value of the last column (`fs_passno`) in the /etc/fstab of the target root file system. This allows to have periodic file system checks. (From OE-Core rev: b9b9f71e6f37bfbf954ade518391b242669481e3) Signed-off-by: Claudius Heine <ch@denx.de> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-20wic: Add --no-fstab-update part optionDaniel Gomez
When embedding a rootfs image (e.g. 'rootfs-dir') as a partition we might want to keep the stock fstab for that image. In such a case, use this option to not update the fstab and use the stock one instead. This option allows you to specify which partitions get the fstab updated and which get the stock fstab. The option matches the argument you can pass to wic itself where the same action is performed but for all the partitions. Example: part /export --source rootfs --rootfs-dir=hockeycam-image --fstype=ext4 --label export --align 1024 --no-fstab-update part / --source rootfs --fstype=ext4 --label rootfs --align 1024 (From OE-Core rev: ab4c95af8ecd15dc136194ab761afae756db5803) Signed-off-by: Daniel Gomez <daniel@qtec.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-05-31Add support for erofs filesystemsRichard Weinberger
Since Linux 5.4 a new read-only filesystem is available, erofs. Compared to squashfs it offers much better read performance with and without compression enabled. It suppports two optional compressors, lz4 and lz4hc. >From the mkfs.erofs man page: EROFS is a new enhanced lightweight linux read-only filesystem with modern designs (eg. no buffer head, reduced metadata, inline xattrs/data, etc.) for scenarios which need high-performance read-only requirements, e.g. Android OS for smartphones and LIVECDs. It also provides fixed-sized output compression support, which improves storage density, keeps relatively higher compression ratios, which is more useful to achieve high performance for embedded devices with limited memory since it has unnoticable memory overhead and page cache thrashing. This commit adds support for three new filesystem targets: erofs: erofs without compression erofs-lz4: erofs with lz4 compresssion enabled erofs-lz4hc: erofs with lz4hc compression enabled (From OE-Core rev: 41dead1ff8ccc49e6cd6e6f5d41a59d164693e0d) Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-01-01wic/direct/kparser: ensure fsuuid for vfat and msdos align with formatLee Chee Yang
vfat/msdos filesystem should have fsuuid in format 0xYYYYYYYY where "0x" in front follow with 8 hexadecimal number in uppercase. In wic, when using custom fsuuid for vfat/msdos partition in wks, it is able to set the value in any length, with or without leading "0x". This can cause fsuuid missaligned when fstab updates, fstab expect exactly 10 character fsuuid for vfat/msdos partition and all in uppercase. if custom fsuuid for vfat/msdos is set, check the length and format, error if it exceed the format size. Amend it so it is align with format 0xYYYYYYYY. This is done before image create and fstab update to ensure the fsuuid are same in all followup process. if custom fsuuid length less than expected, fill in "0". [YOCTO #14161] (From OE-Core rev: d9686ae511ef10a504becfd81bfe296b788e1456) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-22wic: Add 512 Byte alignment to --offsetJoshua Watt
Allows the --offset argument to use the "s" or "S" suffix to specify that it is reporting the number of 512 byte sectors. This is required for some SoCs where the mask ROM looks for an item at a sector that isn't aligned to a 1KB boundary. (From OE-Core rev: 938595d1dc4abaf5f7f3a7900add3f0492b805d0) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-12wic: Fix --extra-space argument handlingJoshua Watt
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>
2020-06-04wic: Add --offset argument for partitionsJoshua Watt
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>
2020-04-26wic: root: Add an opt. destination on include-pathRicardo Ribalda Delgado
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>
2020-04-26wic: Add --change-directory argumentRicardo Ribalda Delgado
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>
2020-04-07Revert "wic: Add --embed-rootfs argument"Richard Purdie
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>
2020-04-06wic: Add --embed-rootfs argumentRicardo Ribalda Delgado
This option adds the content of a rootfs on a specific location on the rootfs. 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 --embed-rootfs target-image /export --embed-rootfs target-image2 /export2 on the .wks file. (From OE-Core rev: efdcf94801f6abe8e4099e324d9a3deccd8d4384) 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] (From OE-Core rev: 18981b8a457104391dfd94938c247eac04e4ed50) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-01-10wic: Add --include-path argumentPaul Barker
This option adds the contents of the given path to a partition built with the rootfs source plugin. The path is relative to the directory in which wic is running not the rootfs itself so use of an absolute path is recommended. This option is most useful when multiple copies of the rootfs are added to an image and it is required to add extra content to only one of these copies. This option only has an effect with the rootfs source plugin. (From OE-Core rev: d4cd27a9837426e809190548a83c6c7c76505114) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-12wic: Add partition type for msdos partition tablesJason Wessel
In order to create a msdos partition table disk image that can auto expand after the image is copied to an SD card, wic needs the ability to have a primary partition as the last entry. The desired use case is to be able to create an A/B update partition image scheme with a /var volume that can be auto expanded to the remainder of the SD card at run time. The typical .wks file will look similar to the following: bootloader --ptable msdos part / --source rawcopy --sourceparams="file=u-boot.imx" \ --ondisk mmcblk --no-table --align 1 --size 1 part /boot --source bootimg-partition \ --ondisk mmcblk --fstype=vfat --label boot --active --align 4 --size 16 part / --source rawcopy --sourceparams="file=imx6_boot.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaboot --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaroot --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6_boot.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaboot_b --align 4 --type logical part / --source rawcopy --sourceparams="file=imx6.otaimg" \ --ondisk mmcblk --fstype=ext4 --label otaroot_b --align 4 --type logical part /var --source rawcopy --sourceparams="file=imx6_var.otaimg" \ --ondisk mmcblk --fstype=ext4 --label fluxdata --align 4 Without the patch applied, wic will generate an SD card image that looks like: Disk boot.img: 890940s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 2056s 48001s 45946s primary fat16 lba 2 48008s 132467s 84460s primary ext4 3 132472s 454467s 321996s primary ext4 4 454471s 890939s 436469s extended lba 5 454472s 538931s 84460s logical ext4 6 538936s 860931s 321996s logical ext4 7 860936s 890939s 30004s logical ext4 boot With the patch applied a primary partition can be created at the end of the image which can be expanded to fill the free space on the media where the image has been copied, which looks like: Disk boot.img: 890940s Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags: Number Start End Size Type File system Flags 1 2056s 48001s 45946s primary fat16 lba 2 48007s 860931s 812925s extended lba 5 48008s 132467s 84460s logical ext4 6 132472s 454467s 321996s logical ext4 7 454472s 538931s 84460s logical ext4 8 538936s 860931s 321996s logical ext4 3 860936s 890939s 30004s primary ext4 boot (From OE-Core rev: 56add7cc547e0113cdf980579d1421b14cc233e5) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-30wic: python2 -> python3Robert Yang
(From OE-Core rev: 9303f92599343adf645fee5d2434fadd97e7febb) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
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>
2019-01-14wic: allow bitbake variables in kickstarter filesRasmus Villemoes
image_types_wic.bbclass has a mechanism for doing variable substitution on .wks files by simply letting the input file be called .wks.in. However, that doesn't allow using variables in files included via the include directive. This is unfortunate, because lacking either the ability to include other files or variable substitution leads to fragile and error-prone duplication between kickstarter files and recipes/configuration files used for various boards. This adds (somewhat naive) support for variable substitution in all files parsed by wic. The user should add all required variables to WICVARS to get them exported appropriately. (From OE-Core rev: 8a75d614a8a1ff72c4af448ac3e1292d0e1d1a79) Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-13wic: Introduce the --use-label partition parameterKevin Hao
We can use this parameter to make the wic use the label to name a partition in /etc/fstab. (From OE-Core rev: 51638edaa00befaed58e2def255d46ae44d9234f) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-09-11wic: squashfs does support partition uuid.Emmanuel Roullit
wic allows the user to create disk image and reference each created partitions via its partition UUID. squashfs does not support filesystem UUID but it does offer support for partition UUID. $ lsblk -o NAME,FSTYPE,UUID,PARTUUID NAME FSTYPE UUID PARTUUID sda |-sda1 vfat 6078-ACD0 95aa4ffb-741d-4d99-adf6-0358bc890046 |-sda2 squashfs 7d46da2d-29cc-4d5a-9e39-d0381c4abb0c |-sda3 squashfs d4a3e24e-410a-4f2c-8ad5-8f8321de177b |-sda4 ext4 d72ec529-78e4-4cd3-b39b-781b6b1cb47c f3edc990-f4f6-4536-9587-44dae4ceb99f `-sda5 ext4 a0b265aa-e935-40b8-9c6b-e9e58ad3890f 6e72ebaa-29ed-41cd-844c-3f76976cf41d Modifying this constrain allows a user to create squashfs-based rootfs and boot from them with such kernel argument 'root=PARTUUID=7d46da2d-29cc-4d5a-9e39-d0381c4abb0c' Fixes: 2fbdcf4e59c8 ("wic: kparser.py: Check for SquashFS and use-uuid") (From OE-Core rev: a8787bbfdf088b0ef9feb8e6b4230b743bb4086f) Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18wic: Introduce --fsuuid and have --use-uuid make use of UUID tooTom Rini
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>
2017-12-18wic: kparser.py: Check for SquashFS and use-uuidTom Rini
The SquashFS filesystem does not support UUIDs so make this combination be an error. (From OE-Core rev: 2fbdcf4e59c835af0f4041bc34243decb42321ef) 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>
2017-11-07wic: add 'part-name' argument for naming GPT partitionsArtur Mądrzak
The WIC's 'part' can now give a name for GPT partition in WKS file. It's similar to '--label', but is naming partintions instead file systems. It's required by some bootloaders to partitions have specified names. (From OE-Core rev: 9b60e3466ed7cff0cea10815851eb1304002eb52) Signed-off-by: Artur Mądrzak <artur@madrzak.eu> Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21wic: implement wks option --mkfs-extraoptsEd Bartosh
This option specifies extra options to pass to mkfs.<fstype> utilities. [YOCTO #11709] (From OE-Core rev: 67b7c67edba305fbd31967baa10d27c2e603ec77) 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-06-23wic: remove extra double-quote on documentation stringJean-Francois Dagenais
(From OE-Core rev: e34fd016ed6634b1375b78f3dfe60afcc58e5bab) Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01wic: allow only supported fstypesEd Bartosh
Restricted possible values of --fstype to the list of supported types. This should catch incorrect values when .wks file is being parsed. Removed checks for empty fstype and mentioning of unsupported fstype 'ontrackdm6aux3'. (From OE-Core rev: 21af89a6d44ccea6aef975ffd2483a8fad1231de) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04wic: use wic logger in core modulesEd Bartosh
Replaced msger with wic logger in the core wic modules. (From OE-Core rev: cdd6675951b74075c9b9159f7465a88f83775bac) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15wic: ksparser: set default disk to 'sda'Ed Bartosh
Set default value of --ondisk to 'sda' to ensure we always have disk name for the partition. This is a first step of replacing --ondisk with disk <name> attribute of .wks. This is better as all partitions share the same disk. (From OE-Core rev: caa243a86ba50c676f8eb0a71440885a49f10cc4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15wic: Add --exclude-path option to rootfs source plugin.Kristian Amlie
It will omit the given path from the resulting partition, and if the given path ends in a slash, it will only delete the content, and keep the directory. Since mkfs only accepts whole directories as input, we need to copy the rootfs directory to the workdir so that we can selectively delete files from it. Since we want to use the copyhardlinktree() function, we need to put the generic oe lib in the module search path. (From OE-Core rev: 6602392db3d391d926dead49fcc54326015cfe35) Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-02wic: move 2 APIs to wic.engineEd Bartosh
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>
2016-12-22wic: add --fixed-size wks optionMaciej Borzecki
Added new option --fixed-size to wks. The option can be used to indicate the exact size of a partition. The option cannot be added together with --size, in which case an error will be raised. Other options that influence automatic partition size (--extra-space, --overhead-factor), if specifiec along with --fixed-size, will raise an error. If it partition data is larger than the amount of space specified with --fixed-size option wic will raise an error. (From OE-Core rev: fdd217ba874bd480e0180830fe2e6bd54dde19d9) 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>
2016-07-20wic: mountpoint is an optional argumentMaciej Borzecki
According to wic documentation partition mount point is an optional argument. Skipping mount point also makes sense in certain configurations when one needs to specify a partition that is not mounted by the running system, such as a recovery or a mirror partition (in dual rootfs setups). (From OE-Core rev: 5e063a4c6bb0e0623a4d25bb2bf6eecd9ad6b9f1) 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>
2016-05-14wic: don't use L suffix for integersEd Bartosh
This suffix is not supported by Python 3. Wic code works without it on Python 2 too, so it's safe to remove it. [YOCTO #9412] (From OE-Core rev: 296db7e33bd71585cac63dc78c2c95bc619b4a86) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14wic: don't inherit classes from objectEd Bartosh
All classes in Python3 are new style classes and don't need to be inherited from object. Wic code works fine without this inheritance even with Python2, so it's harmless to remove it. [YOCTO #9412] (From OE-Core rev: a146b03ee7d0aa5bc1722da5977a5952782b69bf) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29wic: add --system-id wks optionEd Bartosh
Added new option --system-id to wks parser. The option will be used to set partition system id. [YOCTO #9096] (From OE-Core rev: b9c56b1c95cd1d0fd809d257e0cd05a50c481bed) 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>
2016-03-28wic: fix type of no-table optionEd Bartosh
Type of --no-table option was incorrectly set in new wks parser. It causes parser to require argument for this option, which makes wic to fail with wks files that use --no-table: Error: argument --no-table: expected one argument Changed action parameter to 'store_true' to fix the issue. (From OE-Core rev: d483724cf3515f76e1b798a2018e2f3fa2bad0ba) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-04wic: default to empty bootloader configMaciej Borzecki
A kickstart file for non-x86 boards may have no 'bootloader' stanza. It is the usual case if bootloader is setup using other mechanism than through wic, and is for instance a part of u-boot configuration. In such case the 'bootloader' field in the KickStart class will be uninitialized. Instead of adding an empty bootloader line in every kickstart file call the bootloader parser with empty argument list to get defaults namespace. (From OE-Core rev: 264c03e854f77c3b62acb710384f66716ccbf469) Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20wic: pylinted ksparser moduleEd Bartosh
Added missing docstrings, fixed wrong indentation and long lines. Final pylint score is 9.89/10 (From OE-Core rev: 6e5dd42727b40c6b5ba6235026a6cfc78f482ac9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20wic: implement search of includesEd Bartosh
Used custom argument type to implement search of include .wks files in canned wks paths. Include files can be specified either by full path or by name. [YOCTO #8848] (From OE-Core rev: 3695962ba4b685f304f1039978cec60d1b1712e3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20wic: ksparser: add support for includeEd Bartosh
Extended parser to support inclusion of .ks files: recursively called self._parse to parse included .ks (From OE-Core rev: 33dd323ec6a1a1ed4e1a04e51de182c89c7b6bd9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20wic: use unique partition numberEd Bartosh
This is a preparation for 'include' support. Used unique counter instead of line number for partitions in .ks file. Line numbers can be equal for different .ks files, which can cause problems if one .ks file is included into another. (From OE-Core rev: cc2233b51f1d22d4e540f4a3e9ceedd7ede9ffa9) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-20wic: move wks parsing code to KickStart._parseEd Bartosh
This is a preparation for implementation of include statement. Parser will be called recursively to parse included .wks files, so it should be available as a method. (From OE-Core rev: 7778b9851758f4f782cb5f5d5fb36e68aed3b275) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: rename kickstarter.py -> ksparser.pyEd Bartosh
kickstarter.py was not the best name for this module as previously there was a directory with the same name in scripts/lib/wic/. All files were removed from it, but .pyc files could still stay there causing imports from wic.kickstart to fail with ImportError: cannot import name KickStart. (From OE-Core rev: b9d400be06bc4a4bb9f9c6a6a0c8e5ecfd4e2dfb) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>