Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MODULE_COMPRESS_XZ=y [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jun 04, 2017 9:39 pm    Post subject: MODULE_COMPRESS_XZ=y [solved] Reply with quote

if i set compression algorithm for modules to xz (MODULE_COMPRESS_XZ=y), boot is not successful as it seems that kernel won't load modules. i have tried this multiple times now. i only get a full clean successful boot, if modules compression algorithm is gzip (MODULE_COMPRESS_GZIP=y). what am i missing?

Code:
[*] Enable loadable module support  --->
    [*] Compress modules on installation
          Compression algorithm (XZ)  --->
            (X) XZ


Code:
*  sys-kernel/gentoo-sources
      Latest version available: 4.9.16
      Latest version installed: 4.9.16
      Size of files: 91,402 KiB
      Homepage:      https://dev.gentoo.org/~mpagano/genpatches
      Description:   Full sources including the Gentoo patchset for the 4.9 kernel tree
      License:       GPL-2 freedist

_________________
"Growth for the sake of growth is the ideology of the cancer cell." Edward Abbey


Last edited by josephg on Sun Jun 04, 2017 11:21 pm; edited 6 times in total
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jun 04, 2017 9:44 pm    Post subject: Reply with quote

i don't know if this is related. i also have
Code:
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_KERNEL_XZ=y


i build kernel like so
Code:
# make
# make modules_install
# make install


i expect my kernel to be compressed xz. but imagine my surprise when i find this
Code:
$ file /boot/vmlinuz-4.9.16-gentoo-josephg
/boot/vmlinuz-4.9.16-gentoo-josephg: Linux kernel x86 boot executable bzImage, version 4.9.16-gentoo-josephg (root@localhost) #71 SMP Sat Jun 3 09:57:10 BST 2017, RO-rootFS, swap_dev 0x2, Normal VGA


Last edited by josephg on Sun Jun 04, 2017 11:23 pm; edited 4 times in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Jun 04, 2017 9:56 pm    Post subject: Reply with quote

The name bzImage does not mean it is compressed with bzip2.
Your module tools must support compression mode chosen, kmod for instance has lzma USE flag.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jun 04, 2017 10:44 pm    Post subject: Reply with quote

Jaglover wrote:
The name bzImage does not mean it is compressed with bzip2.

oh :oops: that's what i assumed. how would i identify what compression it is?

Jaglover wrote:
Your module tools must support compression mode chosen, kmod for instance has lzma USE flag.

aha.. this must be it! lzma == xz? 8O but i'd never have guessed
Code:
$ equery u kmod
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for sys-apps/kmod-23:
 U I
 - - debug                    : Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
 - - doc                      : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 - - lzma                     : Enable support for XZ compressed modules
 - - python                   : Add optional support/bindings for the Python language
 + + python_targets_python2_7 : Build with Python 2.7
 + + python_targets_python3_4 : Build with Python 3.4
 - - static-libs              : Build static versions of dynamic libraries as well
 + + tools                    : Install module loading/unloading tools.
 + + zlib                     : Enable support for gzipped modules


Last edited by josephg on Sun Jun 04, 2017 11:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jun 04, 2017 11:11 pm    Post subject: Reply with quote

and houston we have liftoff :) thank you Jaglover

/etc/portage/package.use:
sys-apps/kmod lzma

i now have a kernel with MODULE_COMPRESS_XZ=y booting successfully


Last edited by josephg on Sun Jun 04, 2017 11:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
Leio
Developer
Developer


Joined: 27 Feb 2003
Posts: 494
Location: Estonia

PostPosted: Sun Jun 04, 2017 11:12 pm    Post subject: Reply with quote

You don't need to worry about the compression type of bzImage here, it'll know how to decompress itself.
bzImage stands for "big zImage", indeed not related to bzip2.
"xz is a lossless data compression program and file format which incorporates the LZMA/LZMA2 compression algorithms.", so lzma is suitable as a generic USE flag name here. The difference from what you are thinking under lzma (lzma-utils) are with the file format mostly.

If you REALLY want to know what compression format it is in, you could see what scripts/extract-vmlinux (in your kernel sources) does with trying to extra the decompressed vmlinux out of a bzImage given to it, perhaps even just modify it to have a
Code:
echo "Trying $3" >&2
before check_vmlinux call inside try_decompress() and it was in the format you last saw most likely, unless "Cannot find vmlinux" is also printed. Maybe there are some tools to extract just the compressed version out of bzImage too, whose output you could run "file" on.
_________________
GNOME team lead; GStreamer; MIPS/ARM64
Back to top
View user's profile Send private message
josephg
l33t
l33t


Joined: 10 Jan 2016
Posts: 783
Location: usually offline

PostPosted: Sun Jun 04, 2017 11:29 pm    Post subject: Reply with quote

that seems a tad complicated to find out what my kernel is compressed as.

i couldn't associate lzma with xz, as they are separately mentioned in the kernel config.

CONFIG_HAVE_KERNEL_XZ
CONFIG_HAVE_KERNEL_LZMA

CONFIG_RD_XZ
CONFIG_RD_LZMA
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum