Hello there,

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. Either way:

Attached are two patches:

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.

partition_size_largest.patch however takes all "part /" statements into consideration, and picks the largest.

Another valid solution would be to have 'base' kickstarts specify the filesystem size and, by (Spin SIG?) policy, not allowing any overrides of this part of 'base'.

Kind regards,

Jeroen van Meeuwen
-kanarip

diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 30156d8..4840d9c 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -168,12 +168,12 @@ class FirewallConfig(KickstartConfig):
             return
         self.call(["/usr/sbin/lokkit",
                    "-f", "--quiet", "--nostart", "--enabled"])
-        
+
 class RootPasswordConfig(KickstartConfig):
     """A class to apply a kickstart root password configuration to a system."""
     def unset(self):
         self.call(["/usr/bin/passwd", "-d", "root"])
-        
+
     def set_encrypted(self, password):
         self.call(["/usr/sbin/usermod", "-p", password, "root"])
 
@@ -334,7 +334,7 @@ class NetworkConfig(KickstartConfig):
                 raise errros.KickstartError("No --device specified with "
                                             "network kickstart command")
 
-            if (network.onboot and network.bootProto.lower() != "dhcp" and 
+            if (network.onboot and network.bootProto.lower() != "dhcp" and
                 not (network.ip and network.netmask)):
                 raise errors.KickstartError("No IP address and/or netmask "
                                             "specified with static "
@@ -393,10 +393,15 @@ 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
+            if p.size > __size:
+                __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:
@@ -446,7 +451,7 @@ def get_repos(ks, repo_urls = {}):
 
         baseurl = repo.baseurl
         mirrorlist = repo.mirrorlist
-        
+
         if repo.name in repo_urls:
             baseurl = repo_urls[repo.name]
             mirrorlist = None
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 30156d8..052c2e5 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:
--
Fedora-livecd-list mailing list
Fedora-livecd-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Reply via email to