Coder Social home page Coder Social logo

graysky2 / modprobed-db Goto Github PK

View Code? Open in Web Editor NEW
170.0 20.0 16.0 77 KB

Keeps track of EVERY kernel module that has ever been probed. Useful for those of us who make localmodconfig :)

Home Page: https://wiki.archlinux.org/index.php/Modprobed-db

Makefile 15.77% Shell 84.23%

modprobed-db's Introduction

Modprobed-db

Modprobed-db is a useful utility for users wishing to build a minimal kernel via a make localmodconfig. In a nutshell, this make target creates a config based on the current config and a list of modules you define (modprobed-db keeps for you). It then disables any module option that is not needed thus not building hundreds/potentially thousands of extraneous modules. This results in a system-specific, streamlined kernel package and footprint as well as reduced compilation times.

Modprobed-db simply logs every module ever probed on the target system to a text-based database ($XDG_CONFIG_HOME/modprobed-db) which can be read directly by "make localmodconfig" as described above.

Installation

$ make

Running a make install as root will distribute the files to the filesystem.

# make install

Usage

Refer to the man page man modprobed-db

Links

AUR Package: https://aur.archlinux.org/packages/modprobed-db

modprobed-db's People

Contributors

eli-schwartz avatar graysky2 avatar toazd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modprobed-db's Issues

Needed PNC on debian for checkinstall

Hi !

Please, consider adding in readme requested PNC to checkinstall on Debian 12

makefile line 9 need to be changed to :

SKELDIR = $(PREFIX)/share/$(PNC)

All lines with PN must be changed to PNC (depreciated PN on debian 12)

However, makeinstall work without problem

Non-systemd support

Presently the project only contains systemd service files, so it won't work as nicely on distros such as void which don't have a package providing service management files. I'm not experienced with writing service files, but I could try with runit (what I mainly use).

[Feature request] List modules that don't get loaded by "recall"

Hello!

First of all, thank you for this handy tool! I have a suggestion that would help us make it even more useful: when using modprobed-db recall some modules do not get loaded, and it would be nice to know which ones so we enable them from the .config file with make menuconfig and co, if using linux-tkg for example, those additional modules will then be saved in a "fragment" file that can be reused later on.

151 modules currently loaded per /proc/modules
164 modules are in /home/adel/.config/modprobed.db

Attempting to modprobe the contents of /home/adel/.config/modprobed.db
modprobe: ERROR: could not insert 'amd64_edac_mod': No such device
modprobe: ERROR: could not insert 'fjes': No such device

151 modules are now loaded per /proc/modules

Unit file does not exist

When running trying to enable the user unit via systemctl --user, I keep getting Failed to enable unit: Unit file $HOME/.config/systemd/default.target.wants/modprobed-db.service.

I noticed that the default.target.wants directory doesn't get created.
I can still successfully manually start the user service.

I checked Makepkg logs and both the system service and timer gets installed. No mention of user service there (as expected I think).

systemd timer

Got a few notes/questions.

  1. https://github.com/graysky2/modprobed-db/blob/master/init/modprobed-db%40.service#L3
    It contains the info about the manpage twice. So on checking the status there will be

Documentation: modprobed-db(8)
Documentation: modprobed-db(8)
Documentation: https://wiki.archlinux.org/index.php/Modprobed-db

  1. Couldn't this be added as a systemd --user unit files (placed under /usr/lib/systemd/user/ )? As far as I can tell this would simplify both unit files a bit.

  2. Is oneshot the right thing to do? As far as I can tell (and what systemd list-timers tells me) the unit is just run once.

  3. Regarding the doc. The Arch-Wiki states it's just necessary to enable and start the timer
    https://wiki.archlinux.org/index.php/Systemd/Timers#Service_unit
    whereas here it is adviced to enable the service@user

  4. Shouldn't be an OnBootSec= added? Directly after boot it's not very likely to get new modules, and additionally 30min shouldn't hurt there.

Hope you can enlighten me. I'm relatively new at the topic unit files and it's likely I missed something

Best regards

module not compiled

Hello graysky,

When a module is included manually by the user in a random line (in the database file) and not in alphabetical order causes the particular module not to be compiled.


...
isofs
jbd2
loop <---
joydev
...

