Makefile | 2 -
imgcreate/errors.py | 4 ++-
tools/edit-livecd | 9 +++++-
tools/livecd-creator | 57 ++++++++++++++++++--------------------------
tools/livecd-iso-to-disk.sh | 5 +++
5 files changed, 40 insertions(+), 37 deletions(-)
New commits:
commit 9e5331b7428868f38c2ef4e729e1c68cff8c26c6
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Fri Jan 31 14:54:25 2014 -0800
Version 19.9
diff --git a/Makefile b/Makefile
index e5cc336..26cc65e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 19.8
+VERSION = 19.9
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 9885730cfe43571bc31779b40ee6ba032043f0ff
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 29 17:22:53 2014 -0800
Add check for extlinux tools (#881317)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 77691d6..3187537 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -563,6 +563,11 @@ checkFilesystem() {
fi
fi
+ if [ "$TGTFS" = "ext2" -o "$TGTFS" = "ext3" -o "$TGTFS" = "ext4" ] && [ ! -x /usr/sbin/extlinux ]; then
+ echo "Target filesystem ($TGTFS) requires syslinux-extlinux to be installed."
+ exitclean
+ fi
+
TGTLABEL=$(/sbin/blkid -s LABEL -o value $dev)
if [ "$TGTLABEL" != "LIVE" ]; then
if [ "$TGTFS" = "vfat" -o "$TGTFS" = "msdos" ]; then
commit 5fb4e8c87b466dc3aaa5913064e25e08f1491272
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jan 29 16:59:32 2014 -0800
Check kickstart for repo line (#1005580)
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 67e3cec..a2919e6 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -174,6 +174,9 @@ def main():
logging.info("Using title '%s' and product '%s'" % (title, product))
ks = imgcreate.read_kickstart(options.kscfg)
+ if not ks.handler.repo.seen:
+ print >> sys.stderr, "Kickstart (%s) must have at least one repository." % (options.kscfg)
+ return 1
try:
if options.image_type == 'livecd':
commit 5d12dccbaa26f077f84759dbd47c1849884f1e08
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jan 14 14:00:01 2014 -0800
Catch CreatorError during class init (#1005580)
diff --git a/tools/livecd-creator b/tools/livecd-creator
index 44d07a1..67e3cec 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -25,7 +25,6 @@ import optparse
import logging
import imgcreate
-from imgcreate.fs import makedirs
class Usage(Exception):
def __init__(self, msg = None, no_error = False):
@@ -105,7 +104,7 @@ def parse_options(args):
else:
options.image_type = 'livecd'
if options.image_type not in ('livecd', 'image'):
- raise Usage("'%s' is a recognized image type" % options.image_type)
+ raise Usage("'%s' is not a recognized image type" % options.image_type)
# image-create compatibility: Last argument is kickstart file
if len(args) == 1:
@@ -176,26 +175,26 @@ def main():
ks = imgcreate.read_kickstart(options.kscfg)
- if options.image_type == 'livecd':
- creator = imgcreate.LiveImageCreator(ks, name,
- fslabel=fslabel,
- releasever=options.releasever,
- tmpdir=os.path.abspath(options.tmpdir),
- useplugins=options.plugins,
- title=title, product=product,
- cacheonly=options.cacheonly,
- docleanup=not options.nocleanup)
- elif options.image_type == 'image':
- creator = imgcreate.LoopImageCreator(ks, name,
- fslabel=fslabel,
- releasever=options.releasever,
- useplugins=options.plugins,
- tmpdir=os.path.abspath(options.tmpdir),
- cacheonly=options.cacheonly,
- docleanup=not options.nocleanup)
- else:
- # Cannot happen, we validate this when parsing options.
- logging.error(u"'%s' is not a valid image type" % options.image_type)
+ try:
+ if options.image_type == 'livecd':
+ creator = imgcreate.LiveImageCreator(ks, name,
+ fslabel=fslabel,
+ releasever=options.releasever,
+ tmpdir=os.path.abspath(options.tmpdir),
+ useplugins=options.plugins,
+ title=title, product=product,
+ cacheonly=options.cacheonly,
+ docleanup=not options.nocleanup)
+ elif options.image_type == 'image':
+ creator = imgcreate.LoopImageCreator(ks, name,
+ fslabel=fslabel,
+ releasever=options.releasever,
+ useplugins=options.plugins,
+ tmpdir=os.path.abspath(options.tmpdir),
+ cacheonly=options.cacheonly,
+ docleanup=not options.nocleanup)
+ except imgcreate.CreatorError as e:
+ logging.error(u"%s creation failed: %s", options.image_type, e)
return 1
creator.compress_type = options.compress_type
commit 75601166def6c68d38a60edb998832ae8e82edb3
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jan 14 12:20:51 2014 -0800
Add docleanup to edit-livecd (#1000744)
diff --git a/tools/edit-livecd b/tools/edit-livecd
index 1670228..f1287bf 100755
--- a/tools/edit-livecd
+++ b/tools/edit-livecd
@@ -58,7 +58,7 @@ class LiveImageEditor(LiveImageCreator):
"""
- def __init__(self, name):
+ def __init__(self, name, docleanup=True):
"""Initialize a LiveImageEditor instance.
creates a dummy instance of LiveImageCreator
@@ -125,6 +125,8 @@ class LiveImageEditor(LiveImageCreator):
self.__ImageCreator__selinux_mountpoint = fields[4]
break
+ self.docleanup = docleanup
+
# properties
def __get_image(self):
if self._LoopImageCreator__imagedir is None:
@@ -611,6 +613,9 @@ def parse_options(args):
parser.add_option("", "--skip-minimize", action="store_true",
dest="skip_minimize", default=False,
help="Specify no osmin.img minimal snapshot.")
+ parser.add_option("", "--nocleanup", action="store_true",
+ dest="nocleanup", default=False,
+ help="Skip cleanup of temporary files")
setup_logging(parser)
@@ -673,7 +678,7 @@ def main():
if output == '/dev':
output = options.tmpdir
- editor = LiveImageEditor(name)
+ editor = LiveImageEditor(name, docleanup=not options.nocleanup)
editor._exclude = options.exclude
editor._exclude_file = options.exclude_file
editor._include = options.include
commit 5f9fe3b612d283d6330182b71f869ad758327f01
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jan 14 12:01:42 2014 -0800
utf8 decode unicode error strings (#1035248)
diff --git a/imgcreate/errors.py b/imgcreate/errors.py
index 800dc3b..092770d 100644
--- a/imgcreate/errors.py
+++ b/imgcreate/errors.py
@@ -42,7 +42,9 @@ class CreatorError(Exception):
return repr(self.message)
def __unicode__(self):
- return unicode(self.message)
+ if not self.message:
+ return unicode("")
+ return unicode(self.message.decode("utf8"))
class KickstartError(CreatorError):
pass
commit 8db288315bd67e942674315164c13dda69b86b51
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Jan 14 11:09:59 2014 -0800
Remove switch to Permissive (#1051523)
SELinux has improved to the point where livecd-creator can be run with
it in Enforcing mode so it is no longer necessary to switch to
Permissive. If problems come up in the future they should be corrected
with SELinux policy.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index a39e43f..44d07a1 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -23,7 +23,6 @@ import sys
import time
import optparse
import logging
-import selinux
import imgcreate
from imgcreate.fs import makedirs
@@ -144,12 +143,6 @@ def main():
print >> sys.stderr, "You must run %s as root" % sys.argv[0]
return 1
- # Set selinux to Permissive if it is enforcing
- selinux_enforcing = False
- if selinux.is_selinux_enabled() and selinux.security_getenforce():
- selinux_enforcing = True
- selinux.security_setenforce(0)
-
if options.fslabel:
fslabel = options.fslabel
name = fslabel
@@ -203,8 +196,6 @@ def main():
else:
# Cannot happen, we validate this when parsing options.
logging.error(u"'%s' is not a valid image type" % options.image_type)
- if selinux_enforcing:
- selinux.security_setenforce(1)
return 1
creator.compress_type = options.compress_type
@@ -228,8 +219,6 @@ def main():
return 1
finally:
creator.cleanup()
- if selinux_enforcing:
- selinux.security_setenforce(1)
return 0