summaryrefslogtreecommitdiff
path: root/morphlib/builder2.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-05-02 16:21:10 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2013-05-02 16:21:10 +0100
commit6e7dd9db82e8c18dd278f8d38a8da2017bae0676 (patch)
tree016f2a1635438cdb55859f4a8b716f4043f9a2bb /morphlib/builder2.py
parent007c3cf1aedba2991383d57e947c11514a9ad29b (diff)
downloadmorph-6e7dd9db82e8c18dd278f8d38a8da2017bae0676.tar.gz
Create an empty fstab if one is missing
Diffstat (limited to 'morphlib/builder2.py')
-rw-r--r--morphlib/builder2.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/morphlib/builder2.py b/morphlib/builder2.py
index 7ded281e..b8026612 100644
--- a/morphlib/builder2.py
+++ b/morphlib/builder2.py
@@ -598,13 +598,16 @@ class SystemKindBuilder(BuilderBase): # pragma: no cover
path=path, chatty=True)
with self.build_watch('create-fstab'):
fstab = os.path.join(path, 'etc', 'fstab')
- # FIXME: should exist
- if not os.path.exists(os.path.dirname(fstab)):
- os.makedirs(os.path.dirname(fstab))
- with open(fstab, 'w') as f:
- f.write('proc /proc proc defaults 0 0\n')
- f.write('sysfs /sys sysfs defaults 0 0\n')
- f.write('/dev/sda1 / btrfs defaults,rw,noatime 0 1\n')
+ if not os.path.exists(fstab):
+ # FIXME: should exist
+ if not os.path.exists(os.path.dirname(fstab)):
+ os.makedirs(os.path.dirname(fstab))
+ # We create an empty fstab: systemd does not require
+ # /sys and /proc entries, and we can't know what the
+ # right entry for / is. The fstab gets built during
+ # deployment instead, when that information is available.
+ with open(fstab, 'w'):
+ pass
def copy_kernel_into_artifact_cache(self, path):
'''Copy the installed kernel image into the local artifact cache.