[Fedora-livecd-list] imgcreate/kickstart.py

Jeremy Katz katzj at fedoraproject.org
Fri Apr 25 15:28:48 UTC 2008


 imgcreate/kickstart.py |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 3b4ce49118c7c788a1814de7d986254804826b8b
Author: Jeroen van Meeuwen <kanarip at kanarip.com>
Date:   Fri Apr 25 11:12:32 2008 -0400

    Partition Size overriding
    
    While spinning a Games DVD -just for kicks-, I found that the "part /
    8000" in it's kickstart isn't really applied.
    
    Using ksflatten shows me the "part" statements are appended to one
    another, depending on the other they have been specified; if "part /
    8000" is specified before including the 'base' kickstart, the filesystem
    will end up size 8000*1024L*1024L.
    
    partition_size_last-specified.patch makes livecd-tools loop through
    /all/ the partition statements, and takes the size of last "part /"
    specified so that the "part /" statement becomes something that can be
    overridden. I'm not sure how valid this is, as sorting "part" statements
    in pykickstart may result in unsuspected behavior on livecd-tool's part.

diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 30156d8..ef7b9e4 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -393,10 +393,14 @@ class SelinuxConfig(KickstartConfig):
         self.relabel(ksselinux)
 
 def get_image_size(ks, default = None):
+    __size = 0
     for p in ks.handler.partition.partitions:
         if p.mountpoint == "/" and p.size:
-            return int(p.size) * 1024L * 1024L
-    return default
+            __size = p.size
+    if __size > 0:
+        return int(__size) * 1024L * 1024L
+    else:
+        return default
 
 def get_image_fstype(ks, default = None):
     for p in ks.handler.partition.partitions:





More information about the Fedora-livecd-list mailing list