Rahul Sundaram wrote:
Hi,
I am working on a Xfce spin of Fedora available at
http://sundaram.fedorapeople.org/livecd-fedora-8-xfce.ksa which as you
can see inherits the base desktop kickstart file which removes wget. I
have been trying to add it back in my kickstart file but wget is not in
the image created by livecd-creator. I have been able to reproduce this
consistently.
Seth Vidal on IRC commented that urlgrabber would serve the same purpose
as wget and of course curl is also there but regardless of value of wget
in the Xfce spin, this seems to be a bug that I can't add back packages
that are removed in the base kickstart file I am inheriting from. Comments?
FWIW attached is a simple script I put together to use pykickstart to
generate a monolithic kickstart file from a multi-file (include-using)
kickstart file. It may shed some light on what pykickstart is doing
under the covers...
basic usage: ksmono-izer --output=out.ks input.ks
-dmc
#!/usr/bin/python
#
#############################################################################
#
# ksmono-izer: a tool to monolithic-ize a multi-file kickstart config
#
#############################################################################
#
# Copyright 2007 Douglas McClendon <dmc AT filteredperception DOT org>
#
# based in part on pykickstart's ksvalidator example code by
# Chris Lumens <clumens(a)redhat.com>
#
#############################################################################
#
#This file is part of VirOS.
#
# VirOS 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, either version 3 of the License, or
# (at your option) any later version.
#
# VirOS 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with VirOS. If not, see <
http://www.gnu.org/licenses/>.
#
#############################################################################
#
# ksmono-izer
#
# monolithic kickstart generator, can be used to take kickstart files which
# utilize the include directive, and generate an equivalent monolithic file.
#
# basic usage: ksmono-izer --output=out.ks input.ks
#
import optparse
import os
import sys
import warnings
import tempfile
import urlgrabber
import shutil
from pykickstart.errors import *
from pykickstart.parser import *
from pykickstart.version import *
from rhpl.translate import _
import rhpl.translate as translate
translate.textdomain("pykickstart")
def cleanup(tmpdir, file=None):
shutil.rmtree(tmpdir)
if file is not None:
try:
os.remove(file)
except:
pass
op = OptionParser(usage="usage: %prog [options] ksfile|url")
op.add_option("-v", "--version", dest="version",
default=DEVEL,
help=_("version of kickstart syntax to validate against"))
op.add_option("-o", "--output", dest="monolithic_output",
default="___NONE",
help=_("name of output monolithic kickstart file"))
(opts, extra) = op.parse_args(sys.argv[1:])
if len(extra) != 1:
op.print_help()
os._exit(1)
else:
tmpdir = tempfile.mkdtemp("", "ksmono-izer-tmp-",
"/tmp")
f = urlgrabber.urlgrab(extra[0], filename="%s/ks.cfg" % tmpdir)
try:
handler = makeVersion(opts.version)
except KickstartVersionError:
print _("The version %s is not supported by pykickstart" % opts.version)
cleanup(tmpdir)
ksparser = KickstartParser(handler, True, False)
processedFile = None
try:
processedFile = preprocessKickstart(f)
ksparser.readKickstart(processedFile)
if (opts.monolithic_output != "___NONE"):
# output a monolithic kickstart file
outfile = open(opts.monolithic_output, 'w')
outfile.write(ksparser.handler.__str__())
outfile.close()
cleanup(tmpdir, processedFile)
os._exit(0)
except DeprecationWarning, msg:
print _("File uses a deprecated option or command.\n%s") % msg
print msg
except (KickstartParseError, KickstartValueError), msg:
print _("Kickstart parse error in input file")
print msg
except KickstartError:
print _("General kickstart error in input file")
except Exception, e:
print _("General error in input file: %s") % e
cleanup(tmpdir, processedFile)
os._exit(1)