check if loop mount is possible

if not abort gracefully with an explanation
(10x to Bucciarati and sdonk)
This commit is contained in:
Jaromil 2013-09-05 12:45:40 +02:00
parent 914ac9594e
commit fa75d0f7bc

9
tomb
View File

@ -216,6 +216,15 @@ EOF
exit $? exit $?
fi # are we root already fi # are we root already
# check if we have support for loop mounting
losetup -f > /dev/null
{ test "$?" = "0" } || {
no "Loop mount of volumes is not supported on this machine, this error"
no "often occurs on VPS and kernels that don't provide the loop module."
no "It is impossible to use Tomb on this machine at this conditions."
die "Operation aborted."
}
# make sure necessary kernel modules are loaded # make sure necessary kernel modules are loaded
modprobe dm_mod 2>/dev/null modprobe dm_mod 2>/dev/null
modprobe dm_crypt 2>/dev/null modprobe dm_crypt 2>/dev/null