summaryrefslogtreecommitdiff
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-06 10:11:29 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-06 10:12:37 +0200
commit201dbb9fe8f61572d66f02942c4482af9b4f2f0c (patch)
tree95f7422d381f2bad20fe2239fa585f025536b027 /target/linux/ramips
parentad430c1080fa2096d02b054115bd806af4906aea (diff)
downloadmtk-20170518-201dbb9fe8f61572d66f02942c4482af9b4f2f0c.zip
mtk-20170518-201dbb9fe8f61572d66f02942c4482af9b4f2f0c.tar.gz
mtk-20170518-201dbb9fe8f61572d66f02942c4482af9b4f2f0c.tar.bz2
ramips: fix build error in ubnt-erx initramfs factory image
Build initramfs kernel image, but skip factory image if initramfs size is too big. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/image/Makefile2
-rw-r--r--target/linux/ramips/image/mt7621.mk7
2 files changed, 5 insertions, 4 deletions
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 52dde67..0a92765 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -22,7 +22,7 @@ define Image/Build/Initramfs
$(call Image/Build/Profile/$(PROFILE),initramfs)
endef
-DEVICE_VARS += DTS IMAGE_SIZE
+DEVICE_VARS += DTS IMAGE_SIZE KERNEL_SIZE
loadaddr-y := 0x80000000
loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 3175244..2795eb1 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -12,7 +12,7 @@ define Build/seama-seal
endef
define Build/ubnt-erx-factory-image
- if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) ]; then \
+ if [ -e $(KDIR)/tmp/$(KERNEL_INITRAMFS_IMAGE) -a "$$(stat -c%s $@)" -lt "$(KERNEL_SIZE)" ]; then \
echo '21001:6' > $(1).compat; \
$(TAR) -cf $(1) --transform='s/^.*/compat/' $(1).compat; \
\
@@ -30,6 +30,8 @@ define Build/ubnt-erx-factory-image
$(TAR) -rf $(1) --transform='s/^.*/version.tmp/' $(1).version; \
\
$(CP) $(1) $(BIN_DIR)/; \
+ else \
+ echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
fi
endef
@@ -155,8 +157,7 @@ define Device/ubnt-erx
KERNEL_SIZE := 3145728
KERNEL := $(KERNEL_DTB) | uImage lzma
IMAGES := sysupgrade.tar
- KERNEL_INITRAMFS := $$(KERNEL) | check-size $$(KERNEL_SIZE) | \
- ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
+ KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
IMAGE/sysupgrade.tar := sysupgrade-nand
DEVICE_TITLE := Ubiquiti EdgeRouter X
DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo