lkml.org 
[lkml]   [2008]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] create option to compress initramfs within the kernel
Date
On Saturday 22 November 2008 11:30:13 frans wrote:
> Below is a patch to make compression of the initramfs image optional.
> Sumbitted to LKML as there is no MAINTAINER listed for initramfs.
>
> Rationale is that if you create a compressed kernel image (e.g. by
> make bzImage) it is not very efficient and useful to compress initramfs
> as the initramfs will be compressed anyway when the kernel image is
> compressed.

Actually it saves intermediate space (the cpio archive and the decompressed
ramfs coexist during the decompression, until the kernel can free the cpio
archive), so it does serve a purpose. (Given cache effects leaving it
compressed may actually wind up being faster on modern CPUs because it dirties
fewer pages.)

It also eats CPU, which is at more of a premium than memory on some little
battery powered wind-up boxes. But I'd be happier seeing some actual
benchmark numbers on a device that would actually _notice_ this change.

> @@ -257,6 +258,9 @@ while [ $# -gt 0 ]; do
> default_list="$arg"
> ${dep_list}default_initramfs
> ;;
> + "-c") # compress
> + compress=1
> + ;;

You're changing the default behavior for people who run this script directly.
Just FYI.

> --- a/usr/Kconfig
> +++ b/usr/Kconfig
> @@ -44,3 +44,14 @@ config INITRAMFS_ROOT_GID
> owned by group root in the initial ramdisk image.
>
> If you are not sure, leave it set to "0".
> +
> +config INITRAMFS_COMPRESS
> + bool "Compress initramfs image"
> + default y
> + help
> + If you want a compressed initramfs image in your kernel say y
> + If you do not want your initramfs image to be compressed say n.
> + A compressed initramfs is generally not useful if you also have a
> + compressed kernel (vmlinuz, bzImage).

This should probably be in the CONFIG_EMBEDDED menu.

Rob


\
 
 \ /
  Last update: 2008-11-23 02:35    [W:0.043 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site