71a5fc581d83d901cfa35e07887e90b6ad6eef91
[openwrt/openwrt.git] / target / linux / tegra / image / Makefile
1 #
2 # Copyright (C) 2017-2019 Tomasz Maciej Nowak <tmn505@gmail.com>
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
10 define Build/tegra-sdcard
11 rm -fR $@.boot
12 mkdir -p $@.boot
13 $(CP) $(KDIR)/$(KERNEL_NAME) $@.boot
14 $(if $(DEVICE_DTS),\
15 $(foreach dtb,$(DEVICE_DTS),$(CP) $(DTS_DIR)/$(dtb).dtb $@.boot), \
16 $(CP) $(DTS_DIR)/*.dtb $@.boot)
17 mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
18 -n '$(DEVICE_TITLE) OpenWrt bootscript' \
19 -d $(BOOT_SCRIPT) \
20 $@.boot/boot.scr
21
22 SIGNATURE="$(IMG_PART_SIGNATURE)" \
23 $(SCRIPT_DIR)/gen_image_generic.sh \
24 $@ \
25 $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
26 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
27 2048
28
29 $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
30 endef
31
32 DEVICE_VARS += BOOT_SCRIPT UBOOT
33
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
44 define Device/compulab_trimslice
45 DEVICE_VENDOR := CompuLab
46 DEVICE_MODEL := TrimSlice
47 DEVICE_DTS := tegra20-trimslice
48 DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
49 kmod-usb-storage wpad-basic-wolfssl
50 UBOOT := trimslice-mmc
51 endef
52 TARGET_DEVICES += compulab_trimslice
53
54 $(eval $(call BuildImage))