From patchwork Wed Nov 23 03:24:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: INAGAKI Hiroshi X-Patchwork-Id: 1708098 X-Patchwork-Delegate: daniel@makrotopia.org Return-Path: 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=) 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=h+lL56fj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=TWW29uWz; 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 4NH66c0xTTz23nw for ; Wed, 23 Nov 2022 14:28:55 +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=TfY6sGTPo6iC5WkFduLXAATEBRzNNSWbqeynDREDL+s=; b=h+lL56fj6hliqt +anAYMwC13ijqe8GkdTcw8aMtO0SM45KawxgOwrhAhz3GKO7rbBRlXXKTGKaAVX5JsomAZaVza33F e+2rZea1569nQn4ATAKfCUlCvSyJRG2AoCoRDycv9SRfRR4wo9dbkY62s/U6bphFkXNmb9Z5+kRmu E1jnFkeTMUV4tYW9zlZ3PwuVJV7cf2IJ4mKzebV9nrajH0Pa97LeFCgEcW5NhCDaaT0ZS71k0xGYq ORWs0aRzg/TjQKOlr8YZzqLtAHC7ZeUeJSDru2+jFoHT1G8TSO3ZLI8r+13fuPUfaqT/+hjhypQdK vHdo0Z0S0jGQReSCrf2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxgNF-00DSfL-9d; Wed, 23 Nov 2022 03:24:33 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oxgN8-00DSdf-Gd for openwrt-devel@lists.openwrt.org; Wed, 23 Nov 2022 03:24:27 +0000 Received: by mail-pl1-x635.google.com with SMTP id j12so15494977plj.5 for ; Tue, 22 Nov 2022 19:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=TcQ/fYVOPKIc1f1W8H6K/QxRa8Kz7473si3l+FaqDe0=; b=TWW29uWz0DMzgFsbe3XhtstwHWpO6EGdJWcbV/8jowHjoFYG/plgxgvF4BZ0SJEtL2 eobtq9HmBWdZO6wQaMx74plBWYlovMRAzJ+vOkGWGmXP5qulxslwIYeQp7fCpR9zVz5Z qHrdw7tij4rLVo1B/tuYl9wHFDC+CxyTwJEas04oQQKplZQTV0eMf03BKHUtW+/8ARQZ CmfzqstcWj4SVvZpvodCwL7S6nyb7spBnDmtsmEgC+PCw71mTj0xTO6hVym0zVeY7B2X MaE9ZgAfEfCMPEkmS6/Q5ZLxeoVHhg6xEc0TVoEa2kpBFEEP2fD6FZFXy9YXf6QVQTgc P01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TcQ/fYVOPKIc1f1W8H6K/QxRa8Kz7473si3l+FaqDe0=; b=i1Q1nX3YQw6zkazYzy8c9l47XuPBWowUFRTihoq5YLxzZ09yXSX7QvjFMlvmwF7Bc8 gMIMH+FqyTi5IIwEo8CW+2aDEAy4RY0tz2boLTBHqv8C17/TFjSJ/6K9+hVNSQubxTq2 INg2QAWFFs3OCM4Rbint82wDOo5MVi+dydTzUxOqGoKPk3hj15HnjXm2EcBkOiULBRYQ deeXDSQwLKGSGg6XsDzEU/BF++Lrsn+p7RKyCTG16O0RD7sDBSW5qC3UClrqMjCnOm1C uz7hi5Anw0IUsGI7FMdi8oXBXlm7rEPmtBzd1h+0z2gR6biqLghj2x+TP1BJllNkIrmU rYYg== X-Gm-Message-State: ANoB5pnB3O8cwVnR8JcjmrADPzIBasgmI/NHYDtH7AVCqBAOrSoJBulX 1XMWVcLXhWWu5N/OFUaOqgeWeqsQtKDO4g== X-Google-Smtp-Source: AA0mqf4ChnXRHbIU+eSm3/d+Gjqngy4jYYPgqvoHzOHy1OX43P+G7n79De2Hn0YfbYS1xfR2by06Gw== X-Received: by 2002:a17:902:f68a:b0:189:b07:10fd with SMTP id l10-20020a170902f68a00b001890b0710fdmr6723336plg.151.1669173865129; Tue, 22 Nov 2022 19:24:25 -0800 (PST) Received: from localhost.localdomain ([240b:12:500:6500:ac7c:9ec6:c1c0:84f9]) by smtp.gmail.com with ESMTPSA id o14-20020a170902d4ce00b00186a437f4d7sm12875091plg.147.2022.11.22.19.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 19:24:24 -0800 (PST) From: INAGAKI Hiroshi To: openwrt-devel@lists.openwrt.org Cc: INAGAKI Hiroshi Subject: [PATCH] ramips: use ARTIFACTS for initramfs-factory of I-O DATA WN-AX1167GR Date: Wed, 23 Nov 2022 12:24:09 +0900 Message-Id: <20221123032409.840-1-musashino.open@gmail.com> X-Mailer: git-send-email 2.36.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221122_192426_596349_23FA4C46 X-CRM114-Status: UNSURE ( 9.07 ) 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: Use ARTIFACTS to generate initramfs-based factory image of I-O DATA WN-AX1167GR instead of redundant recipe which generate on KERNEL_INITRAMFS. Note: WN-AX1167GR has 2x OS images on stock firmware. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:635 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [musashino.open[at]gmail.com] -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 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 Use ARTIFACTS to generate initramfs-based factory image of I-O DATA WN-AX1167GR instead of redundant recipe which generate on KERNEL_INITRAMFS. Note: WN-AX1167GR has 2x OS images on stock firmware. stock log: flash manufacture id: c2, device id 20 18 MX25L12805D(c2 2018c220) (16384 Kbytes) mtd .name = raspi, .size = 0x01000000 (16M) .erasesize = 0x00010000 (64K) .numeraseregions = 0 Creating 10 MTD partitions on "raspi": 0x000000000000-0x000001000000 : "ALL" 0x000000000000-0x000000030000 : "Bootloader" 0x000000030000-0x000000040000 : "Config " 0x000000040000-0x000000050000 : "Factory" 0x000000050000-0x000000060000 : "iNIC_rf" 0x000000060000-0x0000007e0000 : "Kernel" 0x000000800000-0x000000f80000 : "app" 0x000000f90000-0x000000fa0000 : "Key" 0x000000fa0000-0x000000fb0000 : "backup" 0x000000fb0000-0x000001000000 : "storage" 1st image is "Kernel" and 2nd is "app" when booted from 1st image. In OpenWrt, those 2x partitions are combined to "firmware" with undefined (empty) areas (0x7e0000-0x7fffff, 0xf80000-0xf8ffff). The size of an OS image partition is 0x780000 (7680 KiB = 7.5 MiB), so check-size for initramfs-factory image needs to be called with the size. Signed-off-by: INAGAKI Hiroshi --- target/linux/ramips/image/mt7621.mk | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 943fc62ecd..0e3f1cf0f5 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -49,23 +49,6 @@ define Build/haier-sim_wr1800k-factory $(CP) $(1) $(BIN_DIR)/ endef -define Build/iodata-factory - $(eval fw_size=$(word 1,$(1))) - $(eval fw_type=$(word 2,$(1))) - $(eval product=$(word 3,$(1))) - $(eval factory_bin=$(word 4,$(1))) - if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(fw_size)" ]; then \ - $(CP) $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) $(factory_bin); \ - $(STAGING_DIR_HOST)/bin/mksenaofw \ - -r 0x30a -p $(product) -t $(fw_type) \ - -e $(factory_bin) -o $(factory_bin).new; \ - mv $(factory_bin).new $(factory_bin); \ - $(CP) $(factory_bin) $(BIN_DIR)/; \ - else \ - echo "WARNING: initramfs kernel image too big, cannot generate factory image (actual $$(stat -c%s $@); max $(fw_size))" >&2; \ - fi -endef - define Build/iodata-mstc-header ( \ data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | gzip -c | \ @@ -972,10 +955,13 @@ define Device/iodata_wn-ax1167gr $(Device/dsa-migration) $(Device/uimage-lzma-loader) IMAGE_SIZE := 15552k - KERNEL_INITRAMFS := $$(KERNEL) | \ - iodata-factory 7864320 4 0x1055 $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.bin DEVICE_VENDOR := I-O DATA DEVICE_MODEL := WN-AX1167GR +ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),) + ARTIFACTS := initramfs-factory.bin + ARTIFACT/initramfs-factory.bin := append-image initramfs-kernel.bin | \ + check-size 7680k | senao-header -r 0x30a -p 0x1055 -t 4 +endif DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 endef TARGET_DEVICES += iodata_wn-ax1167gr