Patchwork [3/4] kernel: add lzma compression support

login
register
mail settings
Submitter christian.braunersorensen@prevas.dk
Date Feb. 27, 2013, 8:43 a.m.
Message ID <b677062b01eecb7508ca4dba7c7f5c7ed66ec706.1361954556.git.christian.braunersorensen@prevas.dk>
Download mbox | patch
Permalink /patch/223555/
State Superseded
Delegated to: Esben Haabendal
Headers show

Comments

christian.braunersorensen@prevas.dk - Feb. 27, 2013, 8:43 a.m.
From: Christian Sørensen <christian.braunersorensen@prevas.dk>

---
 classes/kernel.oeclass | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Patch

diff --git a/classes/kernel.oeclass b/classes/kernel.oeclass
index 5b92b76..e22e27e 100644
--- a/classes/kernel.oeclass
+++ b/classes/kernel.oeclass
@@ -23,6 +23,9 @@  KERNEL_INITRAMFS ?= "${MACHINE_SYSROOT}${bootdir}/initramfs.cpio"
 USE_KERNEL_INITRAMFS = "${USE_kernel_initramfs}"
 USE_KERNEL_INITRAMFS[expand] = "3"
 
+CLASS_FLAGS += "cpio_image_compression"
+DEFAULT_USE_cpio_image_compression = "cpio"
+
 do_configure_kernel () {
 	if [ -e "${DEFCONFIG_FILE}" ]; then
 		cp "${DEFCONFIG_FILE}" "${S}/.config"
@@ -35,8 +38,18 @@  do_configure_kernel () {
 		fi
 	fi
 	if [ -n "${USE_KERNEL_INITRAMFS}" ] ; then
-		echo 'CONFIG_INITRAMFS_SOURCE="${KERNEL_INITRAMFS}"' \
-			>> ${S}/.config
+	        case "${USE_cpio_image_compression}" in
+		  cpio) echo 'CONFIG_INITRAMFS_SOURCE="${KERNEL_INITRAMFS}"' >> ${S}/.config
+                           ;;
+		  lzma) echo 'CONFIG_RD_LZMA=y' >> ${S}/.config
+                        echo 'CONFIG_INITRAMFS_COMPRESSION_LZMA=y' >> ${S}/.config
+                        echo 'CONFIG_INITRAMFS_SOURCE="${KERNEL_INITRAMFS}.${USE_cpio_image_compression}"' >> ${S}/.config
+		           ;;
+		  *) echo "ERROR: kernel.oeclass: ${USE_cpio_image_compression} not supported"
+			;;
+	esac
+
+
 		yes '' | oe_runmake oldconfig
 	fi
 }