- # Strip out the length, CFE doesn't like this
- dd if=$(KDIR)/vmlinux$(1).lzma.tmp of=$(KDIR)/vmlinux$(1).lzma.cfe bs=5 count=1
- dd if=$(KDIR)/vmlinux$(1).lzma.tmp of=$(KDIR)/vmlinux$(1).lzma.cfe ibs=13 obs=5 skip=1 seek=1 conv=notrunc
- rm -f $(KDIR)/vmlinux$(1).lzma.tmp
-endef
-
-define Image/PrepareCFELzmaKernelDTB
- # compile the dts (the dtb will be later reused for the lzma loader)
- $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(DTS_DIR)/$(1).dtb ../dts/$(1).dts
- cat $(KDIR)/vmlinux $(DTS_DIR)/$(1).dtb > $(KDIR)/vmlinux-$(1)
- $(call Image/PrepareCFELzmaKernel,-$(1))
-endef
-
-define Image/Prepare
- $(call Image/PrepareCFELzmaKernel,)
-
- $(foreach board,$(sort $(TARGET_$(PROFILE)_DTBS)), $(call Image/PrepareCFELzmaKernelDTB,$(board)))
-
- ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
- $(call Image/PrepareLoader,-initramfs,$(BIN_DIR),loader.elf)
- $(foreach board,$(sort $(TARGET_$(PROFILE)_DTBS)), \
- $(call Image/PrepareLoaderDTB,-initramfs,$(board),$(BIN_DIR),loader.elf))
- ifneq (,$(findstring cvg834g,$(TARGET_$(PROFILE)_DTBS)))
- $(call Image/PrepareLoaderDTB,-initramfs,cvg834g,$(KDIR),loader.bin)
- endif
- endif
-endef
-
-define Image/Build/Initramfs
- # Netgear CVG834G
- ifneq (,$(findstring cvg834g,$(TARGET_$(PROFILE)_DTBS)))
- $(call Image/Build/HCSDTB,initramfs,cvg834g,cvg834g,a020,0001,0022,$(IMG_PREFIX)-loader-initramfs-cvg834g.bin)
- endif
-endef
-
-# $(1) = Image build
-# $(2) = Profile
-# $(3) = imagename
-# $(4) = dtb
-# $(5) = boardname
-# $(6) = chipid
-# $(7) = additional options
-define ImageDTB
- define Image/Build/$(3)
- $$(call Image/Build/$(1),$$(1),$(3),$(4),$(5),$(6),$(7),$(8))