{{Article summary text|Describes the installation and usage of modprobe db.}}

+

{{Related articles start}}

−

{{Article summary heading|Related}}

+

{{Related|Kernels}}

−

{{Article summary wiki|Kernels}}

+

{{Related|Linux-ck}}

−

{{Article summary wiki|Linux-ck}}

+

{{Related articles end}}

−

{{Article summary end}}

−

{{AUR|modprobed_db}} keeps a running list of ALL modules ever probed on a system and allow for easy recall. This is very useful for users wishing to build a minimal kernel via a `make localmodconfig`which simply takes every module currently probed and switches everything BUT them off in the .config for a kernel resulting in smaller kernel packages and reduced compilation times.

+

{{AUR|modprobed-db}} keeps a running list of ALL modules ever probed on a system and allow for easy recall. This is very useful for users wishing to build a minimal kernel via a {{ic|make localmodconfig}} which simply takes every module currently probed and switches everything BUT them off in the {{ic|.config}} for a kernel resulting in smaller kernel packages and reduced compilation times.

== Installation and Setup ==

== Installation and Setup ==

−

#Download, build, and install {{AUR|modprobed_db}}.

+

The {{AUR|modprobed-db}} package is available from the [[AUR]].

−

#Edit {{ic|/etc/modprobed_db.conf}} and optionally add some modules to ignore to the IGNORE array. Some common ones are included by default.

+

+

#Run {{ic|modprobed-db}} which will create {{ic|$XDG_CONFIG_HOME/modprobed-db.conf}} if one does not already exist.

+

#Run {{ic|modprobed-db store}} to store the current loaded modules.

+

+

'''Optionally:''' add modules in the ignore array that you do NOT want counted, for example modules that get built or that are provided by another package.

Once the initial database has been created, simply use the system (insert USB sticks, use hardware that requires modules, mount filesystems that require modules, etc.) and periodically update the databases by one of two automatic methods:

−

The most convenient method to "use" modprobed_db is to simply add an entry in the root user's crontab to invoke {{ic|/usr/bin/modprobed_db store}} at some regular interval.

+

=== Cron ===

+

The most convenient method to use modprobed-db is to simply add a crontab entry invoking {{ic|/usr/bin/modprobed-db store}} at some regular interval.

+

+

Example running the script once every hour:

+

$ crontab -e

+

0 */1 * * * /usr/bin/modprobed-db store &> /dev/null

+

+

=== Systemd ===

+

Systemd users not wishing to use cron may use the included user service: {{ic|modprobed-db.service}}. It will run modprobed-db in store mode once per hour, and at boot and on shutdown.

+

+

$ systemctl --user enable modprobed-db.service

+

$ systemctl --user start modprobed-db.service

−

Example running the script once every 20 minutes:

+

Status of the service and of the timer can be queried like any service and timer:

−

# crontab -e

+

$ systemctl --user status modprobed-db

−

*/20 * * * * /usr/bin/modprobed_db store &> /dev/null

+

$ systemctl --user list-timers

=== Data Recall ===

=== Data Recall ===

−

As mentioned earlier, this script is meant to be used in concert with the '''make localmodconfig''' step of compiling a kernel. After the database has been adequately populated, simply invoke {{ic|/usr/bin/modprobed_db recall}} prior to compiling a kernel to load all modules followed by the '''make localmodconfig''' to do the magic.

+

As mentioned earlier, this script is meant to be used in concert with the '''make localmodconfig''' step of compiling a kernel. After the database has been adequately populated, simply invoke {{ic|/usr/bin/modprobed-db recall}} prior to compiling a kernel to load all modules followed by the '''make localmodconfig''' to do the magic.

+

+

{{Note|Since {{ic|/usr/bin/modprobe}} requires root privileges, {{ic|/usr/bin/modprobed-db}} needs to be called as root or via sudo when users wish to recall the database.}}

−

==== Using the Official ARCH kernel PKGBUILD ====

+

{{Note|While using '''sudo''' is recommended, it is not necessary as the same effect can be achieved with {{ic|<nowiki>make LSMOD=$HOME/.config/modprobed.db localmodconfig</nowiki>}}, this will also avoid polluting your kernel space with unnecessary modules. The downside to this that it will try to build out of tree modules that modprobed has picked up.}}

−

The official ARCH kernel's PKGBUILD does not have native support for this, but it is easily modified as follows:

+

+

==== Using the Official Arch kernel PKGBUILD ====

+

The official Arch kernel's PKGBUILD does not have native support for this, but it is easily modified as follows:

Latest revision as of 19:04, 17 May 2017

modprobed-dbAUR keeps a running list of ALL modules ever probed on a system and allow for easy recall. This is very useful for users wishing to build a minimal kernel via a make localmodconfig which simply takes every module currently probed and switches everything BUT them off in the .config for a kernel resulting in smaller kernel packages and reduced compilation times.

Usage

Once the initial database has been created, simply use the system (insert USB sticks, use hardware that requires modules, mount filesystems that require modules, etc.) and periodically update the databases by one of two automatic methods:

Cron

The most convenient method to use modprobed-db is to simply add a crontab entry invoking /usr/bin/modprobed-db store at some regular interval.

Example running the script once every hour:

$ crontab -e
0 */1 * * * /usr/bin/modprobed-db store &> /dev/null

Systemd

Systemd users not wishing to use cron may use the included user service: modprobed-db.service. It will run modprobed-db in store mode once per hour, and at boot and on shutdown.

Status of the service and of the timer can be queried like any service and timer:

$ systemctl --user status modprobed-db
$ systemctl --user list-timers

Data Recall

As mentioned earlier, this script is meant to be used in concert with the make localmodconfig step of compiling a kernel. After the database has been adequately populated, simply invoke /usr/bin/modprobed-db recall prior to compiling a kernel to load all modules followed by the make localmodconfig to do the magic.

Note: Since /usr/bin/modprobe requires root privileges, /usr/bin/modprobed-db needs to be called as root or via sudo when users wish to recall the database.

Note: While using sudo is recommended, it is not necessary as the same effect can be achieved with make LSMOD=$HOME/.config/modprobed.db localmodconfig, this will also avoid polluting your kernel space with unnecessary modules. The downside to this that it will try to build out of tree modules that modprobed has picked up.

Using the Official Arch kernel PKGBUILD

The official Arch kernel's PKGBUILD does not have native support for this, but it is easily modified as follows:

Recommendations

It is recommended that users install the package and then "use" the system for a good amount of time to allow the database to grow based on usage and capture everything the system needs before building a kernel with a make localmodconfig. Some suggested actions to allow appropriate modules to load and get cataloged:

Insert every kind of removable media (USB, DVD, CD, etc.)

Use every device on the machine (wifi, network, USB stuff like cameras, ipods, etc.)