lkml.org 
[lkml]   [2013]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] Export initial ramdisk compression config
On Sun, 15 Sep 2013 14:49:05 +0530 (IST) P J P <ppandit@redhat.com> wrote:

> 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 ...
>

It's a bit confusing whether all this appiles to initrd, to initramfs
or to both. Can you please clarify all this and be sure that it's all
consistent?

> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -11,6 +11,23 @@ else
> KBUILD_DEFCONFIG := $(ARCH)_defconfig
> endif
>
> +# 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

A few things...

- Why is it specific to x86? Other architcetures use initramfs?

- People add new compression schemes fairly regularly. We should add
a code comment somewhere in a place where such people are sure to
find it. That comment should explain what's going on, remind them to
update this environment varlaible and should explain to them the
process by which they get dracut(8) updated if needed.

- Can we avoid having to update dracut each time a new compression
scheme is added? I assume your dracut changes will just exec
"$INITRD_COMPRESS -d", so as long as any new decompression
application uses the expected -d argument in the expected way, it
should work seamlessly?


\
 
 \ /
  Last update: 2013-09-23 22:01    [W:0.179 / U:9.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site