From patchwork Wed May 15 20:37:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1100182 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BPvbJP5c"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="a2xGr56k"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4545x74kVXz9sB8 for ; Thu, 16 May 2019 06:38:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date: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=rdsBhmh3ZLZigPPTi2vbWFgFgVLQcJClVGhvk84UrRs=; b=BPvbJP5c25pPhQ LUjaQMg11tAK8JlHoocmhHy6jIjDLZcGHCDQSe3aY9dXNv10wXgfzXA85h9c8t0rS1vs6Htv3x2cz +IbD6SVQRV45zXutcDqf17/pgFHMpRiL3DN8S3f1k62a4WRbGsL6/KJ/MUKdnx9JJjzzDokWxnBSp /87T8ZoEkaRhr0Z9nXmh7LtiCJQcorQgdYhi4/f8V7DFZh4l458AuHeZnbDznM6HnJF72m9U615mO 2W0T5Ug20VXCDvur23fCnCJKO8prP9pzTK0bTbuqevTaQpowMM0fksPYRyzZm1Gq6IybV+vLhEVtn YWCldFDQ17MR48azxSiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hR0fG-0002Lc-OA; Wed, 15 May 2019 20:38:14 +0000 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hR0fE-0002Kx-2J for openwrt-devel@lists.openwrt.org; Wed, 15 May 2019 20:38:13 +0000 Received: by mail-lj1-x242.google.com with SMTP id d15so1014610ljc.7 for ; Wed, 15 May 2019 13:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SguP5HL6I+WD1mLWGTI7JgpO063Zofvy9Pq1Vt9IosE=; b=a2xGr56kbdoszp71wpCcvTlRBKBpwDMoA9+iFrMbAAR4PePgQHmQdQSK/gbLLQWkzM 4Py4op2aekTJK6DhBmwsDGBIvajQoM6gsCUqrzPKpUWbPTEXUTgeNYRrNRX8bwbqT28q F6oGb4+5Apv7QT77EbXRBYaZ1EEpQEtkfkPAN40Vihn+PXGUFiHBuLkirknqmNNG5pzP Tk2nQP1iQa4nkKZRMd22oKewohQdEJa0aLkkmMSURtV9Slj+toHmDjf+rdFE1tJQLg1/ dPDGjMmkpAsXumwRI/9jyHGXV+HSLQFZsLbxBRI8WuuYreXuJVBzklII2mjkw0oTDhEd L4WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SguP5HL6I+WD1mLWGTI7JgpO063Zofvy9Pq1Vt9IosE=; b=dDgnfg+jttkAiN1acKRAFUyiRJ464ZxnvyWPY3gpE6x6mNbtG8CT9niRaH1EKwuJ9f P5Q53hDfUR+nvK2nmH7ZUrYea0/gt0hUwzXh8wItsQojPr4NGzwfB3btKmCvNEcNkkcr 0jmwwuw7H93FEw5J1Mx1+XdUxVma/4uh+szYSYgwP4P0N2+g0gt21NMKdhSSsvgm0yz4 6Nt8bLAeVARCsfLr4ZS0lWXc6BfTTlsdIdyfDBXZFmGQocjBcvXjr0HbmMZQlqiDI9MQ KHlowj6Vr22h1WAUM+KUkbddgJrJUpRfIb2Q7NzgvTB3Y/wSSpr1+67UpLQf42yn/RKk AwWA== X-Gm-Message-State: APjAAAWvZBdAamYFg1EJmcH+VIO6X6xLKMSGP3kPNRU0+7DTOiRo1kMv JvCKfPa890FFBWVAie061Tfz6g== X-Google-Smtp-Source: APXvYqzYGVwBVrHSAkbWynTC6BhvWzTJGFaK5F6UBZ91xhYQkIp0ptpFM53pE8MT8FbmJ0D3JMkFoQ== X-Received: by 2002:a2e:94ca:: with SMTP id r10mr21239802ljh.33.1557952689296; Wed, 15 May 2019 13:38:09 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-d2cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.210]) by smtp.gmail.com with ESMTPSA id o70sm564344lff.53.2019.05.15.13.38.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 13:38:07 -0700 (PDT) From: Linus Walleij To: Roman Yeryomin , Sebastian Luft , Hans Ulli Kroll , Hauke Mehrtens , Christian Lamparter Date: Wed, 15 May 2019 22:37:25 +0200 Message-Id: <20190515203726.25739-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190515_133812_175735_DD210D49 X-CRM114-Status: GOOD ( 17.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH 1/2] mtd: Make fixwrgg command work on DIR-685 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stijn Tintel , Petr Stetiar , Florian Fainelli , openwrt-devel@lists.openwrt.org, Linus Walleij Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The D-Link DIR-685 has the same problem as the D-Link DAP-2695: when flashing the factory image, the checksum includes the whole flashed image, even the rootfs_data part with the end of filesystem mark. Also the whole flashed image is stored in the flash, so on the first boot, the whole rootfs image is loaded into memory with the kernel. This is fixed using the fixwrgg command to mtd, but for this to work we need to make fixwrgg work with the Little-Endian ARM DIR-685. The code tries to be endian agnostic but this fails because the WRGG image loader doesn't. On ARM, the file size is stored in little endian format, and on big-endian systems it is stored in big endian format, so we can just drop all the friendly htonl() that will make the shdr->size big endian: this will actually break the little endian systems, and on the big endian systems the native endianness will still be correct. The magic number is always stored in little endian format however, so make sure this is always read in LE32 format. I chose to create a straight-forward le32_to_cpu() static inline that IMO is simple and easy to read. Cc: Stijn Tintel Signed-off-by: Linus Walleij --- It'd be great if someone could verify that this works with DAP-2695 as well. The code is inspired by the kernel mtdsplit code in target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_wrgg.c --- package/system/mtd/src/wrgg.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/package/system/mtd/src/wrgg.c b/package/system/mtd/src/wrgg.c index e0b5ca172d12..c62f9f550736 100644 --- a/package/system/mtd/src/wrgg.c +++ b/package/system/mtd/src/wrgg.c @@ -39,13 +39,10 @@ #include "wrgg.h" #include "md5.h" -#if __BYTE_ORDER == __BIG_ENDIAN -#define STORE32_LE(X) ((((X) & 0x000000FF) << 24) | (((X) & 0x0000FF00) << 8) | (((X) & 0x00FF0000) >> 8) | (((X) & 0xFF000000) >> 24)) -#elif __BYTE_ORDER == __LITTLE_ENDIAN -#define STORE32_LE(X) (X) -#else -#error unknown endianness! -#endif +static inline uint32_t le32_to_cpu(uint8_t *buf) +{ + return buf[0] | buf[1] << 8 | buf[2] << 16 | buf[3] << 24; +} ssize_t pread(int fd, void *buf, size_t count, off_t offset); ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); @@ -94,7 +91,7 @@ wrgg_fix_md5(struct wrgg03_header *shdr, int fd, size_t data_offset, size_t data } /* update the size in the image */ - shdr->size = htonl(data_size); + shdr->size = data_size; /* update the checksum in the image */ memcpy(shdr->digest, digest, sizeof(digest)); @@ -147,12 +144,14 @@ mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) } shdr = (struct wrgg03_header *)(first_block + offset); - if (shdr->magic1 != htonl(STORE32_LE(WRGG03_MAGIC))) { - fprintf(stderr, "magic1 %x\n", shdr->magic1); - fprintf(stderr, "htonl(WRGG03_MAGIC) %x\n", WRGG03_MAGIC); + + /* The magic is always stored in little-endian byte order */ + if (le32_to_cpu((uint8_t *)&shdr->magic1) != WRGG03_MAGIC) { + fprintf(stderr, "magic1 = %x\n", shdr->magic1); + fprintf(stderr, "WRGG03_MAGIC = %x\n", WRGG03_MAGIC); fprintf(stderr, "No WRGG header found\n"); exit(1); - } else if (!ntohl(shdr->size)) { + } else if (!shdr->size) { fprintf(stderr, "WRGG entity with empty image\n"); exit(1); } @@ -160,8 +159,8 @@ mtd_fixwrgg(const char *mtd, size_t offset, size_t data_size) data_offset = offset + sizeof(struct wrgg03_header); if (!data_size) data_size = mtdsize - data_offset; - if (data_size > ntohl(shdr->size)) - data_size = ntohl(shdr->size); + if (data_size > shdr->size) + data_size = shdr->size; if (wrgg_fix_md5(shdr, fd, data_offset, data_size)) goto out; From patchwork Wed May 15 20:37:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1100181 X-Patchwork-Delegate: chunkeey@googlemail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bTpsI9E2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="NaI/bJih"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4545x74Zr3z9s9T for ; Thu, 16 May 2019 06:38:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OZ8zGxJmQlrHdYLPMoaNMAcIfpMhfw/yoTyrLXa1bgI=; b=bTpsI9E24mxxIN Rlf1AAxnE125gDf38WatEk0YFtvayarfVkWobJalmL6UYvy2qHfK+/AYQGvdtPczcUcbgkMd6qLbf jtf4XpyFwDgilC4dgXaRRSOjzo3rfkO8o93VxeZgQrHkNcy8ef0/25a1R6c4/18wGg91XfJyZ40qD rbG9U+AlPUsdUZLfJu06RXAhDb/Jt7glaGJw33TKo6bgn66KQiFgvmA9x+HziHFlR3J7D3cFURigK bxKXba+0NDJ9qVlDYb1riEG9Llov8rQoIfVtP7ZPO2O06Qmmzvegb8Wnq27HtccGVjfv/NnPXzly3 vqHbKDoipnl4/ABZwCkA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hR0fO-0002Vy-Mt; Wed, 15 May 2019 20:38:22 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hR0fG-0002LT-NZ for openwrt-devel@lists.openwrt.org; Wed, 15 May 2019 20:38:17 +0000 Received: by mail-lj1-x244.google.com with SMTP id h21so976819ljk.13 for ; Wed, 15 May 2019 13:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jIAjxKOvDG6mik7NopoMbrRPrKEs1vpIiv9ljAeoI8c=; b=NaI/bJihqiKr4k3pO8XSZrLDxB9lX3MBtP/zNhItak93iB/YfRy8Ppjzff4YylpsPQ Hvf1JDOc/+mBxqJ91d3Zd2EhniTUEE7SFQyvOGUkSXsCySU+iIvtzAKfZyLRnNI6Ltdi TuhWlQ9aiD6cxd3Em5tH5fk4DMzlaFAzbpWbikgjEhXv1B7rBVo1nb2Oy3mt1C7JeHde mG6tdNFQseDWs8qnVXhC/Zz96tFyWcprnPiRleyxHEVj5LVQ8CC0tzA0dQkDAlfQH3W4 zd7EC9dRE/RK8RzLnRpCezOMZK2xroTa3ZGwJCzc20ms6G/OfQlg6wSm+RXjUXaNJsqp mfCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jIAjxKOvDG6mik7NopoMbrRPrKEs1vpIiv9ljAeoI8c=; b=Ne7gBWAIQuiKv3o2nP8Mj4DTYo1fwx5Op1UrWntHm4UOJkOK6VI3G6TEPGetyzUjG9 Y8xz6BjnMXX6TPaKRkOavTq0q6QNw6B88Mkgqwbc+EHDRXq0rwEEMn0JU7CD++BaRcRY 10kCD1tr9cf2Zb129Hd+D8SjDjQLa41ocEas6IAp89l5ndbLMD0ODXirV7zB3DVFBTbJ FXZlmNmcXXK3xmIgu6o+d9nZWfqzXw6Gs23Vt8p+znrAKKul8J8qEDgEqth4wketSsGw 5Giq7Ks3VGse0d6JzQhV+mmJMAWrfH2W6AgHnojxC5ZQGdb6VcAy3S8UePPJmj22WPvC xj0w== X-Gm-Message-State: APjAAAWUba7Ot2pGij9/MzZV7ppVqrkfMa0LRNneAlSHPB1xiDNDPZ4u aCYZcXbcPUbv7SB6B5NTeuEx3Q== X-Google-Smtp-Source: APXvYqyo5PmgzcFvtpHSJxbFuG+IDWKJb0bQ+ZLD0rmW+ZgOhM+bLR2QrYv1wx1Y7wA1BIAxxx3H7g== X-Received: by 2002:a2e:90d1:: with SMTP id o17mr8249596ljg.187.1557952692942; Wed, 15 May 2019 13:38:12 -0700 (PDT) Received: from localhost.bredbandsbolaget (c-d2cd225c.014-348-6c756e10.bbcust.telenor.se. [92.34.205.210]) by smtp.gmail.com with ESMTPSA id o70sm564344lff.53.2019.05.15.13.38.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2019 13:38:11 -0700 (PDT) From: Linus Walleij To: Roman Yeryomin , Sebastian Luft , Hans Ulli Kroll , Hauke Mehrtens , Christian Lamparter Date: Wed, 15 May 2019 22:37:26 +0200 Message-Id: <20190515203726.25739-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190515203726.25739-1-linus.walleij@linaro.org> References: <20190515203726.25739-1-linus.walleij@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190515_133814_890134_22F13E22 X-CRM114-Status: GOOD ( 15.63 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Subject: [OpenWrt-Devel] [PATCH 2/2] gemini: Fix up firmware checksum on DIR-685 X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stijn Tintel , Petr Stetiar , Florian Fainelli , openwrt-devel@lists.openwrt.org, Linus Walleij Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Using the same method as the D-Link DAP-2695 A1 we use the "mtd" tool to augment the firmware checkum in flash on first boot of a new firmware on the D-Link DIR-685. We need to augment the Makefile for "mtd" to build in the special WRGG fixup support for Gemini as well. This works around the problem of the machine not booting after factory install unless the sysupgrade is applied immediately. Based on commit e3875350f3e4185020b64e0588bba521cd1d6e64 "ar71xx: add support for D-Link DAP-2695 rev. A1" Cc: Stijn Tintel Signed-off-by: Linus Walleij --- package/system/mtd/src/Makefile | 1 + .../etc/uci-defaults/09_fix-checksum | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum diff --git a/package/system/mtd/src/Makefile b/package/system/mtd/src/Makefile index 08a9fb295dac..e3265fe9f1b9 100644 --- a/package/system/mtd/src/Makefile +++ b/package/system/mtd/src/Makefile @@ -8,6 +8,7 @@ obj.wrg = wrg.o md5.o obj.wrgg = wrgg.o md5.o obj.tpl = tpl_ramips_recoveryflag.o obj.ar71xx = trx.o $(obj.seama) $(obj.wrgg) +obj.gemini = $(obj.wrgg) obj.brcm = trx.o obj.brcm47xx = $(obj.brcm) obj.bcm53xx = $(obj.brcm) $(obj.seama) diff --git a/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum new file mode 100644 index 000000000000..5f79d1a65caa --- /dev/null +++ b/target/linux/gemini/base-files/etc/uci-defaults/09_fix-checksum @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Copyright (C) 2019 OpenWrt.org +# + +. /lib/functions.sh + +board=$(board_name) + +fixwrgg() { + local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd) + + [ "$kernel_size" ] && mtd -c 0x$kernel_size fixwrgg firmware +} + +case "$board" in +dlink,dir-685) + fixwrgg + ;; +esac