config/livecd-fedora-base-desktop.ks
by Jeremy Katz
config/livecd-fedora-base-desktop.ks | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit c0f49393a954084e7a3bb9a6564096054aa6e49d
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Mon May 19 15:53:43 2008 -0400
Mount a tmpfs on /tmp, /var/tmp and /var/cache (#447127)
dm-snapshot is pretty high-overhead for directories like /tmp, /var/tmp and
/var/cache which are expected to have high turn-over. Let's make them
tmpfs instead
diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks
index ad5ec32..dc6bed7 100644
--- a/config/livecd-fedora-base-desktop.ks
+++ b/config/livecd-fedora-base-desktop.ks
@@ -130,6 +130,14 @@ chkconfig --level 345 anacron off 2>/dev/null
chkconfig --level 345 readahead_early off 2>/dev/null
chkconfig --level 345 readahead_later off 2>/dev/null
+# make it so that we don't do writing to the overlay for things which
+# are just tmpdirs/caches
+mount -t tmpfs varcache /tmp
+(cd /var/cache ; find .) | (cd /tmp ; cpio --quiet -pmdu)
+mount --move /tmp /var/cache
+mount -t tmpfs tmp /tmp
+mount -t tmpfs vartmp /var/tmp
+
# Stopgap fix for RH #217966; should be fixed in HAL instead
touch /media/.hal-mtab
15 years, 10 months
7 commits - imgcreate/creator.py imgcreate/kickstart.py imgcreate/live.py tools/livecd-iso-to-disk.sh
by Jeremy Katz
imgcreate/creator.py | 4 ++++
imgcreate/kickstart.py | 15 ++++++++++++++-
imgcreate/live.py | 4 +---
tools/livecd-iso-to-disk.sh | 22 ++++++++++++++++++++--
4 files changed, 39 insertions(+), 6 deletions(-)
New commits:
commit 35f007112280dfa451ff7b51b65f917b4cad3715
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:56:05 2008 -0400
Fix basing on a previous live image (#437906)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 40ce1ef..fc4298b 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -830,6 +830,9 @@ class LoopImageCreator(ImageCreator):
"""
return self.__instloop.resparse(size)
+
+ def __base_on(self, base_on):
+ shutil.copyfile(base_on, self._image)
#
# Actual implementation
@@ -838,6 +841,7 @@ class LoopImageCreator(ImageCreator):
self.__imgdir = self._mkdtemp()
if not base_on is None:
+ self.__base_on(base_on)
shutil.copyfile(base_on, self._image)
self.__instloop = SparseExtLoopbackMount(self._image,
diff --git a/imgcreate/live.py b/imgcreate/live.py
index 130f7fa..ef07d19 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -127,7 +127,7 @@ class LiveImageCreatorBase(LoopImageCreator):
#
# Actual implementation
#
- def __base_on_iso(self, base_on):
+ def __base_on(self, base_on):
"""helper function to extract ext3 file system from a live CD ISO"""
isoloop = LoopbackMount(base_on, self._mkdtemp())
@@ -173,8 +173,6 @@ class LiveImageCreatorBase(LoopImageCreator):
isoloop.cleanup()
def _mount_instroot(self, base_on = None):
- if not base_on is None:
- self.__base_on_iso(base_on)
LoopImageCreator._mount_instroot(self)
self.__write_initrd_conf(self._instroot + "/etc/sysconfig/mkinitrd")
commit 9fa8210e2db91e1c2d0493aed785d626ac7d176e
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:49:23 2008 -0400
Fix up tab/space inconsistency
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 7cc27ac..8f43f7c 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -151,7 +151,7 @@ class TimezoneConfig(KickstartConfig):
try:
shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)),
self.path("/etc/localtime"))
- except OSError, (errno, msg):
+ except OSError, (errno, msg):
log.error("Error copying timezone: %s" %(msg,))
commit df086a2102b3c8f0103c5905d7b776e07b69cfbc
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:42:23 2008 -0400
Handle using a loop device as the device to use for the target (#447345)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 5250a20..e4acf85 100644
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -40,6 +40,11 @@ exitclean() {
getdisk() {
DEV=$1
+ if [[ "$DEV" =~ "/dev/loop*" ]; then
+ device="/dev/$device"
+ return
+ fi
+
p=$(udevinfo -q path -n $DEV)
if [ -e /sys/$p/device ]; then
device=$(basename /sys/$p)
commit 898e853e789314e343e8531fb25c03dc41ff4f0c
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:35:41 2008 -0400
Quote iso path (#446472)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index fb9d6e4..5250a20 100644
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -194,7 +194,7 @@ fi
if [ -z "$noverify" ]; then
# verify the image
echo "Verifying image..."
- checkisomd5 --verbose $ISO
+ checkisomd5 --verbose "$ISO"
if [ $? -ne 0 ]; then
echo "Are you SURE you want to continue?"
echo "Press Enter to continue or ctrl-c to abort"
@@ -219,7 +219,7 @@ fi
# FIXME: would be better if we had better mountpoints
CDMNT=$(mktemp -d /media/cdtmp.XXXXXX)
-mount -o loop,ro $ISO $CDMNT || exitclean
+mount -o loop,ro "$ISO" $CDMNT || exitclean
USBMNT=$(mktemp -d /media/usbdev.XXXXXX)
mount $USBDEV $USBMNT || exitclean
commit 77e575d26bf742c762023dbb28bc8116e917218b
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:29:35 2008 -0400
Make sure that the disk isn't mounted before writing to it (#446472)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 4ec7f06..fb9d6e4 100644
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -144,6 +144,18 @@ checkSyslinuxVersion() {
fi
}
+checkMounted() {
+ dev=$1
+ if grep -q "^$dev " /proc/mounts ; then
+ echo "$dev is mounted, please unmount for safety"
+ exitclean
+ fi
+ if grep -q "^$dev " /proc/swaps; then
+ echo "$dev is in use as a swap device, please disable swap"
+ exitclean
+ fi
+}
+
if [ $(id -u) != 0 ]; then
echo "You need to be root to run this script"
exit 1
@@ -195,6 +207,7 @@ checkSyslinuxVersion
checkFilesystem $USBDEV
checkPartActive $USBDEV
checkMBR $USBDEV
+checkMounted $USBDEV
[ -n $resetmbr ] && resetMBR $USBDEV
if [ -n "$overlaysizemb" -a "$USBFS" = "vfat" ]; then
commit d2de6738087c91ebf6eb570088d7b2d0296723c8
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:24:36 2008 -0400
Handle copying timezone to /etc/localtime (#445624)
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index efa1ef7..7cc27ac 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -18,6 +18,7 @@
import os
import os.path
+import shutil
import subprocess
import time
@@ -147,6 +148,12 @@ class TimezoneConfig(KickstartConfig):
f.write("ZONE=\"" + tz + "\"\n")
f.write("UTC=" + utc + "\n")
f.close()
+ try:
+ shutil.copyfile(self.path("/usr/share/zoneinfo/%s" %(tz,)),
+ self.path("/etc/localtime"))
+ except OSError, (errno, msg):
+ log.error("Error copying timezone: %s" %(msg,))
+
class AuthConfig(KickstartConfig):
"""A class to apply a kickstart authconfig configuration to a system."""
commit 4793d9e38d18eeeb3a0464e331af23e573149fe2
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 15:15:18 2008 -0400
Make sure that commands exist and give a suitable error message
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index ef7b9e4..efa1ef7 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -107,6 +107,8 @@ class KickstartConfig(object):
os.chdir("/")
def call(self, args):
+ if not os.path.exists("%s/%s" %(self.chroot, args[0])):
+ raise errors.KickstartError("Unable to run %s!" %(args))
subprocess.call(args, preexec_fn = self.chroot)
def apply(self):
@@ -178,6 +180,10 @@ class RootPasswordConfig(KickstartConfig):
self.call(["/usr/sbin/usermod", "-p", password, "root"])
def set_unencrypted(self, password):
+ for p in ("/bin/echo", "/usr/bin/passwd"):
+ if not os.path.exists("%s/%s" %(self.chroot, p)):
+ raise errors.KickstartError("Unable to set unencrypted password due to lack of %s" % p)
+
p1 = subprocess.Popen(["/bin/echo", password],
stdout = subprocess.PIPE,
preexec_fn = self.chroot)
@@ -331,7 +337,7 @@ class NetworkConfig(KickstartConfig):
for network in ksnet.network:
if not network.device:
- raise errros.KickstartError("No --device specified with "
+ raise errors.KickstartError("No --device specified with "
"network kickstart command")
if (network.onboot and network.bootProto.lower() != "dhcp" and
15 years, 10 months
tools/livecd-iso-to-disk.sh
by Jeremy Katz
tools/livecd-iso-to-disk.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit fa20e548176b2f82a59dde1ecd77c2c18f80cc8d
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 21:58:07 2008 -0400
Typo, part two.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index e4acf85..9676633 100644
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -40,7 +40,7 @@ exitclean() {
getdisk() {
DEV=$1
- if [[ "$DEV" =~ "/dev/loop*" ]; then
+ if [[ "$DEV" =~ "/dev/loop*" ]]; then
device="/dev/$device"
return
fi
15 years, 10 months
config/livecd-fedora-base-desktop.ks
by Jeremy Katz
config/livecd-fedora-base-desktop.ks | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
New commits:
commit bdd9dcd487a889793a8ded4dd45382b4ce49b4d4
Author: Jeremy Katz <katzj(a)redhat.com>
Date: Tue May 27 16:05:54 2008 -0400
Only mount over /var/cache/yum and not all of /var/cache
diff --git a/config/livecd-fedora-base-desktop.ks b/config/livecd-fedora-base-desktop.ks
index dc6bed7..5da37aa 100644
--- a/config/livecd-fedora-base-desktop.ks
+++ b/config/livecd-fedora-base-desktop.ks
@@ -132,9 +132,7 @@ chkconfig --level 345 readahead_later off 2>/dev/null
# make it so that we don't do writing to the overlay for things which
# are just tmpdirs/caches
-mount -t tmpfs varcache /tmp
-(cd /var/cache ; find .) | (cd /tmp ; cpio --quiet -pmdu)
-mount --move /tmp /var/cache
+mount -t tmpfs varcacheyum /var/cache/yum
mount -t tmpfs tmp /tmp
mount -t tmpfs vartmp /var/tmp
15 years, 10 months
how is initrd0.img created?
by Till Maas
Hiyas,
I want to write a patch to support the selection of the keyboard at the kernel
commandline, but I cannot see where the initrd0.img file is created, i.e.
which file do I have to patch?
Regards,
Till
15 years, 10 months
Live CD process Synchronization help
by M P Sairam
Hi,
I need some help regarding process synchronization. I'm having
problem when using multiple threads in the Live CD Image. Does it
require any packages which i may missed to install? Please give me some
suggestions on what could be the issue.
thanks in advance,
sairam
********************************************************************************
This email message (including any attachments) is for the sole use of the intended recipient(s)
and may contain confidential, proprietary and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended recipient,
please immediately notify the sender by reply email and destroy all copies of the original message.
Thank you.
Intoto Inc.
15 years, 10 months
Brazilian Portuguese localized spin for Fedora 9
by Igor Pires Soares
Hello all!
I created a spin for Brazilian users and would like to share some
thoughts here.
I managed enough space in order to include required localized packages
such as hunspell-pt and openoffice.org-langpack-pt_BR. It was really
good to get OpenOffice.org included because the DVD Installation Media
is not installing the Language Pack by default, which is critical for
localized desktops.
The interesting thing is that the ISO created using livecd-tools-017-1
in Fedora 9 was 10 MB smaller than the one created using
livecd-tools-013-1 in F8. With the newer version I got 690 MB and with
the older one I got 700 MB, which still fits in a CD in my tests.
Considering the size, I don't intend to make it grow anymore, in order
to preserve the compatibility with older livecd-tools versions. So if
somebody still runs F8 and wants to create the spin there will be no
problem.
The .ks files are available at Fedora People if anybody wants to take a
look:
http://igor.fedorapeople.org/spin-pt_BR/F9/
I am thinking about hosting them in our infrastructure at
http://www.projetofedora.org/ and make a torrent with the ISO in the
future, if nobody opposes to that.
Regards,
Igor Pires Soares
15 years, 10 months
my fedora 10 prophecy: the unsuckiness of liveusb persistence
by Jane Dogalt
Actually I hope to get this done ASAP for F9-
============
The problem:
============
LiveUSB persistence as currently implemented suffers from three really nasty
imperfections.
1) df -h does not really tell you how much free disk space (aka persistent
storage) you have. To find out how close you are to the edge of IO errors (aka
disk/persistent-storage full), you actually need to pay attention to 3 things.
The free space on the root filesystem, the free space in the device mapper
snapshot overlay file, and the free space on the filesystem holding that file.
It is the minimum of those 3 values that is your real constraint.
2) when you delete files that you have created, you do not necessarily free
space.
3) on your LiveUSB, you have this nice 2GB rootfs compressed into a 700MB
squashfs image, but everything you do in persistent/read-write land is done
uncompressed. Throw the inefficiency of (2) on top of that, with the lack of
user monitorability due to (1), and what you have is a feature that starts out
looking really cool, but rather quickly dies a horrible death.
=============
The Solution:
=============
(1) is the easiest and most straightforward to solve. Just write a
mechanism/function/script that exposes the real 'free space' number to the
user, as a fraction of the original amount. Put this in a little meter on the
gnome-panel along with a command line utility, and call it something
appropriately cute, like the 'life bar' or 'live meter' or such...
(2) and (3) however require a rather more clever solution, which just hit me a
couple days ago. If you stare at my rebootless livecd/usb installer(a) and
have a good understanding of how livecd-creator formats the rootfs into the
form it exists on the LiveUSB, you might see where I'm headed.
peace...
-jdog
(a) http://filteredperception.org/smiley/projects/viros/viros-0.5/traits/rliv...
15 years, 10 months
LiveCD and openvpn configs
by Todd N
Hello,
I'm trying to build a Live CD that is set up with a working openvpn client. I have taken what I think are all the config settings for openvpn (from an already existing, configured OS with a functional openvpn setup), and placed them in /etc/skel in the Live CD's ext3 filesystem. (I got the configs from /home/<user>/.gconf/system/networking/connections.) I am also creating a user in the %post section of the pertinent kickstart file.
I would expect that when the Live CD is booted, the user will be created and the openvpn settings will be copied in from /etc/skel to that user's home directory.
On booting the Live CD I create, when first logging into the user's desktop the customized openvpn settings do not seem to be present. However, if I log out of that user and then log back in, the settings are there. Any ideas on what I might be doing wrong? Am I missing some other configurations?
I will be happy to clarify if anyone has any questions on what I am asking - or trying to ask. :-)
Thanks much,
Todd
15 years, 10 months
imgcreate/creator.py imgcreate/debug.py imgcreate/__init__.py imgcreate/live.py imgcreate/yuminst.py tools/image-creator tools/livecd-creator
by Jeremy Katz
imgcreate/__init__.py | 4 +-
imgcreate/creator.py | 5 +-
imgcreate/debug.py | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
imgcreate/live.py | 4 +-
imgcreate/yuminst.py | 3 +
tools/image-creator | 7 ++--
tools/livecd-creator | 7 ++--
7 files changed, 106 insertions(+), 10 deletions(-)
New commits:
commit 37932f4bd8735db53351553f69d35bda0ba2dd1b
Author: David Huff <dhuff(a)redhat.com>
Date: Wed May 21 10:19:53 2008 -0400
Make use of python logging API for debugging messages
Use the python logging API for debugging rather than just outputting
things directly to stdout/stderr
diff --git a/imgcreate/__init__.py b/imgcreate/__init__.py
index e535014..bcfb40e 100644
--- a/imgcreate/__init__.py
+++ b/imgcreate/__init__.py
@@ -21,6 +21,7 @@ from imgcreate.creator import *
from imgcreate.yuminst import *
from imgcreate.kickstart import *
from imgcreate.fs import *
+from imgcreate.debug import *
"""A set of classes for building Fedora system images.
@@ -62,5 +63,6 @@ __all__ = (
'LoopImageCreator',
'FSLABEL_MAXLEN',
'read_kickstart',
- 'construct_name'
+ 'construct_name',
+ 'setup_logging',
)
diff --git a/imgcreate/creator.py b/imgcreate/creator.py
index 1028e32..40ce1ef 100644
--- a/imgcreate/creator.py
+++ b/imgcreate/creator.py
@@ -22,6 +22,7 @@ import stat
import sys
import tempfile
import shutil
+import logging
import yum
import rpm
@@ -522,7 +523,7 @@ class ImageCreator(object):
(pkg, e))
for pkg in skipped_pkgs:
- print >> sys.stderr, "Skipping missing package '%s'" % (pkg,)
+ logging.warn("Skipping missing package '%s'" % (pkg,))
def __select_groups(self, ayum):
skipped_groups = []
@@ -537,7 +538,7 @@ class ImageCreator(object):
skipped_groups.append(group)
for group in skipped_groups:
- print >> sys.stderr, "Skipping missing group '%s'" % (group.name,)
+ logging.warn("Skipping missing group '%s'" % (group.name,))
def __deselect_packages(self, ayum):
for pkg in kickstart.get_excluded(self.ks,
diff --git a/imgcreate/debug.py b/imgcreate/debug.py
new file mode 100644
index 0000000..c45047d
--- /dev/null
+++ b/imgcreate/debug.py
@@ -0,0 +1,86 @@
+#
+# debug.py: Helper routines for debugging
+#
+# Copyright 2008, Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+import logging
+import logging.handlers
+import optparse
+import sys
+
+
+def handle_logging(option, opt, val, parser, logger, level):
+ if level < logger.level:
+ logger.setLevel(level)
+
+def handle_logfile(option, opt, val, parser, logger, stream):
+ try:
+ logfile = logging.FileHandler(val,"a")
+ except IOError, (err, msg):
+ raise optparse.OptionValueError("Cannot open file '%s' : %s" %
+ (val, msg))
+
+
+ logger.removeHandler(stream)
+ logger.addHandler(logfile)
+
+def setup_logging(parser = None):
+ """Set up the root logger and add logging options.
+
+ Set up the root logger so only warning/error messages are logged to stderr
+ by default.
+
+ Also, optionally, add --debug, --verbose and --logfile command line options
+ to the supplied option parser, allowing the root logger configuration to be
+ modified by the user.
+
+ Note, to avoid possible namespace clashes, setup_logging() will only ever
+ add these three options. No new options will be added in the future.
+
+ parser -- an optparse.OptionParser instance, or None
+
+ """
+ logger = logging.getLogger()
+
+ logger.setLevel(logging.WARN)
+
+ stream = logging.StreamHandler(sys.stderr)
+
+ logger.addHandler(stream)
+
+ if parser is None:
+ return
+
+ group = optparse.OptionGroup(parser, "Debugging options",
+ "These options control the output of logging information during image creation")
+
+ group.add_option("-d", "--debug",
+ action = "callback", callback = handle_logging,
+ callback_args = (logger, logging.DEBUG),
+ help = "Output debugging information")
+
+ group.add_option("-v", "--verbose",
+ action = "callback", callback = handle_logging,
+ callback_args = (logger, logging.INFO),
+ help = "Output verbose progress information")
+
+ group.add_option("", "--logfile", type="string",
+ action = "callback", callback = handle_logfile,
+ callback_args = (logger, stream),
+ help = "Save debug information to FILE", metavar = "FILE")
+
+ parser.add_option_group(group)
diff --git a/imgcreate/live.py b/imgcreate/live.py
index c6267f7..130f7fa 100644
--- a/imgcreate/live.py
+++ b/imgcreate/live.py
@@ -21,6 +21,7 @@ import os.path
import glob
import shutil
import subprocess
+import logging
from imgcreate.errors import *
from imgcreate.fs import *
@@ -252,8 +253,7 @@ class LiveImageCreatorBase(LoopImageCreator):
elif os.path.exists("/usr/lib/anaconda-runtime/implantisomd5"):
implantisomd5 = "/usr/lib/anaconda-runtime/implantisomd5"
else:
- print >> sys.stderr, \
- "isomd5sum not installed; not setting up mediacheck"
+ logging.warn("isomd5sum not installed; not setting up mediacheck")
subprocess.call([implantisomd5, iso])
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 80fc514..aebb822 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -18,6 +18,7 @@
import os
import sys
+import logging
import yum
import rpmUtils
@@ -103,7 +104,7 @@ class LiveCDYum(yum.YumBase):
pkgs.remove(x)
self.tsInfo.conditionals[req] = pkgs
else:
- print >> sys.stderr, "No such package %s to remove" %(pkg,)
+ logging.warn("No such package %s to remove" %(pkg,))
def selectGroup(self, grp, include = pykickstart.parser.GROUP_DEFAULT):
yum.YumBase.selectGroup(self, grp)
diff --git a/tools/image-creator b/tools/image-creator
index aca9228..6f2604c 100755
--- a/tools/image-creator
+++ b/tools/image-creator
@@ -21,6 +21,7 @@ import os
import sys
import shutil
import optparse
+import logging
import imgcreate
@@ -30,6 +31,8 @@ def parse_options(args):
parser.add_option("-n", "--name", type="string", dest="name",
help="Image name and filesystem label")
+ imgcreate.setup_logging(parser)
+
(options, args) = parser.parse_args()
if len(args) != 1:
@@ -48,7 +51,7 @@ def main():
try:
ks = imgcreate.read_kickstart(kscfg)
except imgcreate.CreatorError, e:
- print >> sys.stderr, "Error loading kickstart file '%s' : %s" % (kscfg, e)
+ logging.error("Unable to load kickstart file '%s' : %s" % (kscfg, e))
return 1
if options.name:
@@ -61,7 +64,7 @@ def main():
try:
creator.create()
except imgcreate.CreatorError, e:
- print >> sys.stderr, "Error creating image : %s" % e
+ logging.error("Unable to create image : %s" % e)
return 1
finally:
creator.cleanup()
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 7c08323..a3ece16 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -22,6 +22,7 @@ import os.path
import sys
import time
import optparse
+import logging
import imgcreate
@@ -53,6 +54,8 @@ def parse_options(args):
help="Cache directory to use (default: private cache")
parser.add_option_group(sysopt)
+ imgcreate.setup_logging(parser)
+
# debug options not recommended for "production" images
# Start a shell in the chroot for post-configuration.
parser.add_option("-l", "--shell", action="store_true", dest="give_shell",
@@ -101,7 +104,7 @@ def main():
"livecd-",
maxlen = imgcreate.FSLABEL_MAXLEN)
- print "Using label '%s' and name '%s'" % (fs_label, name)
+ logging.info("Using label '%s' and name '%s'" % (fs_label, name))
ks = imgcreate.read_kickstart(options.kscfg)
@@ -121,7 +124,7 @@ def main():
creator.unmount()
creator.package()
except imgcreate.CreatorError, e:
- print >> sys.stderr, "Error creating Live CD : %s" % e
+ logging.error("Error creating Live CD : %s" % e)
return 1
finally:
creator.cleanup()
15 years, 10 months