From patchwork Fri Nov 30 11:43:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Kresin X-Patchwork-Id: 1005909 X-Patchwork-Delegate: openwrt@kresin.me 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=none (p=none dis=none) header.from=kresin.me Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="l0pweO/n"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kresin-me.20150623.gappssmtp.com header.i=@kresin-me.20150623.gappssmtp.com header.b="jJ04jmFa"; 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 435sx15nG2z9s8F for ; Fri, 30 Nov 2018 22:44:05 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:Message-Id:Date:To: From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=p92BEMJl4ZKFm/mGORJqNklRox+qXLVV3Zr5GVs6x0E=; b=l0pweO/nZzek6e +wsulobROHutsVabHwjRMHvNCx8ATFFeR3HYG3fuSBjz3+uEumyyzHWLFYzoz6+Q38UuCTDow1njg zgKWMrw3xdkEzECF5eGrCGtIuA3BaoJVlW45xDe7hsKeFkEHVTqI1vdiQFvlWz0jG9sj2dakjHs7x 9D0leBDBMhzl3MSPIV95sSyAyxY55XnlzzNsBSvDVQRf+ug7Qao05klVwkkFmLodAzRkATnqSLjDi T4nRUOB0GXY0l8olDb/CFsmdRL7HvZSHN5JhMQJBlc9IpwuGrS0qxirl5m9vIxQJ3uKtYwHHfDqTZ n+Ek03EkL+7Lw34bR9TQ==; 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 1gShDB-0005Ja-Ea; Fri, 30 Nov 2018 11:43:57 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gShCw-0005Hq-3Z for openwrt-devel@lists.openwrt.org; Fri, 30 Nov 2018 11:43:43 +0000 Received: by mail-wr1-x442.google.com with SMTP id l9so4965465wrt.13 for ; Fri, 30 Nov 2018 03:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kresin-me.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=Ng1tDGEjbO0fGATXRhJQZeGChT1JYdeajIO4cAOVS74=; b=jJ04jmFalB929qc1pBov7O7vH/xBET58Q0kCuvA41imYXrDSfSRn75bnZ54w6G1QWM ju1UDXOESnHRt50FOlz1f2gclt6Mbnm1MxOUqoTtGrI9l3RIdUoapknmc4GLNIe/2XBV KHVeRibCik/uXo7oByleys/p4wAAfGCjJZfAgD0APQtJHFHT6AKSrGfPWMSOH18mcZsC pO2KdkCwCcIaLpusnaCRgqBbajQARKqQTtNoajoXl9wLdksMSPdpU4yD7vs8x/kZp9ng ncqgGiFoueDchoOS87kwV5AXfh9i/n1nwS9h5ZpFpwvviochdH6fljQ8hbUjfeptxDlq 9Hsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Ng1tDGEjbO0fGATXRhJQZeGChT1JYdeajIO4cAOVS74=; b=Xb3imDHx8G4h3UCbvNRsIpyEzDLnZC8D7oWtXLmw+7DvVndRJ0o7oOhM2Cv510I5Rw ccpKB7BOo1YFXFwqXCkBwxERrKoNgORWdlLodccaYwOc99+uXmX7aBq+Gl21lesJxu3X Ai0bjhtCxNyYMrFJAE8u3zmWno29x4XaTYc7EnSsAw8nBdtXa0+1xJOZcpQmMhyTLObU 9mzZ0zAevak9qbPktfO9uHZBiaLjcdddyuItlZT8H8seT6oG8R1BUzbrchCX65oy9gKX lWFlAi51QE78nj3+RxNPo/vd6bad0kRyWu3dNaLNfPjcMPoMkaeuum3bhTH1WIc8ngmf IzvA== X-Gm-Message-State: AA+aEWaD3fifY2lB/C5wk5KHPAN4wSbjW3a7Cg/29vUHBtS2/XKD5QV4 yCi28tffL/F+9PNKNDFeMpd3IC5j5iU= X-Google-Smtp-Source: AFSGD/XxOYbACutCG2RodV3r3xx0NO6myzmfuzWRWQaqLd32wMLfDkkEycYVlNXNJryL9/nh2TKUyg== X-Received: by 2002:a5d:6152:: with SMTP id y18mr4943024wrt.141.1543578209879; Fri, 30 Nov 2018 03:43:29 -0800 (PST) Received: from desktop.wvd.kresin.me (p4FED3A99.dip0.t-ipconnect.de. [79.237.58.153]) by smtp.gmail.com with ESMTPSA id t5sm4858579wmg.43.2018.11.30.03.43.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 03:43:29 -0800 (PST) From: Mathias Kresin To: openwrt-devel@lists.openwrt.org Date: Fri, 30 Nov 2018 12:43:22 +0100 Message-Id: <20181130114325.26753-1-dev@kresin.me> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181130_034342_207256_6FDD85B2 X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.0 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:442 listed in] [list.dnswl.org] -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.0 DKIMWL_WL_MED DKIMwl.org - Whitelisted Medium sender Subject: [OpenWrt-Devel] [PATCH 1/4] ramips: use new image build code for D-Link DCS-930 family 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: , MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Drop the factory images and the firmware tool to create them. They don't work any more, since the factory image has an uImage header covering the whole kernel + rootfs. This way the uImage splitter will not be able to find the rootfs and the kernel will panic later on. The factory images were most likely added at a time the board had distinct partitions for kernel and rootfs. Signed-off-by: Mathias Kresin --- target/linux/ramips/image/rt305x-legacy.mk | 33 ------------------ target/linux/ramips/image/rt305x.mk | 16 +++++++++ tools/firmware-utils/Makefile | 1 - tools/firmware-utils/src/mkdcs932.c | 39 ---------------------- 4 files changed, 16 insertions(+), 73 deletions(-) delete mode 100644 tools/firmware-utils/src/mkdcs932.c diff --git a/target/linux/ramips/image/rt305x-legacy.mk b/target/linux/ramips/image/rt305x-legacy.mk index 5116dfcd88..f5a892d365 100644 --- a/target/linux/ramips/image/rt305x-legacy.mk +++ b/target/linux/ramips/image/rt305x-legacy.mk @@ -1,23 +1,6 @@ # # RT305X Profiles # -define BuildFirmware/DCS930/squashfs - $(call BuildFirmware/Default4M/squashfs,squashfs,$(2),$(3)) - dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/image.$(2).combined bs=1048512 count=1 conv=sync - cat $(KDIR)/root.squashfs >> $(KDIR)/image.$(2).combined - $(call MkImage,lzma,$(KDIR)/image.$(2).combined,$(KDIR)/image.$(2)) - $(call prepare_generic_squashfs,$(KDIR)/image.$(2)) - if [ `stat -c%s "$(KDIR)/image.$(2)"` -gt $(ralink_default_fw_size_4M) ]; then \ - echo "Warning: $(KDIR)/image.$(2) is too big" >&2; \ - else \ - dd if=$(KDIR)/image.$(2) of=$(KDIR)/dcs.tmp bs=64K count=5 conv=sync ;\ - cat $(KDIR)/image.$(2) >> $(KDIR)/dcs.tmp ; \ - dd if=$(KDIR)/dcs.tmp of=$(call imgname,$(1),$(2))-factory.bin bs=4096k count=1 conv=sync ;\ - $(STAGING_DIR_HOST)/bin/mkdcs932 $(call imgname,$(1),$(2))-factory.bin ; \ - fi -endef -BuildFirmware/DCS930/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3)) - kernel_size_wl341v3=917504 rootfs_size_wl341v3=2949120 define BuildFirmware/WL-341V3/squashfs @@ -46,8 +29,6 @@ define Image/Build/Profile/ALL02393G $(call Image/Build/Template/$(image_type)/$(1),UIMAGE_8M,all0239-3g,ALL0239-3G,ttyS1,57600,phys) endef -Image/Build/Profile/DCS930=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930,DCS-930) -Image/Build/Profile/DCS930LB1=$(call BuildFirmware/DCS930/$(1),$(1),dcs-930l-b1,DCS-930L-B1) Image/Build/Profile/WL-341V3=$(call BuildFirmware/WL-341V3/$(1),$(1)) define LegacyDevice/ALL02393G @@ -56,20 +37,6 @@ define LegacyDevice/ALL02393G endef LEGACY_DEVICES += ALL02393G - -define LegacyDevice/DCS930 - DEVICE_TITLE := D-Link DCS-930 - DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-dwc2 -endef -LEGACY_DEVICES += DCS930 - - -define LegacyDevice/DCS930LB1 - DEVICE_TITLE := D-Link DCS-930L B1 - DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-ohci kmod-usb2 -endef -LEGACY_DEVICES += DCS930LB1 - define LegacyDevice/WL-341V3 DEVICE_TITLE := Sitecom WL-341 v3 endef diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk index cc743c609d..5f514290dc 100644 --- a/target/linux/ramips/image/rt305x.mk +++ b/target/linux/ramips/image/rt305x.mk @@ -210,6 +210,22 @@ define Device/dap-1350 endef TARGET_DEVICES += dap-1350 +define Device/dcs-930 + DTS := DCS-930 + IMAGE_SIZE := $(ralink_default_fw_size_4M) + DEVICE_TITLE := D-Link DCS-930 + DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-dwc2 +endef +TARGET_DEVICES += dcs-930 + +define Device/dcs-930l-b1 + DTS := DCS-930L-B1 + IMAGE_SIZE := $(ralink_default_fw_size_4M) + DEVICE_TITLE := D-Link DCS-930L B1 + DEVICE_PACKAGES := kmod-video-core kmod-video-uvc kmod-sound-core kmod-usb-audio kmod-usb-core kmod-usb-ohci kmod-usb2 +endef +TARGET_DEVICES += dcs-930l-b1 + define Device/dir-300-b1 DTS := DIR-300-B1 IMAGE_SIZE := $(ralink_default_fw_size_4M) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 00917c3417..63df63191d 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -72,7 +72,6 @@ define Host/Compile $(call cc,mkporayfw, -Wall) $(call cc,mkrasimage, --std=gnu99) $(call cc,mkhilinkfw, -lcrypto) - $(call cc,mkdcs932, -Wall) $(call cc,mkheader_gemtek,-lz) $(call cc,mkrtn56uimg, -lz) $(call cc,dgn3500sum, -Wall) diff --git a/tools/firmware-utils/src/mkdcs932.c b/tools/firmware-utils/src/mkdcs932.c deleted file mode 100644 index 28c67aa3b3..0000000000 --- a/tools/firmware-utils/src/mkdcs932.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License, - * version 2 as published by the Free Software Foundation. - * - * (C) John Crispin - */ - -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - uint32_t t = 0, sum = 0x55aa55aa; - int fd; - - if ((argc != 2) || ((fd = open(argv[1], O_RDWR)) == -1)) { - fprintf(stderr, "Usage: %s input_file\n", *argv); - return -EINVAL; - } - - lseek(fd, -4, SEEK_END); - write(fd, &t, 4); - lseek(fd, 0, SEEK_SET); - - while (read(fd, &t, 4) > 0) - sum -= t; - - lseek(fd, -4, SEEK_END); - write(fd, &sum, 4); - close(fd); - - return 0; -}