Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 460882 - sys-kernel/genkernel doesn't create initramfs file - * ERROR: Compression (/usr/bin/xz -e --check=none -z -f -9) failed
Summary: sys-kernel/genkernel doesn't create initramfs file - * ERROR: Compression (/u...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-09 08:02 UTC by Vladimir Romanov (RETIRED)
Modified: 2016-01-24 06:02 UTC (History)
1 user (show)

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


Attachments
emerge --info (einfo,4.23 KB, text/plain)
2013-03-09 08:04 UTC, Vladimir Romanov (RETIRED)
Details
genkernel.log (genkernel.log,662.15 KB, text/plain)
2013-03-09 08:04 UTC, Vladimir Romanov (RETIRED)
Details
New genkernel.log (genkernel.log,393.15 KB, text/plain)
2013-03-18 14:03 UTC, Vladimir Romanov (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Romanov (RETIRED) gentoo-dev 2013-03-09 08:02:27 UTC
I started genkernel --menuconfig all, only difference - i added Device Drivers/Real Time Clock, then i started compiling.
All compiles perfectly (kernel/modules), but initramfs file is not created. A log with error is attached.

Reproducible: Always
Comment 1 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-09 08:04:17 UTC
Created attachment 341380 [details]
emerge --info
Comment 2 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-09 08:04:31 UTC
Created attachment 341382 [details]
genkernel.log
Comment 3 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-03-09 12:30:32 UTC
Is xz present on your system?
Comment 4 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-09 13:35:04 UTC
Yes, when i type xz, it shows

xz: Compressed data cannot be written to a terminal
xz: Try 'xz --help' for more information
Comment 5 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-09 13:51:39 UTC
May be this is important, i don't know, i run genkernel under ssh session, with screen program.
Comment 6 Borislav Milanovic 2013-03-16 22:28:54 UTC
Same problem here,

I try to install a new Gentoo system on a really old laptop.
Minimal DVD -> mount everything, chroot, emerge everything and
'genkernel all' compiles until the end but exits with an error

ERROR: Compression (/usr/bin/xz -e --check=none -z -f -9) failed


xz is reinstalled from repository, but gives same message
as Vladimir:

> /usr/bin/xz
xz: Compressed data cannot be written to a terminal
xz: Try 'xz --help' for more information
Comment 7 Xake 2013-03-17 20:00:52 UTC
Could you please try again, but adding --loglevel=5 to the command, and post the log generated from that?
Comment 8 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-18 14:03:18 UTC
Created attachment 342532 [details]
New genkernel.log
Comment 9 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-25 06:33:37 UTC
Tried to emerge old kernel (3.0.something) - still not compiles. Same error.
Comment 10 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-25 06:55:32 UTC
Well, seems i have resolved an issue. I run only

genkernel initramfs

And it says:
/usr/bin/xz /var/tmp/genkernel/initramfs-3.7.10-gentoo: could not allocate memory

I looked at compression command line:
/usr/bin/xz -e --check=none -z -f -9 /var/tmp/genkernel/initramfs-3.7.10-gentoo

Well, i have 370MB of RAM. But it is not sufficient. But why -9 (best compression)? I removed -9, and all worked fine. I need only to copy initramfs to /boot (and rename it). May be one can use --memlimit option.

So, 370MB now is not sufficient to compile Linux Kernel, because of this xz option.

Question - can we add some genkernel option to limit memory, used by xz? It's annoying to copy/pack initramfs each time.
Comment 11 Sergey Popov (RETIRED) gentoo-dev 2013-03-25 06:56:43 UTC
Confirming this issue.

web ~ # eix xz-utils -c
[I] app-arch/xz-utils (5.0.4-r1@18.02.2013): utils for managing LZMA compressed files
web ~ # eix genkernel -c
[I] sys-kernel/genkernel (3.4.45@18.02.2013): Gentoo automatic kernel building scripts

I have 1G memory on server and still have 'cannot allocate memory' from xz
Comment 12 Xake 2013-03-25 08:02:53 UTC
It is not compiling the kernel that is limited, it is compressing the initramfs.

I think I should take a look into this, I think we may need to have defaults for the compresor like now, but we should really let the user has a possiblity to pass their own options to the compressor.
Comment 13 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-25 08:23:53 UTC
Agreed.
Comment 14 Vladimir Romanov (RETIRED) gentoo-dev 2013-03-25 08:43:56 UTC
By the way, if you will make a way to do so, don't forget to write about it in Installation Handbook. I think, this is related to installation to old computers.
Comment 15 Borislav Milanovic 2013-03-30 12:27:11 UTC
Haaaaa,

did you forget to edit your /etc/fstab and put in your SWAP partition?

> swapon /dev/sda2
> genkernel initramfs

solved it for me.
No more out of memory error.


But your solution without the compression level worked also very well.


Regards,
Boris
Comment 16 Vladimir Romanov (RETIRED) gentoo-dev 2013-04-15 04:06:36 UTC
Well, my swap partition is 150Mb, and it is activated. May be 300M+150M is still not enough, i don't know.
Comment 17 Craig Andrews gentoo-dev 2013-05-02 00:48:10 UTC
I'm seeing this same problem on my system, and I have 4GB of swap.

# swapon -s
Filename                                Type            Size    Used    Priority
/dev/zram0                              partition       511996  374008  16383
/dev/zram1                              partition       511996  373632  16383
/dev/zram2                              partition       511996  373940  16383
/dev/zram3                              partition       511996  373328  16383
/dev/dm-3                               partition       966652  110612  -1
/dev/dm-4                               partition       966652  112924  -2
Comment 18 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-01-24 06:02:49 UTC
I can't reproduce this even on a VM with only 256MB of ram and no swap.
If you still have an issue, patch in setting XZ_DEFAULTS.

Eg:
XZ_DEFAULTS=--memlimit=150MiB.

Or re-open, and we'll add the ability to tweak it more; the xz manpage does describe how much memory is used by the presets like -9 (674MiB for compression)