]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-checkconfig: Only check probed modules if /proc/modules exists 4091/head
authorJami Kettunen <jami.kettunen@protonmail.com>
Tue, 8 Mar 2022 10:20:33 +0000 (12:20 +0200)
committerJami Kettunen <jami.kettunen@protonmail.com>
Tue, 8 Mar 2022 10:37:08 +0000 (12:37 +0200)
commitb7affe5264c5405137389e1cd6fbda5cc4208c05
tree61aa0e6488be108755222a17234d810341ccbafc
parent2ff64429ecd07dfbb869573ee07130cd2199e6a1
lxc-checkconfig: Only check probed modules if /proc/modules exists

Kernels can be built with CONFIG_MODULES=n which results in
is_probed() telling the module isn't probed and lsmod spamming the
following to stderr each time it's called:

  libkmod: kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
  Error: could not get list of modules: No such file or directory

Fix this by "stubbing" is_probed() when /proc/modules doesn't exist
as it's always called after a is_enabled() anyway.

Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
src/lxc/cmd/lxc-checkconfig.in