summaryrefslogtreecommitdiff
path: root/scripts/lib/mic/3rdparty
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2013-08-24 15:31:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-01 22:53:38 +0100
commit31f0360f1fd4ebc9dfcaed42d1c50d2448b4632e (patch)
tree7d8882b785efdb755de36a28dffa69712cf9b365 /scripts/lib/mic/3rdparty
parent95455ae4251e06d66e60945092b784d2d9ef165c (diff)
downloadopenembedded-core-31f0360f1fd4ebc9dfcaed42d1c50d2448b4632e.tar.gz
openembedded-core-31f0360f1fd4ebc9dfcaed42d1c50d2448b4632e.tar.bz2
openembedded-core-31f0360f1fd4ebc9dfcaed42d1c50d2448b4632e.zip
wic: Add mic w/pykickstart
This is the starting point for the implemention described in [YOCTO 3847] which came to the conclusion that it would make sense to use kickstart syntax to implement image creation in OpenEmbedded. I subsequently realized that there was an existing tool that already implemented image creation using kickstart syntax, the Tizen/Meego mic tool. As such, it made sense to use that as a starting point - this commit essentially just copies the relevant Python code from the MIC tool to the scripts/lib dir, where it can be accessed by the previously created wic tool. Most of this will be removed or renamed by later commits, since we're initially focusing on partitioning only. Care should be taken so that we can easily add back any additional functionality should we decide later to expand the tool, though (we may also want to contribute our local changes to the mic tool to the Tizen project if it makes sense, and therefore should avoid gratuitous changes to the original code if possible). Added the /mic subdir from Tizen mic repo as a starting point: git clone git://review.tizen.org/tools/mic.git For reference, the top commit: commit 20164175ddc234a17b8a12c33d04b012347b1530 Author: Gui Chen <gui.chen@intel.com> Date: Sun Jun 30 22:32:16 2013 -0400 bump up to 0.19.2 Also added the /plugins subdir, moved to under the /mic subdir (to match the default plugin_dir location in mic.conf.in, which was renamed to yocto-image.conf (moved and renamed by later patches) and put into /scripts. Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/3rdparty')
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/__init__.py0
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/base.py466
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py26
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py40
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py119
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py55
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py265
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py86
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/device.py125
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py40
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py68
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py91
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py184
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py114
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py193
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py62
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/group.py88
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py139
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py58
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/iscsi.py133
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/iscsiname.py54
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/key.py64
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/keyboard.py55
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/lang.py60
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/langsupport.py58
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/lilocheck.py54
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/logging.py66
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/logvol.py304
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/mediacheck.py53
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/method.py186
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/monitor.py106
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/mouse.py70
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/multipath.py111
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/network.py363
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/partition.py353
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/raid.py365
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/reboot.py79
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/repo.py249
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/rescue.py68
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/rootpw.py93
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/selinux.py64
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/services.py71
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/skipx.py54
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/sshpw.py105
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/timezone.py86
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/updates.py60
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/upgrade.py106
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/user.py173
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/vnc.py114
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/volgroup.py102
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/xconfig.py184
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/zerombr.py69
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/commands/zfcp.py134
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/constants.py57
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/errors.py103
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/__init__.py0
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/control.py1307
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f10.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f11.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f12.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f13.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f14.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f15.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f16.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f7.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f8.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/f9.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/fc3.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/fc4.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/fc5.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/fc6.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/rhel3.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/rhel4.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/rhel5.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/handlers/rhel6.py24
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/ko.py37
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/options.py204
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/parser.py702
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/sections.py244
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/__init__.py53
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/byterange.py463
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/grabber.py1477
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/keepalive.py617
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/mirror.py458
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/progress.py530
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/urlgrabber/sslfactory.py90
-rw-r--r--scripts/lib/mic/3rdparty/pykickstart/version.py197
87 files changed, 13456 insertions, 0 deletions
diff --git a/scripts/lib/mic/3rdparty/pykickstart/__init__.py b/scripts/lib/mic/3rdparty/pykickstart/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/scripts/lib/mic/3rdparty/pykickstart/__init__.py
diff --git a/scripts/lib/mic/3rdparty/pykickstart/base.py b/scripts/lib/mic/3rdparty/pykickstart/base.py
new file mode 100644
index 0000000000..e6c8f56f9d
--- /dev/null
+++ b/scripts/lib/mic/3rdparty/pykickstart/base.py
@@ -0,0 +1,466 @@
+#
+# Chris Lumens <clumens@redhat.com>
+#
+# Copyright 2006, 2007, 2008 Red Hat, Inc.
+#
+# This copyrighted material is made available to anyone wishing to use, modify,
+# copy, or redistribute it subject to the terms and conditions of the GNU
+# General Public License v.2. This program is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the
+# implied warranties 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
+# this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat
+# trademarks that are incorporated in the source code or documentation are not
+# subject to the GNU General Public License and may only be used or replicated
+# with the express permission of Red Hat, Inc.
+#
+"""
+Base classes for creating commands and syntax version object.
+
+This module exports several important base classes:
+
+ BaseData - The base abstract class for all data objects. Data objects
+ are contained within a BaseHandler object.
+
+ BaseHandler - The base abstract class from which versioned kickstart
+ handler are derived. Subclasses of BaseHandler hold
+ BaseData and KickstartCommand objects.
+
+ DeprecatedCommand - An abstract subclass of KickstartCommand that should
+ be further subclassed by users of this module. When
+ a subclass is used, a warning message will be
+ printed.
+
+ KickstartCommand - The base abstract class for all kickstart commands.
+ Command objects are contained within a BaseHandler
+ object.
+"""
+import gettext
+gettext.textdomain("pykickstart")
+_ = lambda x: gettext.ldgettext("pykickstart", x)
+
+import types
+import warnings
+from pykickstart.errors import *
+from pykickstart.ko import *
+from pykickstart.parser import Packages
+from pykickstart.version import versionToString
+
+###
+### COMMANDS
+###
+class KickstartCommand(KickstartObject):
+ """The base class for all kickstart commands. This is an abstract class."""
+ removedKeywords = []
+ removedAttrs = []
+
+ def __init__(self, writePriority=0, *args, **kwargs):
+ """Create a new KickstartCommand instance. This method must be
+ provided by all subclasses, but subclasses must call
+ KickstartCommand.__init__ first. Instance attributes:
+
+ currentCmd -- The name of the command in the input file that
+ caused this handler to be run.
+ currentLine -- The current unprocessed line from the input file
+ that caused this handler to be run.
+ handler -- A reference to the BaseHandler subclass this
+ command is contained withing. This is needed to
+ allow referencing of Data objects.
+ lineno -- The current line number in the input file.
+ writePriority -- An integer specifying when this command should be
+ printed when iterating over all commands' __str__
+ methods. The higher the number, the later this
+ command will be written. All commands with the
+ same priority will be written alphabetically.
+ """
+
+ # We don't want people using this class by itself.
+ if self.__class__ is KickstartCommand:
+ raise TypeError, "KickstartCommand is an abstract class."
+
+ KickstartObject.__init__(self, *args, **kwargs)
+
+ self.writePriority = writePriority
+
+ # These will be set by the dispatcher.
+ self.currentCmd = ""
+ self.currentLine = ""
+ self.handler = None
+ self.lineno = 0
+
+ # If a subclass provides a removedKeywords list, remove all the
+ # members from the kwargs list before we start processing it. This
+ # ensures that subclasses don't continue to recognize arguments that
+ # were removed.
+ for arg in filter(kwargs.has_key, self.removedKeywords):
+ kwargs.pop(arg)
+
+ def __call__(self, *args, **kwargs):
+ """Set multiple attributes on a subclass of KickstartCommand at once
+ via keyword arguments. Valid attributes are anything specified in
+ a subclass, but unknown attributes will be ignored.
+ """
+ for (key, val) in kwargs.items():
+ # Ignore setting attributes that were removed in a subclass, as
+ # if they were unknown attributes.
+ if key in self.removedAttrs:
+ continue
+
+ if hasattr(self, key):
+ setattr(self, key, val)
+
+ def __str__(self):
+ """Return a string formatted for output to a kickstart file. This
+ method must be provided by all subclasses.
+ """
+ return KickstartObject.__str__(self)
+
+ def parse(self, args):
+ """Parse the list of args and set data on the KickstartCommand object.
+ This method must be provided by all subclasses.
+ """
+ raise TypeError, "parse() not implemented for KickstartCommand"
+
+ def apply(self, instroot="/"):
+ """Write out the configuration related to the KickstartCommand object.
+ Subclasses which do not provide this method will not have their
+ configuration written out.
+ """
+ return
+
+ def dataList(self):
+ """For commands that can occur multiple times in a single kickstart
+ file (like network, part, etc.), return the list that we should
+ append more data objects to.
+ """
+ return None
+
+ def deleteRemovedAttrs(self):
+ """Remove all attributes from self that are given in the removedAttrs
+ list. This method should be called from __init__ in a subclass,
+ but only after the superclass's __init__ method has been called.
+ """
+ for attr in filter(lambda k: hasattr(self, k), self.removedAttrs):
+ delattr(self, attr)
+
+ # Set the contents of the opts object (an instance of optparse.Values
+ # returned by parse_args) as attributes on the KickstartCommand object.
+ # It's useful to call this from KickstartCommand subclasses after parsing
+ # the arguments.
+ def _setToSelf(self, optParser, opts):
+ self._setToObj(optParser, opts, self)
+
+ # Sets the contents of the opts object (an instance of optparse.Values
+ # returned by parse_args) as attributes on the provided object obj. It's
+ # useful to call this from KickstartCommand subclasses that handle lists
+ # of objects (like partitions, network devices, etc.) and need to populate
+ # a Data object.
+ def _setToObj(self, optParser, opts, obj):
+ for key in filter (lambda k: getattr(opts, k) != None, optParser.keys()):
+ setattr(obj, key, getattr(opts, key))
+
+class DeprecatedCommand(KickstartCommand):
+ """Specify that a command is deprecated and no longer has any function.
+ Any command that is deprecated should be subclassed from this class,
+ only specifying an __init__ method that calls the superclass's __init__.
+ This is an abstract class.
+ """
+ def __init__(self, writePriority=None, *args, **kwargs):