SliTaz SliTaz Forum

You are not logged in.

#1 2012-02-07 17:23:26

genko
Member
Registered: 2012-02-05
Posts: 28

Module compression in Slitaz

How can the /lib/modules Slitaz kernel modules be uncompressed?

They are definitely not gzipped and unlzma doesn't seem to work,

so how do I uncompress them?

Offline

#2 2012-02-07 17:36:06

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Module compression in Slitaz

# busybox unlzma -c /pathto/module.ko.gz > module.ko

Offline

#3 2012-02-07 18:16:27

genko
Member
Registered: 2012-02-05
Posts: 28

Re: Module compression in Slitaz

Thank you Pascal.....how can you go about uncompressing the whole /lib/modules/ sudirectories

in one shot? how do you do it recursively?

Offline

#4 2012-02-07 18:40:30

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Module compression in Slitaz

And the purpose behind this is...? They work perfectly fine with modprobe compressed.

Offline

#5 2012-02-07 19:13:11

genko
Member
Registered: 2012-02-05
Posts: 28

Re: Module compression in Slitaz

@Trixar-za

I'm experimenting with linux live scripts creating a system that lives on aufs compressed by squashfs, which is why I need to uncompress these modules. I have just a few left in there anyway, as I'm customizing my slitaz specifically for my system only. There is usually a good reason for doing things, T..., try to keep an open mind.

Offline

#6 2012-02-07 19:28:49

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Module compression in Slitaz

Not that you'll get a better compression except with xz, but you could try reverse engineering this:

http://murga-linux.com/puppy/viewtopic.php?t=63971&sid=c6eb885e3cb7b2452e6df437b9b85acf

Since my find-fu isn't that good I can't help you generate the right one for it (could probably be done with sed or a perl script too)

Offline

#7 2012-02-07 23:17:03

genko
Member
Registered: 2012-02-05
Posts: 28

Re: Module compression in Slitaz

Thanks....interesting thread.

I've tried renaming them all to *.ko.lzma with the intention of later using unlzma on them recursively with:

find /path/to/lib/modules/2.6.30.6-slitaz/kernel -type f -name '*.gz' -print0 | xargs -0 rename 's/.gz$/.lzma/'

(all in one line, one command)

to no avail....the command seems to work without error but nothing happens to the file extensions...

heck, not even a direct 'mv module.ko.gz module.ko.lzma' works there.....(why is that?)

I guess we'll have to wait for Pascal....he knows....I'm not in a rush with this anyway...

Offline

#8 2012-02-08 09:05:35

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Module compression in Slitaz

# find /path/to/lib/modules/2.6.30.6-slitaz/kernel -type f -name '*.ko.gz' | while read m; do busybox unlzma -c $m > ${m%.gz} && rm -f $m; done; depmod -a -b /path/to

Offline

#9 2012-02-08 11:51:10

genko
Member
Registered: 2012-02-05
Posts: 28

Re: Module compression in Slitaz

Thank you so very much, Pascal! smile

And can you also give the command for recompressing them back to their original form recursively?

This is very much appreciated.

Offline

#10 2012-02-08 13:35:03

Trixar_za
Administrator
Registered: 2011-03-29
Posts: 1,506

Re: Module compression in Slitaz

Why not just use the script in the puppy linux thread?

Offline

#11 2012-02-08 14:21:50

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: Module compression in Slitaz

http://hg.slitaz.org/wok/raw-file/f7460b4117e7/linux/stuff/gztazmod.sh

Offline

#12 2012-02-08 16:18:04

genko
Member
Registered: 2012-02-05
Posts: 28

Re: Module compression in Slitaz

Thank you! This is excellent! smile smile smile

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.55 MiB (Peak: 1.77 MiB) ]