aboutsummaryrefslogtreecommitdiffstats
path: root/tools/firmware-utils/src/fw.h
Commit message (Collapse)AuthorAgeFilesLines
* firmware-utils: mkfwimage: fix memcpy and strncpy usagePetr Štetiar2020-07-111-7/+8
| | | | | | | | | | | | | | Firmware is binary blob, so there are barely any NULL terminated strings expected, so we should probably convert all chars into u8 types, and after that it's clear, that using strcpy doesn't make sense anymore. This is rather theoretical stuff, but `uint8_t name[PART_NAME_LENGTH]` means, that you can supply PART_NAME_LENGTH sized name, not PART_NAME_LENGTH-1 name when NULL terminated. Ref: https://github.com/openwrt/openwrt/pull/2274 Fixes: 04cb651376f9 ("firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9Petr Štetiar2019-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | src/mkfwimage.c:276:8: error: format '%lld' expects argument of type 'long long int', but argument 4 has type '__off_t' {aka 'const long int'} [-Werror=format=] src/fw.h:71:36: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__off_t' {aka 'long int'} [-Werror=format=] inlined from 'main' at src/mkfwimage.c:543:12: /string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation] inlined from 'write_part' at src/mkfwimage.c:235:2, string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] inlined from 'main' at src/mkfwimage.c:477:5: string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 256 equals destination size [-Werror=stringop-truncation] inlined from 'main' at src/mkfwimage.c:496:5: string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation] inlined from 'main' at src/mkfwimage.c:481:5: string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation] inlined from 'main' at src/mkfwimage.c:485:5: string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] Runtested on ath79 and UBNT Bullet M XW. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* mkfwimage: Add image type definition for WA imagesTobias Schramm2018-10-071-0/+8
| | | | | | | | | | | | | This patch adds a new type of ubiquiti image, the WA image. First seen on the NanoStation AC loco the generic name implies that we will see this type of image on more ubiquiti devices thus it makes sense to implement it in mkfwimage. The main difference is that WA images are signed. The "END" header has been replaced by a "ENDS" header followed by a 2048 bit RSA signature. This signature is not being generated by mkfwimage and filled with 0x00. Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
* buld images for the Ubiquiti LiteStation and NanoStation ported from ↵Travis Kemen2008-05-071-0/+70
http://atheros.openwrt.net. Tested on a Nanostation 2 with airos 3 SVN-Revision: 11061