Compile on TP-Link 740v4 mod flash and ram

I mod flash from 4MB to 8MB and Ram from 32MB to 64MB. I would like to compile firmware for this router. Please tell me how can i do for this.
Thanks you.

I goto directory oenwrt-17.01.4/target/linux/ar71xx/image and change file tp-link.mk
as:
define Device/tl-wr740n-v4
$(Device/tplink-4mlzma)
DEVICE_TITLE := TP-LINK TL-WR740N/ND v4
BOARDNAME := TL-WR741ND-v4
DEVICE_PROFILE := TLWR740
TPLINK_HWID := 0x07400004
CONSOLE := ttyATH0,115200
endef

become
define Device/tl-wr740n-v4
$(Device/tplink-8mlzma)
DEVICE_TITLE := TP-LINK TL-WR740N/ND v4
BOARDNAME := TL-WR741ND-v4
DEVICE_PROFILE := TLWR740
TPLINK_HWID := 0x07400004
CONSOLE := ttyATH0,115200
endef

but not success
please help me

I guess you selected packages more than 8MB.

Package small than 8MB but it not compile than 4MB15268138586098097857016963542086

r u sure ? not see compiler generate xxx-squashfs-sysupgrade.bin. This mean u selected too much packages.

I install udpxy xupnpd igmpproxy tvheaden.
I will remove tvheaden and try a gain.

tvheadend is about ~ 5099 KB. 8MB flash is not enough. :smiley:

If I mod USB for this router. may I put some lines like this?
define Device/tl-wr740n-v4
$(Device/tplink-8mlzma)
DEVICE_TITLE := TP-LINK TL-WR740N/ND v4
BOARDNAME := TL-WR741ND-v4
DEVICE_PROFILE := TLWR740
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
TPLINK_HWID := 0x07400004
CONSOLE := ttyATH0,115200

15268223397394572003461809516712
It made firmware larger 8MB but why it over 8 mb

That is size on disk, not real size, the real size is about ~7900KB.

Should be:~7,75 MB (8.126.464 bytes)

Thanks all for help.