[LEDE-DEV] [PATCH 2/4] Add support for new device: tew827dru
John Crispin
john at phrozen.org
Thu Sep 8 03:14:03 PDT 2016
On 08/09/2016 11:35, J Mo wrote:
>
>>> diff --git a/include/image-commands.mk b/include/image-commands.mk
>>> index 40a9619..209caf4 100644
>>> --- a/include/image-commands.mk
>>> +++ b/include/image-commands.mk
>>> @@ -167,3 +167,48 @@ define Build/sysupgrade-tar
>>> --rootfs $(call
>>> param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \
>>> $@
>>> endef
>>> +
>>> +define Build/mkfit-TEW827DRU
>>> + $(TOPDIR)/scripts/its-maker.sh \
>>> + --device $(DEVICE_NAME) \
>>> + -O $@.its \
>>> + --img-name 0 script \
>>> + --img-descr 0 "u-boot-HTTP firmware update script" \
>>> + --img-file 0
>>> $(TOPDIR)/target/linux/ipq806x/image/tew827dru-flash.scr \
>>> + --img-type 0 script --img-arch 0 $(ARCH) \
>>> + --img-compression 0 none \
>>> + --img-hashes 0 crc32 \
>>> + --img-name 1 ubi-image \
>>> + --img-descr 1 "UBI rootfs image" \
>>> + --img-file 1 $@ \
>>> + --img-type 1 firmware \
>>> + --img-arch 1 $(ARCH) \
>>> + --img-compression 1 none \
>>> + --img-hashes 1 crc32 \
>>> + --img-name 2 bootconfig \
>>> + --img-descr 2 "BOOTCONFIG: boot from APPSBL and rootfs" \
>>> + --img-file 2
>>> $(TOPDIR)/target/linux/ipq806x/image/tew827dru-bootconfig.bin \
>>> + --img-type 2 firmware \
>>> + --img-arch 2 $(ARCH) \
>>> + --img-compression 2 none \
>>> + --img-hashes 2 crc32
>>> + PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.fit
>>> + @rm $@.its
>>> + @mv $@.fit $@
>>> +endef
>>> +
>>> +define Build/cameo-sig
>>> + { \
>>> + cameo_sig=$(word 1, $(1)) ;\
>>> + align=$(if $(2),$(2),64) ;\
>>> + oldsize=$$(stat -c %s $@) ;\
>>> + sigsize=$$(echo -n $$cameo_sig | wc -c) ;\
>>> + padsize=$$(( ( ( ( $$oldsize + $$sigsize ) / $$align ) + 1 )
>>> - ( ( $$oldsize + $$sigsize ) / $$align ) )) ;\
>>> + newsize=$$(( $$oldsize + $$padsize )) ;\
>>> + echo "Appending Cameo signature: \"$$cameo_sig\",
>>> oldsize=$$oldsize align=$$align sigsize=$$sigsize padsize=$$padsize
>>> newsize=$$newsize" ;\
>>> + dd if=$@ of=$@.new bs=$$newsize count=1 conv=sync ;\
>>> + echo -n "$$cameo_sig" >> $@.new ; \
>>> + }
>>> + @mv $@.new $@
>>> +endef
>>> +
>> there is no reason for this to be in the generic code. please add it to
>> the target code.
>
> The cameo signature code is generic and something similar is already
> used in many of the legacy makefiles for other devices. It should
> probably stay there, unless you insist. This will get re-used by other
> targets if LEDE migrates those devices away from the legacy makefiles.
> Do you still want it moved?
the cameo stuff can stay in generic i guess as long as the other chunk
goes into the target subfolder
> As for mkfit-TEW827DRU, there was a reason I had it in there, but I
> guess it's not relevant anymore. The way include/image.mk forces target
> makefiles to use simple variables (:=) was causing my builds to fail:
>
> include/image.mk
>
> define Device/ExportVar
> $(1) : $(2):=$$($(2))
>
> endef
> define Device/Export
> $(foreach var,$(DEVICE_VARS) $(DEFAULT_DEVICE_VARS),$(call
> Device/ExportVar,$(1),$(var)))
> $(1) : FILESYSTEM:=$(2)
> endef
>
>
>
> I just tested a new build and it looks like it built correctly. I guess
> I fixed it and forgot. I will move that into the target makefile.
>
>
>
>
>>> diff --git a/package/boot/uboot-envtools/files/ipq
>>> b/package/boot/uboot-envtools/files/ipq
>>> index 8cf0ddb..f66aabc 100755
>>> --- a/package/boot/uboot-envtools/files/ipq
>>> +++ b/package/boot/uboot-envtools/files/ipq
>>> @@ -18,6 +18,9 @@ case "$board" in
>>> "ea8500")
>>> ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000"
>>> ;;
>>> +"tew827dru")
>>> + ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x40000" "0x20000" "2"
>>> + ;;
>>> esac
>>> config_load ubootenv
>> this should go into its own "uboot-envtools" patch
>>
>
> Yes.
>
>
>
>>
>> trailing blank line
>>
>
> Yes.
>
>
>> at this point the build system thinks that the image is buildable but
>> the dts file has so far not been added. patch 3 needs to be reorder to
>> be prior to this patch.
>>
>>
>
> Yes I will move the DTS into this patch.
>
>
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
More information about the Lede-dev
mailing list