generic/317,318: fail gracefully if userns not supported

generic/317 and generic/318 fail un-gracefully on older kernels
which don't support userns; fix that by running a simple test
as a prerequisite and fail gracefully if needed.

Roll that in with the test for executable presence, and make
a new _require_userns()

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Eric Sandeen
2014-06-18 09:34:39 +10:00
committed by Dave Chinner
parent bbe5d55a0b
commit c728752cfa
3 changed files with 8 additions and 3 deletions
+6
View File
@@ -2132,6 +2132,12 @@ _require_relatime()
_scratch_unmount
}
_require_userns()
{
[ -x src/nsexec ] || _notrun "src/nsexec executable not found"
src/nsexec -U true 2>/dev/null || _notrun "userns not supported by this kernel"
}
_create_loop_device()
{
file=$1