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