2008-09-07 13:28:07 +00:00
|
|
|
#
|
2011-08-04 19:41:16 +00:00
|
|
|
# Copyright (C) 2008-2011 OpenWrt.org
|
2008-07-21 17:08:14 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2015-08-05 13:55:52 +00:00
|
|
|
|
2008-07-21 17:08:14 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2015-01-10 15:27:00 +00:00
|
|
|
KERNEL_LOADADDR = 0x80060000
|
|
|
|
|
2020-03-09 12:14:06 +00:00
|
|
|
DEVICE_VARS += BOARDNAME CMDLINE CONSOLE LOADER_TYPE
|
2015-01-10 15:27:07 +00:00
|
|
|
|
2016-05-22 21:10:02 +00:00
|
|
|
ifeq ($(SUBTARGET),generic)
|
|
|
|
include ./generic.mk
|
2018-01-12 00:42:11 +00:00
|
|
|
include ./generic-legacy-devices.mk
|
|
|
|
include ./generic-tp-link.mk
|
|
|
|
include ./generic-ubnt.mk
|
2016-05-22 21:10:02 +00:00
|
|
|
endif
|
2018-01-12 15:36:13 +00:00
|
|
|
ifeq ($(SUBTARGET),tiny)
|
2018-07-12 04:29:43 +00:00
|
|
|
include ./tiny.mk
|
2018-01-12 15:36:13 +00:00
|
|
|
include ./tiny-tp-link.mk
|
|
|
|
include ./tiny-legacy-devices.mk
|
2018-10-17 15:16:51 +00:00
|
|
|
include ./tiny-senao.mk
|
2018-01-12 15:36:13 +00:00
|
|
|
endif
|
2016-05-22 21:10:54 +00:00
|
|
|
ifeq ($(SUBTARGET),nand)
|
|
|
|
include ./nand.mk
|
|
|
|
endif
|
2017-01-08 13:27:38 +00:00
|
|
|
ifeq ($(SUBTARGET),mikrotik)
|
|
|
|
include ./mikrotik.mk
|
|
|
|
endif
|
2016-05-22 21:04:50 +00:00
|
|
|
include ./legacy.mk
|
2016-05-22 20:57:32 +00:00
|
|
|
|
2015-05-11 09:08:33 +00:00
|
|
|
define Build/loader-common
|
|
|
|
rm -rf $@.src
|
|
|
|
$(MAKE) -C lzma-loader \
|
|
|
|
PKG_BUILD_DIR="$@.src" \
|
|
|
|
TARGET_DIR="$(dir $@)" LOADER_NAME="$(notdir $@)" \
|
2016-03-23 12:52:47 +00:00
|
|
|
BOARD="$(BOARDNAME)" \
|
2015-05-11 09:08:33 +00:00
|
|
|
LZMA_TEXT_START=0x80a00000 LOADADDR=0x80060000 \
|
2016-03-23 12:52:44 +00:00
|
|
|
$(1) compile loader.$(LOADER_TYPE)
|
|
|
|
mv "$@.$(LOADER_TYPE)" "$@"
|
2015-05-11 09:08:33 +00:00
|
|
|
rm -rf $@.src
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/loader-kernel
|
|
|
|
$(call Build/loader-common,LOADER_DATA="$@")
|
|
|
|
endef
|
|
|
|
|
2016-03-23 12:52:47 +00:00
|
|
|
define Build/loader-kernel-cmdline
|
|
|
|
$(call Build/loader-common,LOADER_DATA="$@" KERNEL_CMDLINE="$(CMDLINE)")
|
|
|
|
endef
|
|
|
|
|
2015-01-10 15:27:00 +00:00
|
|
|
define Device/Default
|
|
|
|
BOARDNAME :=
|
|
|
|
DEVICE_PROFILE = $$(BOARDNAME)
|
|
|
|
PROFILES = Default Minimal $$(DEVICE_PROFILE)
|
|
|
|
MTDPARTS :=
|
|
|
|
BLOCKSIZE := 64k
|
2017-06-08 13:18:34 +00:00
|
|
|
CONSOLE := ttyS0,115200
|
2015-01-10 18:48:14 +00:00
|
|
|
CMDLINE = $$(if $$(BOARDNAME),board=$$(BOARDNAME)) $$(if $$(MTDPARTS),mtdparts=$$(MTDPARTS)) $$(if $$(CONSOLE),console=$$(CONSOLE))
|
2015-01-10 15:27:00 +00:00
|
|
|
KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
|
2015-05-11 09:08:33 +00:00
|
|
|
COMPILE :=
|
2015-01-10 15:27:00 +00:00
|
|
|
IMAGES := sysupgrade.bin
|
2016-09-11 17:05:20 +00:00
|
|
|
IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
|
2015-01-10 15:27:00 +00:00
|
|
|
endef
|
|
|
|
|
2008-07-21 17:08:14 +00:00
|
|
|
$(eval $(call BuildImage))
|