diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-15 10:35:31 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-03-15 10:35:31 +0000 |
commit | c2bc7d8a21653ffecdcdf849e6f36cfde0fa5a3f (patch) | |
tree | b7c155f974c7ede4e2a1de362197465f00bff656 /morphlib/morphology.py | |
parent | d17290559f7d97a3801a7666ca87358478bcb986 (diff) | |
download | morph-c2bc7d8a21653ffecdcdf849e6f36cfde0fa5a3f.tar.gz |
Fix system image building with morph
The mkimage.sh script should now be unnecessary again.
Diffstat (limited to 'morphlib/morphology.py')
-rw-r--r-- | morphlib/morphology.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/morphlib/morphology.py b/morphlib/morphology.py index 734c4e3d..f637f0f4 100644 --- a/morphlib/morphology.py +++ b/morphlib/morphology.py @@ -102,7 +102,17 @@ class Morphology(object): @property def disk_size(self): - return self._dict['disk-size'] + size = self._dict['disk-size'] + size = size.lower() + if size.endswith('g'): + size = int(size[:-1]) * 1024**3 + elif size.endswith('m'): + size = int(size[:-1]) * 1024**2 + elif size.endswith('k'): + size = int(size[:-1]) * 1024 + else: + size = int(size) + return size @property def test_stories(self): |