aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins/source/bootimg-pcbios.py
AgeCommit message (Collapse)Author
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. Signed-off-by: Tom Rini <trini@konsulko.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-23wic: flatten directory structureEd Bartosh
Moved misc.py from wic/utils/ to wic/ Removed wic/utils directory Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-14bootimg-pcbios: make boot image file uniqueEd Bartosh
Plugin code uses boot.img file name for an image file. If there are two partitions that use bootimg-pcbios wic breaks with an error "file already exists: boot.img" Made image file name unique by adding wks like number to it to fix the issue. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-31wic: remove runner.show APIEd Bartosh
Replaced runner.show call to exec_cmd call in bootimg-pcbios plugin. Removed runner.show API as it's not used anywhere else. [YOCTO #10618] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-31wic: use wic-tools STAGING_DATADIR as bootimg_dirEd Bartosh
If bootloader artifacts are not found in default bootimg_dir use wic-tools sysroot for the same purpose. This should prevent wic from failing if bootloader artifacts can't be found in image native sysroot. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-22wic: improve getting syslinux pathEd Bartosh
Used wic-tools STAGING_DATADIR if syslinux can't be found in default bootimg_dir. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-22wic: don't set creator.bootimg_dir in pluginsEd Bartosh
Changing bootimg_dir in plugins is a dangerous hack as this value comes from wic command line and can be used by multiple plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04wic: bootimg-pcbios: add support for syslinux vesamenuEd Bartosh
Installed vesamenu.c32 and its dependencies to support vesamenu ui in syslinux config. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError instead of calling logger.errorEd Bartosh
Replaced forgotten calls of logger.error with raising WicError exception. Otherwise errors will be ignored. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: move WicError to lib/wic/__init__.pyEd Bartosh
Removed unused exceptions from error.py Moved definition of WicError to lib/wic/__init__.py Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError instead of ImageError and CreatorErrorEd Bartosh
There is no need to raise special exceptions. Raising WicError should be enough. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: raise WicError in wic pluginsEd Bartosh
Replaced sys.exit with raising WicError in wic plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: move errors moduleEd Bartosh
Moved from lib/wic/utils/ to lib/wic as this is a core module. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-03-04wic: use wic logger in wic source pluginsEd Bartosh
Replaced msger with wic logger in wic source plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: direct: remove set_bootimg_dir setterEd Bartosh
Removed java-like setter set_bootimg_dir. It's more pythonic to access public attributes directly. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-15wic: move disk operations to PartitionImage classEd Bartosh
Disk operations were spread over DirectPlugin, DiskImage and Image code making the code hard to understand. Renamed Image class to PartitionedImage. Removed DiskImage class. Moved disk operations to PartitionedImage. There was an implicit support for multiple disks: if different devices were specified in .wks file (e.g. --ondisk sda and --ondisk sdb), wic would theoretically generate multiple images. This is quite confusing option and the code supporting it was broken for a long time. The same effect (multiple output images) can be achieved in obvious and clear way - by using multiple .wks files. This functionality was removed. PartitionedImage works only with one image. This makes the code less complex and easier to maintain. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: code cleanupEd Bartosh
Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-02-02wic: move oe/misc.py one level upEd Bartosh
Flattened directory structure: moved wic/utils/oe/misc.py -> wic/utils/misc.py [YOCTO #10619] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
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] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2017-01-23wic: bootimg-pcbios: use wic-tools targetEd Bartosh
Used wic-tools target to get location of syslinux. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-03image-live, image-vm, wic: Remove fs size workaroundJussi Kukkonen
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. Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: do not remove build dir in source pluginsEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-19wic: removed unused importsEd Bartosh
Removed imports of wic.kickstart from plugins as they're not used in the code. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-17wic: get rid of 2 gettersEd Bartosh
Used partitions and configfile bootloader attributes instead of using getters get_bootloader_file and get_partitions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-17wic: get rid of set_size and set_source_file settersEd Bartosh
Used size and source_file attributes instead of using setters. It's more pythonic, clear an consistent. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-17wic: get rid of get_timeout getterEd Bartosh
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-09wic: Allow to use a custom config for bootloadersMariano Lopez
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-02wic: fix short variable namesEd Bartosh
Made short variable names longer and more readable. Fixed pylint warnings "Invalid variable name" and "Invalid argument name". Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: fix pylint warning redefined-builtinEd Bartosh
Renamed variables named as Python builtin functions. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-02wic: Code cleanup: long lines, identation and whitespacesEd Bartosh
Fixed pylint warnings bad-continuation, bad-continuation and line-too-long. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-06-23wic: Add missing docstrings to plugin classesEd Bartosh
Docstings from plugin classes are used as part of output of 'wic help plugins'. Adding them makes help page more informative. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-23wic: Code cleanup: bad-classmethod-argumentEd Bartosh
Fixed wrong name for the first argument in class methods. Pylint complains about the issue this way: Class method should have 'cls' as first argument Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11wic: Move validation of --ptable option to wks parserEd Bartosh
bootloader --ptable option has two valid choices: gpt and msdos Moved this check to wks parser by changing option type to 'choice'. Removed similar checks from 5 other places. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11wic: Refactored getting root device nameEd Bartosh
Replaced DirectImageCreator._get_boot_config private method with a 'rootdev' property. Simplified the code and API. Used 'uuid' property instead of incorrectly used 'part_type'. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11wic: Make _ptable_format publicEd Bartosh
Names with one leasding underscore considered protected in Python. _ptable_format is accessed outside of its class. Made it public by removing underscore. This pylint warning should be fixed now: Access to a protected member _ptable_format of a client class Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11wic: Use gptmbr.bin MBR for gpt partitionsEd Bartosh
Used proper syslinux MBR gptmbr.bin for GPT partitons. Added check for unsupported partition formats. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-06-11wic: Add gpt to the list of supported partition table formatsEd Bartosh
Only msdos partition table format was supported by wic source plugins. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-04-24wic: code cleanup: wildcard importsEd Bartosh
Here is what PEP8(Style Guide for Python Code) says about this: Wildcard imports (from <module> import *) should be avoided, as they make it unclear which names are present in the namespace, confusing both readers and many automated tools. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-24wic: code cleanup: undefined variablesEd Bartosh
Fixed forgoten imports Wic_PartData and ImageError. Removed unused and undefined variable syslinux_conf. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-08wic: code cleanup: unused importsEd Bartosh
Fixed pylint warning 'Unused import' Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-07wic: use kB for the partitions sizeAlexandre Belloni
Use kB instead of MB for the partition size to get a better granularity. This is needed on some SoC (i.mx, omap) where it is necessary to create partitions as small as 64kB. Keep the backward compatibility by assuming MB when no unit is provided. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Acked-by: Tom Zanussi <tom.zanussi@linux.intel.com> Tested-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-10-30wic: Remove special-case bootimg_dirTom Zanussi
The first iterations of wic very shortsightedly catered to two specific use-cases and added special-purpose params for those cases so that they could be directly given their corresponding boot artifacts. (hdddir and staging_data_dir). As more use-cases are added, it becomes rather obvious that such a scheme doens't scale, and additionally causes confusion for plugin writers. This removes those special cases and states explicitly in the help text that plugins are responsible for locating their own boot artifacts. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-18wic/bootimg-pcbios.py: checking the existance of syslinuxHongxu Jia
While syslinux not existed in $bootimg_dir, there was a error: $ wic create directdisk -e core-image-minimal ... |Creating image(s)... |Error: exec_cmd: install -m 444 /home/jiahongxu/yocto/ build-20141010-yocto/tmp/deploy/images/qemux86-64/syslinux/ ldlinux.sys /var/tmp/wic/build/hdd/boot/ldlinux.sys returned '1' instead of 0 ... Add checking for the existance of syslinux to fix this issue. If syslinux didn't exist in anywhere, prompt user to build it. [YOCTO #6826] Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-08-15wic: Add sourceparam param to partition plugin methodsTom Zanussi
The sourceparam param allows source plugins to be parameterized generically (via --sourceparams="key=val[,key=val], implemented previously). Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-11wic: Rename /mic to /wicTom Zanussi
As well as any other stray instances of mic in the codebase that can be removed. We don't really need to carry around legacy naming, and the history is in git. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>