Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #
  2. # Copyright (C) 2017-2019 Tomasz Maciej Nowak <[email protected]>
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. define Build/tegra-sdcard
  10. rm -fR [email protected]
  11. mkdir -p [email protected]
  12. $(CP) $(KDIR)/$(KERNEL_NAME) [email protected]
  13. $(if $(DEVICE_DTS),\
  14. $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb [email protected]), \
  15. $(CP) $(DTS_DIR)/*.dtb [email protected])
  16. sed \
  17. -e 's#@ROOT@#$(IMG_PART_SIGNATURE)#g' \
  18. -e 's#@KERNEL@#$(KERNEL_NAME)#g' \
  19. $(BOOT_SCRIPT) > [email protected]
  20. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  21. -n '$(DEVICE_TITLE) OpenWrt bootscript' \
  22. -d [email protected] \
  23. [email protected]/boot.scr
  24. SIGNATURE="$(IMG_PART_SIGNATURE)" \
  25. $(SCRIPT_DIR)/gen_image_generic.sh \
  26. $@ \
  27. $(CONFIG_TARGET_KERNEL_PARTSIZE) [email protected] \
  28. $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
  29. 2048
  30. $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
  31. endef
  32. DEVICE_VARS += BOOT_SCRIPT UBOOT
  33. define Device/Default
  34. BOOT_SCRIPT := generic-bootscript
  35. IMAGES := sdcard.img.gz
  36. IMAGE/sdcard.img.gz := tegra-sdcard | gzip | append-metadata
  37. KERNEL_NAME := zImage
  38. KERNEL := kernel-bin
  39. PROFILES := Default
  40. SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  41. endef
  42. define Device/compulab_trimslice
  43. DEVICE_VENDOR := CompuLab
  44. DEVICE_MODEL := TrimSlice
  45. DEVICE_DTS := tegra20-trimslice
  46. DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
  47. kmod-usb-storage wpad-mini
  48. UBOOT := trimslice-mmc
  49. endef
  50. TARGET_DEVICES += compulab_trimslice
  51. $(eval $(call BuildImage))