From patchwork Fri Sep 2 20:35:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 665323 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sQrZJ5zBcz9s4x for ; Sat, 3 Sep 2016 06:39:04 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=googlemail.com header.i=@googlemail.com header.b=ZGXGMtlo; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfvBb-0002Jm-Rl; Fri, 02 Sep 2016 20:35:39 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfvBX-0001Vg-AZ for lede-dev@lists.infradead.org; Fri, 02 Sep 2016 20:35:36 +0000 Received: by mail-wm0-x244.google.com with SMTP id i138so4245432wmf.3 for ; Fri, 02 Sep 2016 13:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=7t3+Xspb4KFzyOdZNvWKKo2Kkhg/Eb/aiWp7HiAFyjw=; b=ZGXGMtloiDTO1yudUi0AkrUaXQ9w48vzKrVt6PWL7UgSxvdLNMibiniVxTcCPnYZ8q tNs20sw5ilJ25rvJoUrsAjehCuD37uWp9x0ecHvI92BgzRTvW6JdbllbG0Xftp3ogk+B lhuEFJEwQ36x1bmqssMq3E/SWLN0LYKDYMjrqh4lVT/rEzsvqvOtFEMyCBqBedU1kIq2 3bqgn/HhCsZauqowcH5d96+ePbNc/DnZI0jCtrn3eYNFulOpb7qKj/U5Mo2biFZTIpvK RAFPkUf/4GQhTnqK3+k7lFhad4TS1i7TFgtuWbMkmGSN3T5GC0S/oOMj5SnPbTXL4D2t E2fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=7t3+Xspb4KFzyOdZNvWKKo2Kkhg/Eb/aiWp7HiAFyjw=; b=SUa6sz9ucQdx0qTz+u0anbl7vtdD/lcwiJrfb6oDhBcSpiDZedRQfoSNMNf4+hh6Jy LDPINefvm/YJ2cU0Ce6W4snQNinpixmBJ/sY/vwiOz4V1kdGfu2xazZSYDvvJZo8SRf2 7Rhbk+hQ9g+26+2M4VZ1ZsQyaYdWzjfE3CvJapm04KwofzPc8p9yDKVksfL62emxGFPi 9pvdlYNclU3fKGPEUT9ESNP4oowG6rsfPPwFrqmEGdhsGNRvqwzFi3gxyvID4Iy+cVBm ELbbodeyhGyw8/k5j/6tX2TwqUox2oDbp8QH9kPD/ZnHbs+rFEkfFyrp2CCGJADKr03E 0Dog== X-Gm-Message-State: AE9vXwNxLnrhIp7eAYkAeRs2uZabg7ai6kj8ItEvK+KDvYFc4aWTbtrlSTXkR7oZmY6y8A== X-Received: by 10.28.20.139 with SMTP id 133mr4846545wmu.78.1472848513233; Fri, 02 Sep 2016 13:35:13 -0700 (PDT) Received: from debian64.daheim (pD9F88CCB.dip0.t-ipconnect.de. [217.248.140.203]) by smtp.gmail.com with ESMTPSA id n7sm12109874wjf.11.2016.09.02.13.35.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Sep 2016 13:35:11 -0700 (PDT) From: Christian Lamparter X-Google-Original-From: Christian Lamparter Received: from chuck by debian64.daheim with local (Exim 4.87) (envelope-from ) id 1bfvB9-0000b3-Go; Fri, 02 Sep 2016 22:35:11 +0200 To: lede-dev@lists.infradead.org Date: Fri, 2 Sep 2016 22:35:03 +0200 Message-Id: <20160902203503.2251-1-chunkeey@gmail.com> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160902_133535_607417_E80A7C44 X-CRM114-Status: GOOD ( 12.34 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (chunkeey[at]googlemail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -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_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH] apm821xx: add size check for initramfs kernel for the Meraki MR24 X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chris Blake , Russell Senior , Christian Lamparter MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Russell Senior reported an issue with the MR24 initramfs kernels: > ## Booting kernel from Legacy Image at 00c10000 ... > Image Name: POWERPC LEDE Linux-4.4.19 > Created: 2016-08-31 11:57:05 UTC > Image Type: PowerPC Linux Kernel Image (gzip compressed) > Data Size: 2155723 Bytes = 2.1 MiB > Load Address: 00000000 > Entry Point: 00000000 > Verifying Checksum ... OK >Wrong Ramdisk Image Format >Ramdisk image is corrupt or invalid For the MR24, the kernel is uploaded to 0x10000. The ramdisk starts at 0x200000. This leaves the kernel with just 0x1f0000 bytes = 1984kb. This patch adds a size check so the image creation script will abort instead of producing a unbootable initramfs image. A separate patch "apm821xx: Fix initramfs image for the Meraki MR24" which fixed the reported issue was submitted earlier. Cc: Russell Senior Cc: Chris Blake Signed-off-by: Christian Lamparter --- target/linux/apm821xx/image/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 8edd578..f151543 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -72,10 +72,13 @@ define Device/mr24 BLOCKSIZE := 64512 IMAGES := sysupgrade.tar DTB_SIZE := 64512 - KERNEL_SIZE := 2048k + KERNEL_SIZE := 1984k IMAGE_SIZE := 8191k KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND - KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND + KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | \ + check-size $$(KERNEL_SIZE) | \ + MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ + MerakiNAND IMAGE/sysupgrade.tar := sysupgrade-tar endef TARGET_DEVICES += mr24