Commit 655a74aa authored by Phil Miller's avatar Phil Miller

kernel26 updates

parent 42e4e936
......@@ -9,7 +9,7 @@ source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=aufs2-util
pkgver=20100809
pkgrel=1
pkgrel=2
pkgdesc="Another Unionfs Implementation that supports NFS branches"
arch=('i686' 'x86_64')
url="http://aufs.sourceforge.net/"
......
......@@ -9,7 +9,7 @@ source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=aufs2
pkgver=2.6.35_20100809
pkgrel=1
pkgrel=2
_kernver=${pkgver%_*}-CHAKRA
pkgdesc="Another Unionfs Implementation"
arch=('i686' 'x86_64')
......
......@@ -9,7 +9,7 @@ source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=broadcom-wl
pkgver=5.60.48.36
pkgrel=7
pkgrel=8
# Find the kernel name inside the chroot
_kernver=`pacman -Qf kernel26 | cut -c10-15 | sed 's/kernel26 //g'`-CHAKRA
......
......@@ -7,8 +7,6 @@
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
# NOTE: you have to rebuild aufs2 with every new kernel-build.
pkgbase="kernel26"
pkgname=('kernel26' 'kernel26-firmware' 'kernel26-headers') # Build stock -CHAKRA kernel
# pkgname=kernel26-custom # Build kernel with a different name
......@@ -17,7 +15,7 @@ _kernelname=""
_basekernel=2.6.35
pkgver=${_basekernel}.4
pkgrel=2
_patchname="patch-${pkgver}-1-CHAKRA"
_patchname="patch-${pkgver}-2-CHAKRA"
arch=(i686 x86_64)
license=('GPL2')
url="http://www.kernel.org"
......@@ -26,14 +24,12 @@ source=(ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-$_basekernel.tar.bz2
# the main kernel config files
config config.x86_64
# standard config files for mkinitcpio ramdisk
kernel26.preset
http://chakra-project.org/sources/kernel26/linux-2.6.git-c41d68a513c71e35a14f66d71782d27a79a81ea6.patch)
kernel26.preset)
md5sums=('091abeb4684ce03d1d936851618687b6'
'9e1791b99cf714f04b7b8face0cfe65d'
'64089c741709c21b8e645a49e75ddc55'
'8093fff96f915e5353fd07d1a87d2aac'
'25584700a0a679542929c4bed31433b6'
'0672f352de40b0e624b5313388dbaaad')
'949de4fda8c1c3dba527814557721210'
'8ad54ce1ce182f86d704e6d31b617e98'
'c08713d7c3fa4b26be14f9ae8a2f86a3'
'25584700a0a679542929c4bed31433b6')
build() {
cd ${srcdir}/linux-$_basekernel
......@@ -43,9 +39,6 @@ build() {
# Add -CHAKRA patches
patch -Np1 -i ${srcdir}/${_patchname} || return 1
# fix Ac1db1tch3z exploit
patch -Np1 -i ${srcdir}/linux-2.6.git-c41d68a513c71e35a14f66d71782d27a79a81ea6.patch || return 1
if [ "$CARCH" = "x86_64" ]; then
cat ../config.x86_64 >./.config
else
......@@ -223,6 +216,8 @@ package_kernel26-headers() {
find ${pkgdir}/usr/src/linux-${_kernver} -type d -exec chmod 755 {} \;
# remove unneeded architectures
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/arch/{alpha,arm,arm26,avr32,blackfin,cris,frv,h8300,ia64,m32r,m68k,m68knommu,mips,microblaze,mn10300,parisc,powerpc,ppc,s390,sh,sh64,sparc,sparc64,um,v850,xtensa}
# fix aufs
rm -rf ${pkgdir}/usr/src/linux-${_kernver}/include/linux/aufs_type.h
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -14,7 +14,7 @@ post_install () {
echo ">>> If you use LVM2, Encrypted root or software RAID,"
echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
echo ">>> More information about mkinitcpio setup can be found here:"
echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
echo ">>> http://chakra-project.org/wiki/index.php/Mkinitcpio"
echo ""
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
/sbin/mkinitcpio -p kernel26${KERNEL_NAME}
......@@ -47,96 +47,16 @@ post_upgrade() {
fi
fi
if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
# important upgrade notice
echo ">>>"
echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
echo ">>> -------------------------------"
echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
echo ">>> If you still use DevFS, please make the transition to uDev before"
echo ">>> rebooting. If you really need to stay with DevFS for some reason,"
echo ">>> then you can manually downgrade to an older version:"
echo ">>>"
echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
echo ">>>"
echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
echo ">>> IgnorePkg list in /etc/pacman.conf"
echo ">>>"
echo ">>> (NOTE: The following portion applies to uDev users as well!)"
echo ">>>"
echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
echo ">>> be able to boot! Change your root= parameter to use the classic"
echo ">>> naming scheme."
echo ">>>"
echo ">>> EXAMPLES:"
echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
echo ">>> - change root=/dev/md/0 to root=/dev/md0"
echo ">>>"
fi
# generate new init ramdisk
if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
echo ">>> --------------------------------------------------------------"
echo ">>> | WARNING: |"
echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
echo ">>> | Please change to Mkinitcpio setup. |"
echo ">>> --------------------------------------------------------------"
echo ">>>"
fi
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod $KERNEL_VERSION
depmod $KERNEL_VERSION
# generate init ramdisks
echo ">>> MKINITCPIO SETUP"
echo ">>> ----------------"
if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
echo ">>> Please change your bootloader config files:"
echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
echo "------------------------------------------------"
echo "| - initrd26.img to kernel26${KERNEL_NAME}.img |"
echo "| - initrd26-full.img to kernel26${KERNEL_NAME}-fallback.img |"
echo "------------------------------------------------"
fi
if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
echo ""
echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
echo ">>> ----------"
echo ">>> To use the new pata drivers, change the 'ide' hook "
echo ">>> to 'pata' in /etc/mkinicpio.conf HOOKS="
echo ">>> The new system changes: /dev/hd? to /dev/sd?"
echo ">>> Don't forget to modify GRUB, LILO and fstab to the"
echo ">>> new naming system. "
echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
echo ""
echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
echo "----------"
echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf"
echo ">>> the 'ata_piix' module will be used."
echo ">>> This may cause your devices to shift names, eg:"
echo ">>> - IDE: devices from hd? to sd?"
echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix"
echo ""
fi
echo ">>> If you use LVM2, Encrypted root or software RAID,"
echo ">>> Ensure you enable support in /etc/mkinitcpio.conf ."
echo ">>> More information about mkinitcpio setup can be found here:"
echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
echo ">>> http://chakra-project.org/wiki/index.php/Mkinitcpio"
echo ""
echo ">>> Generating initial ramdisk, using mkinitcpio. Please wait..."
if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
/sbin/mkinitcpio -p kernel26${KERNEL_NAME} -m "ATTENTION:\nIf you get a kernel panic below
and are using an Intel chipset, append 'earlymodules=piix' to the
kernel commandline"
else
/sbin/mkinitcpio -p kernel26${KERNEL_NAME}
fi
if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
echo ""
echo "Important ACPI Information:"
echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
echo ">>> The modules are located at:"
echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
echo ">>> For more information about ACPI modules check this wiki page:"
echo ">>> 'http://wiki.archlinux.org/index.php/ACPI_modules'"
fi
}
# Kernel source file
SRC="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.35.tar.bz2"
# Original source directory
SRCORIG="linux-2.6.35"
# Our source directory
SRCNAME="linux-2.6.35-CHAKRA"
# Patches:
# URL%patchlevel
# or
# filename%patchlevel (file must be in patches/ subdirectory)
PATCHES=(
# add upstream patch from 2.6.35 series
http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.35.4.bz2%1
# add latest fixes from stable queue, if needed
# http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
# add aufs2 support, in reference to:
# http://aufs.sourceforge.net
aufs2-base.patch%1
aufs2-standalone.patch%1
# squashfs with lzma
001-squashfs-lzma-add-support-for-lzma-compressed-filesystems.patch%1
002-squashfs-lzma-make-lzma-available-to-non-initramfs-initrd-code.patch%1
003-squashfs-lzma-select-decompress-lzma-needed.patch%1
004-squashfs-lzma-make-lzma-reentrant.patch%1
005-squashfs-lzma-force-lzma-wrapper-to-be-retained.patch%1
006-squashfs-lzma-add-missing-slab.h-include-in-lzma-wrapper.patch%1
# Large I/O operations result in poor interactive performance and high iowait times
# https://bugzilla.kernel.org/show_bug.cgi?id=12309
007-io-fix-for-large-files.patch%1
)
# Name of the resulting patch (will be bzipped afterwards)
PATCHNAME="patch-2.6.35.4-1-CHAKRA"
# Run this before applying patches
pre_apply() {
:
}
# Run this after applying patches
post_apply() {
# remove the extraversion from Makefile
# this ensures our kernel version is always 2.6.XX-CHAKRA
# this way, minor kernel updates will not break external modules
sed -i 's|^EXTRAVERSION = .*$|EXTRAVERSION = |g' Makefile
# Kill some files
find . -name '*~' -exec rm -f {} \; 2>/dev/null
}
README - 2010-03-04
To generate a kernel-patch change in your chakra-buildsys with:
cd ~/DEV/KDEmod
./enter* chakra-i686 or ./enter* chakra-x86_64
check if aufs2 and linux-2.6-ARCH/patches has same DATE
cd ../linux-2.6-ARCH
rm -Rv src
rm -v patch-2.6*
./gen_kernel_patch
copy generated patch archive to kernel26 folder in same repo
update kernel26 PKGBUILD
update svn with new changes of aufs2, kernel26 and linux-2.6-ARCH
\ No newline at end of file
#!/bin/bash
cat_patch() {
file=${startdir}/src/$(basename ${1})
ftype=$(file -bizL "${file}")
case "$ftype" in
*application/x-gzip*)
zcat ${file} ;;
*application/x-bzip*)
bzcat ${file} ;;
*)
cat ${file} ;;
esac
}
get_file() {
file=$(basename ${1})
OPWD=${PWD}
if [ "${file}" != "${1}" ]; then
cd ${SRCDEST}
[ ! -f ${file} ] && wget -c ${1}
cd ${startdir}/src
ln -s ../../_sources/${file} .
else
cd ${startdir}/src
ln -s ../patches/${file} .
fi
cd ${OPWD}
}
source ../_buildscripts/core-testing-${_arch}-makepkg.conf
source PATCHCFG
export SRCNAME
export startdir=${PWD}
mkdir ${startdir}/src
cd ${startdir}/src
get_file ${SRC}
bsdtar -xf $(basename ${SRC})
cp -a ${SRCORIG} ${SRCNAME}
cd ${SRCNAME}
pre_apply
for p in ${PATCHES[@]}; do
patchname=$(echo ${p} | cut -d% -f1)
patchstrip=$(echo ${p} | cut -d% -f2)
get_file ${patchname}
cat_patch ${patchname} | patch -Np${patchstrip} || exit 1
done
post_apply
cd ${startdir}/src
diff -Nur ${SRCORIG} ${SRCNAME} > $startdir/${PATCHNAME}
bzip2 --best $startdir/${PATCHNAME}
From 6e71de691803bf0ec6618a398cbe8b401b5b0dd7 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@lougher.demon.co.uk>
Date: Tue, 20 Oct 2009 10:54:36 +0100
Subject: [PATCH] Squashfs: add support for LZMA compressed filesystems
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
---
fs/squashfs/Kconfig | 5 ++
fs/squashfs/Makefile | 1 +
fs/squashfs/decompressor.c | 4 +
fs/squashfs/lzma_wrapper.c | 151 ++++++++++++++++++++++++++++++++++++++++++++
fs/squashfs/squashfs.h | 3 +
5 files changed, 164 insertions(+), 0 deletions(-)
create mode 100644 fs/squashfs/lzma_wrapper.c
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig
index 25a00d1..0294aa2 100644
--- a/fs/squashfs/Kconfig
+++ b/fs/squashfs/Kconfig
@@ -26,6 +26,11 @@ config SQUASHFS
If unsure, say N.
+config SQUASHFS_LZMA
+ bool "Include support for LZMA compressed file systems"
+ depends on SQUASHFS
+ select DECOMPRESS_LZMA
+
config SQUASHFS_EMBEDDED
bool "Additional option for memory-constrained systems"
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile
index df8a19e..45aaefd 100644
--- a/fs/squashfs/Makefile
+++ b/fs/squashfs/Makefile
@@ -5,5 +5,6 @@
obj-$(CONFIG_SQUASHFS) += squashfs.o
squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
+squashfs-$(CONFIG_SQUASHFS_LZMA) += lzma_wrapper.o
squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o
diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c
index 157478d..0b6ad9b 100644
--- a/fs/squashfs/decompressor.c
+++ b/fs/squashfs/decompressor.c
@@ -50,7 +50,11 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
static const struct squashfs_decompressor *decompressor[] = {
&squashfs_zlib_comp_ops,
+#ifdef CONFIG_SQUASHFS_LZMA
+ &squashfs_lzma_comp_ops,
+#else
&squashfs_lzma_unsupported_comp_ops,
+#endif
&squashfs_lzo_unsupported_comp_ops,
&squashfs_unknown_comp_ops
};
diff --git a/fs/squashfs/lzma_wrapper.c b/fs/squashfs/lzma_wrapper.c
new file mode 100644
index 0000000..cef06d6
--- /dev/null
+++ b/fs/squashfs/lzma_wrapper.c
@@ -0,0 +1,151 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
+ *
+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ * Phillip Lougher <phillip@lougher.demon.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2,
+ * or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * lzma_wrapper.c
+ */
+
+#include <asm/unaligned.h>
+#include <linux/buffer_head.h>
+#include <linux/mutex.h>
+#include <linux/vmalloc.h>
+#include <linux/decompress/unlzma.h>
+
+#include "squashfs_fs.h"
+#include "squashfs_fs_sb.h"
+#include "squashfs_fs_i.h"
+#include "squashfs.h"
+#include "decompressor.h"
+
+struct squashfs_lzma {
+ void *input;
+ void *output;
+};
+
+/* decompress_unlzma.c is currently non re-entrant... */
+DEFINE_MUTEX(lzma_mutex);
+
+/* decompress_unlzma.c doesn't provide any context in its callbacks... */
+static int lzma_error;
+
+static void error(char *m)
+{
+ ERROR("unlzma error: %s\n", m);
+ lzma_error = 1;
+}
+
+
+static void *lzma_init(struct squashfs_sb_info *msblk)
+{
+ struct squashfs_lzma *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
+ if (stream == NULL)
+ goto failed;
+ stream->input = vmalloc(msblk->block_size);
+ if (stream->input == NULL)
+ goto failed;
+ stream->output = vmalloc(msblk->block_size);
+ if (stream->output == NULL)
+ goto failed2;
+
+ return stream;
+
+failed2:
+ vfree(stream->input);
+failed:
+ ERROR("failed to allocate lzma workspace\n");
+ kfree(stream);
+ return NULL;
+}
+
+
+static void lzma_free(void *strm)
+{
+ struct squashfs_lzma *stream = strm;
+
+ if (stream) {
+ vfree(stream->input);
+ vfree(stream->output);
+ }
+ kfree(stream);
+}
+
+
+static int lzma_uncompress(struct squashfs_sb_info *msblk, void **buffer,
+ struct buffer_head **bh, int b, int offset, int length, int srclength,
+ int pages)
+{
+ struct squashfs_lzma *stream = msblk->stream;
+ void *buff = stream->input;
+ int avail, i, bytes = length, res;
+
+ mutex_lock(&lzma_mutex);
+
+ for (i = 0; i < b; i++) {
+ wait_on_buffer(bh[i]);
+ if (!buffer_uptodate(bh[i]))
+ goto block_release;
+
+ avail = min(bytes, msblk->devblksize - offset);
+ memcpy(buff, bh[i]->b_data + offset, avail);
+ buff += avail;
+ bytes -= avail;
+ offset = 0;
+ put_bh(bh[i]);
+ }
+
+ lzma_error = 0;
+ res = unlzma(stream->input, length, NULL, NULL, stream->output, NULL,
+ error);
+ if (res || lzma_error)
+ goto failed;
+
+ /* uncompressed size is stored in the LZMA header (5 byte offset) */
+ res = bytes = get_unaligned_le32(stream->input + 5);
+ for (i = 0, buff = stream->output; bytes && i < pages; i++) {
+ avail = min_t(int, bytes, PAGE_CACHE_SIZE);
+ memcpy(buffer[i], buff, avail);
+ buff += avail;
+ bytes -= avail;
+ }
+ if (bytes)
+ goto failed;
+
+ mutex_unlock(&lzma_mutex);
+ return res;
+
+block_release:
+ for (; i < b; i++)
+ put_bh(bh[i]);
+
+failed:
+ mutex_unlock(&lzma_mutex);
+
+ ERROR("lzma decompression failed, data probably corrupt\n");
+ return -EIO;
+}
+
+const struct squashfs_decompressor squashfs_lzma_comp_ops = {
+ .init = lzma_init,
+ .free = lzma_free,
+ .decompress = lzma_uncompress,
+ .id = LZMA_COMPRESSION,
+ .name = "lzma",
+ .supported = 1
+};
+
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
index fe2587a..d094886 100644
--- a/fs/squashfs/squashfs.h
+++ b/fs/squashfs/squashfs.h
@@ -94,3 +94,6 @@ extern const struct address_space_operations squashfs_symlink_aops;
/* zlib_wrapper.c */
extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
+
+/* lzma wrapper.c */
+extern const struct squashfs_decompressor squashfs_lzma_comp_ops;
--
1.7.1
From 491e6409b8fd8c724f13632715012b157e867e16 Mon Sep 17 00:00:00 2001
From: Phillip Lougher <phillip@lougher.demon.co.uk>
Date: Mon, 11 Jan 2010 16:15:00 +0100
Subject: [PATCH] lzma: Make lzma available to non initramfs/initrd code
Add a config option DECOMPRESS_LZMA_NEEDED which allows subsystems to
specify they need the unlzma code. Normally decompress_unlzma.c is
compiled with __init and unlzma is not exported to modules.
Move INIT definition into separate header files for bzip2/lzma/inflate/lzo
so it can be defined differently for each decompressor.
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
---
include/linux/decompress/bunzip2_mm.h | 12 ++++++++++++
include/linux/decompress/inflate_mm.h | 12 ++++++++++++
include/linux/decompress/mm.h | 3 ---
include/linux/decompress/unlzma_mm.h | 20 ++++++++++++++++++++
include/linux/decompress/unlzo_mm.h | 12 ++++++++++++
lib/Kconfig | 3 +++
lib/decompress_bunzip2.c | 1 +
lib/decompress_inflate.c | 1 +
lib/decompress_unlzma.c | 6 +++++-
lib/decompress_unlzo.c | 1 +
10 files changed, 67 insertions(+), 4 deletions(-)
create mode 100644 include/linux/decompress/bunzip2_mm.h
create mode 100644 include/linux/decompress/inflate_mm.h
create mode 100644 include/linux/decompress/unlzma_mm.h
create mode 100644 include/linux/decompress/unlzo_mm.h
diff --git a/include/linux/decompress/bunzip2_mm.h b/include/linux/decompress/bunzip2_mm.h
new file mode 100644
index 0000000..cac6fef
--- /dev/null
+++ b/include/linux/decompress/bunzip2_mm.h
@@ -0,0 +1,12 @@
+#ifndef BUNZIP2_MM_H
+#define BUNZIP2_MM_H
+
+#ifdef STATIC
+/* Code active when included from pre-boot environment: */
+#define INIT
+#else
+/* Compile for initramfs/initrd code only */
+#define INIT __init
+#endif
+
+#endif
diff --git a/include/linux/decompress/inflate_mm.h b/include/linux/decompress/inflate_mm.h
new file mode 100644
index 0000000..ca4a2ae
--- /dev/null
+++ b/include/linux/decompress/inflate_mm.h
@@ -0,0 +1,12 @@
+#ifndef INFLATE_MM_H
+#define INFLATE_MM_H
+
+#ifdef STATIC
+/* Code active when included from pre-boot environment: */
+#define INIT
+#else
+/* Compile for initramfs/initrd code only */
+#define INIT __init
+#endif
+
+#endif
diff --git a/include/linux/decompress/mm.h b/include/linux/decompress/mm.h
index ad5ec1d..f3f6526 100644
--- a/include/linux/decompress/mm.h
+++ b/include/linux/decompress/mm.h
@@ -63,8 +63,6 @@ static void free(void *where)
#define set_error_fn(x)
-#define INIT
-
#else /* STATIC */
/* Code active when compiled standalone for use when loading ramdisk: */
@@ -87,7 +85,6 @@ static void free(void *where)
static void(*error)(char *m);
#define set_error_fn(x) error = x;
-#define INIT __init
#define STATIC
#include <linux/init.h>
diff --git a/include/linux/decompress/unlzma_mm.h b/include/linux/decompress/unlzma_mm.h
new file mode 100644
index 0000000..859287e
--- /dev/null
+++ b/include/linux/decompress/unlzma_mm.h
@@ -0,0 +1,20 @@
+#ifndef UNLZMA_MM_H
+#define UNLZMA_MM_H
+
+#ifdef STATIC
+
+/* Code active when included from pre-boot environment: */