Transcript: Using the Yocto BSP tools to manage kernel patches and config items: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
Here's a cut-and-paste shell session showing how to use the Yocto BSP 'yocto-kernel' tool to manage kernel patches and config items for a BSP that was created using 'yocto-bsp'.  This particular session uses the qemu ARM BSP that was created in the [https://wiki.yoctoproject.org/wiki/Transcript:_Using_the_Yocto_BSP_tools_to_create_a_qemu_BSP Transcript: Using the Yocto BSP tools to create a qemu BSP].
Here's a cut-and-paste shell session showing how to use the Yocto BSP 'yocto-kernel' tool to manage kernel patches and config items for a BSP that was created using 'yocto-bsp'.  This particular session uses the qemu ARM BSP that was created in the [https://wiki.yoctoproject.org/wiki/Transcript:_Using_the_Yocto_BSP_tools_to_create_a_qemu_BSP Transcript: Using the Yocto BSP tools to create a qemu BSP].
The 'yocto-kernel' tool allows you to list, add, and remove kernel patches and individual kernel config items to/from a BSP's kernel recipe.
Like the other Yocto BSP tools, you can get help by simply invoking the command or sub-command with no parameters (first we need to source the environment, again this is using the BSP we created in the session linked to by the above link):
trz@elmorro:/usr/local/dev/Yocto$ source oe-init-build-env
### Shell environment set up for builds. ###
You can now run 'bitbake <target>'
Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support
You can also run generated qemu images with a command like 'runqemu qemux86'
trz@elmorro:/usr/local/dev/Yocto/build$ yocto-kernel
Usage:
  Modify and list Yocto BSP kernel config items and patches.
  usage: yocto-kernel [--version] [--help] COMMAND [ARGS]
  The most commonly used 'yocto-kernel' commands are:
    config list      List the modifiable set of bare kernel config options for a BSP
    config add        Add or modify bare kernel config options for a BSP
    config rm        Remove bare kernel config options from a BSP
    patch list        List the patches associated with a BSP
    patch add        Patch the Yocto kernel for a BSP
    patch rm          Remove patches from a BSP
  See 'yocto-kernel help COMMAND' for more information on a specific command.
 
Options:
  --version    show program's version number and exit
  -h, --help  show this help message and exit
  -D, --debug  output debug information
Let's start by adding a patch.  Here's the patch we'll add:
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 6a1a092..b6165b6 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -392,6 +392,11 @@ config HMC6352
          This driver provides support for the Honeywell HMC6352 compass,
          providing configuration and heading data via sysfs.
 
+config YOCTO_TESTMOD
+      tristate "Yocto Test Driver"
+      help
+        This driver provides a silly message for testing Yocto.
+
  config EP93XX_PWM
        tristate "EP93xx PWM support"
        depends on ARCH_EP93XX
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 3e1d801..11384d8 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_TI_DAC7512)      += ti_dac7512.o
  obj-$(CONFIG_C2PORT)          += c2port/
  obj-$(CONFIG_IWMC3200TOP)      += iwmc3200top/
  obj-$(CONFIG_HMC6352)          += hmc6352.o
+obj-$(CONFIG_YOCTO_TESTMOD)    += yocto-testmod.o
  obj-y                          += eeprom/
  obj-y                          += cb710/
  obj-$(CONFIG_SPEAR13XX_PCIE_GADGET)    += spear13xx_pcie_gadget.o
diff --git a/drivers/misc/yocto-testmod.c b/drivers/misc/yocto-testmod.c
new file mode 100644
index 0000000..81de912
--- /dev/null
+++ b/drivers/misc/yocto-testmod.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 Intel Corporation
+ * Authored-by:  Tom Zanussi <tom.zanussi@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/module.h>
+
+static int __init yocto_testmod_init(void)
+{
+      printk("Kilroy was here! __m_(OuO)_m__");
+}
+
+static void __exit yocto_testmod_exit(void)
+{
+      printk("Kilroy was not here!");
+}
+
+module_init(yocto_testmod_init);
+module_exit(yocto_testmod_exit);
+
+MODULE_AUTHOR("Tom Zanussi <tom.zanussi@intel.com");
+MODULE_DESCRIPTION("Yocto Test Driver");
+MODULE_LICENSE("GPL");

