Skip to content

Commit

Permalink
dell-bootstrap: use distro policy for swap (Fixes: #82) (LP: #1842325)
Browse files Browse the repository at this point in the history
It's much better than what we were adopting (needlessly wasting space)
> Secondly, the sizing of swapfiles is very different. It is no more than 5% of free disk space or 2GiB, whichever is lower.

See https://blog.surgut.co.uk/2016/12/swapfiles-by-default-in-ubuntu.html
for more details.
  • Loading branch information
Mario Limonciello committed Oct 14, 2019
1 parent 3ea1336 commit 3063f20
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ubiquity/dell-bootstrap.py
Expand Up @@ -364,12 +364,8 @@ def test_swap(self):
release = lsb_release.get_distro_information()

#starting with 17.04, we replace the whole swap partition to swap file
#use distro policy to determine what to do.
if float(release["RELEASE"]) >= 17.04:
try:
self.db.set('partman-swapfile/percentage', '50')
self.db.set('partman-swapfile/size', self.mem * 2048)
except debconf.DebconfError as err:
self.log(str(err))
return True

if (self.mem >= 32 or self.disk_size <= 64):
Expand Down

0 comments on commit 3063f20

Please sign in to comment.