From 594a37d093e874d1d0b7c323aabb9985f936fe66 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Mon, 8 Oct 2018 11:24:29 +0200 Subject: [PATCH] add comment about mounting sys with rbind in unshare mode --- mmdebstrap | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mmdebstrap b/mmdebstrap index 0b3b456..db59ba2 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -1066,6 +1066,9 @@ sub setup { if ($options->{mode} eq 'unshare') { # without the network namespace unshared, we cannot mount a new # sysfs. Since we need network, we just bind-mount. + # + # we have to rbind because just using bind results in "wrong fs + # type, bad option, bad superblock" error 0 == system('mount', '-o', 'rbind', '/sys', "$options->{root}/sys") or die "mount failed: $?"; } else { 0 == system('mount', '-t', 'sysfs', '-o', 'nosuid,nodev,noexec', 'sys', "$options->{root}/sys") or die "mount failed: $?";