From patchwork Wed Apr 3 16:20:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1919380 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=1KMt3keJ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=terefe.re header.i=@terefe.re header.a=rsa-sha256 header.s=default header.b=azdf0azQ; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V8qqL4P8Xz1yZJ for ; Thu, 4 Apr 2024 03:25:32 +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: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:In-Reply-To:References: List-Owner; bh=J1BsrmWuWWc2GJoGbqK+DE5VaQn5lzKDJ3EHLyWoAgI=; b=1KMt3keJ3hZ36f dlxRG8FUZme/vGp1FMEbfVgcLHWOkOAMgKWOhQj8JoKRwPolsPMLfXo4d7smUuGZ9C3m4S9DFvooV lIjCkGY0Lz6YUv0DL21x1iyGec1rLFTb466EAQ20yR/McDwjuqcrZpc7Psco4Q9Em2R6EbxC9V76U 0ESEbDUjeaCdrS039LIR7H95Ob6CezXBSBAegXyzPkCwVjHEP6QlhFh3T+OoEX0M+pS12Up37kZWn /1Utrro7hNlFBkn4GK4cCip9HAKhN4isJW30Jx+BTSG59nwQHLCMTenxLk+d4r67MaBS+S1YYvHnk UP9SokkGQcjScpcOHvow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs3P4-0000000GwyE-1z5M; Wed, 03 Apr 2024 16:23:58 +0000 Received: from terefe.re ([2a04:52c0:101:a4a:0:ffff:5ff:60c8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rs3P0-0000000Gwue-2zd9 for openwrt-devel@lists.openwrt.org; Wed, 03 Apr 2024 16:23:56 +0000 Received: from localhost.localdomain (unknown [212.106.161.100]) by terefe.re (Postfix) with ESMTPSA id 69D861FFB7; Wed, 3 Apr 2024 18:23:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=terefe.re; s=default; t=1712161426; bh=5dE8W9G/Ry5Gp/Tv20HJJabPjyDbzbiwCK9ljjOwuTY=; h=From:To:Cc:Subject:Date:From; b=azdf0azQEZsOr9Hg9maWQis7CZid5ldG6OhpcjtufPIcRATEOsplJfEFevCm+qAXR QVVlU/cvVw/p3Vur/so5jgJmQPTCe+ILNKfVyBEf5b0rF2/+srMA7BNCFyKRqY3AKb ko4M1NE9Pm+a/Qj3/lIwcuCr/kJcAi60YdxqUcXJWDoymIZjRyUrVVQyBWG505ML6x xSYHqZQmKcS3PfP5XtNqemIer/SzTdWelzpozsqpowGpdGJb2oc4WCaRPfSccgt8ue EFawa0gS2jNpkjv73jvLa7to6gzD0ULtJR/QZxC8tLaIFDpyuUgeJc/TwQU9gWJAMF KmSyPcaecDjyw== From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Cc: Tomasz Maciej Nowak Subject: [PATCH v2] scripts: gen_image_generic: allow FAT fs on kernel partition for non-GPT targets Date: Wed, 3 Apr 2024 18:20:56 +0200 Message-ID: <20240403162340.29711-1-tmn505@terefe.re> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240403_092355_290555_34E58304 X-CRM114-Status: UNSURE ( 8.45 ) X-CRM114-Notice: Please train this message. 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: From: Tomasz Maciej Nowak Some old or proprietary bootloader recognise only FAT file system variants on storage devices with MBR but unfortunately script ties format of kernel partition to GPT partition table. So, allow kernel [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Tomasz Maciej Nowak Some old or proprietary bootloader recognise only FAT file system variants on storage devices with MBR but unfortunately script ties format of kernel partition to GPT partition table. So, allow kernel partition file system to be FAT16 or FAT32 if appropriate type is set in partition table. Signed-off-by: Tomasz Maciej Nowak --- v1 -> v2 - use well defined conditional syntax scripts/gen_image_generic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_image_generic.sh b/scripts/gen_image_generic.sh index 11e40f38868f..190cb6ae4a48 100755 --- a/scripts/gen_image_generic.sh +++ b/scripts/gen_image_generic.sh @@ -49,7 +49,7 @@ dos_dircopy() { [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE" dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc -if [ -n "$GUID" ]; then +if [ -n "$GUID" ] || [ "$KERNELPARTTYPE" = "6" ] || [ "$KERNELPARTTYPE" = "c" ]; then [ -n "$PADDING" ] && dd if=/dev/zero of="$OUTPUT" bs=512 seek="$((ROOTFSOFFSET + ROOTFSSIZE))" conv=notrunc count="$sect" mkfs.fat --invariant -n kernel -C "$OUTPUT.kernel" -S 512 "$((KERNELSIZE / 1024))" LC_ALL=C dos_dircopy "$KERNELDIR" /