1 include $(TOPDIR
)/rules.mk
3 LOADADDR
= 0x8108c8f4 # RAM start + 16M
4 KERNEL_ENTRY
= 0x80100000 # Default kernel entry in arch/mips/Makefile
5 RAMSIZE
= 0x04000000 # 64MB
10 KERNEL_ENTRY
=$(KERNEL_ENTRY
) \
13 KDIR
:=$(BUILD_DIR
)/linux-
$(KERNEL
)-$(BOARD
)
16 $(MAKE
) -C ..
/generic
/lzma-loader
$(LOADER_MAKEOPTS
) clean
19 $(MAKE
) -C ..
/generic
/lzma-loader
$(LOADER_MAKEOPTS
) prepare
21 lzma-loader-compile
: $(KDIR
)/vmlinux.lzma lzma-loader-prepare
22 $(MAKE
) -C ..
/generic
/lzma-loader
$(LOADER_MAKEOPTS
) compile
25 $(KDIR
)/vmlinux.lzma
: $(KDIR
)/vmlinux
26 cat
$^ |
$(STAGING_DIR
)/bin
/lzma e
-si
-so
-eos
-lc1
-lp2
-pb2
> $@ ||
(rm -f
$@
&& false
)
28 install: $(KDIR
)/vmlinux.lzma
31 ifeq ($(FS
),jffs2-8MB
)
33 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
: $(KDIR
)/root.
$(FS
)
34 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
0xbe000000 $(KDIR
)/root.
$(FS
) $(KDIR
)/root.srec
35 grep
-v S7
$(KDIR
)/root.srec
> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
36 grep
-v S0
$(LINUX_DIR
)/arch
/mips
/boot
/compressed
/images
/zImage.flash.srec
>> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
38 install: $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
43 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-rootfs.
tar.gz
: $(KDIR
)/root.
tar.gz
46 install: $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-rootfs.
tar.gz
51 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
: $(KDIR
)/root.
$(FS
)
52 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
0xbe000000 $(KDIR
)/root.
$(FS
) $(KDIR
)/root.srec
53 grep
-v S7
$(KDIR
)/root.srec
> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
54 grep
-v S0
$(LINUX_DIR
)/arch
/mips
/boot
/compressed
/images
/zImage.flash.srec
>> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
58 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-vmlinuz
: $(KDIR
)/zImage.flash
62 clean: lzma-loader-clean
63 prepare
: lzma-loader-prepare
64 compile
: lzma-loader-compile
71 mkdir
-p
$(IB_DIR
)/staging_dir_
$(ARCH
)/bin
72 mkdir
-p
$(IB_DIR
)/build_
$(ARCH
)/linux-
$(KERNEL
)-$(BOARD
)
73 $(CP
) $(KDIR
)/loader.elf
$(IB_DIR
)/build_
$(ARCH
)/
74 $(CP
) $(KDIR
)/vmlinux.lzma
$(IB_DIR
)/build_
$(ARCH
)/linux-
$(KERNEL
)-$(BOARD
)/
75 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
0xbe000000 $(KDIR
)/loader.elf
$(KDIR
)/loader.srec
76 grep
-v S0
$(KDIR
)/loader.srec
> $(KDIR
)/kernel.srec