Suspend To RAM and kernel modules

In /usr/lib/pm-utils/defaults or /etc/pm/config.d/ you can set the variable SUSPEND_MODULES to define kernel modules to be unloaded before suspending.

So far, so good.

But it seems, after resuming these kernel modules sometimes seem to not be reloaded again? Or am I wrong?

I put Virtualbox modules in SUSPEND_MODULES and the system suspends just fine.

After resuming my impression was, the modules unloaded did not get reloaded into system again?

Thus I wonder, do I need to create a new power management hook to reload these kernel modules?

On 2014-09-21 23:46, pinguin74 wrote:

> After resuming my impression was, the modules unloaded did not get
> reloaded into system again?

Check if they are. The command “lsmod” will tell you if they are. Then
check the file “/var/log/pm-suspend.log”, the hook that does that trick
is “/usr/lib/pm-utils/sleep.d/75modules”. When a module is unloaded, it
prints a message:

printf “Unloading kernel module %s…” “$x”

put modules are not reloaded one by one, but like this:


resume_modules()
{
modreload
echo "Reloaded unloaded modules."
}

which is defined in “/usr/lib/pm-utils/functions”:


modreload()
{
for x in "${STORAGEDIR}"/module:* ; do
 -O "${x}" ] || continue
modprobe "${x##*:}" >/dev/null 2>&1 || \
log "Could not reload module ${x##*:}."
done
}

That should get you started :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)