1 DEVICE_VARS
+= LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV
7 # Arguments: <output name> <kernel offset>
8 define Build
/loader-okli
9 dd if
=$(KDIR
)/loader-
$(word 1,$(1)).
$(LOADER_TYPE
) bs
=$(word 2,$(1)) conv
=sync of
="$@.new"
14 define Build
/loader-okli-compile
15 $(call Build
/loader-common
,FLASH_OFFS
=$(LOADER_FLASH_OFFS
) FLASH_MAX
=0 KERNEL_CMDLINE
="$(CMDLINE)")
18 # combine kernel and rootfs into one image
19 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
20 # <type> is "sysupgrade" or "factory"
22 # -a align the rootfs start on an <align> bytes boundary
23 # -j add jffs2 end-of-filesystem markers
24 # -s strip padding from end of the image
25 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
26 define Build
/mktplinkfw
27 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
28 -H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -F
$(TPLINK_FLASHLAYOUT
) -N OpenWrt
-V
$(REVISION
) \
29 -m
$(TPLINK_HEADER_VERSION
) \
34 -a
$(call rootfs_align
,$(FILESYSTEM
)) \
35 $(wordlist
2,$(words $(1)),$(1)) \
36 $(if
$(findstring sysupgrade
,$(word 1,$(1))),-s
) && mv
$@.new
$@ ||
rm -f
$@
39 define Build
/uImageArcher
40 mkimage
-A
$(LINUX_KARCH
) \
42 -C
$(1) -a
$(KERNEL_LOADADDR
) -e
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
43 -n
'$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d
$@
$@.new
50 TPLINK_HEADER_VERSION
:= 1
52 KERNEL
:= kernel-bin | patch-cmdline | lzma
53 KERNEL_INITRAMFS
:= kernel-bin | patch-cmdline | lzma | tplink-v1-header
54 IMAGES
:= sysupgrade.bin factory.bin
55 IMAGE
/sysupgrade.bin
:= append-rootfs | mktplinkfw sysupgrade
56 IMAGE
/factory.bin
:= append-rootfs | mktplinkfw factory
59 define Device
/tplink-nolzma
61 LOADER_FLASH_OFFS
:= 0x22000
62 COMPILE
:= loader-
$(1).gz
63 COMPILE
/loader-
$(1).gz
:= loader-okli-compile
64 KERNEL
:= copy-file
$(KDIR
)/vmlinux.bin.lzma | uImage lzma
-M
0x4f4b4c49 | loader-okli
$(1) 7680
65 KERNEL_INITRAMFS
:= copy-file
$(KDIR
)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | tplink-v1-header
68 define Device
/tplink-4m
69 $(Device
/tplink-nolzma
)
70 TPLINK_FLASHLAYOUT
:= 4M
74 define Device
/tplink-8m
75 $(Device
/tplink-nolzma
)
76 TPLINK_FLASHLAYOUT
:= 8M
80 define Device
/tplink-4mlzma
82 TPLINK_FLASHLAYOUT
:= 4Mlzma
86 define Device
/tplink-8mlzma
88 TPLINK_FLASHLAYOUT
:= 8Mlzma
92 define Device
/tplink-16mlzma
94 TPLINK_FLASHLAYOUT
:= 16Mlzma