From: P J P <ppandit@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] Export initial ramdisk compression config
Date: Thu, 10 Oct 2013 20:44:32 +0530 (IST) [thread overview]
Message-ID: <alpine.LFD.2.03.1310102041090.3691@erqung.pbz> (raw)
In-Reply-To: <20131009144849.96389b7cdb3a553e52682137@linux-foundation.org>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 437 bytes --]
Hello Andrew,
+-- On Wed, 9 Oct 2013, Andrew Morton wrote --+
| It would be better to make the change in one place, rather than for
| each architecture. That would appear to involve moving a hunk from
| arch/x86/Makefile into init/Makefile, or perhaps ./Makefile.
Please see this revised version, I missed to include init/do_mounts_rd.c
changes in the previous one.
Thank you.
--
Prasad J Pandit / Red Hat Security Response Team
[-- Attachment #2: Type: TEXT/PLAIN, Size: 2330 bytes --]
From 14dccee98f12f2dbca224510bcfedd1a397ed177 Mon Sep 17 00:00:00 2001
From: P J P <prasad@redhat.com>
Date: Thu, 10 Oct 2013 20:37:48 +0530
Subject: Export initial ramdisk compression config option
Make menuconfig allows one to choose compression format of an
initial ramdisk image. But this choice does not result in duly
compressed ramdisk image. Because - $ make install - does not
pass on the selected compression choice to the dracut(8) tool,
which creates the initramfs file. dracut(8) generates the image
with the default compression, ie. gzip(1).
This patch exports the selected compression option to a sub-shell
environment, so that it could be used by dracut(8) tool to generate
appropriately compressed initramfs images.
There isn't a straight forward way to pass on options to dracut(8)
via positional parameters. Because it is indirectly invoked at the
end of a $ make install sequence.
# make install
-> arch/$arch/boot/Makefile
-> arch/$arch/boot/install.sh
-> /sbing/installkernel ...
-> /sbin/new-kernel-pkg ...
-> /sbin/dracut ...
diff --git a/Makefile b/Makefile
index 8d0668f..5c7f8aa 100644
--- a/Makefile
+++ b/Makefile
@@ -720,6 +720,22 @@ mod_strip_cmd = true
endif # INSTALL_MOD_STRIP
export mod_strip_cmd
+# Select initial ramdisk compression format, default is gzip(1).
+# This shall be used by the dracut(8) tool while creating an initramfs image.
+#
+INITRD_COMPRESS=gzip
+ifeq ($(CONFIG_RD_BZIP2), y)
+ INITRD_COMPRESS=bzip2
+else ifeq ($(CONFIG_RD_LZMA), y)
+ INITRD_COMPRESS=lzma
+else ifeq ($(CONFIG_RD_XZ), y)
+ INITRD_COMPRESS=xz
+else ifeq ($(CONFIG_RD_LZO), y)
+ INITRD_COMPRESS=lzo
+else ifeq ($(CONFIG_RD_LZ4), y)
+ INITRD_COMPRESS=lz4
+endif
+export INITRD_COMPRESS
ifdef CONFIG_MODULE_SIG_ALL
MODSECKEY = ./signing_key.priv
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index bdaa345..9ee3427 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -57,6 +57,11 @@ static int __init crd_load(int in_fd, int out_fd, decompress_fn deco);
* cramfs
* squashfs
* gzip
+ * bzip2
+ * lzma
+ * xz
+ * lzo
+ * lz4
*/
static int __init
identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
--
1.8.3.1
next prev parent reply other threads:[~2013-10-10 15:14 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-15 9:19 P J P
2013-09-23 19:52 ` Andrew Morton
2013-09-24 19:41 ` P J P
2013-09-25 16:56 ` Rob Landley
2013-09-26 7:30 ` P J P
2013-10-09 21:48 ` Andrew Morton
2013-10-10 7:05 ` P J P
2013-10-10 14:43 ` P J P
2013-10-10 15:14 ` P J P [this message]
2013-09-30 21:41 ` P J P
2013-10-05 20:43 ` P J P
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.03.1310102041090.3691@erqung.pbz \
--to=ppandit@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®