1 DEVICE_VARS
+= LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV
3 # Arguments: <output name> <kernel offset>
4 define Build
/loader-okli
5 dd if
=$(KDIR
)/loader-
$(word 1,$(1)).
$(LOADER_TYPE
) bs
=$(word 2,$(1)) conv
=sync of
="$@.new"
10 define Build
/loader-okli-compile
11 $(call Build
/loader-common
,FLASH_OFFS
=$(LOADER_FLASH_OFFS
) FLASH_MAX
=0 KERNEL_CMDLINE
="$(CMDLINE)")
14 # combine kernel and rootfs into one image
15 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
16 # <type> is "sysupgrade" or "factory"
18 # -a align the rootfs start on an <align> bytes boundary
19 # -j add jffs2 end-of-filesystem markers
20 # -s strip padding from end of the image
21 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
22 define Build
/mktplinkfw
23 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
24 -H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -F
$(TPLINK_FLASHLAYOUT
) -N OpenWrt
-V
$(REVISION
) \
25 -m
$(TPLINK_HEADER_VERSION
) \
30 -a
$(call rootfs_align
,$(FILESYSTEM
)) \
31 $(wordlist
2,$(words $(1)),$(1)) \
32 $(if
$(findstring sysupgrade
,$(word 1,$(1))),-s
) && mv
$@.new
$@ ||
rm -f
$@
35 define Build
/uImageArcher
36 mkimage
-A
$(LINUX_KARCH
) \
38 -C
$(1) -a
$(KERNEL_LOADADDR
) -e
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
39 -n
'$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d
$@
$@.new
46 TPLINK_HEADER_VERSION
:= 1
48 KERNEL
:= kernel-bin | patch-cmdline | lzma
49 KERNEL_INITRAMFS
:= kernel-bin | patch-cmdline | lzma | tplink-v1-header
50 IMAGES
:= sysupgrade.bin factory.bin
51 IMAGE
/sysupgrade.bin
:= append-rootfs | mktplinkfw sysupgrade
52 IMAGE
/factory.bin
:= append-rootfs | mktplinkfw factory
55 define Device
/tplink-nolzma
57 LOADER_FLASH_OFFS
:= 0x22000
58 COMPILE
:= loader-
$(1).gz
59 COMPILE
/loader-
$(1).gz
:= loader-okli-compile
60 KERNEL_NAME
:= vmlinux.bin.lzma
61 KERNEL
:= kernel-bin | uImage lzma
-M
0x4f4b4c49 | loader-okli
$(1) 7680
62 KERNEL_INITRAMFS_NAME
:= vmlinux-initramfs.bin.lzma
63 KERNEL_INITRAMFS
:= kernel-bin | loader-kernel-cmdline | tplink-v1-header
66 define Device
/tplink-4m
67 $(Device
/tplink-nolzma
)
68 TPLINK_FLASHLAYOUT
:= 4M
72 define Device
/tplink-8m
73 $(Device
/tplink-nolzma
)
74 TPLINK_FLASHLAYOUT
:= 8M
78 define Device
/tplink-4mlzma
80 TPLINK_FLASHLAYOUT
:= 4Mlzma
84 define Device
/tplink-8mlzma
86 TPLINK_FLASHLAYOUT
:= 8Mlzma
90 define Device
/tplink-16mlzma
92 TPLINK_FLASHLAYOUT
:= 16Mlzma