1 include $(TOPDIR
)/rules.mk
3 LOADADDR
= 0x8108c8f4 # RAM start + 16M
4 KERNEL_ENTRY
= 0x80100000
5 RAMSIZE
= 0x04000000 # 1MB
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
32 FSNAME
:=$(patsubst jffs2-
%,jffs2
,$(FS
))
34 ifeq ($(FS
),jffs2-8MB
)
36 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
: $(KDIR
)/root.
$(FS
)
37 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
0xbe000000 $(KDIR
)/root.
$(FS
) $(KDIR
)/root.srec
38 grep
-v S7
$(KDIR
)/root.srec
> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
39 grep
-v S0
$(LINUX_DIR
)/arch
/mips
/boot
/compressed
/images
/zImage.flash.srec
>> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
41 install: $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
46 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-rootfs.
tar.gz
: $(KDIR
)/root.
tar.gz
49 install: $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-rootfs.
tar.gz
54 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
: $(KDIR
)/root.
$(FS
)
55 $(TARGET_CROSS
)objcopy
-O srec
-I binary
--adjust-vma
0xbe000000 $(KDIR
)/root.
$(FS
) $(KDIR
)/root.srec
56 grep
-v S7
$(KDIR
)/root.srec
> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
57 grep
-v S0
$(LINUX_DIR
)/arch
/mips
/boot
/compressed
/images
/zImage.flash.srec
>> $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FS
).img
61 install: $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-$(FSNAME
).bin
64 $(BIN_DIR
)/openwrt-
$(BOARD
)-$(KERNEL
)-vmlinuz
: $(KDIR
)/zImage.flash
68 clean: lzma-loader-clean
69 prepare
: lzma-loader-prepare
70 compile
: lzma-loader-compile
77 mkdir
-p
$(IB_DIR
)/staging_dir_
$(ARCH
)/bin
78 mkdir
-p
$(IB_DIR
)/build_
$(ARCH
)/linux-
$(KERNEL
)-$(BOARD
)
79 $(CP
) $(KDIR
)/loader.elf
$(IB_DIR
)/build_
$(ARCH
)/
80 $(CP
) $(KDIR
)/vmlinux.lzma
$(IB_DIR
)/build_
$(ARCH
)/linux-
$(KERNEL
)-$(BOARD
)/
81 $(TARGET_CROSS
)objcopy
-O srec
$(KDIR
)/loader.elf
$(KDIR
)/loader.srec
82 grep
-v S0
$(KDIR
)/loader.srec
> $(KDIR
)/kernel.srec