RFE: implant locale information into isos like anaconda implants md5sums
by Till Maas
Hiyas,
I have an idea to make it easier for people to create an iso image with the
desired locale and keyboard layout for local distribution.
The anaconda project created a tool "isomd5sum" that somehow implants the
md5sum of major parts of the iso into the iso file itself. I did not yet find
the time to investigate how they do it. I would find it very useful, if the
same technique could be used to store the default locale and keyboard layout
within the iso image for live cds.
What do you think about this idea?
Regards,
Till
15 years, 6 months
Kobold Project
by Khushbu Mohta
Hi Everyone,
As part of the Summer Training[1] organised by Kushal Das[2] and other
Durgapur LUG[3] Team-members at IRC channel #dgplug, I along with my
colleague Prakhar Agarwal have worked on Kobold Project [4]. We were
suggested this project by Rahul Sundaram(mether).
*About Kobold:*
Kobold is minimalistic tool for automated Fedora Live CD installation on USB
stick in a sequential manner. It uses HAL and D-Bus to discover USB stick
plugging and livecd-iso-to-disk for the actual installation process.
*
Some pitfalls*:
(1) It was sequential.
(2) It could only work on a Single USB stick at a time with hassles of
plugging-in and plugging-out the USB sticks if more than one USB stick need
to be used.
(3) The USB sticks had to be plugged-in after initiating the script. The
script was not able to detect already plugged-in USB sticks.
*Our Tweaks:*
First of all, we eradicated the need to plug-in the USB sticks after
initiating the script. That is, we added the functionality of detecting
already plugged-in USB storage devices.
Secondly, the installation process is changed from sequential to parallel.
We have incorporated threading concept by using "threading" module to enable
installation process on multiple USB sticks simultaneously.
Code is available at
http://dgplug.org/training/trunk/khushbu/Kobold/kobold3.py
*Usability/Benefits*:
The Install-fests will be much more fun. Just plug-in all the USB storage
devices, run the script and you will have Fedora installed in all of them
within no time!! No need to wait for the installation process to get over
with one stick and then plug-in another.
*References:*
[1] http://wiki.dgplug.org/index.php/SummerTraining
[2] http://kushaldas.in
[3] http://dgplug.org
[4] http://trac2.assembla.com/kobold-project
We hope that we have been able to contribute in some way. We wish to add
this code to LiveUSB-Creator(which works on a single USB drive right now)
and for that we need your comments/feedback. Thank You!
--
Khushbu Mohta
khushi.pk(a)gmail.com
--
Khushbu Mohta
khushi.pk(a)gmail.com
15 years, 6 months
Re: [Fedora-livecd-list] xconfig does not work
by Todd Cooper
Still have the problem and I can get into the non-gui login (Shift-Ctrl-F1)
/var/log/messages and /var/log/gdm/* have no inkling to what is wrong.
I do not see any ~/.xsession-errors.
Any other place to look for errors?
----- Original Message ----
From: Jeremy Katz <katzj(a)redhat.com>
To: Todd Cooper <todd(a)world.std.com>; fedora-livecd-list(a)redhat.com
Sent: Thursday, October 2, 2008 10:39:35 AM
Subject: Re: [Fedora-livecd-list] xconfig does not work
On Wed, 2008-10-01 at 09:13 -0700, Todd Cooper wrote:
> I added small things to the desktop kickstart (attached) and the
> xconfig no longer works.
> The biggest change is adding mysql to the rpms to be added.
> The .ks file attached has xconfig commented out.
>
> When I boot it comes up with the X login and when I click on the login
> user, it starts the login and then goes back to the login screen.
> Even if I login as root it does the same thing.
You probably are missing whatever the xsession is trying to run. If you
switch to a tty and check ~/.xsession-errors, you'll probably see
something more enlightening
Jeremy
--
Fedora-livecd-list mailing list
Fedora-livecd-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
15 years, 6 months
Resending the remote kickstart patch
by Bryan Kearney
This is a resend of the patch. Changes include:
- Requireing and using python-urlgrabber instead of urllib
- Allowing for file:// based urls.
- Any string which starts with http://, ftp://, or file:// is assumed valid and will be caught during parsing.
- Rebased with latest upstream changes.
-- bk
15 years, 6 months
[PATCH] Allow for http:// or ftp:// urls to be passed in to the image creators
by Bryan Kearney
From: root <root(a)localhost.localdomain>
---
imgcreate/__init__.py | 2 ++
imgcreate/kickstart.py | 20 +++++++++++++++++++-
tools/livecd-creator | 4 ++--
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py
index bcfb40e..7cf30b8 100644
--- a/imgcreate/__init__.py
+++ b/imgcreate/__init__.py
@@ -34,6 +34,7 @@ Also exported are:
- CreatorError - all exceptions throw are of this type
- FSLABEL_MAXLEN - the length to which LoopImageCreator.fslabel is truncated
- read_kickstart() - a utility function for kickstart parsing
+ - verify_kickstart() - a utility function to verify the existence of a kickstart file
- build_name() - a utility to construct an image name
Each of the creator classes are designed to be subclassable, allowing the user
@@ -63,6 +64,7 @@ __all__ = (
'LoopImageCreator',
'FSLABEL_MAXLEN',
'read_kickstart',
+ 'verify_kickstart',
'construct_name',
'setup_logging',
)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index d911925..9de347a 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -22,6 +22,7 @@ import shutil
import subprocess
import time
import logging
+import urllib
import rhpl.keyboard
@@ -34,6 +35,19 @@ import pykickstart.version as ksversion
import imgcreate.errors as errors
import imgcreate.fs as fs
+def path_is_url(path):
+ pupper = path.upper()
+ return (pupper.startswith("HTTP://")) or (pupper.startswith("FTP://"))
+
+def verify_kickstart(path):
+ verified = False
+ if not path is None:
+ if path_is_url(path):
+ verified = True
+ else:
+ verified = os.path.isfile(path)
+ return verified
+
def read_kickstart(path):
"""Parse a kickstart file and return a KickstartParser instance.
@@ -47,7 +61,11 @@ def read_kickstart(path):
version = ksversion.makeVersion()
ks = ksparser.KickstartParser(version)
try:
- ks.readKickstart(path)
+ if path_is_url(path):
+ ksfile,headers = urllib.urlretrieve(path)
+ ks.readKickstart(ksfile)
+ else:
+ ks.readKickstart(path)
except IOError, (err, msg):
raise errors.KickstartError("Failed to read kickstart file "
"'%s' : %s" % (path, msg))
diff --git a/tools/livecd-creator b/tools/livecd-creator
index b401190..137aecd 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -36,7 +36,7 @@ def parse_options(args):
imgopt = optparse.OptionGroup(parser, "Image options",
"These options define the created image.")
imgopt.add_option("-c", "--config", type="string", dest="kscfg",
- help="Path to kickstart config file")
+ help="Path or url to kickstart config file")
imgopt.add_option("-b", "--base-on", type="string", dest="base_on",
help="Add packages to an existing live CD iso9660 image.")
imgopt.add_option("-f", "--fslabel", type="string", dest="fs_label",
@@ -67,7 +67,7 @@ def parse_options(args):
help=optparse.SUPPRESS_HELP)
(options, args) = parser.parse_args()
- if not options.kscfg or not os.path.isfile(options.kscfg):
+ if not options.kscfg or not imgcreate.verify_kickstart(options.kscfg):
raise Usage("Kickstart config '%s' does not exist" %(options.kscfg,))
if options.base_on and not os.path.isfile(options.base_on):
raise Usage("Live CD ISO '%s' does not exist" %(options.base_on,))
--
1.5.5.2
15 years, 6 months
4 commits - imgcreate/kickstart.py tools/livecd-iso-to-disk.sh
by Jeremy Katz
imgcreate/kickstart.py | 19 +++++++++++--------
tools/livecd-iso-to-disk.sh | 40 +++++++++++++++++++++++++++++++---------
2 files changed, 42 insertions(+), 17 deletions(-)
New commits:
commit 3e8101049b2adfee2898bdf633f58671c792dd60
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Fri Oct 17 09:08:36 2008 -0400
Fix setting up persistent home on mtd for XO
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 0475b0a..0a1144d 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -513,7 +513,7 @@ fi
if [ -n "$xo" ]; then
echo "Setting up /boot/olpc.fth file"
args=$(egrep "^[ ]*append" $USBMNT/$SYSLINUXPATH/isolinux.cfg |head -n1 |sed -e 's/.*initrd=[^ ]*//')
- if [ -n "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
+ if [ -z "$xonohome" -a ! -f $USBMNT/LiveOS/$HOMEFILE ]; then
args="$args persistenthome=mtd0"
fi
if [ ! -d $USBMNT/boot ]; then mkdir -p $USBMNT/boot ; fi
commit 37a6ca3b713d23ca0da39eb501b83aab42a202e3
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Fri Oct 17 09:08:20 2008 -0400
More integer vs string munging
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 195786e..0475b0a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -228,6 +228,7 @@ cryptedhome=1
keephome=1
homesizemb=0
swapsizemb=0
+overlaysizemb=0
HOMEFILE="home.img"
while [ $# -gt 2 ]; do
@@ -322,21 +323,21 @@ elif [ -n "$mactel" ]; then
fi
-if [ -n "$overlaysizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$overlaysizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$overlaysizemb" -gt 2047 ]; then
echo "Can't have an overlay of 2048MB or greater on VFAT"
exitclean
fi
fi
-if [ -n "$homesizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$homesizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$homesizemb" -gt 2047 ]; then
echo "Can't have a home overlay greater than 2048MB on VFAT"
exitclean
fi
fi
-if [ -n "$swapsizemb" -a "$USBFS" = "vfat" ]; then
+if [ "$swapsizemb" -gt 0 -a "$USBFS" = "vfat" ]; then
if [ "$swapsizemb" -gt 2047 ]; then
echo "Can't have a swap file greater than 2048MB on VFAT"
exitclean
@@ -376,7 +377,7 @@ free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt $(($free + $tbd)) ]; then
echo "Unable to fit live image + overlay on available space on USB stick"
echo "Size of live image: $livesize"
- [ -n "$overlaysizemb" ] && echo "Overlay size: $overlaysizemb"
+ [ "$overlaysizemb" -gt 0 ] && echo "Overlay size: $overlaysizemb"
[ "$homesizemb" -gt 0 ] && echo "Home overlay size: $homesizemb"
[ "$swapsizemb" -gt 0 ] && echo "Home overlay size: $swapsizemb"
echo "Available space: $(($free + $tbd))"
@@ -461,7 +462,7 @@ echo "Updating boot config file"
sed -i -e "s/CDLABEL=[^ ]*/$USBLABEL/" -e "s/rootfstype=[^ ]*/rootfstype=$USBFS/" $BOOTCONFIG
if [ -n "$kernelargs" ]; then sed -i -e "s/liveimg/liveimg ${kernelargs}/" $BOOTCONFIG ; fi
-if [ -n "$overlaysizemb" ]; then
+if [ "$overlaysizemb" -gt 0 ]; then
echo "Initializing persistent overlay file"
OVERFILE="overlay-$( /lib/udev/vol_id -l $USBDEV )-$( /lib/udev/vol_id -u $USBDEV )"
if [ "$USBFS" = "vfat" ]; then
commit 8b11d8f99119c4ff5f922286fbec67d8406b09a0
Author: Orion Poplawski <orion(a)cora.nwra.com>
Date: Fri Oct 17 09:07:13 2008 -0400
Support --defaultdesktop
livecd-creator ignores xconfig --defaultdesktop parameter. I have:
xconfig --startxonboot --defaultdesktop=KDE
but no /etc/sysconfig/desktop file is written.
This works for me, and seems pretty comparable to the code in anaconda.
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index d911925..01359e7 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -226,14 +226,17 @@ class ServicesConfig(KickstartConfig):
class XConfig(KickstartConfig):
"""A class to apply a kickstart X configuration to a system."""
def apply(self, ksxconfig):
- if not ksxconfig.startX:
- return
- f = open(self.path("/etc/inittab"), "rw+")
- buf = f.read()
- buf = buf.replace("id:3:initdefault", "id:5:initdefault")
- f.seek(0)
- f.write(buf)
- f.close()
+ if ksxconfig.startX:
+ f = open(self.path("/etc/inittab"), "rw+")
+ buf = f.read()
+ buf = buf.replace("id:3:initdefault", "id:5:initdefault")
+ f.seek(0)
+ f.write(buf)
+ f.close()
+ if ksxconfig.defaultdesktop:
+ f = open(self.path("/etc/sysconfig/desktop"), "w")
+ f.write("DESKTOP="+ksxconfig.defaultdesktop+"\n")
+ f.close()
class RPMMacroConfig(KickstartConfig):
"""A class to apply the specified rpm macros to the filesystem"""
commit 0aadbdc442191e395ee7579716035df55c8d3ded
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Wed Oct 15 13:36:38 2008 -0400
Add support for setting up a swap
Allow setting up a swap on the usb stick/sd card. Also includes a fix from
David Zuhn <zoo AT stpaulterminal DOT org> to use ints instead of depending
on empty strings so we don't get an error from the bash math
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index d48f922..195786e 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -226,6 +226,9 @@ fi
cryptedhome=1
keephome=1
+homesizemb=0
+swapsizemb=0
+
HOMEFILE="home.img"
while [ $# -gt 2 ]; do
case $1 in
@@ -237,6 +240,10 @@ while [ $# -gt 2 ]; do
homesizemb=$2
shift
;;
+ --swap-size-mb)
+ swapsizemb=$2
+ shift
+ ;;
--crypted-home)
cryptedhome=1
;;
@@ -329,6 +336,13 @@ if [ -n "$homesizemb" -a "$USBFS" = "vfat" ]; then
fi
fi
+if [ -n "$swapsizemb" -a "$USBFS" = "vfat" ]; then
+ if [ "$swapsizemb" -gt 2047 ]; then
+ echo "Can't have a swap file greater than 2048MB on VFAT"
+ exitclean
+ fi
+fi
+
# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
mount -o loop,ro "$ISO" $CDMNT || exitclean
@@ -337,7 +351,7 @@ mount $mountopts $USBDEV $USBMNT || exitclean
trap exitclean SIGINT SIGTERM
-if [ -f "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" -a -n "$homesizemb" ]; then
+if [ -f "$USBMNT/LiveOS/$HOMEFILE" -a -n "$keephome" -a "$homesizemb" -gt 0 ]; then
echo "ERROR: Requested keeping existing /home and specified a size for /home"
echo "Please either don't specify a size or specify --delete-home"
exitclean
@@ -359,11 +373,12 @@ fi
livesize=$(du -s -B 1M $check | awk {'print $1;'})
free=$(df -B1M $USBDEV |tail -n 1 |awk {'print $4;'})
-if [ $(($overlaysizemb + $homesizemb + $livesize)) -gt $(($free + $tbd)) ]; then
+if [ $(($overlaysizemb + $homesizemb + $livesize + $swapsizemb)) -gt $(($free + $tbd)) ]; then
echo "Unable to fit live image + overlay on available space on USB stick"
echo "Size of live image: $livesize"
[ -n "$overlaysizemb" ] && echo "Overlay size: $overlaysizemb"
- [ -n "$homesizemb" ] && echo "Home overlay size: $homesizemb"
+ [ "$homesizemb" -gt 0 ] && echo "Home overlay size: $homesizemb"
+ [ "$swapsizemb" -gt 0 ] && echo "Home overlay size: $swapsizemb"
echo "Available space: $(($free + $tbd))"
exitclean
fi
@@ -459,7 +474,13 @@ if [ -n "$overlaysizemb" ]; then
sed -i -e "s/\ ro\ /\ rw\ /" $BOOTCONFIG
fi
-if [ -n "$homesizemb" ]; then
+if [ "$swapsizemb" -gt 0 ]; then
+ echo "Initializing swap file"
+ dd if=/dev/zero of=$USBMNT/LiveOS/swap.img count=$swapsizemb bs=1M
+ mkswap -f $USBMNT/LiveOS/swap.img
+fi
+
+if [ "$homesizemb" -gt 0 ]; then
echo "Initializing persistent /home"
if [ "$USBFS" = "vfat" ]; then
# vfat can't handle sparse files
15 years, 6 months
Seemingly divergent netboot/disklessrc and livecd/mayflower for initrd, init, etc...
by Bryan J Smith
First off, sorry for the cross-post.
Secondly, let's take provisioning (Cobbler/Koan) and configuration
management (Puppet) completely out of the question here. As much as I
would love to focus on such, I'm looking at the boot/initrd aspects for
now. I'd love to come back to them, but I'm on a tight schedule.
Third, I've spent the last few days going through all versions of
Anaconda, PyKickstart, Netboot and LiveCD (in addition to some LTSP
prior, although I need to refresh myself) -- for RHEL 5 w/EPEL, the
CentOS/Scientific "upgraded" versions (over RHEL 5/EPEL), Fedora 9 and
even Fedora 10 Beta. I've really pulled out some hair. ;) Now more
than ever it's clear to me that there have been many divergent paths
taken, although I could just be ignorant (or stating that from
ignorance).
For this post, I will focus on netboot/disklessrc and livecd/mayflower,
and possibly a replacement that focuses on base RHEL 5 support. Please
correct any analysis, assumption, comment, etc... that is made in error
or is otherwise leading down the wrong track.
- Netboot/disklessrc
The current approach in system-config-netboot for Diskless clients is
legacy (not even nash, so it looks like some re-use from circa-2003 or
even earlier), but the "disklessrc" approach with they way it loads in
the Diskless initrd "just works." Not only does it "just work," but it
works for RHEL 5 (possibly earlier).
One of the complaints I've heard second-hand about supporting RHEL 5 in
various setups (LTSP, etc...) is the lack of network card detection and
setup, things that newer Anaconda and init processes seem to do in newer
Fedora releases. Well, in all honesty, the disklessrc seems to do the
job fine for RHEL 5 -- using PCI IDs, etc... Sure, it's not flawless,
but for a diskless client (which is typically wired), it works.
The "big thing" missing from the system-config-netboot is a lot of
automation in generation of the system image/tree. E.g., it doesn't run
Anaconda's install-to-disc like LiveCD does (including the EPEL 013-5
release for RHEL 5).
- LiveCD/mayflower
I've looked at the LiveCD tools now, including the mayflower initrd
builder. I've also looked at the results. A lot of newer developments
make assumptions on newer Anaconda/PyKickstart releases of post-RHEL 5
Fedora releases. I would definitely be interested in anyone who has
concise information on what features are being used, otherwise, I'm
looking at them as non-requirements (with my focus on RHEL 5).
I've noted a few things I really don't care for, like dumping all
modules in /lib/modules of the initrd, instead of maintaining some sort
of tree like netboot/disklessrc does/uses. I also don't know if just
pulling out the squashfs image is the most ideal for iso-to-disc, but I
understand why it was done that way (to use the existing build).
So it's clear it shouldn't be too terribly difficult to come up with
something that adds in the Diskless option, network modules, etc... to
add that.
- What I want (should force myself to do)
What I want -- aka what I should force myself to do so I more than a fat
guy just eating up oxygen ;) -- is try to build a new, flexible initrd
creator (call it "snitrd" out of my frustration ;) and . I don't know
if there are other projects out there trying to do this, so please let
me know if someone already has been tackling this.
The concept is basically this (putting the Anaconda install-to-disc to
the side for now) ...
- Can generate a Diskless initrd (disklessrc init, various network)
- Can generate a ISO initrd (like mayflower's init, various fs/etc...)
- Can generate a Disk initrd (more than just squashfs? new init)
- Can generate a "Super" initrd (take various boot init= options)
Additionally, I was going to add the following options in the new "Disk"
initrd init (think flash/embedded):
- Option to compare image checksums to TFTP server, update if different
- Option to boot diskless if local boot fails (trap failures/set flag)
Does anyone else think this is a good idea? I don't think the Diskless,
ISO and basic Disk initrd/init options are too difficult. The more
embedded options could come later, as could the RHEL 5
Anaconda/PyKickstart v. newer Fedora differences/detections as well.
Right now I could really use a single toolset to do at least some of the
above. And I'm having to choose between the limited/stagnant
Netboot/disklessrc and the more leading Fedora-centric LiveCD/mayflower.
Anyone think I'm off my rocker? Over-complicating a simple issue?
Don't know the first thing of what I'm talking about? Etc...? ;)
--
Bryan J Smith - Senior Consultant - Red Hat GPS SE US
mailto:bjs@redhat.com +1 (407) 489-7013 (Mobile)
mailto:b.j.smith@ieee.org (non-RH/ext to Blackberry)
-----------------------------------------------------
For every dollar you spend on Red Hat solutions, you
not only fund the leading community development re-
source, but you receive the #1 IT industry leader in
corporate value. http://www.redhat.com/promo/vendor/
15 years, 6 months
error reading information on service xxxx
by Todd N
Hello,
During the boot process for a Live CD I have created with livecd-creator, I am getting error messages of the format
error reading information on service xxxxxx: No such file or directory
I am getting 6 such messages. The services listed are bluetooth, isdn, rpcgssd, rpcidmapd, rpcsvcgssd, and sendmail. None of these packages appear to be installed or running on my system. I'd like to get rid of these messages if possible. Any thoughts?
Thanks much,
Todd
15 years, 6 months
Snap1 i686 Live "about Fedora" triggers "yelp not found"
by Till Maas
Hiyas,
I am not sure where to report this. I believed to have read that
fedorahosted/releng hosts the source files for creating the live images, but
I did not find them in the trac browser. So where is it and where is the
apropriate bug tracker? The bug I noticed follows:
I booted the Snap1 i686 Live iso via usb and selected "about Fedora" in the
menu. Then I get an error message that yelp is not found.
Regards,
Till
15 years, 6 months
[PATCH] changed code to try to use os.rename first then shutil.move when moving around the images files. If the file are on the same fs will be alot faster. If not the rename fails and it reverts to shutil.move
by David Huff
---
imgcreate/creator.py | 18 ++++++++++++++----
imgcreate/live.py | 16 ++++++++++++----
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 519735e..72ab132 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -169,7 +169,10 @@ class ImageCreator(object):
By default, this moves the install root into _outdir.
"""
- shutil.move(self._instroot, self._outdir + "/" + self.name)
+ try:
+ os.rename(self._instroot, self._outdir + "/" + self.name)
+ except Exception, e:
+ shutil.move(self._instroot, self._outdir + "/" + self.name)
def _get_required_packages(self):
"""Return a list of required packages.
@@ -750,8 +753,12 @@ class ImageCreator(object):
self._stage_final_image()
for f in os.listdir(self._outdir):
- shutil.move(os.path.join(self._outdir, f),
- os.path.join(destdir, f))
+ try:
+ os.rename(os.path.join(self._outdir, f),
+ os.path.join(destdir, f))
+ except Exception, e:
+ shutil.move(os.path.join(self._outdir, f),
+ os.path.join(destdir, f))
def create(self):
"""Install, configure and package an image.
@@ -932,4 +939,7 @@ class LoopImageCreator(ImageCreator):
def _stage_final_image(self):
self._resparse()
- shutil.move(self._image, self._outdir + "/" + self.name + ".img")
+ try:
+ os.rename(self._image, self._outdir + "/" + self.name + ".img")
+ except Exception, e:
+ shutil.move(self._image, self._outdir + "/" + self.name + ".img")
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 17d3037..eab7be5 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -268,12 +268,20 @@ class LiveImageCreatorBase(LoopImageCreator):
self._image, minimal_size)
if self.skip_compression:
- shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
+ try:
+ os.rename(self._image, self.__isodir + "/LiveOS/ext3fs.img")
+ except Execption, e:
+ shutil.move(self._image, self.__isodir + "/LiveOS/ext3fs.img")
else:
makedirs(os.path.join(os.path.dirname(self._image), "LiveOS"))
- shutil.move(self._image,
- os.path.join(os.path.dirname(self._image),
- "LiveOS", "ext3fs.img"))
+ try:
+ os.rename(self._image,
+ os.path.join(os.path.dirname(self._image),
+ "LiveOS", "ext3fs.img"))
+ except Exception, e:
+ shutil.move(self._image,
+ os.path.join(os.path.dirname(self._image),
+ "LiveOS", "ext3fs.img"))
mksquashfs(os.path.dirname(self._image),
self.__isodir + "/LiveOS/squashfs.img")
--
1.5.5.1
15 years, 6 months