Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. SIGNATURE:=$(shell printf "%.8s" $(SOURCE_DATE_EPOCH))
  10. define Build/tegra-sdcard
  11. rm -fR [email protected]
  12. mkdir -p [email protected]
  13. $(CP) $(KDIR)/$(KERNEL_NAME) [email protected]
  14. $(if $(DEVICE_DTS),\
  15. $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb [email protected]), \
  16. $(CP) $(DTS_DIR)/*.dtb [email protected])
  17. sed \
  18. -e 's#@ROOT@#$(SIGNATURE)#g' \
  19. -e 's#@KERNEL@#$(KERNEL_NAME)#g' \
  20. $(BOOT_SCRIPT) > [email protected]
  21. mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
  22. -n '$(DEVICE_TITLE) OpenWrt bootscript' \
  23. -d [email protected] \
  24. [email protected]/boot.scr
  25. SIGNATURE="$(SIGNATURE)" \
  26. $(SCRIPT_DIR)/gen_image_generic.sh \
  27. $@ \
  28. $(CONFIG_TARGET_KERNEL_PARTSIZE) [email protected] \
  29. $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
  30. 2048
  31. $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
  32. endef
  33. DEVICE_VARS += BOOT_SCRIPT UBOOT
  34. define Device/Default
  35. BOOT_SCRIPT := generic-bootscript
  36. IMAGES := sdcard.img.gz
  37. IMAGE/sdcard.img.gz := tegra-sdcard | gzip | append-metadata
  38. KERNEL_NAME := zImage
  39. KERNEL := kernel-bin
  40. PROFILES := Default
  41. SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
  42. endef
  43. define Device/compulab_trimslice
  44. DEVICE_TITLE := CompuLab 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))