From 7ed9b152319e02090b1265a22eed041a7f93af40 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 29 Jun 2011 16:29:08 +0100 Subject: [PATCH] Add a rudimentary /etc/fstab. --- vmdebootstrap | 7 +++++++ 1 file changed, 7 insertions(+) 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') -- 2.39.5