[livemedia-creator] Add filesystem image install support

Brian C. Lane bcl at redhat.com
Mon Feb 11 14:55:42 UTC 2013


On Mon, Feb 11, 2013 at 12:45:29PM +0100, Vratislav Podzimek wrote:
> On Thu, 2013-02-07 at 10:51 -0800, Brian C. Lane wrote:
> > From: "Brian C. Lane" <bcl at redhat.com>
> > 
> > This adds support for installing to a filesystem image instead of a
> > partitioned disk image. It requires Anaconda's --dirinstall support.
> > Also re-organized the code to break it up into smaller methods.
> > 
> > This speeds up iso creation in no-virt mode by removing the need to copy
> > the filesystem from the partitioned disk image to the filesystem image
> > that is used to make the squashfs image.
> > ---
> >  README.livemedia-creator   |  44 ++--
> >  src/sbin/livemedia-creator | 559 ++++++++++++++++++++++++++-------------------
> >  2 files changed, 355 insertions(+), 248 deletions(-)
> 
> > +    cmd = ["anaconda", "--kickstart", opts.ks[0], "--cmdline", "--repo", repo_url]
> > +    if opts.anaconda_args:
> > +        for arg in opts.anaconda_args:
> > +            cmd += arg.split(" ", 1)
> > +    if opts.proxy:
> > +        cmd += ["--proxy", opts.proxy]
> > +    if opts.armplatform:
> > +        cmd += ["--armplatform", opts.armplatform]
> > +
> > +    if opts.make_iso or opts.make_fsimage:
> > +        # Make a blank fs image
> > +        cmd += ["--dirinstall"]
> > +
> > +        mkext4img(None, disk_img, label="Anaconda", size=disk_size * 1024**3)
> > +        if not os.path.isdir(ROOT_PATH):
> > +            os.mkdir(ROOT_PATH)
> > +        mount(disk_img, opts="loop", mnt=ROOT_PATH)
> > +    else:
> > +        cmd += ["--image", disk_img]
> > +
> > +        # Create the sparse image
> > +        mksparse( disk_img, disk_size * 1024**3 )
> > +
> > +    rc = execWithRedirect(cmd[0], cmd[1:])
> I think it would be better to rename 'cmd' to 'args' and place only args
> there. Then on this line use 'rc = execWithRedirect("anaconda", args)'
> or replace '"anaconda"' by 'cmd' set to "anaconda" before.

yeah, we have several styles of calling things in anaconda and lorax.
I'll look at making this consistent at least.

> 
> Also it would be great to use 'func(args)' instead of 'func( args )'  at
> least in all new/changed lines.

Thanks, missed that one. I've been trying to clean those up. Still can't
figure out why I stuck all those spaces in there in the first place.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/anaconda-patches/attachments/20130211/070c564b/attachment.sig>


More information about the anaconda-patches mailing list