Skip to content

Instantly share code, notes, and snippets.

@mcprat
Created September 22, 2020 19:33
Show Gist options
  • Select an option

  • Save mcprat/c4fe9295a0c7dfc8a33ceb25e54e3610 to your computer and use it in GitHub Desktop.

Select an option

Save mcprat/c4fe9295a0c7dfc8a33ceb25e54e3610 to your computer and use it in GitHub Desktop.
edimax headers fix - using target $@ substitution
commit f3d01d3621f0800d343e42562e6e88b512c9a482
Author: Michael Pratt <mpratt51@gmail.com>
Date: Tue Sep 22 15:25:42 2020 -0400
I like cats
Signed-off-by: Michael Pratt <mpratt51@gmail.com>
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index fbc00b98c8..80d369ae04 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -50,6 +50,13 @@ define Build/cybertan-trx
-rm $@-empty.bin
endef
+define Build/belkin_f9j1108-v2-factory
+ cat $@.uImage > $@.new
+ cat $@.rootfs >> $@.new
+ mv $@.new $@
+ rm -rf $@.*
+endef
+
define Build/edimax-headers
$(eval device_name=$(word 1,$(1)))
$(eval edimax_magic=$(word 2,$(1)))
@@ -58,13 +65,13 @@ define Build/edimax-headers
$(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\
-v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \
-n "uImage" \
- -i "$(KDIR)/loader-$(device_name).uImage" \
- -o $(IMAGE_KERNEL);
+ -i $(KDIR)/loader-$(device_name).uImage \
+ -o $@.uImage;
$(STAGING_DIR_HOST)/bin/edimax_fw_header -M $(edimax_magic) -m $(edimax_model)\
-v $(VERSION_DIST)$(firstword $(subst +, , $(firstword $(subst -, ,$(REVISION))))) \
-n "rootfs" \
- -i "$(KDIR_TMP)/openwrt-ath79-generic-$(device_name)-squashfs-sysupgrade.bin" \
- -o $(IMAGE_ROOTFS);
+ -i $@ \
+ -o $@.rootfs;
endef
# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
@@ -345,7 +352,8 @@ define Device/belkin_f9j1108-v2
uImage lzma
KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
IMAGES += factory.bin
- IMAGE/factory.bin := edimax-headers $(1) F9J1108v1 BR-6679BAC | append-kernel | append-rootfs | check-size
+ IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
+ check-size | edimax-headers $(1) F9J1108v1 BR-6679BAC | belkin_f9j1108-v2-factory
endef
TARGET_DEVICES += belkin_f9j1108-v2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment