Merge pull request #295 from CanonicalLtd/mwhudson/no-swapfile-for-btrfs-root

prevent creation of a swapfile when / is btrfs
This commit is contained in:
Michael Hudson-Doyle 2018-03-14 14:27:01 +13:00 committed by GitHub
commit 5a81c397b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -401,6 +401,10 @@ class FilesystemModel(object):
return True return True
return False return False
def swapfile_ok(self):
for m in self._mounts:
if m.path == '/':
return m.device.fstype != 'btrfs'
## class AttrDict(dict): ## class AttrDict(dict):
## __getattr__ = dict.__getitem__ ## __getattr__ = dict.__getitem__

View File

@ -134,6 +134,9 @@ class SubiquityModel:
}, },
} }
if not self.filesystem.swapfile_ok():
config['swap'] = {'size': 0}
config.update(self.network.render()) config.update(self.network.render())
config.update(self.installpath.render()) config.update(self.installpath.render())