LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-30-2022, 09:54 AM   #4981
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
Smile


Quote:
Originally Posted by kjhambrick View Post
Arrabiata --

How did you trim /lib/modules/5.15.76/ from 315 MB down to 31 MB ?

Thanks

-- kjh
You can compile your own kernel, for example see the attached image
Attached Thumbnails
Click image for larger version

Name:	kern-libmods-size.png
Views:	70
Size:	3.7 KB
ID:	39793  
 
Old 10-30-2022, 10:45 AM   #4982
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks slac.

Yes, I build and install each of the 5.15.y Kernels as soon as they're released ( huge, generic and modules ).

I use Pat's kernel-modules.SlackBuild so I end up with the same 315 MB that Pat's SlackBuild produces ( yesterday's 5.15.76 modules are 380 MB on my machine ).

I was wondering whether Arrabiata had a 'secret recipe' script to automatically pare the default 300+ MB 5.15.y modules down to 31 MB.

Thanks again.

-- kjh

Code:
# du -sh /lib/modules/*

315M    /lib/modules/5.15.63
315M    /lib/modules/5.15.74.kjh
315M    /lib/modules/5.15.75.kjh
380M    /lib/modules/5.15.76.kjh
 
1 members found this post helpful.
Old 10-30-2022, 02:04 PM   #4983
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Quote:
Originally Posted by kjhambrick View Post
Thanks slac.

Yes, I build and install each of the 5.15.y Kernels as soon as they're released ( huge, generic and modules ).

I use Pat's kernel-modules.SlackBuild so I end up with the same 315 MB that Pat's SlackBuild produces ( yesterday's 5.15.76 modules are 380 MB on my machine ).

I was wondering whether Arrabiata had a 'secret recipe' script to automatically pare the default 300+ MB 5.15.y modules down to 31 MB.

Thanks again.

-- kjh

Code:
# du -sh /lib/modules/*

315M    /lib/modules/5.15.63
315M    /lib/modules/5.15.74.kjh
315M    /lib/modules/5.15.75.kjh
380M    /lib/modules/5.15.76.kjh
You're missing main advantage of compiling the kernel if you don't touch the configuration. You could just proceed by step, there are obvious features that you won't need when looking into it
 
Old 10-30-2022, 02:06 PM   #4984
anon231
Member
 
Registered: May 2010
Posts: 47

Rep: Reputation: 76
Quote:
Originally Posted by kjhambrick View Post
Arrabiata --

How did you trim /lib/modules/5.15.76/ from 315 MB down to 31 MB ?

Thanks

-- kjh
With localemodconfig you already get a lot of unnecessary balast removed. However, it is not 100% accurate and you can use menuconfig to improve it. Another 100-200 modules can be safely removed. Some important modules you should better keep, but that depends on the hardware you want to use.
Over time, you will get the optimal configuration.
 
1 members found this post helpful.
Old 10-30-2022, 03:27 PM   #4985
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Thanks Arrabiata, keefaz and slac

I was looking for some good ole PFM(*) that didn't require messing with make *config

But as always, There is No Such Thing as a Free Lunch

-- kjh

(*) - the first word is PURE and the last word is MAGIC, the middle word is an F-Word

P.S. Thanks Arrabiata, localmodconfig was one of the F-Words I was looking for.

But it seems I saw a tool of some sort some where, maybe on the ArchWinki ?

P.P.S. found it: Is there anything like Arch Modprobed-db for Slackware ?

Last edited by kjhambrick; 10-30-2022 at 03:58 PM. Reason: p.p.s.
 
Old 10-30-2022, 08:34 PM   #4986
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,811

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Since I've beern building custom kernels for over 20 years I came from the time when it was both possible as well as bragging rights to get a kernel that would fit on a floppy. Obviously those days are long gone now but thanks to on-demand loadable modules the importance of miniscule kernels is far less valuable that it was before. Within mere miutes of any fresh install I build a custom kernel and these days it doesn't take most of a day like it used to. I just use the generic config as a template, modify the options I want for performance, and remove the most obvious ones I don't. My "/lib/modules/linux-foo" tends to hover around 100MB, much larger than the 27-40MB that some get but comparing performance I don't see a substantial return on investment, so I don't bother any more to take it any further. The benefits I seek are performance, elimination of initrd, and long term service.

With new hardware I will upgrade kernels regularly but once mobos get a year or more on them, upgrades slow to a crawl. I don't bother with encryption and don't pay much attention to security patches because I limit access both physically and networking by a multi-level firewall and disabling network interfaces when not in use. Wifi is always off until I absolutely need it and then off immediately when finished.

I suppose some get a sense of peace and security by bothering with encryption and that's perfectly valid but IMHO the first line of defense is minimizing access and keeping my systems simple.

Last edited by enorbet; 10-30-2022 at 08:36 PM.
 
2 members found this post helpful.
Old 10-31-2022, 11:23 AM   #4987
anon231
Member
 
Registered: May 2010
Posts: 47

Rep: Reputation: 76
Quote:
Originally Posted by kjhambrick View Post

P.S. Thanks Arrabiata, localmodconfig was one of the F-Words I was looking for.

But it seems I saw a tool of some sort some where, maybe on the ArchWinki ?

P.P.S. found it: Is there anything like Arch Modprobed-db for Slackware ?
I know the tool. You will most likely have a laptop, and there the hardware is very limited. Localemodconfig & menuconfig is all you need for this. For example, if you have a laptop with Intel hardware, then of course you don't need modules for Nvidia, AMD, or Mediatek. The advantage is, for the build of bzImage and modules, max. 20-25 minutes pass. And the Skylake is not exactly the fastest CPU. Generating the initrd is also not necessary, if the kernel is configured accordingly. Theoretically you don't need to run grub anymore. It is enough if you adjust the version number in grub.cfg.
 
1 members found this post helpful.
Old 10-31-2022, 03:58 PM   #4988
Jeebizz
Senior Member
 
Registered: May 2004
Distribution: Slackware15.0 64-Bit Desktop, Debian 11 non-free Toshiba Satellite Notebook
Posts: 4,196

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
In the spirit of Halloween:
Click image for larger version

Name:	Screenshot_2022-10-31_15-56-06.jpg
Views:	164
Size:	171.7 KB
ID:	39797
 
4 members found this post helpful.
Old 10-31-2022, 04:41 PM   #4989
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 15.0 + Multilib
Posts: 2,159

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Quote:
Originally Posted by Arrabiata View Post
I know the tool. You will most likely have a laptop, and there the hardware is very limited. Localemodconfig & menuconfig is all you need for this. For example, if you have a laptop with Intel hardware, then of course you don't need modules for Nvidia, AMD, or Mediatek. The advantage is, for the build of bzImage and modules, max. 20-25 minutes pass. And the Skylake is not exactly the fastest CPU. Generating the initrd is also not necessary, if the kernel is configured accordingly. Theoretically you don't need to run grub anymore. It is enough if you adjust the version number in grub.cfg.
Thanks again Arrabiata

I have been running script wrappers that execute Pat's standard SlackBuilds including `make oldconfig` for years and years.

Last Saturday Morning, Linux 5.15.76 took ~18 minutes to build huge, generic and modules:
Code:
[root@kjhlt7 log]# head -1 package-kernel-5.15.76.kjh.log && tail -1 package-kernel-5.15.76.kjh.log
/dld/15.0/slackware/kjh-kernel/.make-SlackBuilds 5.15.76 startup  at Sat Oct 29 04:03:26 CDT 2022
/dld/15.0/slackware/kjh-kernel/.make-SlackBuilds 5.15.76 complete at Sat Oct 29 04:21:29 CDT 2022    # delta_t = 18m 03s
The generic Kernel is MUCH faster by invoking `make localmodconfig` rather than `make oldconfig`

And the /lib/modules/ directory is 33 MB -vs- 380 MB ( nice )

Got some research and testing ahead of me ...

-- kjh

Code:
[root@kjhlt7 linux-5.15.76.kjh_2]# pwd
/usr/src/linux-5.15.76.kjh_2

[root@kjhlt7 linux-5.15.76.kjh_2]# make localmodconfig
<<snip>>

[root@kjhlt7 linux-5.15.76.kjh_2]# vim .config   # edited CONFIG_LOCALVERSION=".kjh_2"
[root@kjhlt7 linux-5.15.76.kjh_2]# time make -j17  bzImage modules    
<<snip>>

Kernel: arch/x86/boot/bzImage is ready  (#1)

real    2m19.835s
user    30m16.029s
sys     2m43.091s

[root@kjhlt7 linux-5.15.76.kjh_2]# make modules_install
<<snip>>

[root@kjhlt7 boot]# du -sh /lib/modules/*
315M    /lib/modules/5.15.63
315M    /lib/modules/5.15.67.kjh
315M    /lib/modules/5.15.68.kjh
315M    /lib/modules/5.15.69.kjh
315M    /lib/modules/5.15.70.kjh
315M    /lib/modules/5.15.71.kjh
315M    /lib/modules/5.15.72.kjh
315M    /lib/modules/5.15.73.kjh
315M    /lib/modules/5.15.74.kjh
315M    /lib/modules/5.15.75.kjh
380M    /lib/modules/5.15.76.kjh     # make oldconfig size
33M     /lib/modules/5.15.76.kjh_2   # make localmodconfig ( nice )
 
1 members found this post helpful.
Old 11-01-2022, 02:30 AM   #4990
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,480
Blog Entries: 2

Rep: Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986
Quote:
Originally Posted by kjhambrick View Post
Thanks Arrabiata, keefaz and slac

I was looking for some good ole PFM(*) that didn't require messing with make *config

But as always, There is No Such Thing as a Free Lunch

-- kjh

(*) - the first word is PURE and the last word is MAGIC, the middle word is an F-Word

P.S. Thanks Arrabiata, localmodconfig was one of the F-Words I was looking for.

But it seems I saw a tool of some sort some where, maybe on the ArchWinki ?

P.P.S. found it: Is there anything like Arch Modprobed-db for Slackware ?
Mayhaps Purely Formulated Magic was the word You were seeking?

I don't swear often, but when I do I swear by Slackware
 
2 members found this post helpful.
Old 11-01-2022, 03:16 AM   #4991
anon231
Member
 
Registered: May 2010
Posts: 47

Rep: Reputation: 76
Quote:
Originally Posted by kjhambrick View Post

The generic Kernel is MUCH faster by invoking `make localmodconfig` rather than `make oldconfig`

And the /lib/modules/ directory is 33 MB -vs- 380 MB ( nice )

Got some research and testing ahead of me ...

-- kjh

[/code]
Correct, it is called localmodconfig, not localemodconfig.
Sorry
 
1 members found this post helpful.
Old 11-01-2022, 10:01 PM   #4992
Fritzarbia
LQ Newbie
 
Registered: Oct 2022
Location: Queensland, Australia
Distribution: Slackware
Posts: 6

Rep: Reputation: 19
Hi All,
As my first post to the forum I guess this is as good a place as any. I started out with Linux using Vector Linux and since it is (was) a Slackware derivative I changed to Slackware. That was version 13.37 and since then Slackware has been my exclusive OS. In the late 90s also I played around with Minix for awhile.

In common with others here I also compile my own kernels and have done so for years. Haven't got my module count as low as some but fairly low. Although memory and disk space is cheap I'd rather not compile hundreds of modules that I will never use. If I get a new piece of hardware then I'll reconfigure and compile a new kernel. The 5.10 kernel is from the original installation.
Code:
$ du -sh /lib/modules/*
280M    /lib/modules/5.10.10
33M     /lib/modules/5.15.21-cwl
33M     /lib/modules/5.15.37-cwl
33M     /lib/modules/5.15.50-cwl
34M     /lib/modules/5.15.72-cwl
I'd like to post some screenshots but as yet I'm not allowed.
 
Old 11-02-2022, 09:38 AM   #4993
elcore
Senior Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 1,754

Rep: Reputation: Disabled
Only problem with localmodconfig is that it won't pick up anything that's not a module.
And if the module's not loaded but used for some software at some point, it won't get picked either.
A lot of manual work is needed to use localmodconfig effectively.

It helps a lot to automatically reduce the number of modules, but from experience, this is where it usually breaks stuff:
If you're using iptables/ebtables/nftables and all of your chains aren't loaded when you run localmodconfig, there will be no firewall modules.
If you have hardware which requires modules and it's not connected when localmodconfig is used, there will be no modules for that hardware.

I apologize for contributing to derailment of this thread without providing any pictures..
But I'll share this local output, where for example my 5.15.72 and 5.15.73 had nouveau compiled-in for testing purposes.
Code:
315M	/lib/modules/5.15.63
16M	/lib/modules/5.15.72-x64
16M	/lib/modules/5.15.73-x64
20M	/lib/modules/5.15.74-x64
20M	/lib/modules/5.15.75-x64
20M	/lib/modules/5.15.76-x64
 
2 members found this post helpful.
Old 11-02-2022, 10:10 AM   #4994
Aeterna
Senior Member
 
Registered: Aug 2017
Location: Terra Mater
Distribution: VM Host: Slackware-current, VM Guests: Artix, Venom, antiX, Gentoo, FreeBSD, OpenBSD, OpenIndiana
Posts: 1,018

Rep: Reputation: Disabled
Quote:
Originally Posted by kjhambrick View Post
Thanks Arrabiata, keefaz and slac

I was looking for some good ole PFM(*) that didn't require messing with make *config

But as always, There is No Such Thing as a Free Lunch

-- kjh

(*) - the first word is PURE and the last word is MAGIC, the middle word is an F-Word

P.S. Thanks Arrabiata, localmodconfig was one of the F-Words I was looking for.

But it seems I saw a tool of some sort some where, maybe on the ArchWinki ?

P.P.S. found it: Is there anything like Arch Modprobed-db for Slackware ?
This is nice but a bit cumbersome (link to Arch).
What you need is to load all modules that you may need. e.g. you have external usb drive firmatted with ntfs, your external cd, music player, tun module and so on. Next run (as mentioned above)
Quote:
make localmodconfig
This is not perfect, but works. Not perfect because you may forget to load something
Anyway:
Quote:
localyesconfig
builds static kernel from loaded modules.
Quote:
allmodconfig
will compile most things as modules.

Arch db works as
Quote:
localmodconfig
collecting all information regarding modules loaded over time, so more time you let it go before compiling kernel more complete db will be.
Of course once you start customizing your kernel, you can go much further than modules only.

Obvious issues: iptables modules. You would have to correct generated kernel config to adjust for iptables modules,also tun module and some custom stuff of course. You will have to remove modules that you don't want e.g ipv6 (examples only).
Manual adjustment of your config will determine safety and performance of your kernel.

Last edited by Aeterna; 11-02-2022 at 10:58 AM.
 
1 members found this post helpful.
Old 11-02-2022, 10:52 AM   #4995
EdGr
Senior Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 1,003

Rep: Reputation: 474Reputation: 474Reputation: 474Reputation: 474Reputation: 474
If you want to save disk space, there is a lot of unused firmware.

Code:
% cd /lib/firmware
% du -s * | sort -n | tail -n 10
20924	qed
24876	liquidio
25184	i915
34600	intel
43280	ath11k
50840	mrvl
65040	amdgpu
71292	mellanox
92728	qcom
143580	netronome
You can easily remove the three worst offenders.
Ed
 
2 members found this post helpful.
  


Reply

Tags
background, cwm, dwm, framebuffer, gnome, gui, i3, ion3, kde, monitor, musca, screenshot, tmux, wallpaper, xfce4, xterm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Desktop on Slackware? darkhatter Slackware 3 10-10-2006 12:26 PM
Slackware 10.0 with NO Desktop NiPP Linux - Newbie 2 01-02-2006 10:43 AM
3d desktop on Slackware k1ll3r_x Linux - Software 1 09-20-2005 10:47 PM
Desktop Slackware s0no Slackware 5 12-04-2004 11:20 AM
I can't get my desktop in Slackware 10 DraGoNsLaYeR Linux - Newbie 1 06-27-2004 02:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration