oxnas: install kernel binaries into bin/ for use with external storage
[lede-git/.git] / target / linux / oxnas / image / Makefile
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
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/image.mk
10
11 UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
12
13 DEVICE_VARS += DTS KERNEL_SIZE PAGESIZE BLOCKSIZE SUBPAGESIZE
14 DEVICE_VARS += KERNEL_IN_UBI UBOOTENV_IN_UBI UBIFS_OPTS
15
16 KERNEL_LOADADDR := 0x60008000
17
18 define Build/ubootable
19         (dd if="$(KDIR)/u-boot.bin" bs=128k conv=sync; \
20          dd if="$@" bs=128k conv=sync ) >> $@.new
21         @mv "$@.new" "$@"
22 endef
23
24 define Device/Default
25   KERNEL_DEPENDS = $$(wildcard $$(DTS_DIR)/ox820-$$(DTS).dts)
26   KERNEL = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb
27   KERNEL_NAME := zImage
28   KERNEL_SUFFIX := -uImage
29   KERNEL_INSTALL := 1
30   KERNEL_INITRAMFS = kernel-bin | lzma | fit lzma $$(DTS_DIR)/ox820-$$(DTS).dtb | ubootable
31   KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-u-boot-initramfs
32   KERNEL_INITRAMFS_SUFFIX := .bin
33   BLOCKSIZE := 128KiB
34   PAGESIZE := 2048
35   SUBPAGESIZE := 512
36   FILESYSTEMS := squashfs ubifs
37   PROFILES = Default $$(DTS)
38   IMAGES := ubinized.bin sysupgrade.tar
39   IMAGE/ubinized.bin := append-ubi
40   IMAGE/sysupgrade.tar := sysupgrade-nand
41   KERNEL_IN_UBI := 1
42   UBOOTENV_IN_UBI := 1
43 endef
44
45 define Device/akitio
46   DTS := akitio
47   DEVICE_TITLE := Akitio MyCloud mini / Silverstone DC01
48   DEVICE_PACKAGES := kmod-i2c-gpio kmod-rtc-ds1307
49 endef
50 TARGET_DEVICES += akitio
51
52 define Device/kd20
53   DTS := kd20
54   DEVICE_TITLE := Shuttle KD20
55   DEVICE_PACKAGES := kmod-usb3 kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper \
56                      kmod-hwmon-core kmod-hwmon-gpiofan
57 endef
58 TARGET_DEVICES += kd20
59
60 define Device/pogoplug-pro
61   DTS := pogoplug-pro
62   DEVICE_TITLE := Cloud Engines Pogoplug Pro (with mPCIe)
63 endef
64 TARGET_DEVICES += pogoplug-pro
65
66 define Device/pogoplug-v3
67   DTS := pogoplug-v3
68   DEVICE_TITLE := Cloud Engines Pogoplug V3 (no mPCIe)
69 endef
70 TARGET_DEVICES += pogoplug-v3
71
72 define Device/stg212
73   DTS := stg212
74   DEVICE_TITLE := MitraStar STG-212
75 endef
76 TARGET_DEVICES += stg212
77
78 VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
79 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
80
81 $(eval $(call BuildImage))