SOURCES (CRI): kernel-CRI-lzma-vmlinuz.patch - update7 of patch from LKML
hawk
hawk at pld-linux.org
Thu Oct 30 22:42:33 CET 2008
Author: hawk Date: Thu Oct 30 21:42:33 2008 GMT
Module: SOURCES Tag: CRI
---- Log message:
- update7 of patch from LKML
---- Files affected:
SOURCES:
kernel-CRI-lzma-vmlinuz.patch (1.1.2.7 -> 1.1.2.8)
---- Diffs:
================================================================
Index: SOURCES/kernel-CRI-lzma-vmlinuz.patch
diff -u SOURCES/kernel-CRI-lzma-vmlinuz.patch:1.1.2.7 SOURCES/kernel-CRI-lzma-vmlinuz.patch:1.1.2.8
--- SOURCES/kernel-CRI-lzma-vmlinuz.patch:1.1.2.7 Thu Oct 30 10:02:14 2008
+++ SOURCES/kernel-CRI-lzma-vmlinuz.patch Thu Oct 30 22:42:27 2008
@@ -1,6 +1,6 @@
diff -urNp linux-2.6.27.orig/arch/x86/boot/compressed/Makefile linux-2.6.27/arch/x86/boot/compressed/Makefile
--- linux-2.6.27.orig/arch/x86/boot/compressed/Makefile 2008-10-29 08:48:23.000000000 +0100
-+++ linux-2.6.27/arch/x86/boot/compressed/Makefile 2008-10-29 08:59:01.000000000 +0100
++++ linux-2.6.27/arch/x86/boot/compressed/Makefile 2008-10-30 22:30:21.000000000 +0100
@@ -4,7 +4,7 @@
# create a compressed vmlinux image from the original vmlinux
#
@@ -10,7 +10,7 @@
KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
-@@ -46,19 +46,34 @@ $(obj)/vmlinux.bin.all: $(vmlinux.bin.al
+@@ -46,9 +46,17 @@ $(obj)/vmlinux.bin.all: $(vmlinux.bin.al
ifdef CONFIG_RELOCATABLE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
$(call if_changed,gzip)
@@ -28,27 +28,28 @@
endif
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
- else
+@@ -56,9 +64,17 @@ else
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
$(call if_changed,gzip)
+
+$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
+ $(call if_changed,bzip2)
+$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
+ $(call if_changed,lzma)
-
LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
endif
+
+-$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
+suffix_$(CONFIG_KERNEL_GZIP) = gz
+suffix_$(CONFIG_KERNEL_BZIP2) = bz2
+suffix_$(CONFIG_KERNEL_LZMA) = lzma
-
--$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
++
+$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
$(call if_changed,ld)
diff -urNp linux-2.6.27.orig/arch/x86/boot/compressed/misc.c linux-2.6.27/arch/x86/boot/compressed/misc.c
--- linux-2.6.27.orig/arch/x86/boot/compressed/misc.c 2008-10-29 08:48:23.000000000 +0100
-+++ linux-2.6.27/arch/x86/boot/compressed/misc.c 2008-10-29 08:59:22.000000000 +0100
++++ linux-2.6.27/arch/x86/boot/compressed/misc.c 2008-10-30 22:27:54.000000000 +0100
@@ -116,71 +116,13 @@
/*
* gzip declarations
@@ -217,7 +218,7 @@
putstr("done.\nBooting the kernel.\n");
diff -urNp linux-2.6.27.orig/drivers/block/Kconfig linux-2.6.27/drivers/block/Kconfig
--- linux-2.6.27.orig/drivers/block/Kconfig 2008-10-29 08:48:02.000000000 +0100
-+++ linux-2.6.27/drivers/block/Kconfig 2008-10-29 08:54:14.000000000 +0100
++++ linux-2.6.27/drivers/block/Kconfig 2008-10-30 22:27:34.000000000 +0100
@@ -357,6 +357,30 @@ config BLK_DEV_XIP
will prevent RAM block device backing store memory from being
allocated from highmem (only a problem for highmem systems).
@@ -251,7 +252,7 @@
depends on !UML
diff -urNp linux-2.6.27.orig/include/asm-x86/boot.h linux-2.6.27/include/asm-x86/boot.h
--- linux-2.6.27.orig/include/asm-x86/boot.h 2008-10-29 08:47:54.000000000 +0100
-+++ linux-2.6.27/include/asm-x86/boot.h 2008-10-29 08:54:19.000000000 +0100
++++ linux-2.6.27/include/asm-x86/boot.h 2008-10-30 22:27:38.000000000 +0100
@@ -17,11 +17,21 @@
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
& ~(CONFIG_PHYSICAL_ALIGN - 1))
@@ -277,7 +278,7 @@
diff -urNp linux-2.6.27.orig/include/linux/decompress/bunzip2.h linux-2.6.27/include/linux/decompress/bunzip2.h
--- linux-2.6.27.orig/include/linux/decompress/bunzip2.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/include/linux/decompress/bunzip2.h 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/include/linux/decompress/bunzip2.h 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,10 @@
+#ifndef DECOMPRESS_BUNZIP2_H
+#define DECOMPRESS_BUNZIP2_H
@@ -291,7 +292,7 @@
+#endif
diff -urNp linux-2.6.27.orig/include/linux/decompress/generic.h linux-2.6.27/include/linux/decompress/generic.h
--- linux-2.6.27.orig/include/linux/decompress/generic.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/include/linux/decompress/generic.h 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/include/linux/decompress/generic.h 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,30 @@
+#ifndef DECOMPRESS_GENERIC_H
+#define DECOMPRESS_GENERIC_H
@@ -325,7 +326,7 @@
+#endif
diff -urNp linux-2.6.27.orig/include/linux/decompress/inflate.h linux-2.6.27/include/linux/decompress/inflate.h
--- linux-2.6.27.orig/include/linux/decompress/inflate.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/include/linux/decompress/inflate.h 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/include/linux/decompress/inflate.h 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,13 @@
+#ifndef INFLATE_H
+#define INFLATE_H
@@ -342,7 +343,7 @@
+#endif
diff -urNp linux-2.6.27.orig/include/linux/decompress/mm.h linux-2.6.27/include/linux/decompress/mm.h
--- linux-2.6.27.orig/include/linux/decompress/mm.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/include/linux/decompress/mm.h 2008-10-29 08:59:22.000000000 +0100
++++ linux-2.6.27/include/linux/decompress/mm.h 2008-10-30 22:27:54.000000000 +0100
@@ -0,0 +1,88 @@
+/*
+ * linux/compr_mm.h
@@ -434,7 +435,7 @@
+#endif /* DECOMPR_MM_H */
diff -urNp linux-2.6.27.orig/include/linux/decompress/unlzma.h linux-2.6.27/include/linux/decompress/unlzma.h
--- linux-2.6.27.orig/include/linux/decompress/unlzma.h 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/include/linux/decompress/unlzma.h 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/include/linux/decompress/unlzma.h 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,12 @@
+#ifndef DECOMPRESS_UNLZMA_H
+#define DECOMPRESS_UNLZMA_H
@@ -450,7 +451,7 @@
+#endif
diff -urNp linux-2.6.27.orig/init/do_mounts_rd.c linux-2.6.27/init/do_mounts_rd.c
--- linux-2.6.27.orig/init/do_mounts_rd.c 2008-10-29 08:48:10.000000000 +0100
-+++ linux-2.6.27/init/do_mounts_rd.c 2008-10-29 08:54:14.000000000 +0100
++++ linux-2.6.27/init/do_mounts_rd.c 2008-10-30 22:27:34.000000000 +0100
@@ -10,6 +10,12 @@
#include "do_mounts.h"
@@ -464,18 +465,16 @@
int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */
static int __init prompt_ramdisk(char *str)
-@@ -28,7 +34,9 @@ static int __init ramdisk_start_setup(ch
+@@ -28,7 +34,7 @@ static int __init ramdisk_start_setup(ch
}
__setup("ramdisk_start=", ramdisk_start_setup);
-static int __init crd_load(int in_fd, int out_fd);
-+
-+
+static int __init crd_load(int in_fd, int out_fd, decompress_fn deco);
/*
* This routine tries to find a RAM disk image to load, and returns the
-@@ -44,7 +52,7 @@ static int __init crd_load(int in_fd, in
+@@ -44,7 +50,7 @@ static int __init crd_load(int in_fd, in
* gzip
*/
static int __init
@@ -484,7 +483,7 @@
{
const int size = 512;
struct minix_super_block *minixsb;
-@@ -70,6 +78,7 @@ identify_ramdisk_image(int fd, int start
+@@ -70,6 +76,7 @@ identify_ramdisk_image(int fd, int start
sys_lseek(fd, start_block * BLOCK_SIZE, 0);
sys_read(fd, buf, size);
@@ -492,14 +491,14 @@
/*
* If it matches the gzip magic numbers, return -1
*/
-@@ -77,9 +86,39 @@ identify_ramdisk_image(int fd, int start
+@@ -77,9 +84,39 @@ identify_ramdisk_image(int fd, int start
printk(KERN_NOTICE
"RAMDISK: Compressed image found at block %d\n",
start_block);
+ *decompressor = gunzip;
- nblocks = 0;
- goto done;
- }
++ nblocks = 0;
++ goto done;
++ }
+#endif
+
+#ifdef CONFIG_RD_BZIP2
@@ -511,9 +510,9 @@
+ "RAMDISK: Bzipped image found at block %d\n",
+ start_block);
+ *decompressor = bunzip2;
-+ nblocks = 0;
-+ goto done;
-+ }
+ nblocks = 0;
+ goto done;
+ }
+#endif
+
+#ifdef CONFIG_RD_LZMA
@@ -532,7 +531,7 @@
/* romfs is at block zero too */
if (romfsb->word0 == ROMSB_WORD0 &&
-@@ -143,6 +182,7 @@ int __init rd_load_image(char *from)
+@@ -143,6 +180,7 @@ int __init rd_load_image(char *from)
int nblocks, i, disk;
char *buf = NULL;
unsigned short rotate = 0;
@@ -540,7 +539,7 @@
#if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES)
char rotator[4] = { '|' , '/' , '-' , '\\' };
#endif
-@@ -155,12 +195,12 @@ int __init rd_load_image(char *from)
+@@ -155,12 +193,12 @@ int __init rd_load_image(char *from)
if (in_fd < 0)
goto noclose_input;
@@ -555,7 +554,7 @@
goto successful_load;
goto done;
}
-@@ -259,138 +299,48 @@ int __init rd_load_disk(int n)
+@@ -259,138 +297,48 @@ int __init rd_load_disk(int n)
return rd_load_image("/dev/root");
}
@@ -719,7 +718,7 @@
}
diff -urNp linux-2.6.27.orig/init/initramfs.c linux-2.6.27/init/initramfs.c
--- linux-2.6.27.orig/init/initramfs.c 2008-10-29 08:48:10.000000000 +0100
-+++ linux-2.6.27/init/initramfs.c 2008-10-29 08:54:14.000000000 +0100
++++ linux-2.6.27/init/initramfs.c 2008-10-30 22:27:34.000000000 +0100
@@ -337,11 +337,14 @@ static int __init write_buffer(char *buf
return len - count;
}
@@ -753,7 +752,8 @@
-#ifndef memzero
-#define memzero(s, n) memset ((s), 0, (n))
-#endif
--
++static unsigned my_inptr; /* index of next byte to be processed in inbuf */
+
-typedef unsigned char uch;
-typedef unsigned short ush;
-typedef unsigned long ulg;
@@ -788,8 +788,7 @@
-#define NO_INFLATE_MALLOC
-
-#include "../lib/inflate.c"
-+static unsigned my_inptr; /* index of next byte to be processed in inbuf */
-
+-
-/* ===========================================================================
- * Write the output window window[0..outcnt-1] and update crc and bytes_out.
- * (Used for the decompressed data only.)
@@ -829,7 +828,7 @@
state = Start;
this_header = 0;
message = NULL;
-@@ -452,21 +397,41 @@ static char * __init unpack_to_rootfs(ch
+@@ -452,21 +397,39 @@ static char * __init unpack_to_rootfs(ch
continue;
}
this_header = 0;
@@ -841,12 +840,10 @@
- crc = (ulg)0xffffffffL; /* shift register contents */
- makecrc();
- gunzip();
-+#ifdef CONFIG_RD_GZIP
+ if (!gunzip(buf, len, NULL, flush_buffer, NULL,
+ &my_inptr, error) &&
+ message == NULL)
+ goto ok;
-+#endif
+
+#ifdef CONFIG_RD_BZIP2
+ message = NULL; /* Zero out message, or else cpio will
@@ -886,7 +883,7 @@
kfree(header_buf);
diff -urNp linux-2.6.27.orig/init/Kconfig linux-2.6.27/init/Kconfig
--- linux-2.6.27.orig/init/Kconfig 2008-10-29 08:48:10.000000000 +0100
-+++ linux-2.6.27/init/Kconfig 2008-10-29 08:54:14.000000000 +0100
++++ linux-2.6.27/init/Kconfig 2008-10-30 22:27:34.000000000 +0100
@@ -101,6 +101,56 @@ config LOCALVERSION_AUTO
which is done within the script "scripts/setlocalversion".)
@@ -946,7 +943,7 @@
depends on MMU && BLOCK
diff -urNp linux-2.6.27.orig/lib/decompress_bunzip2.c linux-2.6.27/lib/decompress_bunzip2.c
--- linux-2.6.27.orig/lib/decompress_bunzip2.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/lib/decompress_bunzip2.c 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/lib/decompress_bunzip2.c 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,735 @@
+/* vi: set sw = 4 ts = 4: */
+/* Small bzip2 deflate implementation, by Rob Landley (rob at landley.net).
@@ -1685,7 +1682,7 @@
+#define decompress bunzip2
diff -urNp linux-2.6.27.orig/lib/decompress_unlzma.c linux-2.6.27/lib/decompress_unlzma.c
--- linux-2.6.27.orig/lib/decompress_unlzma.c 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/lib/decompress_unlzma.c 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/lib/decompress_unlzma.c 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,647 @@
+/* Lzma decompressor for Linux kernel. Shamelessly snarfed
+ *from busybox 1.1.1
@@ -2336,7 +2333,7 @@
+#define decompress unlzma
diff -urNp linux-2.6.27.orig/lib/inflate.c linux-2.6.27/lib/inflate.c
--- linux-2.6.27.orig/lib/inflate.c 2008-10-29 08:47:55.000000000 +0100
-+++ linux-2.6.27/lib/inflate.c 2008-10-29 08:59:22.000000000 +0100
++++ linux-2.6.27/lib/inflate.c 2008-10-30 22:27:54.000000000 +0100
@@ -109,20 +109,76 @@ static char rcsid[] = "#Id: inflate.c,v
#endif
@@ -2860,12 +2857,12 @@
+#define decompress gunzip
diff -urNp linux-2.6.27.orig/lib/Makefile linux-2.6.27/lib/Makefile
--- linux-2.6.27.orig/lib/Makefile 2008-10-29 08:47:55.000000000 +0100
-+++ linux-2.6.27/lib/Makefile 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/lib/Makefile 2008-10-30 22:27:34.000000000 +0100
@@ -57,6 +57,10 @@ obj-$(CONFIG_CRC7) += crc7.o
obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
-+obj-$(CONFIG_RD_GZIP) += inflate.o
++obj-y += inflate.o
+obj-$(CONFIG_RD_BZIP2) += decompress_bunzip2.o
+obj-$(CONFIG_RD_LZMA) += decompress_unlzma.o
+
@@ -2874,7 +2871,7 @@
obj-$(CONFIG_REED_SOLOMON) += reed_solomon/
diff -urNp linux-2.6.27.orig/scripts/bin_size linux-2.6.27/scripts/bin_size
--- linux-2.6.27.orig/scripts/bin_size 1970-01-01 01:00:00.000000000 +0100
-+++ linux-2.6.27/scripts/bin_size 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/scripts/bin_size 2008-10-30 22:27:29.000000000 +0100
@@ -0,0 +1,10 @@
+#!/bin/sh
+
@@ -2888,7 +2885,7 @@
+/bin/echo -ne $size_hex_echo_string
diff -urNp linux-2.6.27.orig/scripts/Makefile.lib linux-2.6.27/scripts/Makefile.lib
--- linux-2.6.27.orig/scripts/Makefile.lib 2008-10-29 08:48:11.000000000 +0100
-+++ linux-2.6.27/scripts/Makefile.lib 2008-10-29 08:54:07.000000000 +0100
++++ linux-2.6.27/scripts/Makefile.lib 2008-10-30 22:27:29.000000000 +0100
@@ -174,3 +174,17 @@ quiet_cmd_gzip = GZIP $@
cmd_gzip = gzip -f -9 < $< > $@
@@ -2897,75 +2894,13 @@
+# ---------------------------------------------------------------------------
+
+# Bzip2 does not include size in file... so we have to fake that
-+size_append=$(SHELL) $(srctree)/scripts/bin_size
++size_append=$(CONFIG_SHELL) $(srctree)/scripts/bin_size
+
+quiet_cmd_bzip2 = BZIP2 $@
-+cmd_bzip2 = (bzip2 -9 < $< ; $(size_append) $<) > $@
++cmd_bzip2 = (bzip2 -9 < $< ; $(size_append) $<) > $@ || (rm -f $@ ; false)
+
+# Lzma
+# ---------------------------------------------------------------------------
+
+quiet_cmd_lzma = LZMA $@
-+cmd_lzma = (lzma -9 --format=alone -c $< ; $(size_append) $<) >$@
-diff -urNp linux-2.6.27.orig/usr/initramfs_data.S linux-2.6.27/usr/initramfs_data.S
---- linux-2.6.27.orig/usr/initramfs_data.S 2008-10-29 08:47:54.000000000 +0100
-+++ linux-2.6.27/usr/initramfs_data.S 2008-10-29 08:54:07.000000000 +0100
-@@ -8,7 +8,7 @@
-
-
- ld -m elf_i386 --format binary --oformat elf32-i386 -r \
-- -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
-+ -T initramfs_data.scr initramfs_data.cpio -o initramfs_data.o
- ld -m elf_i386 -r -o built-in.o initramfs_data.o
-
- initramfs_data.scr looks like this:
-@@ -26,5 +26,5 @@ SECTIONS
- */
-
- .section .init.ramfs,"a"
--.incbin "usr/initramfs_data.cpio.gz"
-+.incbin "usr/initramfs_data.cpio"
-
-diff -urNp linux-2.6.27.orig/usr/Makefile linux-2.6.27/usr/Makefile
---- linux-2.6.27.orig/usr/Makefile 2008-10-29 08:47:54.000000000 +0100
-+++ linux-2.6.27/usr/Makefile 2008-10-29 08:54:07.000000000 +0100
-@@ -12,7 +12,7 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramf
- # initramfs_data.o contains the initramfs_data.cpio.gz image.
- # The image is included using .incbin, a dependency which is not
- # tracked automatically.
--$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
-+$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio FORCE
-
- #####
- # Generate the initramfs cpio archive
-@@ -29,24 +29,24 @@ ramfs-args := \
- # in initramfs and to detect if any files are added/removed.
- # Removed files are identified by directory timestamp being updated
- # The dependency list is generated by gen_initramfs.sh -l
--ifneq ($(wildcard $(obj)/.initramfs_data.cpio.gz.d),)
-- include $(obj)/.initramfs_data.cpio.gz.d
-+ifneq ($(wildcard $(obj)/.initramfs_data.cpio.d),)
-+ include $(obj)/.initramfs_data.cpio.d
- endif
-
- quiet_cmd_initfs = GEN $@
- cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
-
--targets := initramfs_data.cpio.gz
-+targets := initramfs_data.cpio
- # do not try to update files included in initramfs
- $(deps_initramfs): ;
-
- $(deps_initramfs): klibcdirs
--# We rebuild initramfs_data.cpio.gz if:
-+# We rebuild initramfs_data.cpio if:
- # 1) Any included file is newer then initramfs_data.cpio.gz
- # 2) There are changes in which files are included (added or deleted)
- # 3) If gen_init_cpio are newer than initramfs_data.cpio.gz
- # 4) arguments to gen_initramfs.sh changes
--$(obj)/initramfs_data.cpio.gz: $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
-- $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.gz.d
-+$(obj)/initramfs_data.cpio: $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
-+ $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d
- $(call if_changed,initfs)
-
++cmd_lzma = (lzma -9 --format=alone -c $< ; $(size_append) $<) >$@ || (rm -f $@ ; false)
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-CRI-lzma-vmlinuz.patch?r1=1.1.2.7&r2=1.1.2.8&f=u
More information about the pld-cvs-commit
mailing list