[PATCH firmware-utils v1 05/10] tplink-safeloader: don't end-pad sysupgrade file

Sander Vanheule sander at svanheule.net
Fri Feb 3 14:03:19 PST 2023


To ensure the stock rootfs ends up at the correct offset, the preceding
kernel partition is padded with 0xff, corresponding to erased flash.
Since on sysupgrade all the required flash space is anyway rased before
writing the new image, it is not necessary to also pad after the second
and last part of the generated image. This can reduce the generated
image size by several MiB.

Signed-off-by: Sander Vanheule <sander at svanheule.net>
---
 src/tplink-safeloader.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/tplink-safeloader.c b/src/tplink-safeloader.c
index 5b19e8726821..05b7ca17f786 100644
--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -4071,7 +4071,6 @@ static void convert_firmware(const char *input, const char *output)
 	/* write file-system behind os_image */
 	fseek(output_file, flash_file_system->base - flash_os_image->base, SEEK_SET);
 	write_partition(input_file, firmware_offset, fwup_file_system, output_file);
-	write_ff(output_file, flash_file_system->size - fwup_file_system->size);
 
 	fclose(output_file);
 	fclose(input_file);
-- 
2.39.0




More information about the openwrt-devel mailing list