linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wu Zhangjin <wuzhangjin@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org, Alexander Clouter <alex@digriz.org.uk>
Subject: Re: [PATCH -v1] MIPS: add support for gzip/bzip2/lzma compressed kernel images
Date: Mon, 12 Oct 2009 11:31:58 +0800	[thread overview]
Message-ID: <1255318318.5744.82.camel@falcon> (raw)
In-Reply-To: <20091012023442.GA7438@linux-mips.org>

Hi,

On Mon, 2009-10-12 at 04:34 +0200, Ralf Baechle wrote:
> On Mon, Aug 10, 2009 at 04:49:14PM +0800, Wu Zhangjin wrote:
> 
> > This patch will help to generate smaller kernel images for linux-MIPS,
> > 
> > Here is the effect when using lzma:
> > 
> > $ ls -sh vmlinux
> > 7.1M vmlinux
> > $ ls -sh arch/mips/boot/compressed/vmlinuz
> > 1.5M arch/mips/boot/compressed/vmlinuz
> > 
> > Have tested the 32bit kernel on Qemu/Malta and 64bit kernel on FuLoong
> > Mini PC. both of them work well.
> 
>   ip27_defconfig:
> 
>   CHK     include/linux/compile.h
> (standard_in) 1: parse error
> (standard_in) 1: parse error
>   AS      arch/mips/boot/compressed/head.o
> arch/mips/boot/compressed/head.S: Assembler messages:
> arch/mips/boot/compressed/head.S:78: Error: Number (0xa800000000021bf0) larger than 32 bits
> make[1]: *** [arch/mips/boot/compressed/head.o] Error 1
> 

Seems something wrong in the Makefile, will fix it later, here it is:

[...]
/bin/sh: 0x0xa80000000001c000: value too great for base (error token is
"0x0xa80000000001c000")
  Building modules, stage 2.
  AS      arch/mips/boot/compressed/head.o
  CC      arch/mips/boot/compressed/decompress.o
  GZIP    arch/mips/boot/compressed/vmlinux.gz
  CC      arch/mips/boot/compressed/dbg.o
  MODPOST 137 modules
  CC      arch/mips/boot/compressed/dummy.o
arch/mips/boot/compressed/head.S: Assembler messages:
arch/mips/boot/compressed/head.S:47: Error: Number (0xa800000000021bf0)
larger than 32 bits
[...]

>   rm200_defconfig:
> 
> $ make
> [...]
>   IHEX2FW firmware/whiteheat.fw
>   IHEX2FW firmware/keyspan_pda/keyspan_pda.fw
>   IHEX2FW firmware/keyspan_pda/xircom_pgs.fw
> [ralf@h5 linux-queue]$ ll vmlinuz 
> lrwxrwxrwx 1 ralf ralf 33 2009-10-12 03:30 vmlinuz -> arch/mips/boot/compressed/vmlinuz*
> [ralf@h5 linux-queue]$ ll arch/mips/boot/compressed/vmlinuz 
> -rwxrwxr-x 1 ralf ralf 1675346 2009-10-12 03:30 arch/mips/boot/compressed/vmlinuz*
> [ralf@h5 linux-queue]$ make distclean
>   CLEAN   arch/mips/boot
> (standard_in) 1: parse error
> [...]
> 
> For rm200 we need an ECOFF zimage.
> 

Okay, will fix it later.

> malta_defconfig:
> 
> $ mkdir ../build-malta
> $ make O=../build-malta malta_defconfig
> [...]
> $ cd ../build-malta
> $ make
> [...]
> $ make distclean
> make -C /home/ralf/src/linux/linux-queue O=/home/ralf/src/linux/build-malta/. distclean
>   CLEAN   arch/mips/boot
> (standard_in) 1: parse error

This "parse error" will be fixed by tuning the Makefile via adding
something like " blabla 2>/dev/null".

> $
> 
> By default we generate a binary that is not ELF file for malta, so a
> compressed kernel should be in that format also.
> 
> $ make help
> [...]
> Architecture specific targets (mips):
>   install              - install kernel into /boot
>   vmlinux.ecoff        - ECOFF boot image
>   vmlinux.bin          - Raw binary boot image
>   vmlinux.srec         - SREC boot image
>   vmlinuz              - Compressed boot image
> [...]
> $ make vmlinuz
> make: *** No rule to make target `vmlinuz'.  Stop.
> $
> 

it should be

$ make zImage

will replace "vmlinuz - Compressed boot image" to "zImage - Compressed
boot image", or, fix "make vmlinuz" itself.

> > diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> > index 861da51..300b996 100644
> > --- a/arch/mips/Makefile
> > +++ b/arch/mips/Makefile
> > @@ -709,7 +709,10 @@ vmlinux.64: vmlinux
> >  
> >  makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot VMLINUX=$(vmlinux-32) $(1)
> >  
> > -all:	$(all-y)
> > +all:	$(all-y) zImage
> > +
> > +zImage: vmlinux
> > +	$(Q)$(MAKE) $(build)=arch/mips/boot/compressed $@ LOADADDR=$(load-y)
> 
> Several systems rely on the firmware for memory usage information.  With
> a compressed kernel this information will be inaccurate.  This is a
> somewhat hard problem to solve so I suggest to only enable compressed
> kernels on systems where they're known to work.

Okay, I will add a new kernel option for this, and also, the
DEBUG(dbg.[hc]) part will be selectable with a new kernel option too.

Thanks & Regards,
	Wu Zhangjin

      reply	other threads:[~2009-10-12  3:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10  8:49 [PATCH -v1] MIPS: add support for gzip/bzip2/lzma compressed kernel images Wu Zhangjin
     [not found] ` <20090810101205.GW19816@chipmunk>
     [not found]   ` <200908102342.30031.florian@openwrt.org>
2009-08-11 21:19     ` AR7 runtime identification [was:- Re: [PATCH -v1] MIPS: add support for gzip/bzip2/lzma compressed kernel images] Florian Fainelli
2009-08-12  8:37       ` Alexander Clouter
2009-08-12  9:19         ` Florian Fainelli
2009-09-26 12:33 ` [PATCH -v1] MIPS: add support for gzip/bzip2/lzma compressed kernel images Alexander Clouter
2009-09-28 14:08 ` Manuel Lauss
2009-09-28 14:08   ` Manuel Lauss
2009-09-28 20:17 ` Alexander Clouter
2009-10-12  2:34 ` Ralf Baechle
2009-10-12  3:31   ` Wu Zhangjin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255318318.5744.82.camel@falcon \
    --to=wuzhangjin@gmail.com \
    --cc=alex@digriz.org.uk \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).