[Fedora-livecd-list] 2 commits - imgcreate/live.py

Jeremy Katz katzj at fedoraproject.org
Thu Jan 8 21:53:36 UTC 2009


 imgcreate/live.py |   30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)

New commits:
commit 73ff0151b331e60d011e7038c0485694e1d79dbb
Author: Jeremy Katz <katzj at redhat.com>
Date:   Thu Jan 8 16:50:43 2009 -0500

    Be explicit with isofstype being iso9660 vs udf

diff --git a/imgcreate/live.py b/imgcreate/live.py
index 584bf72..f7e35db 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -70,6 +70,8 @@ class LiveImageCreatorBase(LoopImageCreator):
         self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire", "=mmc", "=pcmcia", "mptsas", "udf"]
         self.__modules.extend(kickstart.get_modules(self.ks))
 
+        self.__isofstype = "iso9660"
+
     #
     # Hooks for subclasses
     #
@@ -248,6 +250,7 @@ class LiveImageCreatorBase(LoopImageCreator):
                       {'file': os.path.join(path, name),
                       'size': os.stat(os.path.join(path, name)).st_size,
                       'fourgib': 4*1024*1024*1024})
+              self.__isofstype = "udf"
               break
 
         args.append(isodir)
@@ -404,13 +407,13 @@ menu hiddenrow 5
             template = """label %(short)s
   menu label %(long)s
   kernel vmlinuz%(index)s
-  append initrd=initrd%(index)s.img root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s
+  append initrd=initrd%(index)s.img root=CDLABEL=%(fslabel)s rootfstype=%(isofstype) %(liveargs)s %(extra)s
 """
         else:
             template = """label %(short)s
   menu label %(long)s
   kernel mboot.c32
-  append xen%(index)s.gz --- vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s --- initrd%(index)s.img
+  append xen%(index)s.gz --- vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=%(isofstype) %(liveargs)s %(extra)s --- initrd%(index)s.img
 """
         return template % args
 
@@ -442,6 +445,7 @@ menu hiddenrow 5
 
             cfg += self.__get_image_stanza(is_xen,
                                            fslabel = self.fslabel,
+                                           isofstype = self.__isofstype,
                                            liveargs = kernel_options,
                                            long = long,
                                            short = "linux" + index,
@@ -454,6 +458,7 @@ menu hiddenrow 5
             if checkisomd5:
                 cfg += self.__get_image_stanza(is_xen,
                                                fslabel = self.fslabel,
+                                               isofstype = self.__isofstype,
                                                liveargs = kernel_options,
                                                long = "Verify and " + long,
                                                short = "check" + index,
@@ -530,7 +535,7 @@ hiddenmenu
 
     def __get_efi_image_stanza(self, **args):
         return """title %(long)s
-  kernel /EFI/boot/vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s
+  kernel /EFI/boot/vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=%(isofstype) %(liveargs)s %(extra)s
   initrd /EFI/boot/initrd%(index)s.img
 """ %args
 
@@ -547,11 +552,13 @@ hiddenmenu
             if os.path.exists("%s/EFI/boot/xen%d.gz" %(isodir, index)):
                 continue
             cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
+                                               isofstype = self.__isofstype,
                                                liveargs = kernel_options,
                                                long = name,
                                                extra = "", index = index)
             if checkisomd5:
                 cfg += self.__get_efi_image_stanza(fslabel = self.fslabel,
+                                                   isofstype = self.__isofstype,
                                                    liveargs = kernel_options,
                                                    long = "Verify and Boot " + name,
                                                    extra = "check",
@@ -670,6 +677,7 @@ image=/ppc/ppc%(bit)s/vmlinuz
         kernel_options = self._get_kernel_options()
 
         cfg += self.__get_image_stanza(fslabel = self.fslabel,
+                                       isofstype = self.__isofstype,
                                        short = "linux",
                                        long = "Run from image",
                                        extra = "",
@@ -678,6 +686,7 @@ image=/ppc/ppc%(bit)s/vmlinuz
 
         if self._has_checkisomd5():
             cfg += self.__get_image_stanza(fslabel = self.fslabel,
+                                           isofstype = self.__isofstype,
                                            short = "check",
                                            long = "Verify and run from image",
                                            extra = "check",


commit e4c497601f021d877e6ef0e68da99f331aed4899
Author: Bruno Wolff III <bruno at wolff.to>
Date:   Thu Jan 8 16:47:10 2009 -0500

    Support using UDF for large ISO spins (#476696)
    
    For ISO spins of larger than four gigabytes, we should use UDF instead of
    ISO9660

diff --git a/imgcreate/live.py b/imgcreate/live.py
index 347d22c..584bf72 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -67,7 +67,7 @@ class LiveImageCreatorBase(LoopImageCreator):
 
         self.__isodir = None
 
-        self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire", "=mmc", "=pcmcia", "mptsas"]
+        self.__modules = ["=ata", "sym53c8xx", "aic7xxx", "=usb", "=firewire", "=mmc", "=pcmcia", "mptsas", "udf"]
         self.__modules.extend(kickstart.get_modules(self.ks))
 
     #
@@ -239,6 +239,17 @@ class LiveImageCreatorBase(LoopImageCreator):
 
         args.extend(self._get_mkisofs_options(isodir))
 
+        # Switch to udf if any file on the image will be 4 GiB or more
+        for path, dirs, files in os.walk(isodir):
+          for name in files:
+            if os.stat(os.path.join(path, name)).st_size >= 4*1024*1024*1024:
+              args.append("-allow-limited-size")
+              logging.warn('%(file)s has a size of %(size)d, which is greater than or equal to %(fourgib)d, requiring a switch from iso9660 to udf.' %
+                      {'file': os.path.join(path, name),
+                      'size': os.stat(os.path.join(path, name)).st_size,
+                      'fourgib': 4*1024*1024*1024})
+              break
+
         args.append(isodir)
 
         if subprocess.call(args) != 0:
@@ -393,13 +404,13 @@ menu hiddenrow 5
             template = """label %(short)s
   menu label %(long)s
   kernel vmlinuz%(index)s
-  append initrd=initrd%(index)s.img root=CDLABEL=%(fslabel)s rootfstype=iso9660 %(liveargs)s %(extra)s
+  append initrd=initrd%(index)s.img root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s
 """
         else:
             template = """label %(short)s
   menu label %(long)s
   kernel mboot.c32
-  append xen%(index)s.gz --- vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=iso9660 %(liveargs)s %(extra)s --- initrd%(index)s.img
+  append xen%(index)s.gz --- vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s --- initrd%(index)s.img
 """
         return template % args
 
@@ -519,7 +530,7 @@ hiddenmenu
 
     def __get_efi_image_stanza(self, **args):
         return """title %(long)s
-  kernel /EFI/boot/vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=iso9660 %(liveargs)s %(extra)s
+  kernel /EFI/boot/vmlinuz%(index)s root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s
   initrd /EFI/boot/initrd%(index)s.img
 """ %args
 
@@ -648,7 +659,7 @@ image=/ppc/ppc%(bit)s/vmlinuz
   label=%(short)s
   initrd=/ppc/ppc%(bit)s/initrd.img
   read-only
-  append="root=CDLABEL=%(fslabel)s rootfstype=iso9660 %(liveargs)s %(extra)s"
+  append="root=CDLABEL=%(fslabel)s rootfstype=udf,iso9660 %(liveargs)s %(extra)s"
 """ % args
 
 





More information about the Fedora-livecd-list mailing list