aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/ptgen.c
Commit message (Collapse)AuthorAgeFilesLines
* firmware-utils/ptgen: remove unused variable assignmentDaniel Golle2021-03-141-1/+0
| | | | | | | | | | | | | | | | Discovered by coverty: CID 1473630: Code maintainability issues (UNUSED_VALUE) Assigning value from "type_to_guid_and_name(type, &name)" to "part_guid" here, but that stored value is overwritten before it can be used. Remove the now redundant assignment of part_guid which is also set conditionally later on. Fixes: 4a078bd135 ("firmware-utils/ptgen: fix partition guid and name") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* firmware-utils/ptgen: change GPT to LBA addressingOskari Lemmela2021-03-031-13/+20
| | | | | | | | | Do not align partitions with sectors. Only kb align for GPT is supported. Use 254 heads and 63 sectors for PMBR. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* firmware-utils/ptgen: add support for hybrid MBROskari Lemmela2021-03-031-11/+28
| | | | | | | | | | | Adding -H option copies partition to MBR after pmbr entry. Max 3 partitions can be copied to MBR. Hybrid MBR is needed only in special cases. For example mt7622 SD card boot needs MBR entry with boot flag enabled. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* firmware-utils/ptgen: fix partition guid and nameOskari Lemmela2021-03-031-2/+3
| | | | | | | guid and name function should be called before storing partition info. Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* firmware-utils/ptgen: fix compile warningsOskari Lemmela2021-03-031-2/+2
| | | | | | remove extra arguments from printf message Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
* firmware-utils/ptgen: set GPT partition attributes and nameDaniel Golle2021-02-281-10/+71
| | | | | | | | | | | Allow setting GPT partition names as used by TF-A bl2 to identify the FIP volume to load from eMMC and SD-card. While at it, also allow setting 'required' attribute as it should be used for volumes which are essential for the system to boot. Also properly handle setting the LEGACY_BOOT flag on the partition selected as 'active', as this is how it is specified in the spec. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* firmware-utils/ptgen: allow explicit placement of partitionsDavid Woodhouse2020-07-081-3/+27
| | | | | | For Banana Pi R2 we need to place the U-Boot partition at precisely 0x50000. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
* firmware-utils: ptgen: add GPT support李国2020-03-311-23/+318
| | | | | | | | | | | | | | | | Add GPT support to ptgen, so we can generate EFI bootable images. Introduced two options: -g generate GPT partition table -G GUID use GUID for disk and increase last bit for all partitions We drop The alternate partition table to reduce size, This may cause problems when generate vmdk images or vdi images. We have to pad enough sectors when generate these images. Signed-off-by: 李国 <uxgood.org@gmail.com> [fixed compilation on macOS] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* firmware-tools/ptgen: Allow generation 0 size partitionsLinus Walleij2019-02-201-2/+9
| | | | | | | | | | | | The firmware on the D-Link DNS-313 NAS require two blank partitions before the boot partition. Support this if explicitly requested with a "-n" flag. Tested on the D-Link DNS-313. Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [Broken out from original patch] Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* firmware-tools/ptgen: use portable exit codesMichael Heimpold2018-01-021-3/+3
| | | | Signed-off-by: Michael Heimpold <mhei@heimpold.de>
* firmware-tools/ptgen: fix minor coding style issuesMichael Heimpold2018-01-021-26/+34
| | | | Signed-off-by: Michael Heimpold <mhei@heimpold.de>
* ptgen: work around gcc miscompilationJonas Gorski2016-09-261-1/+3
| | | | | | | Some gcc versions seem to miscompile code using ternary operators, work around this by just returning the result if exp is 0. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* treewide: replace nbd@openwrt.org with nbd@nbd.nameFelix Fietkau2016-06-071-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* firmware-tools/ptgen: use stdint types for struct pteFelix Fietkau2015-06-141-7/+8
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 45957
* firmware-tools/ptgen: fix endianness conversion for PTE .start, .length field.Felix Fietkau2015-06-141-4/+4
| | | | | | | | They are of 32-bit little endian integers. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> SVN-Revision: 45956
* firmware-utils: allow passing a specific MBR signature to ptgenJo-Philipp Wich2014-10-161-4/+15
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 42934
* tools/firmware-utils/ptgen option to use MB roundingJohn Crispin2012-08-221-4/+18
| | | | SVN-Revision: 33218
* firmware-utils: when using open with O_CREAT and O_WRONLY, also use O_TRUNC ↵Felix Fietkau2008-09-231-1/+1
| | | | | | to ensure that overwritten files have the right size (fixes #3505) SVN-Revision: 12667
* fix x86 boot filesystem allocation (#1736)Felix Fietkau2007-05-231-1/+1
| | | | SVN-Revision: 7312
* make ptgen print the end offset of the last partition as wellFelix Fietkau2007-02-251-0/+1
| | | | SVN-Revision: 6358
* fix cylinder rounding in ptgenFelix Fietkau2007-02-241-1/+1
| | | | SVN-Revision: 6352
* remove custom partition table hack, add ptgen utility for generating ↵Felix Fietkau2006-12-071-0/+219
partition tables SVN-Revision: 5704