Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 399081 - [aidecoe] add option for have possibility to change dracut compression method (like --xz)
Summary: [aidecoe] add option for have possibility to change dracut compression method...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: genkernel (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-16 15:00 UTC by Vadim A. Misbakh-Soloviov (mva)
Modified: 2012-06-24 12:59 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2012-01-16 15:00:58 UTC
somethinkg like:
«COMP_METHOD="gz"» to /etc/genkernel.conf
and


--- /usr/share/genkernel/gen_dracut.sh  2012-01-16 22:00:15.000000000 +0700
+++ /usr/share/genkernel/gen_dracut.sh.new      2012-01-16 21:59:40.000000000 +0700
@@ -30,7 +30,7 @@
 }
 
 create_initramfs() {
-       local tmprd="${TMPDIR}/initramfs-${KV}" opts='-f -L=3 -M' add_files=()
+       local tmprd="${TMPDIR}/initramfs-${KV}" opts='-f -L=3 -M --${COMP_METHOD}' add_files=()
 
        print_info 1 'initramfs: >> Initializing Dracut...'
 
@@ -86,9 +86,9 @@
 
        if isTrue "${INTEGRATED_INITRAMFS}"
        then
-               mv ${tmprd} ${tmprd}.cpio.gz
+               mv ${tmprd} ${tmprd}.cpio.${COMP_METHOD}
                sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config
-               echo -e "CONFIG_INITRAMFS_SOURCE=\"${tmprd}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" \
+               echo -e "CONFIG_INITRAMFS_SOURCE=\"${tmprd}.cpio.${COMP_METHOD}\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" \
                                >> ${KERNEL_DIR}/.config
        fi
Comment 1 Amadeusz Żołnowski (RETIRED) gentoo-dev 2012-06-24 12:59:33 UTC
From 8b62b367acd45e8b48d0531ab64c37970c958266 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@gentoo.org>
Date: Sun, 24 Jun 2012 14:43:39 +0200
Subject: [PATCH] Change dracut compression method.

Thanks to mva <mva@mva.name> for the patch at bug #399081.  I have fixed
quotes and set a default value.
---
 gen_dracut.sh  |    5 +++--
 genkernel.conf |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gen_dracut.sh b/gen_dracut.sh
index 858426e..3edfc8f 100755
--- a/gen_dracut.sh
+++ b/gen_dracut.sh
@@ -31,6 +31,7 @@ dracut_modules() {
 
 create_initramfs() {
 	local tmprd="${TMPDIR}/initramfs-${KV}" opts='-f -L=3 -M' add_files=()
+    local tmprd="${TMPDIR}/initramfs-${KV}" opts="-f -L=3 -M --${COMP_METHOD}" add_files=()
 
 	print_info 1 'initramfs: >> Initializing Dracut...'
 
@@ -86,9 +87,9 @@ create_initramfs() {
 
 	if isTrue "${INTEGRATED_INITRAMFS}"
 	then
-		mv ${tmprd} ${tmprd}.cpio.gz
+        mv ${tmprd} ${tmprd}.cpio.${COMP_METHOD:-gz}
 		sed -i '/^.*CONFIG_INITRAMFS_SOURCE=.*$/d' ${KERNEL_DIR}/.config
-		echo -e "CONFIG_INITRAMFS_SOURCE=\"${tmprd}.cpio.gz\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" \
+		echo -e "CONFIG_INITRAMFS_SOURCE=\"${tmprd}.cpio.${COMP_METHOD:-gz}\"\nCONFIG_INITRAMFS_ROOT_UID=0\nCONFIG_INITRAMFS_ROOT_GID=0" \
 				>> ${KERNEL_DIR}/.config
 	fi
 
diff --git a/genkernel.conf b/genkernel.conf
index c425da0..3b9eab5 100644
--- a/genkernel.conf
+++ b/genkernel.conf
@@ -226,6 +226,8 @@ DEFAULT_KERNEL_SOURCE="/usr/src/linux"
 # Create a self-contained env in the initramfs
 #NETBOOT="1"
 
+# Compression method
+COMP_METHOD="xz"
 
 # =========MISC BOOT CONFIGURATION============
 #
-- 
1.7.8.6