2013-05-29 01:27:29 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2013 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2015-11-18 21:35:24 +00:00
|
|
|
#################################################
|
|
|
|
# Images
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
# build a ubi for a specific flash geometry/layout which can contain
|
|
|
|
# volumes with the following data from ubinize-$(DEVICE_NAME).cfg:
|
|
|
|
# - 'boot.ubifs' volume: kernel+dtbs+bootscript
|
|
|
|
# - 'root.squashfs' volume: rootfs
|
|
|
|
# $(1): name (used for suffix)
|
|
|
|
# $(2): PAGESIZE (-m param to mkfs.ubifs/ubinize)
|
|
|
|
# $(3): ERASESIZE (logical eraseblock size: -e param to mkfs.ubifs)
|
|
|
|
# $(4): BLOCKSIZE (-p param to ubinize)
|
|
|
|
# $(5): MAXSIZE (maximum file-system size in LEB's -c param to mkfs.ubifs)
|
|
|
|
#
|
|
|
|
define Build/ubi-boot-overlay
|
|
|
|
# ubi-boot-overlay $(DEVICE_NAME) $(word 1, $(1))
|
|
|
|
|
|
|
|
# boot filesystem
|
|
|
|
rm -rf $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))
|
|
|
|
mkdir -p $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))
|
|
|
|
$(CP) $< $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(IMG_PREFIX)-uImage
|
|
|
|
ln -sf $(IMG_PREFIX)-uImage \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/uImage
|
|
|
|
$(foreach dts,$(shell echo $(DEVICE_DTS)), \
|
|
|
|
$(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-$(dts).dtb; \
|
|
|
|
$(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(IMG_PREFIX)-$(dts).dtb; \
|
|
|
|
ln -sf $(IMG_PREFIX)-$(dts).dtb \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/$(dts).dtb; \
|
2013-11-18 22:23:42 +00:00
|
|
|
)
|
2015-11-18 21:35:24 +00:00
|
|
|
mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
|
2016-03-24 21:40:13 +00:00
|
|
|
-n '$(DEVICE_ID) LEDE bootscript' \
|
2015-11-18 21:35:24 +00:00
|
|
|
-d ./bootscript-$(DEVICE_NAME) \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))/6x_bootscript-$(DEVICE_NAME)
|
|
|
|
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
|
|
|
|
--space-fixup --force-compr=zlib --squash-uids \
|
|
|
|
-m $(word 2, $(1)) -e $(word 3, $(1)) -c $(word 5, $(1)) \
|
|
|
|
-o $(KDIR)/boot-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs \
|
|
|
|
-d $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)_$(word 1, $(1))
|
|
|
|
$(CP) $(KDIR)/boot-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs
|
|
|
|
|
|
|
|
# ubi
|
|
|
|
rm -rf p $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))
|
|
|
|
mkdir -p $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))
|
|
|
|
$(CP) $(word 2, $^) \
|
|
|
|
$(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/
|
|
|
|
$(CP) $(KDIR)/boot-$(DEVICE_NAME)-bootfs_$(word 1, $(1)).ubifs \
|
|
|
|
$(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/boot.ubifs
|
|
|
|
$(CP) ./ubinize-$(DEVICE_NAME).cfg \
|
|
|
|
$(KDIR)/$(DEVICE_NAME)_$(word 1, $(1))/ubinize.cfg
|
|
|
|
( cd $(KDIR)/$(DEVICE_NAME)_$(word 1, $(1)); \
|
|
|
|
$(STAGING_DIR_HOST)/bin/ubinize \
|
|
|
|
-m $(word 2, $(1)) -p $(word 4, $(1)) -s $(word 2, $(1)) \
|
|
|
|
-o $@ \
|
|
|
|
ubinize.cfg \
|
2013-11-18 22:23:42 +00:00
|
|
|
)
|
2013-05-29 01:27:29 +00:00
|
|
|
endef
|
|
|
|
|
2016-04-19 13:46:33 +00:00
|
|
|
define Build/bootfs.tar.gz
|
|
|
|
# boot filesystem
|
|
|
|
rm -rf $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)
|
|
|
|
mkdir -p $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)
|
|
|
|
$(CP) $< $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)/$(IMG_PREFIX)-uImage
|
|
|
|
ln -sf $(IMG_PREFIX)-uImage \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)/uImage
|
|
|
|
$(foreach dts,$(shell echo $(DEVICE_DTS)), \
|
|
|
|
$(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-$(dts).dtb; \
|
|
|
|
$(CP) $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(dts).dtb \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)/$(IMG_PREFIX)-$(dts).dtb; \
|
|
|
|
ln -sf $(IMG_PREFIX)-$(dts).dtb \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)/$(dts).dtb; \
|
|
|
|
)
|
|
|
|
mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
|
|
|
|
-n '$(DEVICE_ID) OpenWrt bootscript' \
|
|
|
|
-d ./bootscript-$(DEVICE_NAME) \
|
|
|
|
$(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME)/6x_bootscript-$(DEVICE_NAME)
|
|
|
|
|
|
|
|
# tar and zip
|
|
|
|
( \
|
|
|
|
cd $(TARGET_ROOTFS_DIR)/boot-$(DEVICE_NAME); \
|
|
|
|
$(TAR) --numeric-owner --owner=0 --group=0 --transform "s,./,./boot/," \
|
|
|
|
-czvf $(BIN_DIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-bootfs.tar.gz . ; \
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2015-11-18 21:35:24 +00:00
|
|
|
#################################################
|
|
|
|
# Devices
|
|
|
|
#################################################
|
|
|
|
|
|
|
|
KERNEL_LOADADDR=0x10008000
|
|
|
|
|
|
|
|
define Device/Default
|
2016-07-02 17:12:09 +00:00
|
|
|
DEVICE_DTS :=
|
|
|
|
FILESYSTEMS := squashfs ext4
|
|
|
|
KERNEL_INSTALL := 1
|
|
|
|
KERNEL_SUFFIX := -uImage
|
|
|
|
KERNEL_NAME := zImage
|
|
|
|
KERNEL_PREFIX := $$(IMAGE_PREFIX)
|
|
|
|
KERNEL := kernel-bin | uImage none
|
|
|
|
IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
|
|
|
|
IMAGES :=
|
2013-10-18 00:02:45 +00:00
|
|
|
endef
|
|
|
|
|
2015-11-18 21:35:24 +00:00
|
|
|
DEVICE_VARS += DEVICE_DTS
|
|
|
|
|
|
|
|
define Device/ventana
|
2016-07-02 17:12:09 +00:00
|
|
|
PROFILES := Generic VENTANA
|
|
|
|
DEVICE_TITLE := Gateworks Ventana family
|
|
|
|
DEVICE_DTS:= \
|
|
|
|
imx6dl-gw51xx \
|
|
|
|
imx6dl-gw52xx \
|
|
|
|
imx6dl-gw53xx \
|
|
|
|
imx6dl-gw54xx \
|
|
|
|
imx6dl-gw551x \
|
|
|
|
imx6dl-gw552x \
|
|
|
|
imx6q-gw51xx \
|
|
|
|
imx6q-gw52xx \
|
|
|
|
imx6q-gw53xx \
|
|
|
|
imx6q-gw54xx \
|
|
|
|
imx6q-gw5400-a \
|
|
|
|
imx6q-gw551x \
|
|
|
|
imx6q-gw552x
|
|
|
|
DEVICE_PACKAGES := kmod-thermal-imx kmod-sky2 kmod-usb-chipidea-imx kmod-usb-mxs-phy \
|
|
|
|
kmod-sound-core kmod-sound-soc-imx kmod-sound-soc-imx-sgtl5000 \
|
|
|
|
kmod-can kmod-can-flexcan kmod-can-raw \
|
|
|
|
kmod-rtc-ds1672 kmod-gpio-pca953x kmod-hwmon-gsc kmod-eeprom-at24 \
|
|
|
|
kmod-leds-gpio kmod-pps-gpio kmod-gw16083 \
|
|
|
|
kobs-ng
|
|
|
|
IMAGES := nand_normal.ubi nand_large.ubi bootfs.tar.gz
|
|
|
|
IMAGE/nand_normal.ubi := ubi-boot-overlay normal 2048 124KiB 128KiB 8124
|
|
|
|
IMAGE/nand_large.ubi := ubi-boot-overlay large 4096 248KiB 256KiB 8124
|
|
|
|
IMAGE/bootfs.tar.gz := bootfs.tar.gz
|
|
|
|
IMAGE_NAME := $$(IMAGE_PREFIX)-$$(1)-$$(2)
|
2013-11-18 22:23:40 +00:00
|
|
|
endef
|
2013-10-18 00:02:45 +00:00
|
|
|
|
2015-11-18 21:35:24 +00:00
|
|
|
define Device/wandboard
|
2016-07-02 17:12:09 +00:00
|
|
|
PROFILES := Generic IMX6DL_WANDBOARD
|
|
|
|
DEVICE_TITLE := Wandboard Dual
|
|
|
|
DEVICE_DTS := imx6dl-wandboard
|
|
|
|
DEVICE_PACKAGES := kmod-thermal-imx kmod-usb-chipidea-imx kmod-usb-mxs-phy
|
2013-10-18 00:02:45 +00:00
|
|
|
endef
|
|
|
|
|
2015-11-18 21:35:24 +00:00
|
|
|
TARGET_DEVICES += \
|
|
|
|
ventana \
|
|
|
|
wandboard
|
2013-05-29 01:27:29 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|