Revision as of 03:45, 17 March 2012

Here's a cut-and-paste shell session showing how to use the Yocto BSP 'yocto-kernel' tool to manage kernel patches and config items for a BSP that was created using 'yocto-bsp'. This particular session uses the qemu ARM BSP that was created in the Transcript: Using the Yocto BSP tools to create a qemu BSP.

The 'yocto-kernel' tool allows you to list, add, and remove kernel patches and individual kernel config items to/from a BSP's kernel recipe.

Like the other Yocto BSP tools, you can get help by simply invoking the command or sub-command with no parameters (first we need to source the environment, again this is using the BSP we created in the session linked to by the above link):

trz@elmorro:/usr/local/dev/Yocto$ source oe-init-build-env 

### Shell environment set up for builds. ###

You can now run 'bitbake <target>'

Common targets are:
    core-image-minimal
    core-image-sato
    meta-toolchain
    meta-toolchain-sdk
    adt-installer
    meta-ide-support

You can also run generated qemu images with a command like 'runqemu qemux86'

trz@elmorro:/usr/local/dev/Yocto/build$ yocto-kernel

Usage: 

 Modify and list Yocto BSP kernel config items and patches.

 usage: yocto-kernel [--version] [--help] COMMAND [ARGS]

 The most commonly used 'yocto-kernel' commands are:
   config list       List the modifiable set of bare kernel config options for a BSP
   config add        Add or modify bare kernel config options for a BSP
   config rm         Remove bare kernel config options from a BSP
   patch list        List the patches associated with a BSP
   patch add         Patch the Yocto kernel for a BSP
   patch rm          Remove patches from a BSP

 See 'yocto-kernel help COMMAND' for more information on a specific command.
 


Options:
  --version    show program's version number and exit
  -h, --help   show this help message and exit
  -D, --debug  output debug information


Let's start by adding a patch. Here's the patch we'll add:

diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 6a1a092..b6165b6 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -392,6 +392,11 @@ config HMC6352
          This driver provides support for the Honeywell HMC6352 compass,
          providing configuration and heading data via sysfs.
 
+config YOCTO_TESTMOD
+       tristate "Yocto Test Driver"
+       help
+         This driver provides a silly message for testing Yocto.
+
 config EP93XX_PWM
        tristate "EP93xx PWM support"
        depends on ARCH_EP93XX
diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
index 3e1d801..11384d8 100644
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_TI_DAC7512)      += ti_dac7512.o
 obj-$(CONFIG_C2PORT)           += c2port/
 obj-$(CONFIG_IWMC3200TOP)      += iwmc3200top/
 obj-$(CONFIG_HMC6352)          += hmc6352.o
+obj-$(CONFIG_YOCTO_TESTMOD)    += yocto-testmod.o
 obj-y                          += eeprom/
 obj-y                          += cb710/
 obj-$(CONFIG_SPEAR13XX_PCIE_GADGET)    += spear13xx_pcie_gadget.o
diff --git a/drivers/misc/yocto-testmod.c b/drivers/misc/yocto-testmod.c
new file mode 100644
index 0000000..81de912
--- /dev/null
+++ b/drivers/misc/yocto-testmod.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2012 Intel Corporation
+ * Authored-by:  Tom Zanussi <tom.zanussi@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/module.h>
+
+static int __init yocto_testmod_init(void)
+{
+       printk("Kilroy was here! __m_(OuO)_m__");
+}
+
+static void __exit yocto_testmod_exit(void)
+{
+       printk("Kilroy was not here!");
+}
+
+module_init(yocto_testmod_init);
+module_exit(yocto_testmod_exit);
+
+MODULE_AUTHOR("Tom Zanussi <tom.zanussi@intel.com");
+MODULE_DESCRIPTION("Yocto Test Driver");
+MODULE_LICENSE("GPL");