summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic
Commit message (Collapse)AuthorAgeFilesLines
* wic: rawcopy: make source filenames uniqueEd Bartosh2016-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | Rawcopy plugin copies source files to build folder before using them to assemble result image. After assembling the image wic renames source files to <image>.p<partition number>. If the same source file is used in multiple partitions wic breaks trying to rename file that doesn't exist. Added <line number> suffix to the files when copying them to the build dir. This should make filename unique even if the same source file is used for multiple partitions. [YOCTO #9826] (From OE-Core rev: 6f7afd6f76c40e1b050e40bc4965cb5000df7088) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix path parsing, use last occurrenceGeorge McCollister2016-06-291-1/+1
| | | | | | | | | | | | | | | If the path contains 'scripts' more than once the first occurrence will be incorrectly used. Use rfind instead of find to find the last occurrence. (From OE-Core rev: f30c486c17060d2f21618612804a692512ad6a57) (From OE-Core rev: d34a0fd910babe233d89ad9c1e9d61dcec1c4b63) Signed-off-by: George McCollister <george.mccollister@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: isoimage-isohybrid: fix splash file pathsIoan-Adrian Ratiu2016-06-291-2/+2
| | | | | | | | | | | | | | | os.path.join discards the cr_workdir var contents if the path of the second arguments is absolute. (From OE-Core rev: dba099d77dcc66b239523a55f3ed26784f9a662a) (From OE-Core rev: ef37c7d8e4abf896aa791ee01e52a74f24aadb99) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: isoimage-isohybrid: add grubefi configfile supportIoan-Adrian Ratiu2016-06-291-21/+32
| | | | | | | | | | | | | | | | | | | The latest wic kickstart refactoring introduced a bootloader option "--configfile" which lets wks' specify a custom grub.cfg for use while booting. This is very useful for creating stuff like boot menus. This change lets isoimage-isohybrid use --configfile; if this option is not specified in a wks, it generates a default cfg as before. (From OE-Core rev: bf673a769514b13558ad9c785ae4da3a5adfd1e0) (From OE-Core rev: e5e35d055b0a72f2204f9530a1ad39bc51e79217) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix bug in handling fsoptionsEd Bartosh2016-04-141-19/+17
| | | | | | | | | | | | | | | | | Partitions specifying --fsoptions were silently skipped by wic due to the old bug introduced when removing code related to subvolume handling: - if mountpoint == "/" or not fsopts or fsopts.find("subvol=") == -1 + if mountpoint == "/" or not fsopts: [YOCTO #9396] (From OE-Core rev: be7ff1741e8ab5f2724b3f64da1bed8b0d3dcb7c) 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>
* Revert "wic/utils/partitionedfs.py: assemble .wic images as sparse files"Ross Burton2016-04-131-1/+1
| | | | | | | | | | | | | | It turns out that dd's conv=sparse doesn't look at the file extents, but simply checks if a "block" is all zero. If the block of zero was meaningful it gets lost and if the image is subsequently written to media using a sparse-aware writer then the block of zeros won't be written at all. This reverts commit 5fd592fbae2e046bcb8c3a6c3ef4993fe0400676. (From OE-Core rev: 63d15764cc2014dba9fee2186f0c8b97c2ac5682) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/utils/partitionedfs.py: assemble .wic images as sparse filesJoshua Lock2016-04-091-1/+1
| | | | | | | | | | | | | | | | The individual partitions created by wic are sparse but without this change the assembled image is written as one (potentially very) large file. Preserve sparseness in the assembled image by passing the sparse conversion symbol. [YOCTO #9099] (From OE-Core rev: 5fd592fbae2e046bcb8c3a6c3ef4993fe0400676) Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/isoimage-isohybrid.py: change cpio generated uid&gid to rootIoan-Adrian Ratiu2016-04-031-2/+2
| | | | | | | | | | | | By default cpio preserves the uid&guid's of the original user which leads to host contamination and boot failures because commands like mount from initramfs expect to be run by root and the original host user might not even exist on the target. (From OE-Core rev: 28910ee2eacc15cf42b5e58bd43b3bd15c34eb97) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/isoimage-isohybrid.py: use glob to find initramfs locationIoan-Adrian Ratiu2016-04-031-2/+2
| | | | | | | | | | | Some filenames can omit 'initramfs', or use other names. This makes detection more flexible by using only the image name, machine arch and image type in a glob wildcard. (From OE-Core rev: ca516f5907a661606c35e1ca5c2ece9fc79c77ea) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix type of no-table optionEd Bartosh2016-03-281-1/+1
| | | | | | | | | | | | | | 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>
* wic: don't throw away our created swap partitionChristopher Larson2016-02-281-0/+1
| | | | | | | | | | | | | We were creating the partition, mkswap'ing it, and then not dd'ing it into place in the final image, as source_file wasn't being set for swap partitions. This would result in a swap partition that couldn't be enabled on target until mkswap was run. (From OE-Core rev: 7580942a66f84c2120763c2d9665e2cec8e25138) 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: fix processing of --use-uuidEd Bartosh2016-02-151-0/+3
| | | | | | | | | | | | | | | Processing of this option was lost during recent change of wks parsting. It was discovered during the work on booting wic images under qemu. Now, when -use-uuid is fixed it's possible to specify root partition by partition uuid. This will be done in the following commit. (From OE-Core rev: b4882e0b84d7fd4c85ee95386e94722485eafc2b) (From OE-Core rev: 73e9e3f150bf2de9b27c2ccc73e3dee334ee73fe) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* isoimage-isohybrid.py: fix cpio working directoryIoan-Adrian Ratiu2016-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Take `pwd` to be <initial-dir>. The %s path is relative to it. The value of %s is "output_folder/build". The current code works as follows: Changing directory to %s and finding the sources (after cd'ing) to cpio with output redirection to %s/initrd.cpio triggers the following error "Error: exec_cmd: cd output_folder/build/INITRD && find . | cpio -o -H newc >output_folder/build/initrd.cpio returned '1' instead of 0" This happens because after the cd, `pwd` is <initial-dir>/%s and by the redirect we write the result to to <initial-dir>/%s/%s/initrd.cpio which obviously does not exist. Fix this by getting the sources with "find %s" instead of "cd && find ." (From OE-Core rev: 07fa4783566d22d46ce719a621eee5404932dbbe) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: isoimage-isohybrid: check for syslinux-nativeMihaly Varga2016-02-041-2/+5
| | | | | | | | | | | | | | .iso image creation fails if during the image creation syslinux is baked and syslinux-native is not. Added new check to verify if both syslinux and syslinux-native are baked and bake them if these are not installed. (From OE-Core rev: fd5749832960ad3b85697c2878490d6f008982a3) Signed-off-by: Mihaly Varga <mihaly.varga@ni.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: default to empty bootloader configMaciej Borzecki2016-02-041-0/+4
| | | | | | | | | | | | | | | | 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>
* wic: pylinted ksparser moduleEd Bartosh2016-01-201-4/+11
| | | | | | | | | | 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>
* wic: add help for 'include' commandEd Bartosh2016-01-201-0/+14
| | | | | | | | | | Added description of 'include' parser command to the 'wic help kickstart' output. (From OE-Core rev: 7481f39382e63ecbb5de406559cc28e5689bd974) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: move parts of canned .wks into common.wks.incEd Bartosh2016-01-204-9/+6
| | | | | | | | | | | In order to give and example of 'include' feature of ks parser and for testing purposes common parts of 3 canned wks files were moved into common.wks.inc (From OE-Core rev: 629c6381669bd4acdb1613229cd095881d2d9cd2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: implement search of includesEd Bartosh2016-01-201-2/+14
| | | | | | | | | | | | | 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>
* wic: refactor get_boot_configEd Bartosh2016-01-201-9/+7
| | | | | | | | | | | | | | | This function is going to be used by ks parser to find include .wks files. get_boot_config name is a bit confusing as function is quite generic. It looks if file is present in the canned wks directories. Renamed get_boot_config -> get_canned. Renamed parameter file_boot -> file_name. Updated description. (From OE-Core rev: 8ea9a4c0422c9600cd33ec6e815ebcf2d0aad364) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: ksparser: add support for includeEd Bartosh2016-01-201-1/+6
| | | | | | | | | | 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>
* wic: do not remove build dir in source pluginsEd Bartosh2016-01-204-7/+3
| | | | | | | | | | | | | | | | | | 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: use unique partition numberEd Bartosh2016-01-201-1/+3
| | | | | | | | | | | | | | 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>
* wic: move wks parsing code to KickStart._parseEd Bartosh2016-01-201-0/+3
| | | | | | | | | | | 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>
* wic: rename kickstarter.py -> ksparser.pyEd Bartosh2016-01-192-1/+1
| | | | | | | | | | | | | 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>
* wic: override ArgumentParser.errorEd Bartosh2016-01-191-1/+9
| | | | | | | | | | | Overriden error method to throw exception instead of printing usage error message. Exception is caught by KickStart code to add .ks file name and line number. (From OE-Core rev: 373016ba08c2ec4dbcd44649d9c8cd57d5574402) 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-194-4/+3
| | | | | | | | | | 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: improve processing of parseing errorsEd Bartosh2016-01-191-3/+8
| | | | | | | | | | Caught argparse.ArgumentError Included .ks file name and line number into the error messages. (From OE-Core rev: 549c76ebda9afba0771d6d2c9b0b83f7a479c626) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: catch KickStartErrorEd Bartosh2016-01-191-2/+5
| | | | | | | | | Catch parsing errors and output them using msger. (From OE-Core rev: 9c058f115583592f5cce2a969882fdd0c2ab535f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add custom exception KickStartErrorEd Bartosh2016-01-191-0/+3
| | | | | | | | | | | This exception will be raised by kickstart parser on parsing errors and processed in the code which calls parser to produce meaningful error output. (From OE-Core rev: 13092793693c1c0ea172701578506f4a70a093d2) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/help.py: document requirements for valid fstab generationJoshua Lock2016-01-181-0/+7
| | | | | | | | | | | | | Without one of the --ondrive, --ondisk or --use-uuid options for a partition with a mountpoint specified the automatically generated fstab entry will be invalid. [YOCTO #8844] (From OE-Core rev: a524ced19db05e776834cd1f1db03c68a05f9c0b) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: get rid of 2 gettersEd Bartosh2016-01-183-8/+9
| | | | | | | | | | 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-183-7/+7
| | | | | | | | | | 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_rootfs and set_rootfsEd Bartosh2016-01-184-18/+18
| | | | | | | | | | | Got rid of get_rootfs and set_rootfs java-like getter and setter. Renamed rootfs to rootfs_dir to be consistent with the name of kickstart parameter --rootfs-dir. (From OE-Core rev: 51ec52a62ce49d1a1a83489379990f78cfe849f9) 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-184-32/+16
| | | | | | | | | | | | | | | | 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-184-12/+12
| | | | | | | | | | | | 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: remove pykickstart codeEd Bartosh2016-01-1819-3264/+0
| | | | | | | | | | Removed pykickstart-related code as it's replaced by new kickstart parser. (From OE-Core rev: 30bb1f3b6b832f9be691350581458c5fdaaaad70) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: use new kickstart parserEd Bartosh2016-01-182-3/+3
| | | | | | | | | | | | | Used KickStart parser class instead of pykickstart API. This commit breaks wic as data structures and field names provided by new API are a bit different from old ones. This issue will be addressed in the following commits. (From OE-Core rev: f72439d321220b724bfe2b4a92fed46c2c19fb3f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add kickstart parser moduleEd Bartosh2016-01-181-0/+120
| | | | | | | | | | | | This module will replace existing pykickstart machinery it contains only option used by wic, it's simple and clear. And It will allow to remove a lot of old complex code from 3rdparty/pykickstart/ and kickstart/custom_commands. (From OE-Core rev: c7b67ccfda8b22c090aa74d96b7c9af5a97a9a98) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: add partition moduleEd Bartosh2016-01-181-0/+410
| | | | | | | | | | | Copied partition-related API from kickstart/custom_commands/partition.py to separate module in preparation for removal of all pykickstart related code. (From OE-Core rev: a915c4cbc33ef0a12546ac0000ecf8aedb6241d5) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: rawcopy: Copy source file to build folderNoor Ahsan2016-01-071-3/+4
| | | | | | | | | | | | | | | | When a file is given using --sourceparams then wic directly use that file instead of copying them to build folder. At time of assembling it os.rename is called which renames all the files to name. In that process the original file is renamed. When image recipe is rebuilt then wic complains about missing file which was renamed in previous build. [YOCTO #8854] (From OE-Core rev: 33c52b1f2d39feb641465bf42e8b16d0ab22a316) 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/help.py: document that mountpoint is optional for part commandJoshua Lock2015-12-221-1/+4
| | | | | | | | | | | | | | If no mountpoint is specified for a partition command the partition will be created but not mounted — mention this in the kickstart help text. [YOCTO #8820] (From OE-Core rev: d1ff1fef987457eb1a5ffe42dbabc7808fa7d598) Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* directdisk-bootloader-config.wks: Add example for custom bootloader configMariano Lopez2015-12-092-0/+21
| | | | | | | | | | | | | | | | | | Add new wks file as a example for a custom bootloader configuration. This change also includes the configuration that file that will be used. This example is using syslinux with MBR, the configuration file is almost the same as the one generated by wic. As stated before this is just an example. [YOCTO #8728] (From OE-Core rev: 4a9db893f721c0da5d103d28b97a0302cc9e2197) 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/help.py: Document the new option "configfile"Mariano Lopez2015-12-091-0/+6
| | | | | | | | | | | | | This just adds the "configfile" option for the bootloader to wic help. [YOCTO #8728] (From OE-Core rev: 597045657a1a635f667404306160f9ab2551e954) 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: Allow to use a custom config for bootloadersMariano Lopez2015-12-092-46/+93
| | | | | | | | | | | | | | | | 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/utils/misc.py: Added function to search for files in canned-wksMariano Lopez2015-12-091-0/+39
| | | | | | | | | | | | | | | | | | This change add two new function to search for files in the canned-wks folder for all the layers included in bblayers.conf. This will be used to search for custom configuration files for the bootloaders. There are similar functions in the wic engine, but these are focused in wks files only, so it was needed to create new ones. [YOCTO #8728] (From OE-Core rev: 356a942e75ac1743290d2c360d1bb89e2225b6cc) 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: Prepare wicboot to allow custom bootloader configMariano Lopez2015-12-092-0/+12
| | | | | | | | | | | | | | | | | Currently wic does the bootloader configuration file on the fly. This change introduce a configfile variable for the bootloader; this is to have a user defined configuration file for the bootloaders (grub, syslinux, and gummiboot). This is particular useful when having a multiboot system or scripts embedded in the configuration file. [YOCTO #8728] (From OE-Core rev: 8347aee95ea271921c15ea8e580f0ff62325aa26) 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: exec_native_cmd: implement support for pseudoEd Bartosh2015-12-012-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | Wic runs some tools through pseudo, which makes exec_native_cmd to fail and throw cryptic error message when tool is not baked: For example: Error: exec_cmd: 'export PSEUDO_PREFIX=/media/ssd/poky-build/tmp/sysroots/x86_64-linux/usr;export PSEUDO_LOCALSTATEDIR=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/ ... PSEUDO_PASSWD=/media/ssd/poky-build/tmp/work/qemux86-poky-linux/ ... PSEUDO_NOSYMLINKEXP=1;/media/ssd/poky-build/tmp/sysroots/ ... mkfs.ext4 -F -i 8192 /var/tmp/wic/build/rootfs_platform.7.ext4 -L platform -d /media/ssd/poky-build/tmp/work/qemux86-poky-linux/core-image-minimal/... returned '1' instead of 0 Made exec_native_cmd aware of pseudo and properly report errors when command is not found. (From OE-Core rev: 04bab58809c63c9114feb0aadc9b6115be10fcc4) 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/utils/oe/misc.py: Preserve PATH when running native toolsRandy Witt2015-10-271-4/+16
| | | | | | | | | | | | | | | Previously exec_native_cmd() would remove all items from PATH except for the native sysroot. This can cause issues for the tools that are created using create_wrapper(). Now instead of wiping out the PATH, run a sanity check to check if the command is in the native sysroot. (From OE-Core rev: ba127370e621b5b683d6f454596c3d0c60c13df7) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: fix partition size calculationEd Bartosh2015-09-231-2/+1
| | | | | | | | | | | It was wrongly assumed that part.size is meagured in Mb. In fact it's in Kb, so there is no need to convert bitbake variable ROOTFS_SIZE as it's also in Kb. (From OE-Core rev: 3703ecb4aa5267e6d7330e7978cc7c3bb2250ead) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>