From patchwork Sun Apr 24 15:53:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Kresin X-Patchwork-Id: 614157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (caladan.dune.hu [78.24.191.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qtDTZ1nHkz9t60 for ; Mon, 25 Apr 2016 01:55:30 +1000 (AEST) Authentication-Results: ozlabs.org; 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=qT2K/Zas; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 39A43B912A7; Sun, 24 Apr 2016 17:54:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Sun, 24 Apr 2016 17:54:24 +0200 (CEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1A2ABB910CE for ; Sun, 24 Apr 2016 17:54:06 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .kresin. - helo: .mail-wm0-f67.google. - helo-domain: .google.) FROM/MX_MATCHES_NOT_HELO(DOMAIN)=1; rate: -4 Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Sun, 24 Apr 2016 17:54:05 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id w143so15255854wmw.3 for ; Sun, 24 Apr 2016 08:54:05 -0700 (PDT) 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:in-reply-to:references; bh=XXcW++wahaC1SFXGo8ARUju0QnvD2yBQSvqcQb8Zpc4=; b=qT2K/ZasayjUOrPCq8E46WEpgqS3pGR8rnsvwHP2vHKhfJDNgvjJ0uc2QhkjNU7MXN i1/zE3b32lzLAf1Bdk4zk/D1V8rm8n1aTMe8ynsq91TJOyQrmtNyYDc74okrvNrjyRMu b4XQo37YmvqM8Md0Rzzj8akWNeHgwaDR9uhMnRxqEnFWgAY4R98rBWD0TTjjGfIcRuty ybCSGblBmW6tRpx1VAOA/vn50rRc6NXRHt6VJ8DMgjrACKkx0ZykqgeInnuFztMeFcBt oxwrvAzO/3ovl8g8urrW/HU/bNhrwXT6nzFt9yyPgki6+hY+uoC2R7XPYroVx8yJg8sU BRgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=XXcW++wahaC1SFXGo8ARUju0QnvD2yBQSvqcQb8Zpc4=; b=FxRPezL5dvqeLldviQMScYRAIAxjbpXIu9uGacR/obTLxOM6+IPsKW1/+uJeswiLjA jKHOuN1Wyr9rb+koUMPCrMt9cXLzsPuKnwIJWx/far+tqqbw7CZvI0ziZUACVONPe8pY jsT0R2aLhsMXyLfdEFu15ZRFgjh+NeAmvRKtN0vaA1Z5SocYLQCsN3i0U/h9b+Q3L26k 5v+e2GxYM9VFUBj75uzapMNFcJ7rrW1bm62hMlinDZ7C3NueX0TVR2dYiFK2gjOwfHoS haA/DPgTfG+EypcuZ/aMdYP/sgDwcSw1iG3c0hu0eWLTDqoSroj0YytikLdWW13ag5wj 56cQ== X-Gm-Message-State: AOPr4FX3/kmpfYarNeChnUEP2INdww+NcXKgWJAbW4ysN3a6S4UTIk+JLMBxjMKnz3Q7bQ== X-Received: by 10.28.9.135 with SMTP id 129mr7074451wmj.31.1461513245300; Sun, 24 Apr 2016 08:54:05 -0700 (PDT) Received: from desktop.wvd.kresin.me (p5DDC559B.dip0.t-ipconnect.de. [93.220.85.155]) by smtp.gmail.com with ESMTPSA id k133sm14303620wmg.7.2016.04.24.08.54.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Apr 2016 08:54:04 -0700 (PDT) From: Mathias Kresin To: openwrt-devel@lists.openwrt.org Date: Sun, 24 Apr 2016 17:53:58 +0200 Message-Id: <1461513238-13290-5-git-send-email-openwrt@kresin.me> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461513238-13290-1-git-send-email-openwrt@kresin.me> References: <1461513238-13290-1-git-send-email-openwrt@kresin.me> Subject: [OpenWrt-Devel] [PATCH 5/5] lantiq: use new image build process for brnImages X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" LZMA compress the kernel without dictionary, otherwise brnboot fails to uncompress the kernel. The filesystem parameter of mkbrncmdline was dropped since the used filesystem isn't exported in the kernel build step and at least in my tests everything works without the parameter. If the parameter is required for some reason, the static keyword "squashfs" can be used. Signed-off-by: Mathias Kresin Acked-by: Hauke Mehrtens --- target/linux/lantiq/image/Makefile | 42 +++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 6bad91b..f779a1b 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -39,12 +39,6 @@ define PatchKernelLzma $(call CompressLzma,$(KDIR)/vmlinux$(2)-$(1).tmp,$(KDIR)/vmlinux$(2)-$(1).lzma) endef -define MkBrnImage - mkbrncmdline -i $(KDIR)/vmlinux-$(5) -o $(KDIR)/vmlinux-$(5)-brn BRN-BOOT $(7) - $(call CompressLzma,$(KDIR)/vmlinux-$(5)-brn,$(KDIR)/vmlinux-$(5)-brn.lzma) - mkbrnimg -s $(1) -m $(2) -p $(3) -o $(4) $(KDIR)/vmlinux-$(5)-brn.lzma $(KDIR)/root.$(6) -endef - define MkImageLzma mkimage -A mips -O linux -T kernel -a 0x80002000 -C lzma \ -e 0x80002000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ @@ -61,7 +55,6 @@ endef define Image/Build/squashfs cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image) - $(if $(3),$(call MkBrnImage,$(3),$(4),$(5),$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(3)-brnImage,$(2),$(1),$(6))) endef define Image/BuildNAND/squashfs @@ -268,6 +261,14 @@ define Build/mktplinkfw2 -o $@ endef +define Build/mkbrncmdline + mkbrncmdline -i $@ -o $@.new BRN-BOOT + mv $@.new $@ +endef + +define Build/mkbrnimg + mkbrnimg -s $(SIGNATURE) -m $(MAGIC) -p $(CRC32_POLY) -o $@ $(word 1,$^) $(word 2,$^) +endef # Shared device definition: applies to every defined device define Device/Default @@ -291,6 +292,13 @@ define Device/lantiqTpLink IMAGE/tplink := mktplinkfw2 endef +define Device/lantiqBrnImage + KERNEL := kernel-bin | append-dtb | mkbrncmdline | lzma-no-dict + IMAGES := factory.bin + IMAGE/factory.bin := mkbrnimg +endef +DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY + define lantiqTpLink define Device/$(1) $$(Device/lantiqTpLink) @@ -310,6 +318,17 @@ define lantiqImage TARGET_DEVICES += $(1) endef +define lantiqBrnImage + define Device/$(1) + $$(Device/lantiqBrnImage) + DEVICE_PROFILE := $(1) + DEVICE_DTS := $(1) + SIGNATURE := $(2) + MAGIC := $(3) + CRC32_POLY := $(4) + endef + TARGET_DEVICES += $(1) +endef ifeq ($(CONFIG_TARGET_lantiq_falcon),y) @@ -404,14 +423,9 @@ $(eval $(call lantiqTpLink,TDW8970,TD-W8970v1)) $(eval $(call lantiqTpLink,TDW8980,TD-W8980v1)) $(eval $(call lantiqTpLink,VR200v,ArcherVR200V)) $(eval $(call lantiqImage,VGV7510KW22NOR)) - -Image/BuildKernel/Profile/VGV7510KW22BRN=$(call Image/BuildKernel/Template,VGV7510KW22BRN,$(1)) -Image/Build/Profile/VGV7510KW22BRN=$(call Image/Build/$(1),$(1),VGV7510KW22BRN,BRNDA6431,0x12345678,0x04c11db7,$(1)) - +$(eval $(call lantiqBrnImage,VGV7510KW22BRN,BRNDA6431,0x12345678,0x04c11db7)) $(eval $(call lantiqImage,VGV7519NOR)) - -Image/BuildKernel/Profile/VGV7519BRN=$(call Image/BuildKernel/Template,VGV7519BRN,$(1)) -Image/Build/Profile/VGV7519BRN=$(call Image/Build/$(1),$(1),VGV7519BRN,5D00008000,0x12345678,0x2083b8ed,$(1)) +$(eval $(call lantiqBrnImage,VGV7519BRN,5D00008000,0x12345678,0x2083b8ed)) define Image/Prepare $(call Image/Prepare/Profile,$(PROFILE))