[Vmdebootstrap-devel] [PATCH 3/4] Add freebsd-variant of mounting dev, proc and sys in chroots
Christoph Egger
christoph at christoph-egger.org
Sun Nov 1 18:32:01 UTC 2015
---
vmdebootstrap | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/vmdebootstrap b/vmdebootstrap
index d166485..8deda74 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -858,12 +858,20 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth
cfg.write("%s\n" % command)
def _mount_wrapper(self, rootdir):
- self.runcmd(['mount', '/dev', '-t', 'devfs', '-obind',
- '%s' % os.path.join(rootdir, 'dev')])
- self.runcmd(['mount', '/proc', '-t', 'proc', '-obind',
- '%s' % os.path.join(rootdir, 'proc')])
- self.runcmd(['mount', '/sys', '-t', 'sysfs', '-obind',
- '%s' % os.path.join(rootdir, 'sys')])
+ if 'freebsd' in os.sys.platform:
+ self.runcmd(['mount', 'dev', '-t', 'devfs',
+ '%s' % os.path.join(rootdir, 'dev')])
+ self.runcmd(['mount', 'proc', '-t', 'linprocfs',
+ '%s' % os.path.join(rootdir, 'proc')])
+ self.runcmd(['mount', 'sys', '-t', 'linsysfs',
+ '%s' % os.path.join(rootdir, 'sys')])
+ else:
+ self.runcmd(['mount', '/dev', '-t', 'devfs', '-obind',
+ '%s' % os.path.join(rootdir, 'dev')])
+ self.runcmd(['mount', '/proc', '-t', 'proc', '-obind',
+ '%s' % os.path.join(rootdir, 'proc')])
+ self.runcmd(['mount', '/sys', '-t', 'sysfs', '-obind',
+ '%s' % os.path.join(rootdir, 'sys')])
def _umount_wrapper(self, rootdir):
self.runcmd(['umount', os.path.join(rootdir, 'sys')])
--
2.6.1
More information about the Vmdebootstrap-devel
mailing list