Commit fb59f3f4 authored by Alessandro Rubini's avatar Alessandro Rubini

patches/2.6.35: added initramfs hack

This patch simply breaks the loop that uncompresses cpio.gz
archives into initramfs. The default behaviour is to error out
when no more valid data is there in the "initrd=start,size" area.
Since we don't know in advance the exact size of the compressed
initramfs when the kernel is being compiled, the command line in the
WR switch shas 16M ("initrd=0x23000000,16777216") as a safe size.

This patch prevents a panic and allos the system to boot with a
smaller-than-expected cpio archive.
parent 7e5a1721
From 4e4080233a2843d405a8c0574209a8245baa7de5 Mon Sep 17 00:00:00 2001
From: Alessandro Rubini <>
Date: Sat, 20 Nov 2010 13:15:48 +0100
Subject: [PATCH] initramfs: stop after one cpio archive
init/initramfs.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/init/initramfs.c b/init/initramfs.c
index 4b9c202..9b446ff 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -461,6 +461,7 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len)
error("junk in compressed archive");
if (state != Reset)
error("junk in compressed archive");
+ break; /* so we can use a bigger initrd size in the cmdline */
this_header = saved_offset + my_inptr;
buf += my_inptr;
len -= my_inptr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment