Add virtual workbook / config-in-skeleton classes
This patch introduces a new abstraction 'skeleton-workbook'
for representing a system configuration. At present it is
pulled in by the skeleton recipe so the requirement on what is
implemented by a package providing obmc-phosphor-workbook is something
compatible with the existing System.py python modules in skeleton.
Additionally this patch adds a new recipe for each system using
a configuration file from skeleton today, and a class for common
configuration.
This enables a couple of things:
- No need to patch skeleton.service for each system.
- New systems don't have to put their configuration in the skeleton
repository.
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/classes/config-in-skeleton.bbclass b/classes/config-in-skeleton.bbclass
new file mode 100644
index 0000000..33266be
--- /dev/null
+++ b/classes/config-in-skeleton.bbclass
@@ -0,0 +1,28 @@
+# In general this class should only be used by board layers
+# that keep their machine-readable-workbook in the skeleton repository.
+
+inherit allarch
+inherit setuptools
+
+SRC_URI += "git://github.com/openbmc/skeleton;subpath=configs"
+S = "${WORKDIR}/configs"
+
+python() {
+ machine = d.getVar('MACHINE', True).capitalize() + '.py'
+ d.setVar('_config_in_skeleton', machine)
+}
+
+do_make_setup() {
+ cp ${S}/${_config_in_skeleton} \
+ ${S}/obmc_system_config.py
+ cat <<EOF > ${S}/setup.py
+from distutils.core import setup
+
+setup(name='${BPN}',
+ version='${PR}',
+ py_modules=['obmc_system_config'],
+ )
+EOF
+}
+
+addtask make_setup after do_patch before do_configure