X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fchunkeey.git;a=blobdiff_plain;f=include%2Fimage-commands.mk;h=9ec3a84884ba4b6266ee04e96f310ebd9a4bcce8;hp=c513f19d3a1244ae2d6cd692b0f2545b393bda1c;hb=138c76332b7e39b3c4e3018e7792e74645ab0c7a;hpb=1d49b534f5b74676f30f2ee1ba78d9e02d59f0bc diff --git a/include/image-commands.mk b/include/image-commands.mk index c513f19d3a..9ec3a84884 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -7,7 +7,7 @@ define Build/uImage mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new + -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' -d $@ $@.new mv $@.new $@ endef @@ -44,31 +44,46 @@ define Build/buffalo-dhp-image mv $@.new $@ endef +define Build/eva-image + $(STAGING_DIR_HOST)/bin/lzma2eva $(KERNEL_LOADADDR) $(KERNEL_LOADADDR) $@ $@.new + mv $@.new $@ +endef + define Build/netgear-chk $(STAGING_DIR_HOST)/bin/mkchkimg \ -o $@.new \ -k $@ \ -b $(NETGEAR_BOARD_ID) \ - -r $(NETGEAR_REGION) + $(if $(NETGEAR_REGION),-r $(NETGEAR_REGION),) mv $@.new $@ endef define Build/netgear-dni $(STAGING_DIR_HOST)/bin/mkdniimg \ - -B $(NETGEAR_BOARD_ID) -v LEDE.$(REVISION) \ + -B $(NETGEAR_BOARD_ID) -v $(VERSION_DIST).$(REVISION) \ $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \ -r "$(1)" \ -i $@ -o $@.new mv $@.new $@ endef +define Build/append-squashfs-fakeroot-be + rm -rf $@.fakefs $@.fakesquashfs + mkdir $@.fakefs + $(STAGING_DIR_HOST)/bin/mksquashfs-lzma \ + $@.fakefs $@.fakesquashfs \ + -noappend -root-owned -be -nopad -b 65536 \ + $(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH)) + cat $@.fakesquashfs >> $@ +endef + # append a fake/empty rootfs uImage header, to fool the bootloaders # rootfs integrity check define Build/append-uImage-fakeroot-hdr rm -f $@.fakeroot $(STAGING_DIR_HOST)/bin/mkimage \ -A $(LINUX_KARCH) -O linux -T filesystem -C none \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE fakeroot' \ + -n '$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) fakeroot' \ -s \ $@.fakeroot cat $@.fakeroot >> $@ @@ -76,7 +91,7 @@ endef define Build/tplink-safeloader -$(STAGING_DIR_HOST)/bin/tplink-safeloader \ - -B $(TPLINK_BOARD_NAME) \ + -B $(TPLINK_BOARD_ID) \ -V $(REVISION) \ -k $(IMAGE_KERNEL) \ -r $@ \ @@ -87,8 +102,7 @@ define Build/tplink-safeloader endef define Build/append-dtb - $(call Image/BuildDTB,$(if $(DEVICE_DTS_DIR),$(DEVICE_DTS_DIR),$(DTS_DIR))/$(DEVICE_DTS).dts,$@.dtb) - cat $@.dtb >> $@ + cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@ endef define Build/install-dtb @@ -119,7 +133,7 @@ define Build/lzma-no-dict endef define Build/gzip - gzip -9n -c $@ $(1) > $@.new + gzip --force -9n -c $@ $(1) > $@.new @mv $@.new $@ endef @@ -210,6 +224,19 @@ define Build/combined-image @mv $@.new $@ endef +define Build/openmesh-image + $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \ + "$@-fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \ + "$(call param_get_default,rootfs,$(1),$@)" + $(TOPDIR)/scripts/combined-ext-image.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \ + "$@-fwupgrade.cfg" "fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \ + "$(call param_get_default,rootfs,$(1),$@)" "rootfs" +endef + define Build/sysupgrade-tar sh $(TOPDIR)/scripts/sysupgrade-tar.sh \ --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \ @@ -218,6 +245,35 @@ define Build/sysupgrade-tar $@ endef +define Build/tplink-v1-header + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \ + -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V $(REVISION) \ + -k $@ -o $@.new $(1) + @mv $@.new $@ +endef + +define Build/tplink-v2-header + $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ + -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \ + -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" \ + -k $@ -o $@.new $(1) + @mv $@.new $@ +endef + +define Build/tplink-v2-image + $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \ + -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1) + cat $@.new >> $@ + rm -rf $@.new +endef + json_quote=$(subst ','\'',$(subst ",\",$(1))) #")') metadata_devices=$(if $(1),$(subst "$(space)","$(comma)",$(strip $(foreach v,$(1),"$(call json_quote,$(v))")))) @@ -233,7 +289,7 @@ metadata_json = \ }' define Build/append-metadata - $(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) endef define Build/kernel2minor