Message ID | f9c1a485267169515aa735dd7dc6e8c673b65961.1675461748.git.sander@svanheule.net |
---|---|
State | Accepted |
Delegated to: | Sander Vanheule |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gv25heZe; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=svanheule.net header.i=@svanheule.net header.a=rsa-sha256 header.s=mail1707 header.b=NreIpaDC; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4P7qWz5SBwz23hn for <incoming@patchwork.ozlabs.org>; Sat, 4 Feb 2023 09:07:27 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jAXgOby8zgqq0CphHdjdmh3yuerqIs3nFzJQyr2rrWk=; b=gv25heZeVlODOe o6LUm+dcsvkSB+N9lAHm+OGXZAVO3xAfS05TWJeMZs9IRFaJ4xWZNXCFT9So0so9dIXzzL6LKrKKr wyzSf0UVnSPvV2QUojASLpclx/wBnx35ut4nDKD1b6/znl2mjP1qVrRtvGgaDWzje5FcRAnKOCblM vFKnSVKDrmj1pR43I7lr2bXHA+Yfmh4sRasdBRxFrNI7xi5cBCm19nriXnY1Xs/+bP/d4prvH/ipu Lv5CJ0dHlxa9A6MSSU9C1HvbkjDvQRyehAqVRp1aUQJSqmZiVTGbRPBe7y/4SqbzlqgJiNez2GqJA Kx/WIq3fjrKQ4a9qeFKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pO4BR-003jV4-UL; Fri, 03 Feb 2023 22:05:26 +0000 Received: from polaris.svanheule.net ([84.16.241.116]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pO4AB-003jBP-V4 for openwrt-devel@lists.openwrt.org; Fri, 03 Feb 2023 22:04:09 +0000 Received: from terra.lan (cust-41-49-110-94.dyn.as47377.net [94.110.49.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sander@svanheule.net) by polaris.svanheule.net (Postfix) with ESMTPSA id 4CC343775DC; Fri, 3 Feb 2023 23:03:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svanheule.net; s=mail1707; t=1675461838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YrVGAu5hCndXLTJPm+tN5l2S+K2rRPBdvprjcdeZJyc=; b=NreIpaDCbIaoLL9Faa114Y8WRaEhGi4G8y8OLEgEMAuVMq5F+dQ6kWVZQD69Z1Q5XNDVsH iU74Ttm2P/lZ/0WPxZ9+iRNry4CdEl7MjzHYclzVeCZU9FnbSPtLVWW+MeyG4cJ25pTdpT LS4FioehUeRr7MFTYRLdSPxgE6vbqk5AmyVbXWD62MepwzHWccwl9RFggopcIiTnUaIwDz Yrfh/T4w6PI4eV0rkaEPPDs9JnzHlcDv+pJCZB/fbCUfoF1jHeWjIZJV/6x8VUKzywqtqk 1C3b9VKb9mBF0b7gNesiBo5r+ADpwAISXdKZE0XWp0FyEj65EzIrgnYnTGczjA== From: Sander Vanheule <sander@svanheule.net> To: openwrt-devel@lists.openwrt.org Cc: Sander Vanheule <sander@svanheule.net>, =?utf-8?q?Andreas_B=C3=B6hler?= <dev@aboehler.at> Subject: [PATCH firmware-utils v1 05/10] tplink-safeloader: don't end-pad sysupgrade file Date: Fri, 3 Feb 2023 23:03:19 +0100 Message-Id: <f9c1a485267169515aa735dd7dc6e8c673b65961.1675461748.git.sander@svanheule.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <cover.1675461748.git.sander@svanheule.net> References: <cover.1675461748.git.sander@svanheule.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230203_140408_176286_20F6C1FB X-CRM114-Status: GOOD ( 10.23 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
Refactor image ingestion to support new formats
|
expand
|
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);
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@svanheule.net> --- src/tplink-safeloader.c | 1 - 1 file changed, 1 deletion(-)