poky/scripts
Tom Zanussi 73ce09065f wic: Add SourcePlugin class
Define the SourcePlugin class, which is the class that should be
subclassed to create a 'source' plugin.

'Source' plugins provide a mechanism to customize various aspects of
the image generation process in wic, mainly the contents of
partitions.

The initial version of wic defined a --source param for partitions,
which was in the first revision hard-coded to two possible values:
rootfs and bootimg.

This patch essentially removes the hard-coded --bootimg param and
replaces it with a plugin system that maps the value specified as
--source to a particular 'source' plugin instead.

A 'source' plugin is created as a subclass of SourcePlugin and the
plugin file containing it is added to scriptsl/lib/mic/plugins/source/
to make the plugin implementation available to the wic implementation.

When the wic implementation needs to invoke a partition-specific
implementation, it looks for the plugin that has the same name as the
--source param given to that partition.  For example, if the partition
is set up like this:

  part /boot --source bootimg-pcbios   ...

then the methods defined as class members of the plugin having the
matching .name class member would be used.

To be more concrete, here's the plugin definition that would match a
'--source bootimg-pcbios' usage, along with an example method that
would be called by the wic implementation when it needed to invoke an
implementation-specific partition-preparation function:

  class BootimgPcbiosPlugin(SourcePlugin):
      name = 'bootimg-pcbios'

  @classmethod
      def do_prepare_partition(self, part, ...)

If the subclass itself doesn't implement a function, a 'default'
version in a superclass will be located and used, which is why all
plugins must be derived from SourcePlugin.

This scheme is extensible - adding more hooks is a simple matter of
adding more plugin methods to SourcePlugin and derived classes.  The
code that then needs to call the plugin methods the uses
plugin.get_source_plugin_methods() to find the method(s) needed by the
call; this is done by filling up a dict with keys containing the
methon names of interest - on success, these will be filled in with
the actual methods. fPlease see the implementation for examples and
details.

Note that a source plugin need not restrict itself to methods that
apply directly to partitions - methods can also be defined for higher
level processing such as at the 'disk' level.  The
get_default_source_plugin() of DirectImageCreator allows the default
source plugin to be retrieved; by default this is set to be the same
plugin used for the /boot partition, but that can be overridden by
specifying a different --source and therefore different plugin on the
'bootloader' line.  This isn't ideal, but it avoids forcing a new
high-level object to be defined for that purpose.

Note that the '--source rootfs' param remains as its current
hard-coded value, which is just the rootfs to be used to populate the
partition - by default, that's just the value of the bitbake
ROOTFS_DIR variable (or whatever was passed in using the -r param).
Note that this also could also be overridden by creating a source
plugin using a different name; at this point, unlike with bootimg,
there's been no need to do so.

