From patchwork Fri Feb 15 16:02:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1042983 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="aVH8rMM1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="XEvmzBxm"; 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 441J1x5bp5z9rxp for ; Sat, 16 Feb 2019 03:02:45 +1100 (AEDT) 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=XIzVFgFplYh+O/2Zlba5eJTYM4l8/QSNUuXPjvrRzYk=; b=aVH8rMM1R4c0wK c1Q9UtLrHS52zDV7iVN79bG92h1NGEtyVbY+ZDIYEWbG+LC9vZnZj/ya8OF8vyuh45Q/U3ak0ce8j PZ0R2r8Df30WdlsBlzXxKmlP9SdvZKWGKtj40TZeQmdWx0v9ULMzUE/LJn9bmRKv/fMhH0JDQ8q4k svzCTIlmMr7Hot8JtAqlmLqeFqS/3bC21gpWd8Eui48d+HpyA2xrcNPW6Q8xox2EiMf69P73YRNK8 CW8cFJTooKwvAGbzZ9Ydui78pu21bxgr0iSLUircJidJkiWEA45AUrTCvp4dQMp0yn/+F8KA/0gFs DMaswoKDqL+4mig/jJmg==; 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 1gufwY-0004xe-AA; Fri, 15 Feb 2019 16:02:26 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gufwT-0004vg-FO for openwrt-devel@lists.openwrt.org; Fri, 15 Feb 2019 16:02:24 +0000 Received: by mail-lj1-x243.google.com with SMTP id g11-v6so8826560ljk.3 for ; Fri, 15 Feb 2019 08:02:20 -0800 (PST) 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=rpIDU6Eu+lj4BN1A0PgbKq0QKSLn9pAoHK62MapYFJk=; b=XEvmzBxmUvDwLx1jVJIM8RfOe8ehO1zhzuqX1ws1S9dkCXLwQ5Bs2ogwexwqpCr17C 6UGX5p3+uM8HV+EhbWr8NoTeMqTfflVdRXCTTc1mVMOfaDBVuiHgUPPdTa+FFL4ouPU0 Oik3S8TolShnyrvKXh2WK6IIyak+ZHkY2yvf6fIwWHzKgKzW1MJoLS+zWk/9zKsa0x0r WrXCugGe0LoXqbtBzh/werw8lMVZ2Mv5dv4Uxpwz9HQv/bKdrm8r6Z0LDAAONLhkQjNW 9f7Mq6Mcv5xtiVtwdHxBRK1mLS1nPhDuySelWFpmwBBSLqgMoEgM4Mqhnosces/eVmmn yWTw== 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=rpIDU6Eu+lj4BN1A0PgbKq0QKSLn9pAoHK62MapYFJk=; b=dXWXsmR7RgCVMStssxDo0xM6GIHk5aOYA+0NUSVux6eQbqh8S7dr+R+JfatacWyh/O a/UTkebZGDWIyIwOjM22HcgpryvhbU1LlCRDx2fpaY/VewQlNXiVA9ldCovef102uyqa 7OKIc2tx5XiCgKE1npnj2rVeUc81t5JL5sIJA1TzM3tN85TVCMHZSofSKKd0qe67JBv6 6QoRJcEj+ZaXPSNDbFikkPpDMHo67+qQ6KfwPS2AaoTiKg2iA3AYADo9ySJ36NfeHeTf HuqBDnNydbXQrzekYvsJE06xoRM91wBIm2PtWWuTMepr3XSGomdnEUT26kueLEIs4s+0 81RQ== X-Gm-Message-State: AHQUAubTg7pwL4DB0dC4C0HQdPoyW6ENsJncF5rzOuwKHL7mfNqxcmA2 Jg4mFP2dEeS33BxcrhAFmcPeOA== X-Google-Smtp-Source: AHgI3IYrmIWsXgsI+fSK0mPP6ZNUYtP8PHiizpEbssoUebi8gf3yHPT95li9Sqd7/s5tkbdTj74WDQ== X-Received: by 2002:a2e:858e:: with SMTP id b14-v6mr6532102lji.43.1550246538894; Fri, 15 Feb 2019 08:02:18 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id f20-v6sm1371647ljk.33.2019.02.15.08.02.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Feb 2019 08:02:17 -0800 (PST) From: Linus Walleij To: Roman Yeryomin , Sebastian Luft , Hans Ulli Kroll , Hauke Mehrtens , Christian Lamparter Date: Fri, 15 Feb 2019 17:02:14 +0100 Message-Id: <20190215160214.19680-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-20190215_080221_526099_8C73A8B2 X-CRM114-Status: GOOD ( 12.52 ) 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 http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -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_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 Subject: [OpenWrt-Devel] [PATCH 1/2] firmware-tools/ptgen: Allow generation 0 size partitions 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 firmware on the D-Link DNS-313 NAS require two blank partitions before the boot partition. Support this if explicitly requested with a "-n" flag. Tested on the D-Link DNS-313. Signed-off-by: Christian Lamparter [Broken out from original patch] Signed-off-by: Linus Walleij --- tools/firmware-utils/src/ptgen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index 13e0eda6222a..0192bb65e514 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ int active = 1; int heads = -1; int sectors = -1; int kb_align = 0; +bool ignore_null_sized_partition = false; struct partinfo parts[4]; char *filename = NULL; @@ -140,6 +142,8 @@ static int gen_ptable(uint32_t signature, int nr) memset(pte, 0, sizeof(struct pte) * 4); for (i = 0; i < nr; i++) { if (!parts[i].size) { + if (ignore_null_sized_partition) + continue; fprintf(stderr, "Invalid size in partition %d!\n", i); return -1; } @@ -196,7 +200,7 @@ fail: static void usage(char *prog) { - fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); + fprintf(stderr, "Usage: %s [-v] [-n] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); exit(EXIT_FAILURE); } @@ -207,7 +211,7 @@ int main (int argc, char **argv) int part = 0; uint32_t signature = 0x5452574F; /* 'OWRT' */ - while ((ch = getopt(argc, argv, "h:s:p:a:t:o:vl:S:")) != -1) { + while ((ch = getopt(argc, argv, "h:s:p:a:t:o:vnl:S:")) != -1) { switch (ch) { case 'o': filename = optarg; @@ -215,6 +219,9 @@ int main (int argc, char **argv) case 'v': verbose++; break; + case 'n': + ignore_null_sized_partition = true; + break; case 'h': heads = (int)strtoul(optarg, NULL, 0); break; From patchwork Fri Feb 15 16:02:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 1042984 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="jTdwEvsQ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="orAM+ILk"; 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 441J222NQcz9rxp for ; Sat, 16 Feb 2019 03:02:50 +1100 (AEDT) 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=VdoHkE7kB5QoXRpM2ixtU7HmXC2pcwHRZZLs4uSOw/w=; b=jTdwEvsQyPSTPl +UlFWRXZJb9VfrF9iAWsVCSXZDAOSkC/iIyvIUAFv1HgQnzs6sQBdgHRkMw6JCyQYR2IPQwt3UiDp gdDyfDz3QjMoPClWcXkTqUlaWnOE0zERApVFvK3NWtO66OuQcq1wvvXQfsl6t6F5kBwPgQZkcVmvl UtBQ9+QWVfeVdY1954dPn/+r+Q30wZaPC28cu+a6+T78yICIo+7LdZB7rEmmWF64owmN9833v8WWS EbEZDkXGRqdi3oCAnjh+dVh3GPQXolv34TPvQLLupHSjR8ETXHscHH59SLMIy+/cmUPNqbtRDtagh RMHXzSNnd39Dl3KWrZfg==; 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 1gufwj-00059p-HG; Fri, 15 Feb 2019 16:02:37 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gufwa-0004yX-RI for openwrt-devel@lists.openwrt.org; Fri, 15 Feb 2019 16:02:35 +0000 Received: by mail-lj1-x241.google.com with SMTP id g11-v6so8827001ljk.3 for ; Fri, 15 Feb 2019 08:02:28 -0800 (PST) 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=oZUaam9TJzRhIF95DVQpVhLGfyxAtEx/zX9wIJPz7mI=; b=orAM+ILkttgqT35c4rPfLD6pfo/vMhuba/6/RM4VEQIs8eKnMHVveAONC/hq1tcPMU GooCAoegTy9U+kwwIJWYDAMuRscCvMU/oa9xJH6t+wPks/rn2/jaOjfGWFp5PdSOaOD9 IWmaZS+2SxNjYQXA65U/m8nuGj13dEUO4vCBL8aIZsabFYnP3eV+ByFyEZ3JKERwkbCi zT4AZ7rMlrPytuh1xH5lOB+DB/DTzDzY9COhpRGREPnbe655ljGY2Fp9iblXNWeIEDGC wYMxBsl+uDDwJw/I6RjIIjzyCg1UYzdoY4H5HO61gCbm85qBxVtKv0ZqjSjJvcA4sXM9 fk6A== 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=oZUaam9TJzRhIF95DVQpVhLGfyxAtEx/zX9wIJPz7mI=; b=Sr5gJS8zGev01Qgndl3vylUNsQQCkfgDBKldFo1nyS+lX9jG6/8p8VGmcgv+SDI1GU 1rfpwqdCUpaK8nQJftA+BNEq9Wu56KDdfx4QxzWSKqnBFFqvF1PT9FLSdEdhAeqIZz5G JWjd07QG3r+Uuv79yT34dhjQralZR10SZf5HaRY2A+5EZ4g+TRFaIfOy9aChvFhnCa/n za9oq+Sl9qu03oxbMHklwRAPNrjdmMkibBxB6emXzBZslAfAvpMrs3ooxx2PBVSY17Dc TzUSEdza/OUB9H4z/krKiSD6VSmEhud/XxnoFyOUTgkYyIXxqVRjeq7OC7viKjV+8slQ sZMw== X-Gm-Message-State: AHQUAuYqTP/1PPauQn1pc6Hbso8x0seDkdbyomnGw6WQiARwmkvyX3k9 v58+Z0ct20+0bGzJOIRKQ1XB9w== X-Google-Smtp-Source: AHgI3Ib5LCsmfKQ22PsuVvhZMxohpB7kedtpSqJaA+l7n2rQ9RKjxTbLXqnbRihkvZol7t+rCk+UTw== X-Received: by 2002:a2e:9f0b:: with SMTP id u11mr6237887ljk.64.1550246546736; Fri, 15 Feb 2019 08:02:26 -0800 (PST) Received: from localhost.bredbandsbolaget (c-ae7b71d5.014-348-6c756e10.bbcust.telenor.se. [213.113.123.174]) by smtp.gmail.com with ESMTPSA id y30sm1256913ljd.12.2019.02.15.08.02.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Feb 2019 08:02:25 -0800 (PST) From: Linus Walleij To: Roman Yeryomin , Sebastian Luft , Hans Ulli Kroll , Hauke Mehrtens , Christian Lamparter Date: Fri, 15 Feb 2019 17:02:23 +0100 Message-Id: <20190215160223.19734-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-20190215_080229_154744_C50C45CF X-CRM114-Status: GOOD ( 15.42 ) 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 http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:241 listed in] [list.dnswl.org] -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_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 Subject: [OpenWrt-Devel] [PATCH 2/2] gemini: Generate harddisk image for DNS-313 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 This makes OpenWrt build an Ext2+Ext4 partitioned image for the D-Link DNS-313 with two blank partitions, a boot partition on /dev/sda3 and a rootfs partition on /dev/sda4. This uses the methods already used in apm821xx including the tricks to convert the generated Ext2 filesystem partition to version 1 so that the firmware bootloader will properly recognize it. We patch a bit around the build files to make sure we get the rootfs size set and that genext2fs is properly built. Tested on the D-Link DNS-313. Signed-off-by: Christian Lamparter [Fixing and tricksing] Signed-off-by: Linus Walleij --- config/Config-images.in | 2 +- target/linux/gemini/Makefile | 2 +- target/linux/gemini/image/Makefile | 27 ++++++++++++++---- .../linux/gemini/image/dns313_gen_hdd_img.sh | 28 +++++++++++++++++++ tools/Makefile | 2 +- 5 files changed, 52 insertions(+), 9 deletions(-) create mode 100755 target/linux/gemini/image/dns313_gen_hdd_img.sh diff --git a/config/Config-images.in b/config/Config-images.in index bdd24ef6178c..b9cc929f0f95 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -275,7 +275,7 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" - depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml + depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_omap || TARGET_rb532 || TARGET_sunxi || TARGET_uml || TARGET_gemini default 256 help Select the root filesystem partition size. diff --git a/target/linux/gemini/Makefile b/target/linux/gemini/Makefile index 7c573c7c6d09..e232937bb9eb 100644 --- a/target/linux/gemini/Makefile +++ b/target/linux/gemini/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=gemini BOARDNAME:=Cortina Systems CS351x -FEATURES:=squashfs pci rtc usb dt gpio display +FEATURES:=squashfs pci rtc usb dt gpio display ext4 root-part boot-part CPU_TYPE:=fa526 MAINTAINER:=Roman Yeryomin diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index a612cf706d63..493f14cbf416 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -28,6 +28,7 @@ endef # the only real content. define Build/dns313-images mkdir -p $@.tmp/.boot + chmod 755 $@.tmp/.boot echo "dummy" > $@.tmp/dummyfile @@ -38,9 +39,20 @@ define Build/dns313-images dns313-header $(IMAGE_KERNEL) \ $@.tmp/.boot/zImage - tar --sort=name --owner=0 --group=0 --numeric-owner -czf $@ \ - -C $@.tmp .boot \ - $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") + rm $@.tmp/dummyfile + + genext2fs --block-size $(BLOCKSIZE:%k=%Ki) \ + --size-in-blocks $$((1024 * $(CONFIG_TARGET_KERNEL_PARTSIZE))) \ + --squash-uids \ + --root $@.tmp $@.tmp-boot + + # The device firmware needs revision 1 of EXT2 + $(STAGING_DIR_HOST)/bin/tune2fs -O filetype $@.tmp-boot + $(STAGING_DIR_HOST)/bin/e2fsck -pDf $@.tmp-boot > /dev/null + + ./dns313_gen_hdd_img.sh $@ $@.tmp-boot $(IMAGE_ROOTFS) \ + $(CONFIG_TARGET_KERNEL_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) rm -rf $@.tmp endef @@ -106,7 +118,8 @@ GEMINI_NAS_PACKAGES:=kmod-md-mod kmod-md-linear kmod-md-multipath \ kmod-fs-btrfs kmod-fs-cifs kmod-fs-nfs \ kmod-fs-nfsd kmod-fs-ntfs kmod-fs-reiserfs kmod-fs-vfat \ kmod-nls-utf8 kmod-usb-storage-extras \ - samba36-server mdadm cfdisk fdisk e2fsprogs badblocks + samba36-server mdadm cfdisk fdisk e2fsprogs badblocks \ + partx-utils define Device/dlink_dir-685 DEVICE_TITLE := D-Link DIR-685 Xtreme N Storage Router @@ -123,8 +136,10 @@ define Device/dlink_dns-313 DEVICE_TITLE := D-Link DNS-313 1-Bay Network Storage Enclosure DEVICE_DTS := gemini-dlink-dns-313 DEVICE_PACKAGES := $(GEMINI_NAS_PACKAGES) - IMAGES := bootpart.tar.gz - IMAGE/bootpart.tar.gz := dns313-images + BLOCKSIZE := 1k + FILESYSTEMS := ext4 squashfs + IMAGES := factory.bin.gz + IMAGE/factory.bin.gz := dns313-images | gzip endef TARGET_DEVICES += dlink_dns-313 diff --git a/target/linux/gemini/image/dns313_gen_hdd_img.sh b/target/linux/gemini/image/dns313_gen_hdd_img.sh new file mode 100755 index 000000000000..1eb2c7c57599 --- /dev/null +++ b/target/linux/gemini/image/dns313_gen_hdd_img.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -x +[ $# -eq 5 ] || { + echo "SYNTAX: $0 " + exit 1 +} + +OUTPUT="$1" +BOOTFS="$2" +ROOTFS="$3" +BOOTFSSIZE="$4" +ROOTFSSIZE="$5" + +head=4 +sect=63 + +# Create two empty partitions followed by the boot partition with +# the ./boot/zImage and then the rootfs partition. +set `ptgen -o $OUTPUT -h $head -s $sect -t 83 -n -p 0 -p 0 -p ${BOOTFSSIZE}M -p ${ROOTFSSIZE}M` + +BOOTOFFSET="$(($1 / 512))" +BOOTSIZE="$(($2 / 512))" +ROOTFSOFFSET="$(($3 / 512))" +ROOTFSSIZE="$(($4 / 512))" + +dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc +dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/tools/Makefile b/tools/Makefile index cacba5bcb467..0123a759c826 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -37,7 +37,7 @@ tools-y += lzma squashfs4 zip tools-$(BUILD_B43_TOOLS) += b43-tools tools-$(BUILD_ISL) += isl tools-$(CONFIG_USE_SPARSE) += sparse -tools-$(CONFIG_TARGET_apm821xx) += genext2fs +tools-$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini) += genext2fs # builddir dependencies $(curdir)/bison/compile := $(curdir)/flex/compile