diff mbox

[LEDE-DEV] bcm53xx: put kernel into TRX when building initramfs images

Message ID 20170324173748.27258-1-zajec5@gmail.com
State Changes Requested
Headers show

Commit Message

Rafał Miłecki March 24, 2017, 5:37 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

Many (most?) devices can't boot raw kernel using tftp and probably none
allows flashing it. It's way more usable to have TRX with kernel
containing initrams as such an image can be actually flashed.

Some devices may support tftp flash booting and it would be the best to
have both images generated for them. Unfortunately it's not possible
right now (only one initramfs image can be generated).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 target/linux/bcm53xx/image/Makefile | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Felix Fietkau March 24, 2017, 7:39 p.m. UTC | #1
On 2017-03-24 18:37, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Many (most?) devices can't boot raw kernel using tftp and probably none
> allows flashing it. It's way more usable to have TRX with kernel
> containing initrams as such an image can be actually flashed.
> 
> Some devices may support tftp flash booting and it would be the best to
> have both images generated for them. Unfortunately it's not possible
> right now (only one initramfs image can be generated).
Please exclude buffalo devices from this change. You can press a button
that makes it load firmware.lzma via TFTP from 192.168.11.1.

- Felix
diff mbox

Patch

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 660981ea1e..58ec84cae6 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -49,6 +49,14 @@  define Build/buffalo-wzr-header
 	mv $@.new $@
 endef
 
+define Build/trx
+	$(STAGING_DIR_HOST)/bin/trx \
+		-o $@.new \
+		-m 33554432 \
+		-f $@
+	mv $@.new $@
+endef
+
 define Build/trx-serial
 	$(STAGING_DIR_HOST)/bin/trx \
 		-o $@.new \
@@ -111,6 +119,7 @@  define Device/Default
   DEVICE_DTS := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb)))
   KERNEL := kernel-bin | append-dtb | lzma-d16
   KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts)
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma-d16 | trx
   FILESYSTEMS := squashfs
   KERNEL_NAME := zImage
   IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)