Had enough time to test the loop module only, repeated the test 2 times.

Cheers

Not SystemD

Good morning, I want to install modprobed-db on a non SystemD setup. What are the steps you recommend me to do?
Edit.: I'm using OpenRC.

problems with su -

I have problems using this script with su -

palo@iron [~]$ su - 
Password:
root@iron [~]# modprobed-db 
Modprobed-db v2.24

172 modules currently loaded per /proc/modules
172 modules are in /home/palo/.config/modprobed.db

/usr/bin/modprobed-db {list|recall|store|debug}
See manpage for additional details

You use logname to find out the username.

root@iron [~]# logname 
palo
root@iron [~]# echo $USER 
root

I think my personal user is safe but, it makes it harder (have to use a console) for me to look in the database my cronjob is creating (and to load when building a kernel).

grep: conflicting matchers specified

Hi

I have this error message with the debug subcommand. I use grep version 2.19 on archlinux. I get the same error if I run grep -F. Any idea ?

SUDO_USER is not defined

If I'm running as root, USER gets assigned to SUDO_USER which is not defined. Then, I get Error: Cannot figure out who ran this script. Bailing out But root ran the script! What's the problem? Why can't we just always use the value of whoami?

Add functionality to "keep modules stored"

This is a functionality I need. There are some modules which I only occasionally modprobe (e.g., those required for Docker), but would rather have it compiled every time. Otherwise, when I decide I want to use Docker, often I find that I have to rebuild the kernel :-)

I can help with implementing this; it shouldn't be hard, I believe we can just read from a "persistent modules" file and cat it with modprobed.db.

I'll see if I can implement this.

Nvidia-340xx-dkms not build with ck-modprobed kernel

I couldn't find the answer anywhere, request some ideas...

Build kernel linux-ck with modprobed-db without errors, but can't install linux-ck-header with nvidia340xx-dkms:

$ sudo dkms autoinstall -k 6.6.3-2-ck-atom-modprobed --verbose
[sudo] password for nebulosa: 
Sign command: /usr/lib/modules/6.6.3-2-ck-atom-modprobed/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
make clean; make -C uvm clean
make: Entering directory '/var/lib/dkms/nvidia/340.108/build/uvm'
make: Leaving directory '/var/lib/dkms/nvidia/340.108/build/uvm'

{ make -j4 KERNELRELEASE=6.6.3-2-ck-atom-modprobed -j4 module KERNEL_UNAME=6.6.3-2-ck-atom-modprobed; make -C uvm module KERNEL_UNAME=6.6.3-2-ck-atom-modprobed KBUILD_EXTMOD=/var/lib/dkms/nvidia/340.108/build/uvm CC=clang LD=ld.lld; } >> /var/lib/dkms/nvidia/340.108/build/make.log 2>&1
(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.6.3-2-ck-atom-modprobed (x86_64)
Consult /var/lib/dkms/nvidia/340.108/build/make.log for more information.
dkms autoinstall on 6.6.3-2-ck-atom-modprobed/x86_64 failed for nvidia(10)
Error! One or more modules failed to install during autoinstall.
Refer to previous errors for more information.

make.log
modprobed.db

This kernel version but without modprobed.db (compiled all drivers) - 6.6.3-2-atom - installing nvidia340xx-dkms works correct.

I suppose that I need add some modules but can't understand how I can figure out witch ones they are?

How to determine the correct module name from given kernel options

Hi graysky,

I'm using modprobed-db to build my (arch) custom kernel, works great!
There's one thing though I fail to understand: how can I determine the correct MODULE name (to put into the $HOME/.config/modprobed.db database) if I only konw a given KERNEL OPTION?

e.g. in order to use docker, docker tells me "CONFIG_NF_NAT_IPV4: missing" (and equally CONFIG_NF_NAT_NEEDED, CONFIG_IP_NF_TARGET_MASQUERADE, CONFIG_NF_NAT_NEEDED); but I can't figure out what module I would have to add to get this turned on in my custom kernel!

If I simply put these names into the database, a warning appears at the beginning of the kernel compilation (with makepkg -s) that "nf_nat_ipv4 config not found!!".

Is it possible to combine the traditional manual "make menuconfig" approach with the automated modprobed-db / localmodconfig mechanism?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.