(From OE-Core rev: 663833d8ecccb36ab42150bc5c9c00be79fa5b93)

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-04 12:57:35 +00:00
..
contrib generate-manifest-3.3.py: Add script to generate python 3.3 manifests 2014-02-02 22:37:38 +00:00
jhbuild Convert to use direct access to the data store (instead of bb.data.*Var*()) 2011-11-10 11:51:19 +00:00
lib wic: Add SourcePlugin class 2014-02-04 12:57:35 +00:00
native-intercept native.bbclass: Add a simple chown intercept command 2011-06-23 21:08:01 +01:00
postinst-intercepts scripts/postinst-intercepts: create separete hooks for multilib 2013-04-29 14:45:10 +01:00
pybootchartgui pybootchartgui: Add option -T to allways use the full time 2014-01-23 10:17:36 +00:00
tiny scripts: Add ksize.py and dirsize.py 2013-10-29 10:41:39 +00:00
bitbake-prserv-tool bitbake-prserv-tool: show error when export file does not exist 2013-02-06 16:52:19 +00:00
bitbake-whatchanged bitbake-whatchanged: print what is about to happen 2013-03-07 11:14:37 +00:00
buildhistory-collect-srcrevs buildhistory-collect-srcrevs: match new buildhistory-diff command line parsing 2013-08-16 11:44:17 +01:00
buildhistory-diff buildhistory-diff: add ability to report version changes 2013-10-26 15:59:13 +01:00
cleanup-workdir cleanup-workdir: fix typo 2013-06-25 17:57:29 +01:00
combo-layer combo-layer: Make directories only if they don't exisit yet 2014-01-28 00:52:37 +00:00
combo-layer-hook-default.sh scripts/combo-layer: fix still overzealous regex in default hook script 2011-09-21 13:42:49 +01:00
combo-layer.conf.example scripts/combo-layer: add branch option to example config 2012-02-21 17:00:46 +00:00
cp-noerror scripts/cp-noerror: Avoid a race 2014-02-02 11:23:45 +00:00
create-pull-request create-pull-request: Error message on missing -u 2013-02-08 14:50:36 +00:00
create-recipe scripts/create-recipe: fix handling of --help 2013-11-14 13:39:48 +00:00
crosstap crosstap: handle hyphenated x86_64 target arch 2013-02-05 15:22:45 +00:00
gen-site-config siteconfig: generate configuration data caches for autoconf 2010-09-03 10:50:02 +01:00
help2man Remove help2man dependency 2011-10-04 13:46:19 +01:00
hob scripts/hob: enable additional arguments 2013-05-14 14:57:27 +03:00
multilib_header_wrapper.h multilib_header.bbclass: Add oe_multilib_header wrapper 2011-07-27 15:45:47 +01:00
oe-buildenv-internal oe-buildenv-internal: Ensure error messages got to stderr 2013-06-18 17:33:15 +01:00
oe-find-native-sysroot oe-find-native-sysroot: minor optimization 2013-08-03 10:33:12 +01:00
oe-git-proxy oe-git-proxy: Use socat instead of BSD nc 2013-02-11 22:54:04 +00:00
oe-pkgdata-util classes/package: record PKGSIZE as total file size in pkgdata 2013-12-03 17:45:49 +00:00
oe-selftest lib/oeqa/selftest/base, scripts/oe-selftest: fix wrong remove path and do a complete cleanup at the end 2013-12-05 14:24:43 +00:00
oe-setup-builddir oe-setup-builddir: substitute ##OEROOT## when using templates 2013-08-13 23:06:03 +01:00
oe-setup-rpmrepo oe-setup-rpmrepo: add native sysroot so nativepython can be found by env 2013-08-30 18:06:31 +01:00
oe-trim-schemas scripts/oe-setup-builddir: Fix up OE-Core/Poky mismatch for now (and fix permissions) 2011-04-21 19:19:33 +01:00
opkg-query-helper.py classes/image: write image manifest 2013-11-26 23:01:32 +00:00
README Further cleanup of various poky references 2011-04-21 12:56:16 +01:00
relocate_sdk.py relocate_sdk.py: Allow script to work with Python 2.4 and 3. 2013-10-26 15:59:18 +01:00
rootfs_rpm-extract-postinst.awk meta/classes/rootfs_rpm.bbclass: re implement base on rpm5 2010-07-24 00:46:57 +01:00
rpm2cpio.sh rpm2cpio.sh: make compression tests case-insensitive 2012-01-03 12:14:39 +00:00
runqemu runqemu, runqemu-internal: Allow slirp for NFS and KVM use 2014-01-28 00:52:36 +00:00
runqemu-addptable2image scripts/oe-setup-builddir: Fix up OE-Core/Poky mismatch for now (and fix permissions) 2011-04-21 19:19:33 +01:00
runqemu-export-rootfs runqemu-export-rootfs: update for unfs3 2014-01-28 00:52:36 +00:00
runqemu-extract-sdk runqemu-extract-sdk: add --numeric-owner option to tar command 2013-10-26 15:59:17 +01:00
runqemu-gen-tapdevs runqemu: Replace use of ifconfig with ip 2013-05-16 00:09:47 +03:00
runqemu-ifdown runqemu-ifdown: clean up the remaining iptables rules 2013-08-30 16:23:47 +01:00
runqemu-ifup runqemu-ifup: when tunctl can't be found, say what package builds it 2013-08-26 11:47:17 +01:00
runqemu-internal scripts/runqemu-internal: use -cpu core2duo for qemux86-64 2014-01-28 18:01:47 +00:00
runqemu.README scripts/runqemu.README: Clean this up to accurately reflect what the runqemu command now does 2011-04-21 12:56:13 +01:00
send-pull-request send-pull-request: add extra CC argument 2013-02-06 09:37:22 +00:00
sstate-cache-management.sh sstate-cache-management.sh: don't remove all packagedata sstate archives 2014-02-02 11:30:34 +00:00
sstate-diff-machines.sh scripts/sstate-diff-machines.sh: add simple script to compare sstate checksums between MACHINEs 2013-01-07 12:06:27 +00:00
sstate-sysroot-cruft.sh scripts/sstate-sysroot-cruft.sh: add simple script to find files in sysroots not tracked by sstate 2013-01-07 12:06:27 +00:00
swabber-strace-attach scripts: replace os.system with subprocess.call 2012-05-30 12:04:45 +01:00
sysroot-relativelinks.py image/populate_sdk: Ensure symlinks in target sysroot are relative 2013-09-11 11:05:05 +01:00
test-dependencies.sh test-dependencies.sh: avoid showing misleading error messages 2014-01-02 12:56:28 +00:00
test-reexec test-reexec: Add script to address issues when task re-execution 2012-05-18 15:25:11 +01:00
wic wic: Create and use new functions for getting bitbake variables 2014-02-04 12:57:35 +00:00
wipe-sysroot wipe-sysroot: explain what is being deleted, and check for arguments 2014-01-02 13:08:40 +00:00
yocto-bsp yocto-bsp: add basic git connectivity check 2013-01-16 12:08:01 +00:00
yocto-kernel yocto-kernel: add support for destroying recipe-space kernel features 2013-03-17 23:10:28 +00:00
yocto-layer yocto-layer: add optional layer priority param 2013-01-20 13:05:39 +00:00

This directory contains Various useful scripts for working with OE builds