OpenWrt – Blame information for rev 4
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
4 | office | 1 | # |
2 | # Copyright (C) 2010 OpenWrt.org |
||
3 | # |
||
4 | # This is free software, licensed under the GNU General Public License v2. |
||
5 | # See /LICENSE for more information. |
||
6 | # |
||
7 | include $(TOPDIR)/rules.mk |
||
8 | include $(INCLUDE_DIR)/image.mk |
||
9 | |||
10 | define CompressLzma |
||
11 | $(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2) |
||
12 | endef |
||
13 | |||
14 | define CompressGzip |
||
15 | gzip -9n -c $(1) > $(2) |
||
16 | endef |
||
17 | |||
18 | define MkuImage |
||
19 | mkimage -A mips -O linux -T kernel -a 0x80100000 -C $(1) $(2) \ |
||
20 | -e 0x80100000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \ |
||
21 | -d $(3) $(4) |
||
22 | endef |
||
23 | |||
24 | define Image/Prepare |
||
25 | $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) |
||
26 | $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) |
||
27 | $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz) |
||
28 | $(call MkuImage,gzip,,$(KDIR)/vmlinux.bin.gz,$(KDIR)/uImage.gz) |
||
29 | endef |
||
30 | |||
31 | define Image/BuildKernel |
||
32 | cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf |
||
33 | cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma |
||
34 | cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip |
||
35 | endef |
||
36 | |||
37 | define Image/Build/squashfs |
||
38 | $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) |
||
39 | endef |
||
40 | |||
41 | define Image/Build/Initramfs |
||
42 | cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.elf |
||
43 | cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs.bin |
||
44 | endef |
||
45 | |||
46 | define Image/Build |
||
47 | $(call Image/Build/$(1)) |
||
48 | dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync |
||
49 | endef |
||
50 | |||
51 | $(eval $(call BuildImage)) |