summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-06-29 16:29:08 +0100
committerLars Wirzenius <liw@liw.fi>2011-06-29 16:29:08 +0100
commit7ed9b152319e02090b1265a22eed041a7f93af40 (patch)
treeba40e2570137f740d13cf78250aabf0d9d7d1e7c
parent6906af4d702987376af64b4229763672f7c1eca2 (diff)
downloadvmdebootstrap-7ed9b152319e02090b1265a22eed041a7f93af40.tar.gz
Add a rudimentary /etc/fstab.
-rwxr-xr-xvmdebootstrap7
1 files changed, 7 insertions, 0 deletions
diff --git a/vmdebootstrap b/vmdebootstrap
index 61f0760..b5e02a0 100755
--- a/vmdebootstrap
+++ b/vmdebootstrap
@@ -77,6 +77,7 @@ class VmDebootstrap(cliapp.Application):
rootdir = self.mount(rootdev)
self.debootstrap(rootdir)
self.set_hostname(rootdir)
+ self.create_fstab(rootdir)
self.set_root_password(rootdir)
self.remove_udev_persistent_rules(rootdir)
self.setup_networking(rootdir)
@@ -184,6 +185,12 @@ class VmDebootstrap(cliapp.Application):
line += ' %s' % hostname
f.write('%s\n' % line)
+ def create_fstab(self, rootdir):
+ fstab = os.path.join(rootdir, 'etc', 'fstab')
+ with open(fstab, 'w') as f:
+ f.write('proc /proc proc defaults 0 0\n')
+ f.write('/dev/sda1 / ext4 errors=remount-ro 0 1\n')
+
def set_root_password(self, rootdir):
if self.settings['root-password']:
self.message('Setting root password')