Do not assume that `overlay` is always a module. Check first for
`overlay` in `/proc/filesystems`. This is needed in the --no-kernel
use case to avoid the error: modprobe:
FATAL: Module overlay not found in directory /lib/modules/<kver>
Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
fi
fi
if [ -n "$overlayfs" ]; then
- if ! modprobe overlay; then
+ if ! { strstr "$(< /proc/filesystems)" overlay || modprobe overlay; }; then
if [ "$overlayfs" = required ]; then
die "OverlayFS is required but not available."
exit 1