Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #
  2. # Copyright (C) 2013-2016 OpenWrt.org
  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. UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
  10. DEVICE_VARS += DTS UBIFS_OPTS
  11. KERNEL_LOADADDR := 0x60008000
  12. define Build/ubootable
  13. (dd if="$(KDIR)/u-boot.bin" bs=128k conv=sync; \
  14. dd if="$@" bs=128k conv=sync ) >> $@.new
  15. @mv "$@.new" "$@"
  16. endef
  17. define Device/Default
  18. KERNEL_DEPENDS = $$(wildcard $$(DTS_DIR)/ox820-$$(DTS).dts)
  19. KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb
  20. KERNEL_NAME := zImage
  21. KERNEL_SUFFIX := -uImage
  22. KERNEL_INSTALL := 1
  23. KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb | ubootable
  24. KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-u-boot-initramfs
  25. KERNEL_INITRAMFS_SUFFIX := .bin
  26. BLOCKSIZE := 128k
  27. PAGESIZE := 2048
  28. SUBPAGESIZE := 512
  29. FILESYSTEMS := squashfs ubifs
  30. PROFILES = Default $$(DTS)
  31. IMAGES := ubinized.bin sysupgrade.tar
  32. IMAGE/ubinized.bin := append-ubi
  33. IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata
  34. KERNEL_IN_UBI := 1
  35. UBOOTENV_IN_UBI := 1
  36. endef
  37. define Device/akitio
  38. DTS := akitio
  39. DEVICE_TITLE := Akitio MyCloud mini / Silverstone DC01
  40. DEVICE_PACKAGES := kmod-i2c-gpio kmod-rtc-ds1307
  41. endef
  42. TARGET_DEVICES += akitio
  43. define Build/omninas-factory
  44. rm -rf $@.tmp $@.dummy $@.dummy.gz
  45. mkdir -p $@.tmp
  46. $(CP) $@ $@.tmp/uImage
  47. dd if=/dev/zero bs=64k count=4 of=$@.dummy
  48. gzip $@.dummy
  49. mkimage -A arm -T ramdisk -C gzip -n "dummy" \
  50. -d $@.dummy.gz \
  51. $@.tmp/rdimg.gz
  52. echo 2.35.20140102 > $@.tmp/version ; echo >> $@.tmp/version
  53. chmod 0744 $@.tmp/*
  54. $(TAR) -C $@.tmp -czvf $@ \
  55. $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") .
  56. endef
  57. define Build/encrypt-3des
  58. openssl enc -des3 -a -k $(1) -in $@ -out $@.new && mv $@.new $@
  59. endef
  60. define Device/kd20
  61. DEVICE_DTS := ox820-kd20
  62. DEVICE_TITLE := Shuttle KD20
  63. KERNEL := kernel-bin | append-dtb | uImage none
  64. KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory
  65. KERNEL_INITRAMFS_SUFFIX := .tar.gz
  66. KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | encrypt-3des sohmuntitnlaes
  67. KERNEL_IMAGE := zImage
  68. DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
  69. kmod-hwmon-core kmod-hwmon-gpiofan \
  70. kmod-md-mod kmod-md-raid0 kmod-md-raid1 kmod-fs-ext4 kmod-fs-xfs
  71. KERNEL_IN_UBI :=
  72. UBOOTENV_IN_UBI :=
  73. endef
  74. TARGET_DEVICES += kd20
  75. define Device/pogoplug-pro
  76. DTS := pogoplug-pro
  77. DEVICE_TITLE := Cloud Engines Pogoplug Pro (with mPCIe)
  78. endef
  79. TARGET_DEVICES += pogoplug-pro
  80. define Device/pogoplug-v3
  81. DTS := pogoplug-v3
  82. DEVICE_TITLE := Cloud Engines Pogoplug V3 (no mPCIe)
  83. endef
  84. TARGET_DEVICES += pogoplug-v3
  85. define Device/stg212
  86. DTS := stg212
  87. DEVICE_TITLE := MitraStar STG-212
  88. endef
  89. TARGET_DEVICES += stg212
  90. VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
  91. UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
  92. $(eval $(call BuildImage))