X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/3b617e51ccb4e6e8fd00cbf15bf76a218776d6dd..9cc88f31c271c983c5b0fe90e2e12bdac0844b92:/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch?ds=inline diff --git a/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch b/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch index d03d34b33..6a4a666c3 100644 --- a/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch +++ b/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch @@ -1,7 +1,14 @@ -diff --git a/init/initramfs.c b/init/initramfs.c --- a/init/initramfs.c +++ b/init/initramfs.c -@@ -475,6 +475,69 @@ static void __init flush_window(void) +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + + static __initdata char *message; + static void __init error(char *x) +@@ -475,6 +476,69 @@ static void __init flush_window(void) outcnt = 0; } @@ -41,13 +48,13 @@ diff --git a/init/initramfs.c b/init/initramfs.c + workspace_size = ((LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp))) * sizeof(CProb)) + 100; + printk( KERN_NOTICE "initramfs: LZMA lc=%d,lp=%d,pb=%d,origSize=%d\n", + lc,lp,pb,osize); -+ outputbuffer = kmalloc(osize, GFP_KERNEL); ++ outputbuffer = vmalloc(osize); + if (outputbuffer == 0) { + printk(KERN_ERR "initramfs: Couldn't allocate lzma output buffer\n"); + return -1; + } + -+ workspace = kmalloc(workspace_size, GFP_KERNEL); ++ workspace = vmalloc(workspace_size); + if (workspace == NULL) { + printk(KERN_ERR "initramfs: Couldn't allocate lzma workspace\n"); + return -1; @@ -62,8 +69,8 @@ diff --git a/init/initramfs.c b/init/initramfs.c + flush_buffer(outputbuffer, outsizeProcessed); + inptr = insize; + -+ kfree(outputbuffer); -+ kfree(workspace); ++ vfree(outputbuffer); ++ vfree(workspace); + state = Reset; + return 0; +} @@ -71,7 +78,7 @@ diff --git a/init/initramfs.c b/init/initramfs.c static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) { int written; -@@ -509,12 +572,28 @@ static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) +@@ -509,12 +573,28 @@ static char * __init unpack_to_rootfs(ch inptr = 0; outcnt = 0; /* bytes in output buffer */ bytes_out = 0; @@ -105,7 +112,6 @@ diff --git a/init/initramfs.c b/init/initramfs.c buf += inptr; len -= inptr; } -diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh @@ -287,7 +287,7 @@ if [ ! -z ${output_file} ]; then