[LORAX] livemedia-creator: update TreeBuilder use for isolabel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

TreeBuilder class changed its __init__ so add --volid switch,
length check and isolabel.
---
 src/sbin/livemedia-creator |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator
index dc5ff09..9730d99 100755
--- a/src/sbin/livemedia-creator
+++ b/src/sbin/livemedia-creator
@@ -424,7 +424,7 @@ def make_ami( disk_img, ami_img="ami-root.img", ami_label="AMI" ):
 
 
 def make_livecd( disk_img, squashfs_args="", templatedir=None,
-                 title="Linux", project="Linux", releasever=16 ):
+                 title="Linux", project="Linux", releasever=16, isolabel=None ):
     """
     Take the content from the disk image and make a livecd out of it
 
@@ -487,9 +487,14 @@ def make_livecd( disk_img, squashfs_args="", templatedir=None,
         subprocess.check_call(["/bin/ln", "-s", joinpaths( work_dir, "images" ),
                                                 joinpaths( installroot, "images" )])
 
+        isolabel = isolabel or "{0.name} {0.version} {1.basearch}".format(product, arch)
+        if len(isolabel) > 32:
+            isolabel = isolabel[:32]
+            log.error("Truncating isolabel to 32 chars: %s" % (isolabel,))
+
         tb = TreeBuilder( product=product, arch=arch,
                           inroot=installroot, outroot=work_dir,
-                          runtime=runtime, templatedir=templatedir)
+                          runtime=runtime, isolabel=isolabel, templatedir=templatedir)
         log.info( "Rebuilding initrds" )
         if not opts.dracut_args:
             dracut_args = DRACUT_DEFAULT
@@ -579,6 +584,7 @@ if __name__ == '__main__':
                          help="substituted for @PROJECT@ in bootloader config files" )
     parser.add_argument( "--releasever", type=int, default=16,
                          help="substituted for @VERSION@ in bootloader config files" )
+    parser.add_argument( "--volid", default=None, help="volume id")
     parser.add_argument( "--squashfs_args",
                          help="additional squashfs args" )
 
@@ -638,6 +644,10 @@ if __name__ == '__main__':
         log.error( "virt-install needs an install iso." )
         sys.exit( 1 )
 
+    if opts.volid and len(opts.volid) > 32:
+        logger.fatal("the volume id cannot be longer than 32 characters")
+        sys.exit(1)
+
     # Make the disk image
     if not opts.disk_image:
         # Parse the kickstart to get the partition sizes
@@ -716,7 +726,8 @@ if __name__ == '__main__':
     if opts.make_iso and not opts.image_only:
         result_dir = make_livecd( opts.disk_image or disk_img, opts.squashfs_args,
                                   opts.lorax_templates,
-                                  opts.title, opts.project, opts.releasever )
+                                  opts.title, opts.project, opts.releasever,
+                                  opts.volid )
     elif opts.make_ami and not opts.image_only:
         result_dir = make_ami(opts.disk_image or disk_img)
 
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux