diff options
author | Wu Zhangjin <wuzhangjin@gmail.com> | 2009-10-14 06:12:16 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2009-12-16 20:56:56 -0500 |
commit | 1b93b3c3e94be2605759735a89fc935ba5f58dcf (patch) | |
tree | 1d49ea7cca709e0380d5463357deb1c632308cc0 /arch/mips/Makefile | |
parent | bea4c899f2b5fad80099aea979780ef19f9b1987 (diff) |
MIPS: Add support for GZIP / BZIP2 / LZMA compressed kernel images
This patch helps to generate smaller kernel images for linux-MIPS,
Here is the effect when using lzma:
$ ls -sh vmlinux
7.1M vmlinux
$ ls -sh vmlinuz
1.5M vmlinuz
Have tested the 32bit kernel on Qemu/Malta and 64bit kernel on FuLoong
Mini PC. both of them work well. and also, tested by Alexander Clouter
on an AR7 based Linksys WAG54Gv2, and by Manuel Lauss on an Alchemy
board.
This -v2 version incorporate the feedback from Ralf, and add the
following changes:
1. add .ecoff, .bin, .erec format support
2. only enable it and the debug source code for the machines we tested
3. a dozen of fixups and cleanups
and if you want to enable it for your board, please try to select
SYS_SUPPORTS_ZBOOT for it, and if the board have an 16550 compatible
uart, you can select SYS_SUPPORTS_ZBOOT_UART16550 directly. and then
sending the relative patches to Ralf.
Tested-by: Manuel Lauss <manuel.lauss@googlemail.com>
Tested-by: Alexander Clouter <alex@digriz.org.uk>
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/Makefile')
-rw-r--r-- | arch/mips/Makefile | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 77f5021218d3..ba04782c4b91 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -69,6 +69,7 @@ endif | |||
69 | 69 | ||
70 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) | 70 | all-$(CONFIG_BOOT_ELF32) := $(vmlinux-32) |
71 | all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) | 71 | all-$(CONFIG_BOOT_ELF64) := $(vmlinux-64) |
72 | all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz | ||
72 | 73 | ||
73 | # | 74 | # |
74 | # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel | 75 | # GCC uses -G 0 -mabicalls -fpic as default. We don't want PIC in the kernel |
@@ -331,7 +332,7 @@ load-$(CONFIG_LEMOTE_FULOONG2E) +=0xffffffff80100000 | |||
331 | core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ | 332 | core-$(CONFIG_MIPS_MALTA) += arch/mips/mti-malta/ |
332 | cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta | 333 | cflags-$(CONFIG_MIPS_MALTA) += -I$(srctree)/arch/mips/include/asm/mach-malta |
333 | load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 | 334 | load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 |
334 | all-$(CONFIG_MIPS_MALTA) := vmlinux.bin | 335 | all-$(CONFIG_MIPS_MALTA) := vmlinuz.bin |
335 | 336 | ||
336 | # | 337 | # |
337 | # MIPS SIM | 338 | # MIPS SIM |
@@ -581,7 +582,7 @@ load-$(CONFIG_SNI_RM) += 0xffffffff80600000 | |||
581 | else | 582 | else |
582 | load-$(CONFIG_SNI_RM) += 0xffffffff80030000 | 583 | load-$(CONFIG_SNI_RM) += 0xffffffff80030000 |
583 | endif | 584 | endif |
584 | all-$(CONFIG_SNI_RM) := vmlinux.ecoff | 585 | all-$(CONFIG_SNI_RM) := vmlinuz.ecoff |
585 | 586 | ||
586 | # | 587 | # |
587 | # Common TXx9 | 588 | # Common TXx9 |
@@ -699,9 +700,23 @@ vmlinux.64: vmlinux | |||
699 | $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ | 700 | $(OBJCOPY) -O $(64bit-bfd) $(OBJCOPYFLAGS) $< $@ |
700 | 701 | ||
701 | makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) | 702 | makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1) |
703 | makezboot =$(Q)$(MAKE) $(build)=arch/mips/boot/compressed \ | ||
704 | VMLINUX_LOAD_ADDRESS=$(load-y) 32bit-bfd=$(32bit-bfd) $(1) | ||
702 | 705 | ||
703 | all: $(all-y) | 706 | all: $(all-y) |
704 | 707 | ||
708 | vmlinuz: vmlinux FORCE | ||
709 | +@$(call makezboot,$@) | ||
710 | |||
711 | vmlinuz.bin: vmlinux | ||
712 | +@$(call makezboot,$@) | ||
713 | |||
714 | vmlinuz.ecoff: vmlinux | ||
715 | +@$(call makezboot,$@) | ||
716 | |||
717 | vmlinuz.srec: vmlinux | ||
718 | +@$(call makezboot,$@) | ||
719 | |||
705 | vmlinux.bin: $(vmlinux-32) | 720 | vmlinux.bin: $(vmlinux-32) |
706 | +@$(call makeboot,$@) | 721 | +@$(call makeboot,$@) |
707 | 722 | ||
@@ -726,11 +741,13 @@ endif | |||
726 | 741 | ||
727 | install: | 742 | install: |
728 | $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) | 743 | $(Q)install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE) |
744 | $(Q)install -D -m 755 vmlinuz $(INSTALL_PATH)/vmlinuz-$(KERNELRELEASE) | ||
729 | $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) | 745 | $(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE) |
730 | $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) | 746 | $(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE) |
731 | 747 | ||
732 | archclean: | 748 | archclean: |
733 | @$(MAKE) $(clean)=arch/mips/boot | 749 | @$(MAKE) $(clean)=arch/mips/boot |
750 | @$(MAKE) $(clean)=arch/mips/boot/compressed | ||
734 | @$(MAKE) $(clean)=arch/mips/lasat | 751 | @$(MAKE) $(clean)=arch/mips/lasat |
735 | 752 | ||
736 | define archhelp | 753 | define archhelp |
@@ -738,10 +755,18 @@ define archhelp | |||
738 | echo ' vmlinux.ecoff - ECOFF boot image' | 755 | echo ' vmlinux.ecoff - ECOFF boot image' |
739 | echo ' vmlinux.bin - Raw binary boot image' | 756 | echo ' vmlinux.bin - Raw binary boot image' |
740 | echo ' vmlinux.srec - SREC boot image' | 757 | echo ' vmlinux.srec - SREC boot image' |
758 | echo ' vmlinuz - Compressed boot(zboot) image' | ||
759 | echo ' vmlinuz.ecoff - ECOFF zboot image' | ||
760 | echo ' vmlinuz.bin - Raw binary zboot image' | ||
761 | echo ' vmlinuz.srec - SREC zboot image' | ||
741 | echo | 762 | echo |
742 | echo ' These will be default as apropriate for a configured platform.' | 763 | echo ' These will be default as apropriate for a configured platform.' |
743 | endef | 764 | endef |
744 | 765 | ||
745 | CLEAN_FILES += vmlinux.32 \ | 766 | CLEAN_FILES += vmlinux.32 \ |
746 | vmlinux.64 \ | 767 | vmlinux.64 \ |
747 | vmlinux.ecoff | 768 | vmlinux.ecoff \ |
769 | vmlinuz \ | ||
770 | vmlinuz.ecoff \ | ||
771 | vmlinuz.bin \ | ||
772 | vmlinuz.srec | ||