build: move Build/buffalo-trx to image-commands.mk
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Wed, 27 Mar 2024 11:38:04 +0000 (20:38 +0900)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 5 Jun 2024 19:14:16 +0000 (21:14 +0200)
Move Build/buffalo-trx to image-commands.mk from image/mt7622.mk to use
that definition from ramips as well.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
include/image-commands.mk
target/linux/mediatek/image/mt7622.mk

index c3c7a3c6dcb0e45c7a8dd848880e68212e5540a7..fed92a5793591d5d43d4323e4b7b6ea0cce6c8bf 100644 (file)
@@ -231,6 +231,27 @@ define Build/buffalo-tag-dhp
        mv $@.new $@
 endef
 
+define Build/buffalo-trx
+       $(eval magic=$(word 1,$(1)))
+       $(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@))
+       $(eval rtfs_bin=$(word 2,$(1)))
+       $(eval apnd_bin=$(word 3,$(1)))
+       $(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
+
+       $(if $(rtfs_bin),touch $(rtfs_bin))
+       $(STAGING_DIR_HOST)/bin/otrx create $@.new \
+               $(if $(magic),-M $(magic),) \
+               -f $(kern_bin) \
+               $(if $(rtfs_bin),\
+                       -a 0x20000 \
+                       -b $$(( $(call exp_units,$(kern_size)) )) \
+                       -f $(rtfs_bin),) \
+               $(if $(apnd_bin),\
+                       -A $(apnd_bin) \
+                       -a 0x20000)
+       mv $@.new $@
+endef
+
 define Build/check-size
        @imagesize="$$(stat -c%s $@)"; \
        limitsize="$$(($(call exp_units,$(if $(1),$(1),$(IMAGE_SIZE)))))"; \
index 441e29a1dc4e3eaaa33c049586c3570712fc00b1..f91720479ae726757d8c8f585aa4d47186bf281e 100644 (file)
@@ -8,27 +8,6 @@ define Image/Prepare
        echo -ne '\xde\xad\xc0\xde' > $(KDIR)/ubi_mark
 endef
 
-define Build/buffalo-trx
-       $(eval magic=$(word 1,$(1)))
-       $(eval kern_bin=$(if $(1),$(IMAGE_KERNEL),$@))
-       $(eval rtfs_bin=$(word 2,$(1)))
-       $(eval apnd_bin=$(word 3,$(1)))
-       $(eval kern_size=$(if $(KERNEL_SIZE),$(KERNEL_SIZE),0x400000))
-
-       $(if $(rtfs_bin),touch $(rtfs_bin))
-       $(STAGING_DIR_HOST)/bin/otrx create $@.new \
-               $(if $(magic),-M $(magic),) \
-               -f $(kern_bin) \
-               $(if $(rtfs_bin),\
-                       -a 0x20000 \
-                       -b $$(( $(call exp_units,$(kern_size)) )) \
-                       -f $(rtfs_bin),) \
-               $(if $(apnd_bin),\
-                       -A $(apnd_bin) \
-                       -a 0x20000)
-       mv $@.new $@
-endef
-
 define Build/bl2
        cat $(STAGING_DIR_IMAGE)/mt7622-$1-bl2.img >> $@
 endef