fbff1cf6e8749899eb1a9d9935de991c3af094f0
[openwrt/staging/jow.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 sed -e 's#@KERNEL@#$(KERNEL_NAME)#g' $(BOOT_SCRIPT) > $@-boot.scr
18 mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
19 -n '$(DEVICE_TITLE) OpenWrt bootscript' \
20 -d $@-boot.scr \
21 $@.boot/boot.scr
22
23 SIGNATURE="$(IMG_PART_SIGNATURE)" \
24 $(SCRIPT_DIR)/gen_image_generic.sh \
25 $@ \
26 $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
27 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
28 2048
29
30 $(if $(UBOOT),dd if=$(STAGING_DIR_IMAGE)/$(UBOOT).img of=$@ bs=512 skip=1 seek=1 conv=notrunc)
31 endef
32
33 DEVICE_VARS += BOOT_SCRIPT UBOOT
34
35 define Device/Default
36 BOOT_SCRIPT := generic-bootscript
37 IMAGES := sdcard.img.gz
38 IMAGE/sdcard.img.gz := tegra-sdcard | gzip | append-metadata
39 KERNEL_NAME := zImage
40 KERNEL := kernel-bin
41 PROFILES := Default
42 SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
43 endef
44
45 define Device/compulab_trimslice
46 DEVICE_VENDOR := CompuLab
47 DEVICE_MODEL := TrimSlice
48 DEVICE_DTS := tegra20-trimslice
49 DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
50 kmod-usb-storage wpad-basic-wolfssl
51 UBOOT := trimslice-mmc
52 endef
53 TARGET_DEVICES += compulab_trimslice
54
55 $(eval $(call BuildImage))