Bug 3706

Summary: RFE: Can I compress the nvidia .ko module files please?
Product: Fedora Reporter: leigh scott <leigh123linux>
Component: kmodtoolAssignee: Nicolas Chauvet <kwizart>
Status: RESOLVED WONTFIX    
Severity: normal CC: leigh123linux
Priority: P5    
Version: 26   
Hardware: All   
OS: GNU/Linux   
namespace:
Attachments: patch for spec file to compress the .ko files
updated patch for spec file to compress the .ko files as it's x86 only
generic spec file compress patch

Description leigh scott 2015-07-06 01:23:28 CEST
Created attachment 1455 [details]
patch for spec file to compress the .ko files

Fedora kernel modules are compressed .ko.xz files for >= f21, it's seem a simple mod and the space saving is huge.
This would save server bandwidth and reduce storage space required.


example

un-compressed

$ rpm -qlv kmod-nvidia-4.0.5-300.fc22.x86_64-352.21-1.fc22.x86_64
drwxr-xr-x    2 root    root                        0 Jun 16 06:06 /usr/lib/modules/4.0.5-300.fc22.x86_64/extra
drwxr-xr-x    2 root    root                        0 Jun 16 06:06 /usr/lib/modules/4.0.5-300.fc22.x86_64/extra/nvidia
-rw-r--r--    1 root    root                   130248 Jun 16 06:06 /usr/lib/modules/4.0.5-300.fc22.x86_64/extra/nvidia/nvidia-uvm.ko
-rw-r--r--    1 root    root                 12062696 Jun 16 06:06 /usr/lib/modules/4.0.5-300.fc22.x86_64/extra/nvidia/nvidia.ko


compressed


$ rpm -qlv kmod-nvidia-4.0.6-300.fc22.x86_64-352.21-1.fc22.2.x86_64
drwxr-xr-x    2 root    root                        0 Jul  5 23:47 /usr/lib/modules/4.0.6-300.fc22.x86_64/extra
drwxr-xr-x    2 root    root                        0 Jul  5 23:47 /usr/lib/modules/4.0.6-300.fc22.x86_64/extra/nvidia
-rw-r--r--    1 root    root                   453196 Jul  5 23:47 /usr/lib/modules/4.0.6-300.fc22.x86_64/extra/nvidia/nvidia-uvm.ko.xz
-rw-r--r--    1 root    root                  4439284 Jul  5 23:47 /usr/lib/modules/4.0.6-300.fc22.x86_64/extra/nvidia/nvidia.ko.xz
Comment 1 leigh scott 2015-07-06 22:39:21 CEST
Created attachment 1457 [details]
updated patch for spec file to compress the .ko files as it's x86 only

updated patch for spec file to compress the .ko files as it's x86 only
Comment 2 Nicolas Chauvet 2015-07-06 22:55:39 CEST
Why this would be x86 only ? and why this would be only nvidia ?

In others words, this is something that would be better implemented within kmodtool and using the appropriate macros (using the same macros as fedora ?) so that any kmod packages would benefit.
Comment 3 leigh scott 2015-07-06 23:26:07 CEST
(In reply to comment #2)
> Why this would be x86 only ?
>
fedora kernel only does it for x86.

http://pkgs.fedoraproject.org/cgit/kernel.git/tree/kernel.spec#n13

link to arm kernel module package

https://koji.fedoraproject.org/koji/rpminfo?rpmID=6512802

>and why this would be only nvidia ?

I didn't mean it for nvidia only, it's was a bad title choice, sorry.

> In others words, this is something that would be better implemented within
> kmodtool and using the appropriate macros (using the same macros as fedora ?)
> so that any kmod packages would benefit.

fedora kernel uses this to compress the modules

http://pkgs.fedoraproject.org/cgit/kernel.git/tree/kernel.spec#n1751

I agree it would bebetter implemented within kmodtool but don't know to do it.
Comment 4 Nicolas Chauvet 2015-07-06 23:48:03 CEST
Well(In reply to comment #3)
> (In reply to comment #2)
> > Why this would be x86 only ?
...
> 
> http://pkgs.fedoraproject.org/cgit/kernel.git/tree/kernel.spec#n1751
> 
> I agree it would bebetter implemented within kmodtool but don't know to do it.
Well, as you pointed out, it install the script in 
  %define __modsign_install_post
then install this macro in 
  %define __spec_install_post
which is probably used after the install section in nvidia-kmod.spec

You could probably add the needed conditional script in __spec_install_post directly simply by writting to stdout from kmodtool
Comment 5 leigh scott 2015-07-08 22:04:44 CEST
Created attachment 1458 [details]
generic spec file compress patch
Comment 6 leigh scott 2016-09-08 11:39:21 CEST
(In reply to leigh scott from comment #5)
> Created attachment 1458 [details]
> generic spec file compress patch

new compress patch

https://github.com/leigh123linux/nvidia-kmod-1/commit/69ffbe09ea5b14e3a1b9e0ef431b231e03443ddf.patch
Comment 7 Nicolas Chauvet 2016-09-08 11:55:44 CEST
My point is still that the macros should be added to kmodtool and either disabled/enabled by default (I prefer enabled) "and" disabled/enabled on per foo-kmod.spec file basis.
Comment 8 leigh scott 2016-09-08 15:36:31 CEST
(In reply to Nicolas Chauvet from comment #7)
> My point is still that the macros should be added to kmodtool and either
> disabled/enabled by default (I prefer enabled) "and" disabled/enabled on per
> foo-kmod.spec file basis.

What is point of adding it to kmodtool when it's the *-kmod.spec file which is used during akmod-* build?
Comment 9 Nicolas Chauvet 2016-09-08 16:15:35 CEST
This comment still hold, have you tried to remove kmodtool while having akmods ?
Comment 10 Emmanuel Seyman 2016-12-21 09:27:19 CET
Fedora 23 has been EOL-ed and RPMFusion will no longer be releasing updates for this version of Fedora. This bug will be set to RESOLVED:EXPIRED at the end of the week to reflect this.

If the problem persists after upgrading to the latest version of Fedora, please
update the version field of this bug (and re-open it if it has been closed).
Comment 11 leigh scott 2016-12-21 10:06:30 CET
(In reply to Emmanuel Seyman from comment #10)
> Fedora 23 has been EOL-ed and RPMFusion will no longer be releasing updates
> for this version of Fedora. This bug will be set to RESOLVED:EXPIRED at the
> end of the week to reflect this.
> 
> If the problem persists after upgrading to the latest version of Fedora,
> please
> update the version field of this bug (and re-open it if it has been closed).

Can you leave RFE bugs alone as there no subject to EOL!
Comment 12 leigh scott 2017-03-17 08:27:19 CET
kmodtool is now in fedora repo so if the issue persists please file your issue at redhat bugzilla.