summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils
AgeCommit message (Collapse)Author
2015-05-03wic: Add plugin for single partition diskAdrian Freihofer
The wic plugin creates a disk image containig one ext2/3/4 partition. No additional boot partition is required. Syslinux is installed into the image. The target device is a legacy BIOS PC. Purpose of this plugin: Other avaliable plugins create a fat partition for /boot and an ext partition for rootfs. Current linux-yocto kernel packages are not compatible with this disk layout. The boot partition is not mounted by default, hence the kernel is installed into rootfs and not into boot partition. A kernel update ends up in a bricked device. The old kernel which is still in boot likely does not even boot with updated kernel modules from /. Even if the boot partition is mounted during the kernel update the update will fail. The kernel package installs a symbolic link which is not supported by the fat partition. Creating just one ext partition for boot and rootfs solves all issues related to package based kernel updates on the device. The plugin depends on syslinux-nomtools a user space installer for syslinux on ext filesystems. Thanks to Robert Yang who implemented syslinux-nomtools and supported the implementation of this plugin. Signed-off-by: Adrian Freihofer <adrian.freihofer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-14wic: Print bitbake error outputEd Bartosh
Added bitbake error output to wic error message to make it more descriptive. [YOCTO #6911] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-14wic: use native partedEd Bartosh
Used exec_native_cmd instead of find_binary_path to run parted. Got rid of find_binary_path as it's not used anywhere else. There are several tools wic is trying to find not only in sysroot, but also in host root. Parted is a special as on some distros it's installed in /usr/sbin, which is not in the user's PATH. This makes wic to fail with error "External command 'parted' not found, exiting." [YOCTO #7122] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-13wic:code cleanup: No space allowedEd Bartosh
Fixed pylint warning 'No space allowed around keyword argument assignment' Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09wic: make error message more informativeEd Bartosh
Included name of the missing program into the error message produced by exec_native_cmd when program is not found. Removed mentioning of the host programs as this API is not running them anymore. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-09wic: don't use host paths when looking for native toolsEd Bartosh
exec_native_cmd should not use host paths in $PATH to avoid finding and using host tools. [YOCTO: #6204] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-04-08wic: support ontrackdm6aux3 partitionsAlexandre Belloni
ontrack dm6 aux3 is a type of partition required to be able to boot a Freescale mxs based platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.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-14wic: add GPT supportAlexandre Belloni
Add GPT partition table support. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure overhead factor per partitionAlexandre Belloni
Introduce a new option --overhead-factor to replace IMAGE_OVERHEAD_FACTOR. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow to configure extra space per partitionAlexandre Belloni
Introduce a new option --extra-space instead of using IMAGE_EXTRA_SPACE. This is useful for boot partitions where the extra space is often useless or for huge partition where 10MiB may not be enough. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-02-14wic: allow creation of partitions not in tableAlexandre Belloni
For some architectures it is necessary to reserve space on disk without it being present in the partition table. For example, u-boot on i.mx is placed at an offset of 1kB on the sdcard. While it would be possible to create a partition at that offset and place u-boot there, it would then be necessary to update the default u-boot environment to use partition 2 on the mmc instead of partition 1. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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>
2015-02-07wic: fix extended/logical partition layoutMaciej Borzecki
The patch fixes an issue in laying out extended and logical partitions by wic. The original code produced disk images in which the size 3rd partition as described in MBR was incorrect. Depending on the type of file system used for that partition and size of the partition, it would be impossible to mount the partition correctly. For instance, kickstart file in which the 3rd partition had size of 1GB and used ext4 fs, would result in an image with an umountable partition. The root cause is reservation of sectors for EBR through stealing of last sector from the last primary partition. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-11-12scripts: use '/usr/bin/env' in shebangs with pythonMartin Hundebøll
To support yocto on systems with python3 as default version, scripts should use /usr/bin/env python in the shebang, as this allows the use of a fake env to mimic python2 as default version. This patch simply replaces occurrences of #!/usr/bin/python with #!/usr/bin/env python and was done with this oneliner: git grep -lE '^#!/usr/bin/python' | xargs \ sed -i 's|/usr/bin/python|/usr/bin/env python|' Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-10-30wic: Use overhead factor when creating partitions from rootfs directoriesTom Zanussi
When creating partitions sized to given rootfs directories, filesystem creation could fail in cases where the calculated target partition size was too small to contain the filesystem created using mkfs. This occurred in particular when creating partitions to contain very large filesystems such as those containing sdk image artifacts. This same limition is present in the oe-core image creation classes, which can be readily see by changing IMAGE_OVERHEAD_FACTOR from the default 1.3 to 1.0 and building a sato-sdk image. It should be possible to calculate required sizes exactly given the source rootfs and target filesystem types, but for now, to address the specific problem users are hitting in such situations, we'll just do exactly what oe-core does and define and use an IMAGE_OVERHEAD_FACTOR or 1.3 in those cases. Fixes [YOCTO #6863]. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23wic: do not realign aligned partitionsMaciej Borzecki
The change prevents additional realignment of already aligned partition. Previously, even already aligned partitions would be pushed forward by the amount of --align. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-23wic: do not steal sectors from the first partitionMaciej Borzecki
In order to make up for space loss due to overhead located before the first partition, same amount of bytes was extracted from the first partition's size. This leads to unexpected change of first partition's size, and is not matched by similar adjustment at the time the partition image is generated. Thus it is possible that the first partition may partially overwrite contents of the following partition, as the partition image is larger than the allocated space. This is also problematic on certain platforms such as OMAP, where the first partition is required for have an even number of sectors (typically already expressed by --size in kickstart file). Subtracting an odd number of sectors lost for overhead, leads to an odd number of sectors assigned for partition, preventing the board, such as beaglebone, from booting correctly. Signed-off-by: Maciej Borzecki <maciej.borzecki@open-rnd.pl> Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15wic: Add utility function for parsing sourceparamsTom Zanussi
Parses strings of the form key1=val1[,key2=val2,...] and returns a dict. Also accepts valueless keys i.e. without =. 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>