Browse Source

apm821xx: fix IB image building

Change the image build code to generate the DTB files as part of the kernel
build phase in order to fix the image build in the ImageBuilder environment.

Signed-off-by: Jo-Philipp Wich <[email protected]>
Jo-Philipp Wich 9 years ago
parent
commit
4d9fc1bd44
1 changed files with 10 additions and 6 deletions
  1. 10 6
      target/linux/apm821xx/image/Makefile

+ 10 - 6
target/linux/apm821xx/image/Makefile

@@ -85,7 +85,7 @@ define Build/create-uImage-dtb
 	-$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \
 	-$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \
 		-O linux -T kernel -C none \
 		-O linux -T kernel -C none \
 		-n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' \
 		-n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' \
-		-d $@.dtb [email protected]
+		-d $(IMAGE_KERNEL).dtb [email protected]
 	@mv [email protected] $@
 	@mv [email protected] $@
 endef
 endef
 
 
@@ -152,9 +152,9 @@ define Device/WNDR4700
   IMAGE_SIZE:=25559040
   IMAGE_SIZE:=25559040
   IMAGES := factory.img sysupgrade.tar
   IMAGES := factory.img sysupgrade.tar
   KERNEL_SIZE := 1920k
   KERNEL_SIZE := 1920k
-  KERNEL := kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs
+  KERNEL := dtb | kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs
   KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
   KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
-  IMAGE/factory.img := dtb | create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
+  IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
 		       netgear-dni | check-size $$$$(IMAGE_SIZE)
 		       netgear-dni | check-size $$$$(IMAGE_SIZE)
   IMAGE/sysupgrade.tar := sysupgrade-tar
   IMAGE/sysupgrade.tar := sysupgrade-tar
   NETGEAR_BOARD_ID := WNDR4700
   NETGEAR_BOARD_ID := WNDR4700
@@ -178,7 +178,7 @@ define Build/boot-img
 	mkdir -p [email protected]/boot
 	mkdir -p [email protected]/boot
 
 
 	$(CP) [email protected] [email protected]/boot/boot.scr
 	$(CP) [email protected] [email protected]/boot/boot.scr
-	$(CP) $@.dtb [email protected]/boot/$(DEVICE_DTB)
+	$(CP) $(IMAGE_KERNEL).dtb [email protected]/boot/$(DEVICE_DTB)
 	$(CP) $(IMAGE_KERNEL) [email protected]/boot/uImage
 	$(CP) $(IMAGE_KERNEL) [email protected]/boot/uImage
 
 
 	genext2fs --block-size $(BLOCKSIZE) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root [email protected] [email protected]
 	genext2fs --block-size $(BLOCKSIZE) --size-in-blocks $$((1024 * $(BOOT_SIZE))) --root [email protected] [email protected]
@@ -211,6 +211,10 @@ define Build/recovery-tar
 		$@
 		$@
 endef
 endef
 
 
+define Build/export-dtb
+	cp $(IMAGE_KERNEL).dtb $@
+endef
+
 define Device/MyBookLiveDefault
 define Device/MyBookLiveDefault
   IMAGE_SIZE := 48m
   IMAGE_SIZE := 48m
   BLOCKSIZE := 1024
   BLOCKSIZE := 1024
@@ -220,8 +224,8 @@ define Device/MyBookLiveDefault
   IMAGES := rootfs.img recovery.tar kernel.dtb
   IMAGES := rootfs.img recovery.tar kernel.dtb
   DEVICE_DTB := apollo3g.dtb
   DEVICE_DTB := apollo3g.dtb
   FILESYSTEMS := ext4
   FILESYSTEMS := ext4
-  IMAGE/kernel.dtb := append-dtb
-  IMAGE/rootfs.img := boot-script | dtb | boot-img | hdd-img
+  IMAGE/kernel.dtb := export-dtb
+  IMAGE/rootfs.img := boot-script | boot-img | hdd-img
   IMAGE/recovery.tar := append-rootfs | gzip | uRamdisk | recovery-tar
   IMAGE/recovery.tar := append-rootfs | gzip | uRamdisk | recovery-tar
 endef
 endef