common.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. define Build/imx-combined-image-prepare
  2. rm -rf [email protected]
  3. mkdir -p [email protected]
  4. endef
  5. define Build/imx-combined-image-clean
  6. rm -rf [email protected] [email protected]
  7. endef
  8. define Build/imx-combined-image
  9. $(CP) $(IMAGE_KERNEL) [email protected]/uImage
  10. $(foreach dts,$(DEVICE_DTS), \
  11. $(CP) \
  12. $(DTS_DIR)/$(dts).dtb \
  13. [email protected]/;
  14. )
  15. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  16. -n '$(DEVICE_ID) OpenWrt bootscript' \
  17. -d bootscript-$(DEVICE_NAME) \
  18. [email protected]/boot.scr
  19. cp $@ [email protected]
  20. $(SCRIPT_DIR)/gen_image_generic.sh $@ \
  21. $(CONFIG_TARGET_KERNEL_PARTSIZE) \
  22. [email protected] \
  23. $(CONFIG_TARGET_ROOTFS_PARTSIZE) \
  24. [email protected] \
  25. 1024
  26. endef
  27. define Build/imx-sdcard
  28. $(Build/imx-combined-image-prepare)
  29. if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img ]; then \
  30. $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img \
  31. [email protected]/u-boot.img; \
  32. fi
  33. if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img ]; then \
  34. $(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img \
  35. [email protected]/u-boot-dtb.img; \
  36. fi
  37. $(Build/imx-combined-image)
  38. dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
  39. $(Build/imx-combined-image-clean)
  40. endef
  41. define Build/imx-sdcard-raw-uboot
  42. $(Build/imx-combined-image-prepare)
  43. $(Build/imx-combined-image)
  44. dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
  45. dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img of=$@ bs=1024 seek=69 conv=notrunc
  46. $(Build/imx-combined-image-clean)
  47. endef