aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm53xx
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-03-24 18:25:23 +0100
committerRafał Miłecki <rafal@milecki.pl>2017-03-27 10:41:36 +0200
commit2ebfdabfbdbb49f4ce258998fce88210beada2f8 (patch)
treee4e561f32c954597e2d15d07d1ab4eb100c9a598 /target/linux/bcm53xx
parent6c937df749c700f218e8dd4536043a190c19f1d2 (diff)
downloadupstream-2ebfdabfbdbb49f4ce258998fce88210beada2f8.tar.gz
upstream-2ebfdabfbdbb49f4ce258998fce88210beada2f8.tar.bz2
upstream-2ebfdabfbdbb49f4ce258998fce88210beada2f8.zip
bcm53xx: put kernel into TRX when building initramfs images
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. An exception are Buffalo devices which have recovery mode with support for booting kernels over TFTP. For them keep building default images. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/bcm53xx')
-rw-r--r--target/linux/bcm53xx/image/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index 660981ea1e..d5dfe22c1d 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -49,6 +49,15 @@ define Build/buffalo-wzr-header
mv $@.new $@
endef
+# TRX with only one (kernel) partition
+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 +120,8 @@ 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_SUFFIX := .trx
+ KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma-d16 | trx
FILESYSTEMS := squashfs
KERNEL_NAME := zImage
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
@@ -149,19 +160,32 @@ define Device/asus-rt-n18u
endef
TARGET_DEVICES += asus-rt-n18u
+# Buffalo devices have TFTP recovery mode which can work nicely with initramfs
+# kernels.
+# We should have two initramfs images for Buffalo: plain initramfs kernel and
+# TRX with initramfs kernel. It's not possible right now so let's just build
+# plain initramfs kernel as it may be more useful.
+define Device/buffalo/Default
+ KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
+ KERNEL_INITRAMFS = $$(KERNEL)
+endef
+
define Device/buffalo-wxr-1900dhp
+ $(call Device/buffalo/Default)
DEVICE_TITLE := Buffalo WXR-1900DHP
DEVICE_PACKAGES := $(USB3_PACKAGES)
endef
TARGET_DEVICES += buffalo-wxr-1900dhp
define Device/buffalo-wzr-600dhp2
+ $(call Device/buffalo/Default)
DEVICE_TITLE := Buffalo WZR-600DHP2
DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES)
endef
TARGET_DEVICES += buffalo-wzr-600dhp2
define Device/buffalo-wzr-900dhp
+ $(call Device/buffalo/Default)
DEVICE_TITLE := Buffalo WZR-900DHP
DEVICE_PACKAGES := kmod-b43 $(USB3_PACKAGES)
BUFFALO_TAG_PLATFORM := bcm
@@ -182,6 +206,7 @@ endef
TARGET_DEVICES += buffalo-wzr-900dhp
define Device/buffalo-wzr-1750dhp
+ $(call Device/buffalo/Default)
DEVICE_TITLE := Buffalo WZR-1750DHP
DEVICE_PACKAGES := kmod-b43 $(USB3_PACKAGES)
endef