On Thu, 2013-02-07 at 10:51 -0800, Brian C. Lane wrote:
From: "Brian C. Lane" <bcl(a)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.
Also it would be great to use 'func(args)' instead of 'func( args )' at
least in all new/changed lines.
Otherwise this looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic