Yocto BSP tools
cover Yocto BSP tools
From: Tom Zanussi <[email protected]>
This patchset implements the 'yocto-bsp' and 'yocto-kernel' BSP tools previously described in some detail in this RFC posting:
https://lists.yoctoproject.org/pipermail/yocto/2011-December/006111.html
With the functionality implemented by this patchset, you can:
- create a new Yocto BSP for any architecture supported Yocto, as well as qemu versions of the same. The default mode of operation when invoked from the command-line is to prompt the user for information needed to generate the BSP. For the current set of BSPs, the user is prompted for various important parameters such as which kernel to use, which branch of that kernel to use (or re-use), whether or not to use X, and if so, which drivers to use, whether to turn on SMP, whether the BSP has a keyboard, touchscreen, etc.
There's also an option (-i) that allows all the necessary information to be supplied directly as a JSON object instead, which allows the built-in prompting to be bypassed. This is mainly for use by developers of alternate UIs, such as the ADT integration that should now be possible with what's provided here.
(available via the 'yocto-bsp create' command)
- list the architectures available for BSP generation (using the 'yocto-bsp list karch' command). You can also list the properties and possible values for those properties for all the input items needed for a given architecture in order to create a bsp. The latter is mainly useful for developers of alternate UIs. See the documention in the built-in help system for details of the extensive data displayed by this command.
(available via the 'yocto-bsp list' command)
- add and remove kernel patches to/from the BSP, as well as list the kernel patches attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel patch add/rm/list' commands)
- add and remove kernel config items to/from the BSP, as well as list the user-defined config items attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel config add/rm/list' commands)
The built-in help system that makes it easy to drill down at any time and remind oneself of the syntax required for any specific command:
Simply entering the name of the command, or the command along with 'help' will display a list of the available sub-commands. For example:
$ yocto-bsp $ yocto-bsp help
Usage:
Create a customized Yocto BSP layer.
usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
The most commonly used 'yocto-bsp' commands are:
create Create a new Yocto BSP
list List available values for options and BSP properties
See 'yocto-bsp 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
Similarly, entering just the name of the subcommand will show the detailed usage for that command:
$ yocto-bsp create
Usage:
Create a new Yocto BSP
usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>]
[-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within
the top-level directory specified as 'meta-bsp-name'. The -o option
can be used to place the BSP layer in a directory with a different name and location.
...
For any subcommand, you can also use the word 'help' just before the subcommand to get more extensive documentation on the subcommand:
$ yocto-bsp help create
NAME
yocto-bsp create - Create a new Yocto BSP
SYNOPSIS
yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]
DESCRIPTION
This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within the top-level directory specified as 'meta-bsp-name'. The -o option can be used to place the BSP layer in a directory with a different name and location.
The value of the 'karch' parameter determines the set of files that will be generated for the BSP, along with the specific set of 'properties' that will be used to fill out the BSP-specific portions of the BSP.
...
NOTE: Once created, you should add your new layer to your bblayers.conf file in order for it to be subsquently seen and modified by the yocto-kernel tool.
NOTE for x86- and x86_64-based BSPs: The generated BSP assumes the presence of the of the meta-intel layer, so you should also have a meta-intel layer present and added to your bblayers.conf as well.
So, armed simply with the knowledge that there are two Yocto BSP commands, 'yocto-bsp' and 'yocto-kernel', with the help of the help system and what's implemented by those commands, you should be able to create a BSP from scratch and do basic configuration and maintenance of the kernel without ever seeing a Yocto metadata file.
What's not implemented, or what still needs work:
- No support yet for kernel features.
- The 'publish' mechanism isn't yet implemented; currently this is all done in 'recipe-space'.
- The template data (the BSP-specific files in the bsp/substrate dir) for some specific architectures is untested and probably woefully incomplete or too specific (I didn't test what I don't have hardware for)
- I need to document the template 'language' in order to make that easier. Conceptually, it should be relatively easy to understand by looking at the other template files - basically they're just straight Yocto metadata files marked up with variable replacement tags {{=xxx}} and inline Python in any other tag.
I have tested all the commands for the entire workflow - BSP creation, kernel patch and configuration commands - for the following architectures, and have successfully built and booted the generated and modified BSPs for each:
- qemuarm
- qemux86
- x86
- x86_64
Aside from any other bugs, some work probably still needs to be done for some of the other non-qemu architectures in order to get them to a point where BSPs generated for them would stand a reasonable chance of booting as do the machines tested above.
My plans are to implement the missing functionality as follow-on patches shortly. In the meantime, I think the tools should be functional enough to allow people to accomplish the basic tasks related to BSP creation and kernel configuration for a Yocto BSP.
To provide a starting point for using the tools and as a quick illustration of their basic capabilities, I've captured the output of a couple different sessions below.
The first thing you need to do is source the build environment just as you would when building an image. Because the tools are contained in the /scripts directory, doing so makes them directly available:
$ source oe-init-build-env
Once you've done that, you can invoke the 'yocto-bsp create' command to create the BSP. The example below uses 'myarm' as the machine name, and tells it to use the 'qemu' architecture (the specific qemu machine architecture to use will be prompte for). You can use the 'yocto-bsp list karch' command to list the aviailable architectures for BSP creation:
$ yocto-bsp list karch
Architectures available:
arm
powerpc
i386
mips
x86_64
qemuThe 'yocto-bsp create' command for the qemu architecture will display the following prompts along the way to gather the input required for BSP generation. Each prompt asks for input, but has a default value [in brackets]. If you press 'enter' (or any invalid value), the default value will automatically be used.
In the case of the qemu architecture, the first prompt asks which emulated architecture to use. It then asks if the default (3.2) is ok, and we press enter, essentially telling it 'yes'. Once we've selected the kernel, the prompt asks whether we need to have a new branch in the Yocto kernel git repository created for this BSP, which is where any patches we add can later be pushed (once we have publish functionality). For now, the patches and configuration live only in recipe-space, but we generate different code for later use in that regard depending on the answer. We're then given the opportunity to select a particular machine branch to use (or re-use if we elected not to create a new branch). Because we're generating an arm BSP, we choose #3 at that prompt to select the arm-versatile branch. The rest of the prompts are routine, and once all the questions have been completed, the BSP is generated along with a message telling you so.
$ yocto-bsp create myarm qemu Which qemu architecture would you like to use? [default: x86] 1) common 32-bit x86 2) common 64-bit x86 3) common 32-bit ARM 4) common 32-bit PowerPC 5) common 32-bit MIPS 3 Would you like to use the default (3.2) kernel? (Y/n) Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.2... Please choose a machine branch to base this BSP on => [default: standard/default/common-pc] 1) base 2) standard/base 3) standard/default/arm-versatile-926ejs 4) standard/default/base 5) standard/default/beagleboard 6) standard/default/cedartrail 7) standard/default/common-pc-64/base 8) standard/default/common-pc-64/jasperforest 9) standard/default/common-pc-64/romley 10) standard/default/common-pc-64/sugarbay 11) standard/default/common-pc/atom-pc 12) standard/default/common-pc/base 13) standard/default/crownbay 14) standard/default/emenlow 15) standard/default/fishriver 16) standard/default/fri2 17) standard/default/fsl-mpc8315e-rdb 18) standard/default/mti-malta32-be 19) standard/default/mti-malta32-le 20) standard/default/preempt-rt 21) standard/default/qemu-ppc32 22) standard/default/routerstationpro 23) standard/preempt-rt/base 24) standard/preempt-rt/qemu-ppc32 25) standard/preempt-rt/routerstationpro 26) standard/tiny 3 Do you need SMP support? (Y/n) Does your BSP have a touchscreen? (y/N) Does your BSP have a keyboard? (Y/n) New qemu BSP created in meta-myarm
Now that we have our BSP created, we need to add it to our bblayers.conf. This of course is required in order to build the BSP, but it's also required in order for the 'yocto-kernel' tool to be able to find the layer and other metadata it needs to operate on.
$ emacs -nw conf/bblayers.conf Add the BSP layer to e.g. BBLAYERS /home/trz/bsptest/build/meta-myarm \
We can now use the 'yocto-kernel' command to add patches and config items to the BSP's kernel.
First, let's see what's available via in 'yocto-kernel' command:
$ 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.
Let's add a couple patches:
$ yocto-kernel patch add myarm//home/trz/junk.patch Added patches: junk.patch
$ yocto-kernel patch add myarm /home/trz/yocto-testmod.patch Added patches: yocto-testmod.patch
We can list the patches associated with the kernel and verify what we added:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) junk.patch 2) yocto-testmod.patch
Let's remove one of the patches, junk.patch:
$ yocto-kernel patch rm myarm Specify the patches to remove: 1) junk.patch 2) yocto-testmod.patch 1 Removed patches: junk.patch
Listing again shows that it's been removed:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) yocto-testmod.patch
Similarly, we can add kernel config items by using the 'yocto-kernel config add' command:
$ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y Added items: CONFIG_MISC_DEVICES=y
$ yocto-kernel config add myarm KCONFIG_YOCTO_TESTMOD=y Added items: CONFIG_YOCTO_TESTMOD=y
Finally, we can list the config items now associated with the BSP and see the config items we added along with some others.
$ yocto-kernel config list myarm The current set of machine-specific kernel config items for myarm is: 1) CONFIG_FTRACE_SYSCALLS=y 2) CONFIG_SCHED_TRACER=y 3) CONFIG_IRQSOFF_TRACER=y 4) CONFIG_PREEMPT_TRACER=y 5) CONFIG_MISC_DEVICES=y 6) CONFIG_YOCTO_TESTMOD=y
Finally, as an example of a BSP for some actual hardware, below we generate an i386 BSP for an Atom board. We specify the 3.0 kernel instead of the default 3.2 kernel and in this case specify that we'll re-use an existing branch and take the default kernel branch suggested. We also specify that we want to use the Atom tuning and that we also want support for X and in this case we'll start by using the vesa driver. Again, the remaining items are straightforward, and finally, building this BSP might stand a good chance of actually booting and running on the actual Atom hardware, or it may not (most likely). If it's the kernel that needs tweaking, then of course, the 'yocto-kernel' command can be used to make those modifications.
$ yocto-bsp create myatom i386 Would you like to use the default (3.2) kernel? (Y/n) n Please choose the kernel to use in this BSP => [default: linux-yocto_3.2] 1) linux-yocto-rt_3.2 2) linux-yocto_3.2 3) linux-yocto_3.0 4) linux-yocto-rt_3.0 3 Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] n Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.0... Please choose a machine branch to base this BSP on => [default: yocto/standard/base] 1) yocto/base 2) yocto/eg20t 3) yocto/emgd 4) yocto/emgd-1.10 5) yocto/gma500 6) yocto/pvr 7) yocto/standard/arm-versatile-926ejs 8) yocto/standard/base 9) yocto/standard/beagleboard 10) yocto/standard/cedartrail 11) yocto/standard/common-pc-64/base 12) yocto/standard/common-pc-64/jasperforest 13) yocto/standard/common-pc-64/romley 14) yocto/standard/common-pc-64/sugarbay 15) yocto/standard/common-pc/atom-pc 16) yocto/standard/common-pc/base 17) yocto/standard/crownbay 18) yocto/standard/emenlow 19) yocto/standard/fishriver 20) yocto/standard/fri2 21) yocto/standard/fsl-mpc8315e-rdb 22) yocto/standard/mti-malta32-be 23) yocto/standard/mti-malta32-le 24) yocto/standard/pandaboard 25) yocto/standard/preempt-rt/base 26) yocto/standard/preempt-rt/qemu-ppc32 27) yocto/standard/preempt-rt/routerstationpro 28) yocto/standard/qemu-ppc32 29) yocto/standard/routerstationpro
Do you need SMP support? (Y/n)
Which machine tuning would you like to use? [default: tune_core2]
1) Atom tuning optimizations
2) Core2 tuning optimizations
1
Do you need support for X? (Y/n)
Please select an xserver for this machine [default: xserver_i915]
1) VESA xserver support
2) EMGD xserver support (proprietary)
3) i915 xserver support
1
Does your BSP have a touchscreen? (y/N)
Does your BSP have a keyboard? (Y/n)
New i386 BSP created in meta-myatom
Hopefully the above examples along with the documentation contained in the built-in help system are enough to start becoming productive with these tools; please let me know of anything lacking, bugs, etc. Any and all input appreciated,
Tom
The following changes since commit 6b6aa170d5c618cfcd016dd1de926db647f7f932:
Gary Thomas (1):
busybox: Restore 'date' compatability
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib.git tzanussi/yocto-bsp-tools
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=tzanussi/yocto-bsp-tools
Tom Zanussi (8):
yocto-bsp: add BSP template files
yocto-bsp-tools: add bsp library
yocto-bsp: add templating engine
yocto-bsp: add kernel interface
yocto-bsp-tools: add help/usage
yocto-bsp: add some useful constants
yocto-bsp: new script
yocto-kernel: new script
scripts/lib/bsp/__init__.py | 17 +
scripts/lib/bsp/engine.py | 1336 ++++++++++++++++++++
scripts/lib/bsp/help.py | 588 +++++++++
scripts/lib/bsp/kernel.py | 679 ++++++++++
.../target/arch/arm/conf/machine/{{=machine}}.conf | 87 ++
.../{{ if xserver == \"y\": }} xorg.conf" | 34 +
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-non_hardware.cfg | 30 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 336 +++++
.../recipes-kernel/linux/files/{{=machine}}.scc | 7 +
.../arm/recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
.../bsp/substrate/target/arch/common/COPYING.MIT | 17 +
.../lib/bsp/substrate/target/arch/common/README | 118 ++
.../substrate/target/arch/common/README.sources | 17 +
.../substrate/target/arch/common/conf/layer.conf | 10 +
.../formfactor/formfactor/{{=machine}}/machconfig | 5 +
.../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 +
.../tasks/task-core-tools-profile.bbappend | 2 +
.../arch/i386/conf/machine/{{=machine}}.conf | 44 +
...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 +
...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 +
...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 +
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 54 +
.../recipes-kernel/linux/files/{{=machine}}.scc | 30 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
.../arch/mips/conf/machine/{{=machine}}.conf | 28 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 1 +
.../recipes-kernel/linux/files/{{=machine}}.scc | 8 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
.../arch/powerpc/conf/machine/{{=machine}}.conf | 53 +
.../recipes-kernel/linux/files/user-config.cfg | 4 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 163 +++
.../recipes-kernel/linux/files/{{=machine}}.scc | 11 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
.../arch/qemu/conf/machine/{{=machine}}.conf | 59 +
.../xserver-xf86-config/{{=machine}}/xorg.conf | 69 +
..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 +
.../recipes-kernel/linux/files/user-config.cfg | 4 +
.../linux/files/{{=machine}}-preempt-rt.scc | 30 +
.../linux/files/{{=machine}}-standard.scc | 30 +
.../recipes-kernel/linux/files/{{=machine}}.scc | 6 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
.../arch/x86_64/conf/machine/{{=machine}}.conf | 29 +
...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 +
...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 +
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 47 +
.../recipes-kernel/linux/files/{{=machine}}.scc | 17 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 +
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 +
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 +
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 +
scripts/lib/bsp/tags.py | 39 +
scripts/yocto-bsp | 131 ++
scripts/yocto-kernel | 219 ++++
87 files changed, 5445 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/__init__.py
create mode 100644 scripts/lib/bsp/engine.py
create mode 100644 scripts/lib/bsp/help.py
create mode 100644 scripts/lib/bsp/kernel.py
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README.sources
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/tags.py
create mode 100755 scripts/yocto-bsp
create mode 100755 scripts/yocto-kernelPATCH 1/8 yocto-bsp: add BSP template files
From: Tom Zanussi <[email protected]>
BSP template files for all supported Yocto architectures, plus qemu versions of the same.
---
.../target/arch/arm/conf/machine/{{=machine}}.conf | 87 +++++
.../{{ if xserver == \"y\": }} xorg.conf" | 34 ++
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-non_hardware.cfg | 30 ++
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 336 ++++++++++++++++++++
.../recipes-kernel/linux/files/{{=machine}}.scc | 7 +
.../arm/recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
.../bsp/substrate/target/arch/common/COPYING.MIT | 17 +
.../lib/bsp/substrate/target/arch/common/README | 118 +++++++
.../substrate/target/arch/common/README.sources | 17 +
.../substrate/target/arch/common/conf/layer.conf | 10 +
.../formfactor/formfactor/{{=machine}}/machconfig | 5 +
.../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 +
.../tasks/task-core-tools-profile.bbappend | 2 +
.../arch/i386/conf/machine/{{=machine}}.conf | 44 +++
...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 +++
...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++
...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 54 ++++
.../recipes-kernel/linux/files/{{=machine}}.scc | 30 ++
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
.../arch/mips/conf/machine/{{=machine}}.conf | 28 ++
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 1 +
.../recipes-kernel/linux/files/{{=machine}}.scc | 8 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
.../arch/powerpc/conf/machine/{{=machine}}.conf | 53 +++
.../recipes-kernel/linux/files/user-config.cfg | 4 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 163 ++++++++++
.../recipes-kernel/linux/files/{{=machine}}.scc | 11 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
.../arch/qemu/conf/machine/{{=machine}}.conf | 59 ++++
.../xserver-xf86-config/{{=machine}}/xorg.conf | 69 ++++
..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 +
.../recipes-kernel/linux/files/user-config.cfg | 4 +
.../linux/files/{{=machine}}-preempt-rt.scc | 30 ++
.../linux/files/{{=machine}}-standard.scc | 30 ++
.../recipes-kernel/linux/files/{{=machine}}.scc | 6 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
.../arch/x86_64/conf/machine/{{=machine}}.conf | 29 ++
...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++
...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++
... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 +
.../linux/files/{{=machine}}-preempt-rt.scc | 8 +
.../linux/files/{{=machine}}-standard.scc | 8 +
.../recipes-kernel/linux/files/{{=machine}}.cfg | 47 +++
.../recipes-kernel/linux/files/{{=machine}}.scc | 17 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
80 files changed, 2436 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README.sources
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc
create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"scripts/lib/bsp/substrate/target/arch/arm/.gitignore new file +0 -0
scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf new file +87 -0
87 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf new file +34 -0
@@ -0,0 +1,34 @@ +Section "Module" + Load "extmod" + Load "dbe" + Load "glx" + Load "freetype" + Load "type1" + Load "record" + Load "dri" +EndSection + +Section "Monitor" + Identifier "Builtin Default Monitor" +EndSection + +Section "Device" + Identifier "Builtin Default fbdev Device 0" + Driver "omapfb" +EndSection + +Section "Screen" + Identifier "Builtin Default fbdev Screen 0" + Device "Builtin Default fbdev Device 0" + Monitor "Builtin Default Monitor" +EndSection + +Section "ServerLayout" + Identifier "Builtin Default Layout" + Screen "Builtin Default fbdev Screen 0" +EndSection + +Section "ServerFlags" + Option "DontZap" "0" + Option "AutoAddDevices" "False" +EndSection
scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend new file +3 -0
@@ -0,0 +1,3 @@ +THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:" +
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg new file +0 -0
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg new file +30 -0
@@ -0,0 +1,30 @@ +# +# Miscellaneous filesystems +# +CONFIG_NFS_DEF_FILE_IO_SIZE=1024 + +# +# Multiple Device Support +# +# CONFIG_MD is not set + +# Kernel Features +# +CONFIG_NO_HZ=y + +# +# CPUIdle +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Kernel hacking +# +CONFIG_DEBUG_FS=y + +# +# Power management options +# +CONFIG_PM_DEBUG=y
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH arm + +# no new branch required, re-use the ktypes/preempt-rt branch +include ktypes/preempt-rt + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH arm + +include ktypes/standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg new file +336 -0
336 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc new file +7 -0
@@ -0,0 +1,7 @@ +kconf hardware {{=machine}}.cfg +kconf non-hardware {{machine}}-non_hardware.cfg + +include features/usb-net/usb-net.scc + +kconf hardware user-config.cfg +include user-patches.scc
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +36 -0
@@ -0,0 +1,36 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT new file +17 -0
@@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
scripts/lib/bsp/substrate/target/arch/common/README new file +118 -0
118 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/common/README.sources new file +17 -0
@@ -0,0 +1,17 @@ +The sources for the packages comprising the images shipped with this +BSP can be found at the following location: + +http://downloads.yoctoproject.org/mirror/sources/ + +The metadata used to generate the images shipped with this BSP, in +addition to the code contained in this BSP, can be found at the +following location: + +http://www.yoctoproject.org/downloads/yocto-1.1/poky-edison-6.0.tar.bz2 + +The metadata used to generate the images shipped with this BSP, in +addition to the code contained in this BSP, can also be found at the +following locations: + +git://git.yoctoproject.org/poky.git +git://git.yoctoproject.org/meta-xxxx
scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore new file +0 -0
scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf new file +10 -0
@@ -0,0 +1,10 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH := "${BBPATH}:${LAYERDIR}" + +# We have a recipes directory, add to BBFILES +BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "{{=machine}}" +BBFILE_PATTERN_{{=machine}} := "^${LAYERDIR}/" +BBFILE_PRIORITY_{{=machine}} = "6"
scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig new file +5 -0
@@ -0,0 +1,5 @@ +# Assume a USB mouse and keyboard are connected +{{ input type:"boolean" name:"touchscreen" msg:"Does your BSP have a touchscreen? (y/N)" default:"n" }} +HAVE_TOUCHSCREEN={{=touchscreen}} +{{ input type:"boolean" name:"keyboard" msg:"Does your BSP have a keyboard? (Y/n)" default:"y" }} +HAVE_KEYBOARD={{=keyboard}}
scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend new file +3 -0
@@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +PRINC = "1"
scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend new file +2 -0
@@ -0,0 +1,2 @@ +RRECOMMENDS_task-core-tools-profile_append_{{=machine}} = " systemtap" +
scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf new file +44 -0
44 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf new file +48 -0
48 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf new file +26 -0
@@ -0,0 +1,26 @@ +Section "Device" + Identifier "Intel Graphics Driver" + Driver "intel" +EndSection + +Section "Monitor" + Identifier "Generic Monitor" + Option "DPMS" +EndSection + +Section "Screen" + Identifier "Default Screen" + Device "Intel Graphics Driver" + Monitor "Generic Monitor" + DefaultDepth 24 +EndSection + +Section "ServerLayout" + Identifier "Default Layout" + Screen "Default Screen" +EndSection + +Section "ServerFlags" + Option "DontZap" "0" + Option "AutoAddDevices" "False" +EndSection
scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf new file +26 -0
@@ -0,0 +1,26 @@ +Section "Device" + Identifier "Generic VESA" + Driver "vesa" +EndSection + +Section "Monitor" + Identifier "Generic Monitor" + Option "DPMS" +EndSection + +Section "Screen" + Identifier "Default Screen" + Device "Generic VESA" + Monitor "Generic Monitor" + DefaultDepth 24 +EndSection + +Section "ServerLayout" + Identifier "Default Layout" + Screen "Default Screen" +EndSection + +Section "ServerFlags" + Option "DontZap" "0" + Option "AutoAddDevices" "False" +EndSection
scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend new file +3 -0
@@ -0,0 +1,3 @@ +THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:" +
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg new file +0 -0
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH i386 + +# no new branch required, re-use the ktypes/preempt-rt branch +include ktypes/preempt-rt + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH i386 + +include ktypes/standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg new file +54 -0
54 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc new file +30 -0
@@ -0,0 +1,30 @@ +kconf hardware {{=machine}}.cfg + +include features/intel-e1xxxx/intel-e100.scc +include features/intel-e1xxxx/intel-e1xxxx.scc + +{{ if xserver_choice == "xserver_emgd": }} +include features/drm-emgd/drm-emgd.scc + +{{ if xserver_choice == "xserver_i915": }} +include features/i915/i915.scc + +include features/dmaengine/dmaengine.scc +include features/serial/8250.scc +include features/hpet/hpet.scc +include features/ericsson-3g/f5521gw.scc + +{{ if xserver_choice == "xserver_vesa" or xserver_choice == "xserver_emgd": }} +include features/framebuffer/vesafb.scc + +include cfg/usb-mass-storage.scc +include cfg/boot-live.scc +include features/power/intel.scc + +include features/logbuf/size-normal.scc + +include features/latencytop/latencytop.scc +include features/profiling/profiling.scc + +kconf hardware user-config.cfg +include user-patches.scc
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +36 -0
@@ -0,0 +1,36 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard/base" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default/base" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/mips/.gitignore new file +0 -0
scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf new file +28 -0
@@ -0,0 +1,28 @@ +#@TYPE: Machine +#@NAME: {{=machine}} + +#@DESCRIPTION: Machine configuration for {{=machine}} systems + +require conf/machine/include/tune-mips32.inc + +MACHINE_FEATURES = "kernel26 screen keyboard pci usbhost ext2 ext3 \ + serial" + +KERNEL_IMAGETYPE = "vmlinux" +KERNEL_ALT_IMAGETYPE = "vmlinux.bin" + +{{ preferred_kernel = kernel_choice.split('_')[0] }} +{{ preferred_kernel_version = kernel_choice.split('_')[1] }} +PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" +PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" + +{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (Y/n)" default:"y" }} +{{ if xserver == "y": }} +PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive" +XSERVER = "xserver-kdrive-fbdev" + +SERIAL_CONSOLE = "115200 ttyS0" + +MACHINE_EXTRA_RRECOMMENDS = " kernel-modules" + +IMAGE_FSTYPES ?= "jffs2 tar.bz2"
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg new file +0 -0
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH mips + +# no new branch required, re-use the ktypes/preempt-rt branch +include ktypes/preempt-rt + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH mips + +include ktypes/standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg new file +1 -0
@@ -0,0 +1 @@ +CONFIG_MIPS=y
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc new file +8 -0
@@ -0,0 +1,8 @@ +kconf hardware {{=machine}}.cfg + +include cfg/usb-mass-storage.scc +include cfg/vfat.scc + +kconf hardware user-config.cfg +include user-patches.scc +
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +36 -0
@@ -0,0 +1,36 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore new file +0 -0
scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf new file +53 -0
53 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_FTRACE_SYSCALLS=y +CONFIG_SCHED_TRACER=y +CONFIG_IRQSOFF_TRACER=y +CONFIG_PREEMPT_TRACER=y
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH powerpc + +# no new branch required, re-use the ktypes/preempt-rt branch +include ktypes/preempt-rt + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH powerpc + +include ktypes/standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg new file +163 -0
163 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc new file +11 -0
@@ -0,0 +1,11 @@ +kconf hardware {{=machine}}.cfg + +include cfg/usb-mass-storage.scc +include cfg/vfat.scc +{{ if kernel_choice == "linux-yocto_3.0" or kernel_choice == "linux-yocto-rt_3.0": }} +include features/dmaengine/dmaengine.scc +{{ if kernel_choice == "linux-yocto_3.2" or kernel_choice == "linux-yocto-rt_3.2": }} +include cfg/dmaengine/dmaengine.scc + +kconf hardware user-config.cfg +include user-patches.scc
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +36 -0
@@ -0,0 +1,36 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf new file +59 -0
59 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf new file +69 -0
69 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend new file +2 -0
@@ -0,0 +1,2 @@ +THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg new file +4 -0
@@ -0,0 +1,4 @@ +CONFIG_FTRACE_SYSCALLS=y +CONFIG_SCHED_TRACER=y +CONFIG_IRQSOFF_TRACER=y +CONFIG_PREEMPT_TRACER=y
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +30 -0
@@ -0,0 +1,30 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +{{ if qemuarch == "x86": }} +define KARCH i386 +{{ if qemuarch == "x86_64": }} +define KARCH x86_64 +{{ if qemuarch == "arm": }} +define KARCH arm +{{ if qemuarch == "powerpc": }} +define KARCH powerpc +{{ if qemuarch == "mips": }} +define KARCH mips + +{{ if qemuarch == "x86": }} +include bsp/common-pc/common-pc-preempt-rt +branch {{=machine}} +{{ if qemuarch == "x86_64": }} +include bsp/common-pc-64/common-pc-64-preempt-rt +branch {{=machine}} +{{ if qemuarch == "arm": }} +include bsp/arm-versatile-926ejs/arm-versatile-926ejs-preempt-rt +branch {{=machine}} +{{ if qemuarch == "powerpc": }} +include bsp/qemu-ppc32/qemu-ppc32-rt +branch {{=machine}} +{{ if qemuarch == "mips": }} +include bsp/mti-malta32/mti-malta32-be-preempt-rt +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +30 -0
@@ -0,0 +1,30 @@ +define KMACHINE {{=machine}} +define KTYPE standard +{{ if qemuarch == "x86": }} +define KARCH i386 +{{ if qemuarch == "x86_64": }} +define KARCH x86_64 +{{ if qemuarch == "arm": }} +define KARCH arm +{{ if qemuarch == "powerpc": }} +define KARCH powerpc +{{ if qemuarch == "mips": }} +define KARCH mips + +{{ if qemuarch == "x86": }} +include bsp/common-pc/common-pc-standard +branch {{=machine}} +{{ if qemuarch == "x86_64": }} +include bsp/common-pc-64/common-pc-64-standard +branch {{=machine}} +{{ if qemuarch == "arm": }} +include bsp/arm-versatile-926ejs/arm-versatile-926ejs-standard +branch {{=machine}} +{{ if qemuarch == "powerpc": }} +include bsp/qemu-ppc32/qemu-ppc32-standard +branch {{=machine}} +{{ if qemuarch == "mips": }} +include bsp/mti-malta32/mti-malta32-be-standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg new file +0 -0
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc new file +6 -0
@@ -0,0 +1,6 @@ +kconf hardware {{=machine}}.cfg + +include features/logbuf/size-normal.scc + +kconf hardware user-config.cfg +include user-patches.scc
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +32 -0
@@ -0,0 +1,32 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +32 -0
@@ -0,0 +1,32 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base your new BSP branch on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard/common-pc" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose an existing machine branch to use for this BSP =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard/common-pc/base" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Would you like SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default/common-pc" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default/common-pc/base" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore new file +0 -0
scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf new file +29 -0
@@ -0,0 +1,29 @@ +#@TYPE: Machine +#@NAME: {{=machine}} + +#@DESCRIPTION: Machine configuration for {{=machine}} systems + +{{ preferred_kernel = kernel_choice.split('_')[0] }} +{{ preferred_kernel_version = kernel_choice.split('_')[1] }} +PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}" +PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%" + +require conf/machine/include/tune-x86_64.inc +require conf/machine/include/ia32-base.inc + +{{ input type:"boolean" name:"xserver" prio:"50" msg:"Do you need support for X? (Y/n)" default:"y" }} +{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine" depends-on:"xserver" depends-on-val:"y" default:"xserver_i915" }} +{{ input type:"choice" val:"xserver_vesa" msg:"VESA xserver support" }} +{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }} +{{ if xserver == "y": }} +XSERVER ?= "${XSERVER_IA32_BASE} \ + ${XSERVER_IA32_EXT} \ +{{ if xserver_choice == "xserver_vesa": }} + ${XSERVER_IA32_VESA} \ +{{ if xserver_choice == "xserver_i915": }} + ${XSERVER_IA32_I915} \ +{{ if xserver == "y": }} + " + +{{ if xserver_choice == "xserver_vesa": }} +APPEND += "video=vesafb vga=0x318"
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf new file +26 -0
@@ -0,0 +1,26 @@ +Section "Device" + Identifier "Intel Graphics Driver" + Driver "intel" +EndSection + +Section "Monitor" + Identifier "Generic Monitor" + Option "DPMS" +EndSection + +Section "Screen" + Identifier "Default Screen" + Device "Intel Graphics Driver" + Monitor "Generic Monitor" + DefaultDepth 24 +EndSection + +Section "ServerLayout" + Identifier "Default Layout" + Screen "Default Screen" +EndSection + +Section "ServerFlags" + Option "DontZap" "0" + Option "AutoAddDevices" "False" +EndSection
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf new file +26 -0
@@ -0,0 +1,26 @@ +Section "Device" + Identifier "Generic VESA" + Driver "vesa" +EndSection + +Section "Monitor" + Identifier "Generic Monitor" + Option "DPMS" +EndSection + +Section "Screen" + Identifier "Default Screen" + Device "Generic VESA" + Monitor "Generic Monitor" + DefaultDepth 24 +EndSection + +Section "ServerLayout" + Identifier "Default Layout" + Screen "Default Screen" +EndSection + +Section "ServerFlags" + Option "DontZap" "0" + Option "AutoAddDevices" "False" +EndSection
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend new file +3 -0
@@ -0,0 +1,3 @@ +THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" +FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:" +
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg new file +0 -0
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc new file +0 -0
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE preempt-rt +define KARCH x86_64 + +# no new branch required, re-use the ktypes/preempt-rt branch +include ktypes/preempt-rt + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc new file +8 -0
@@ -0,0 +1,8 @@ +define KMACHINE {{=machine}} +define KTYPE standard +define KARCH x86_64 + +include bsp/common-pc-64/common-pc-64-standard +branch {{=machine}} + +include {{=machine}}.scc
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg new file +47 -0
47 lines not on this page · raw message
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc new file +17 -0
@@ -0,0 +1,17 @@ +kconf hardware {{=machine}}.cfg + +include features/serial/8250.scc +{{ if xserver_choice == "xserver_vesa": }} +include cfg/vesafb.scc +{{ if xserver_choice == "xserver_i915": }} +include features/i915/i915.scc +include cfg/usb-mass-storage.scc +include features/power/intel.scc + +include features/logbuf/size-normal.scc + +include features/latencytop/latencytop.scc +include features/profiling/profiling.scc + +kconf hardware user-config.cfg +include user-patches.scc
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall new file +3 -0
@@ -0,0 +1,3 @@ +{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.2) kernel? (Y/n)" default:"y"}} +{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP =>" depends-on:"use_default_kernel" depends-on-val:"n" default:"linux-yocto_3.2"}} +
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"y" default:"yocto/standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_0" depends-on-val:"n" default:"yocto/standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_0}}" + +{{ if new_kbranch_linux_yocto_rt_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_0}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_rt_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"y" default:"standard/preempt-rt" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_rt_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_rt_3_2" depends-on-val:"n" default:"standard/preempt-rt/base" }} + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_rt_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_rt_3_2}}" + +{{ if new_kbranch_linux_yocto_rt_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_rt_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_rt_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_rt_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-preempt-rt.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto-rt_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto-rt_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend new file +36 -0
@@ -0,0 +1,36 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_0" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"y" default:"yocto/standard/common-pc-64" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_0" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_0" depends-on-val:"n" default:"yocto/standard/common-pc-64/base" }} + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_0" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_0 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +{{ if new_kbranch_linux_yocto_3_0 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_0}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_0 == "n": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_0}}" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend new file +34 -0
@@ -0,0 +1,34 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +PR := "${PR}.1" + +COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}" +{{ input type:"boolean" name:"new_kbranch_linux_yocto_3_2" prio:"20" msg:"Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]" default:"y" }} +{{ input type:"choicelist" name:"base_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"y" default:"standard/default/common-pc-64" }} +{{ input type:"choicelist" name:"existing_kbranch_linux_yocto_3_2" gen:"bsp.kernel.all_branches" prio:"20" msg:"Please choose a machine branch to base this BSP on =>" depends-on:"new_kbranch_linux_yocto_3_2" depends-on-val:"n" default:"standard/default/common-pc-64/base" }} + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +KBRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" +{{ if new_kbranch_linux_yocto_3_2 == "n": }} +KBRANCH_{{=machine}} = "{{=existing_kbranch_linux_yocto_3_2}}" + +{{ if new_kbranch_linux_yocto_3_2 == "y": }} +YOCTO_KERNEL_EXTERNAL_BRANCH_{{=machine}} = "{{=base_kbranch_linux_yocto_3_2}}/{{=machine}}" + +KMACHINE_{{=machine}} = "{{=machine}}" + +{{ input type:"boolean" name:"smp_linux_yocto_3_2" prio:"30" msg:"Do you need SMP support? (Y/n)" default:"y"}} +{{ if smp_linux_yocto_3_2 == "y": }} +KERNEL_FEATURES_append_{{=machine}} += " cfg/smp.scc" + +SRC_URI += "file://{{=machine}}-standard.scc \ + file://{{=machine}}.scc \ + file://{{=machine}}.cfg \ + file://user-config.cfg \ + file://user-patches.scc \ + " + +# uncomment and replace these SRCREVs with the real commit ids once you've had +# the appropriate changes committed to the upstream linux-yocto repo +#SRCREV_machine_pn-linux-yocto_{{=machine}} ?= "417fc778a86e81303bab5883b919ee422ec51c04" +#SRCREV_meta_pn-linux-yocto_{{=machine}} ?= "138bf5b502607fe40315c0d76822318d77d97e01"
Signature · 1 line
1.7.0.4
PATCH 2/8 yocto-bsp-tools: add bsp library
From: Tom Zanussi <[email protected]>
Create a home for the yocto bsp tools.
--- scripts/lib/bsp/__init__.py | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/__init__.py
scripts/lib/bsp/__init__.py new file +17 -0
@@ -0,0 +1,17 @@ +# +# Yocto BSP tools library +# +# Copyright (C) 2012 Tom Zanussi +# +# 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.
Signature · 1 line
1.7.0.4
Re: [PATCH 2/8] yocto-bsp-tools: add bsp library
Responded privately to Tom on this one...
Quoted 33 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Create a home for the yocto bsp tools.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/__init__.py | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/__init__.pyscripts/lib/bsp/__init__.py new file +17
-0@@ -0,0 +1,17 @@ +# +# Yocto BSP tools library +# +# Copyright (C) 2012 Tom Zanussi +# +# 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.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
PATCH 3/8 yocto-bsp: add templating engine
In reply to [email protected]From: Tom Zanussi <[email protected]>
The main implementation of the Yocto BSP templating engine, essentially containing the internal implementation of the 'yocto-bsp create' and yocto-bsp list' commands.
--- scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1336 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/engine.py
scripts/lib/bsp/engine.py new file +1336 -0
@@ -0,0 +1,1336 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +import os +import sys +from abc import ABCMeta, abstractmethod +from tags import * +import shlex +import json + +class Line(): + """ + Generic (abstract) container representing a line that will appear + in the BSP-generating program. + """ + __metaclass__ = ABCMeta + + def __init__(self, line): + self.line = line + self.generated_line = "" + + @abstractmethod + def gen(self, context = None): + """ + Generate the final executable line that will appear in the + BSP-generation program. + """ + pass + + def escape(self, line): + """ + Escape single and double quotes and backslashes until I find + something better (re.escape() escapes way too much) + """ + return line.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "\\'") + + def parse_error(self, msg, lineno, line): + raise SyntaxError("%s: %s" % (msg, line)) + + +class NormalLine(Line): + """ + Container for normal (non-tag) lines. + """ + def __init__(self, line): + Line.__init__(self, line) + self.is_filename = False + self.is_dirname = False + self.out_filebase = None + + def gen(self, context = None): + if self.is_filename: + line = "of = open(\"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, self.escape(self.line)) + line = "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + line = "of.write(\"" + self.escape(self.line) + "\\n\")" + return line + + +class CodeLine(Line): + """ + Container for Python code tag lines. + """ + def __init__(self, line): + Line.__init__(self, line) + + def gen(self, context = None): + return self.line + + +class Assignment: + """ + Representation of everything we know about {{=name }} tags. + Instances of these are used by Assignment lines. + """ + def __init__(self, start, end, name): + self.start = start + self.end = end + self.name = name + + +class AssignmentLine(NormalLine): + """ + Container for normal lines containing assignment tags. Assignment + tags must be in ascending order of 'start' value. + """ + def __init__(self, line): + NormalLine.__init__(self, line) + self.assignments = [] + + def add_assignment(self, start, end, name): + self.assignments.append(Assignment(start, end, name)) + + def gen(self, context = None): + line = self.escape(self.line) + + for assignment in self.assignments: + replacement = "\" + " + assignment.name + " + \"" + idx = line.find(ASSIGN_TAG) + line = line[:idx] + replacement + line[idx + assignment.end - assignment.start:] + if self.is_filename: + return "of = open(\"" + os.path.join(self.out_filebase, line) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, line) + return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + return "of.write(\"" + line + "\\n\")" + + +class InputLine(Line): + """ + Base class for Input lines. + """ + def __init__(self, props, tag, lineno): + Line.__init__(self, tag) + self.props = props + self.lineno = lineno + + try: + self.prio = int(props["prio"]) + except KeyError: + self.prio = sys.maxint + + def gen(self, context = None): + try: + depends_on = self.props["depends-on"] + try: + depends_on_val = self.props["depends-on-val"] + except KeyError: + self.parse_error("No 'depends-on-val' for 'depends-on' property", + self.lineno, self.line) + except KeyError: + pass + + +class EditBoxInputLine(InputLine): + """ + Base class for 'editbox' Input lines. + + props: + name: example - "Load address" + msg: example - "Please enter the load address" + result: + Sets the value of the variable specified by 'name' to + whatever the user typed. + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = default(raw_input(" + msg + " ), " + name + ")" + + return line + + +class BooleanInputLine(InputLine): + """ + Base class for boolean Input lines. + props: + name: example - "keyboard" + msg: example - "Got keyboard?" + result: + Sets the value of the variable specified by 'name' to "yes" or "no" + example - keyboard = "yes" + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = boolean(raw_input(\"" + msg + " \"), " + name + ")" + + return line + + +class ListInputLine(InputLine): + """ + Base class for List-based Input lines. e.g. Choicelist, Checklist + """ + __metaclass__ = ABCMeta + + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + self.choices = [] + + def gen_choicepair_list(self): + """generate a list of 2-item val:desc lists from self.choices""" + if not self.choices: + return None + + choicepair_list = list() + + for choice in self.choices: + choicepair = [] + choicepair.append(choice.val) + choicepair.append(choice.desc) + choicepair_list.append(choicepair) + + return choicepair_list + + def gen_degenerate_choicepair_list(self, choices): + """generate a list of 2-item val:desc with val=desc from passed-in choices""" + choicepair_list = list() + + for choice in choices: + choicepair = [] + choicepair.append(choice) + choicepair.append(choice) + choicepair_list.append(choicepair) + + return choicepair_list + + def exec_listgen_fn(self, context = None): + """ + execute the list-generating function contained as a string in + the "gen" property. + """ + retval = None + try: + fname = self.props["gen"] + modsplit = fname.split('.') + mod_fn = modsplit.pop() + mod = '.'.join(modsplit) + + __import__(mod) + # python 2.7 has a better way to do this using importlib.import_module + m = sys.modules[mod] + + fn = getattr(m, mod_fn) + if not fn: + self.parse_error("couldn't load function specified for 'gen' property ", + self.lineno, self.line) + retval = fn(context) + if not retval: + self.parse_error("function specified for 'gen' property returned nothing ", + self.lineno, self.line) + except KeyError: + pass + + return retval + + def gen_choices_str(self, choicepairs): + """ + Generate a numbered list of choices from a list of choicepairs + for display to the user. + """ + choices_str = "" + + for i, choicepair in enumerate(choicepairs): + choices_str += "\t" + str(i + 1) + ") " + choicepair[1] + "\n" + + return choices_str + + def gen_choices_val_str(self, choicepairs): + """ + Generate an array of choice values corresponding to the + numbered list generated by gen_choices_str(). + """ + choices_val_list = "[" + + for i, choicepair in enumerate(choicepairs): + choices_val_list += "\"" + choicepair[0] + "\"," + choices_val_list += "]" + + return choices_val_list + + def gen_choices_val_list(self, choicepairs): + """ + Generate an array of choice values corresponding to the + numbered list generated by gen_choices_str(). + """ + choices_val_list = [] + + for i, choicepair in enumerate(choicepairs): + choices_val_list.append(choicepair[0]) + + return choices_val_list + + def gen_choices_list(self, context = None, checklist = False): + """ + Generate an array of choice values corresponding to the + numbered list generated by gen_choices_str(). + """ + choices = self.exec_listgen_fn(context) + if choices: + if len(choices) == 0: + self.parse_error("No entries available for input list", + self.lineno, self.line) + choicepairs = self.gen_degenerate_choicepair_list(choices) + else: + if len(self.choices) == 0: + self.parse_error("No entries available for input list", + self.lineno, self.line) + choicepairs = self.gen_choicepair_list() + + return choicepairs + + def gen_choices(self, context = None, checklist = False): + """ + Generate an array of choice values corresponding to the + numbered list generated by gen_choices_str(), display it to + the user, and process the result. + """ + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + try: + default_choice = self.props["default"] + except KeyError: + default_choice = "" + + msg += " [default: " + default_choice + "]" + + choicepairs = self.gen_choices_list(context, checklist) + + choices_str = self.gen_choices_str(choicepairs) + choices_val_list = self.gen_choices_val_list(choicepairs) + if checklist: + choiceval = default(find_choicevals(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice) + else: + choiceval = default(find_choiceval(raw_input(msg + "\n" + choices_str), choices_val_list), default_choice) + + return choiceval + + +def find_choiceval(choice_str, choice_list): + """ + Take number as string and return val string from choice_list, + empty string if oob. choice_list is a simple python list. + """ + choice_val = "" + + try: + choice_idx = int(choice_str) + if choice_idx <= len(choice_list): + choice_idx -= 1 + choice_val = choice_list[choice_idx] + except ValueError: + pass + + return choice_val + + +def find_choicevals(choice_str, choice_list): + """ + Take numbers as space-separated string and return vals list from + choice_list, empty list if oob. choice_list is a simple python + list. + """ + choice_vals = [] + + choices = choice_str.split() + for choice in choices: + choice_vals.append(find_choiceval(choice, choice_list)) + + return choice_vals + + +def default(input_str, name): + """ + Return default if no input_str, otherwise stripped input_str + """ + if not input_str: + return name + + return input_str.strip() + + +def boolean(input_str, name): + """ + Return lowercase version of first char in string, or value in name. + """ + if not input_str: + return name + + str = input_str.lower().strip() + if str and str[0] == "y" or str[0] == "n": + return str[0] + else: + return name + + +deferred_choices = {} + +def gen_choices_defer(input_line, context, checklist = False): + """ + Save the context hashed the name of the input item, which will be + passed to the gen function later. + """ + name = input_line.props["name"] + deferred_choice = (input_line, context, checklist) + deferred_choices[name] = deferred_choice + + +def invoke_deferred_choices(name): + """ + Invoke the choice generation function using the context hashed by + 'name'. + """ + deferred_choice = deferred_choices[name] + input_line = deferred_choice[0] + context = deferred_choice[1] + checklist = deferred_choice[2] + context["name"] = name + + choices = input_line.gen_choices(context, checklist) + + return choices + + +class ChoicelistInputLine(ListInputLine): + """ + Base class for choicelist Input lines. + props: + name: example - "xserver_choice" + msg: example - "Please select an xserver for this machine" + result: + Sets the value of the variable specified by 'name' to whichever Choice was chosen + example - xserver_choice = "xserver_vesa" + """ + def __init__(self, props, tag, lineno): + ListInputLine.__init__(self, props, tag, lineno) + + def gen(self, context = None): + InputLine.gen(self, context) + + gen_choices_defer(self, context) + name = self.props["name"] + line = name + " = default(invoke_deferred_choices(\"" + name + "\"), " + name + ")" + + return line + + +class ListValInputLine(InputLine): + """ + Abstract base class for choice and checkbox Input lines. + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + try: + self.val = self.props["val"] + except KeyError: + self.parse_error("No input 'val' property found", self.lineno, self.line) + + try: + self.desc = self.props["msg"] + except KeyError: + self.parse_error("No input 'msg' property found", self.lineno, self.line) + + +class ChoiceInputLine(ListValInputLine): + """ + Base class for choicelist item Input lines. + """ + def __init__(self, props, tag, lineno): + ListValInputLine.__init__(self, props, tag, lineno) + + def gen(self, context = None): + return None + + +class ChecklistInputLine(ListInputLine): + """ + Base class for checklist Input lines. + """ + def __init__(self, props, tag, lineno): + ListInputLine.__init__(self, props, tag, lineno) + + def gen(self, context = None): + InputLine.gen(self, context) + + gen_choices_defer(self, context, True) + name = self.props["name"] + line = name + " = default(invoke_deferred_choices(" + name + "), " + name + ")" + + return line + + +class CheckInputLine(ListValInputLine): + """ + Base class for checklist item Input lines. + """ + def __init__(self, props, tag, lineno): + ListValInputLine.__init__(self, props, tag, lineno) + + def gen(self, context = None): + return None + + +class SubstrateBase(object): + """ + Base class for both expanded and unexpanded file and dir container + objects. + """ + def __init__(self, filename, filebase, out_filebase): + self.filename = filename + self.filebase = filebase + self.out_filebase = out_filebase + self.raw_lines = [] + self.expanded_lines = [] + self.prev_choicelist = None + + def parse_error(self, msg, lineno, line): + raise SyntaxError("%s: [%s: %d]: %s" % (msg, self.filename, lineno, line)) + + def expand_input_tag(self, tag, lineno): + """ + Input tags consist of the word 'input' at the beginning, + followed by name:value property pairs which are converted into + a dictionary. + """ + propstr = tag[len(INPUT_TAG):] + + props = dict(prop.split(":") for prop in shlex.split(propstr)) + + input_type = props[INPUT_TYPE_PROPERTY] + if not props[INPUT_TYPE_PROPERTY]: + self.parse_error("No input 'type' property found", lineno, tag) + + if input_type == "boolean": + return BooleanInputLine(props, tag, lineno) + if input_type == "edit": + return EditBoxInputLine(props, tag, lineno) + elif input_type == "choicelist": + self.prev_choicelist = ChoicelistInputLine(props, tag, lineno) + return self.prev_choicelist + elif input_type == "choice": + if not self.prev_choicelist: + self.parse_error("Found 'choice' input tag but no previous choicelist", + lineno, tag) + choice = ChoiceInputLine(props, tag, lineno) + self.prev_choicelist.choices.append(choice) + return choice + elif input_type == "checklist": + return ChecklistInputLine(props, tag, lineno) + elif input_type == "check": + return CheckInputLine(props, tag, lineno) + + def expand_assignment_tag(self, start, line, lineno): + """ + Expand all tags in a line + """ + expanded_line = AssignmentLine(line.strip()) + + while start != -1: + end = line.find(CLOSE_TAG, start) + if end == -1: + self.parse_error("No close tag found for assignment tag", lineno, line) + else: + name = line[start + len(ASSIGN_TAG):end].strip() + expanded_line.add_assignment(start, end + len(CLOSE_TAG), name) + start = line.find(ASSIGN_TAG, end) + + return expanded_line + + def expand_tag(self, line, lineno): + """ + Returns a processed tag line, or None if there was no tag + + The rules for tags are very simple: + - No nested tags + - Tags start with {{ and end with }} + - An assign tag, {{=, can appear anywhere and will + be replaced with what the assignment evaluates to + - Any other tag occupies the whole line it is on + - if there's anything else on the tag line, it's an error + - if it starts with 'input', it's an input tag and + will only be used for prompting and setting variables + - anything else is straight Python + - tags are in effect only until the next blank line or tag or 'pass' tag + - we don't have indentation in tags, but we need some way to end a block + forcefully without blank lines or other tags - that's the 'pass' tag + - todo: implement pass tag + - directories and filenames can have tags as well, but only assignment + and 'if' code lines + - directories and filenames are the only case where normal tags can + coexist with normal text on the same 'line' + """ + start = line.find(ASSIGN_TAG) + if start != -1: + return self.expand_assignment_tag(start, line, lineno) + + start = line.find(OPEN_TAG) + if start == -1: + return None + + end = line.find(CLOSE_TAG, 0) + if end == -1: + self.parse_error("No close tag found for open tag", lineno, line) + + tag = line[start + len(OPEN_TAG):end].strip() + + if not tag.lstrip().startswith(INPUT_TAG): + return CodeLine(tag) + + return self.expand_input_tag(tag, lineno) + + def expand_file_or_dir_name(self): + """ + Expand file or dir names into codeline. Dirnames and + filenames can only have assignments or if statements. First + translate if statements into CodeLine + (dirname or filename + creation). + """ + lineno = 0 + + line = self.filename[len(self.filebase):] + if line.startswith("/"): + line = line[1:] + opentag_start = -1 + + start = line.find(OPEN_TAG) + while start != -1: + if not line[start:].startswith(ASSIGN_TAG): + opentag_start = start + break + start += len(ASSIGN_TAG) + start = line.find(OPEN_TAG, start) + + if opentag_start != -1: + end = line.find(CLOSE_TAG, opentag_start) + if end == -1: + self.parse_error("No close tag found for open tag", lineno, line) + # we have a {{ tag i.e. code + tag = line[opentag_start + len(OPEN_TAG):end].strip() + + if not tag.lstrip().startswith(IF_TAG): + self.parse_error("Only 'if' tags are allowed in file or directory names", + lineno, line) + self.expanded_lines.append(CodeLine(tag)) + + # everything after }} is the actual filename (possibly with assignments) + # everything before is the pathname + line = line[:opentag_start] + line[end + len(CLOSE_TAG):].strip() + + assign_start = line.find(ASSIGN_TAG) + if assign_start != -1: + assignment_tag = self.expand_assignment_tag(assign_start, line, lineno) + if isinstance(self, SubstrateFile): + assignment_tag.is_filename = True + assignment_tag.out_filebase = self.out_filebase + elif isinstance(self, SubstrateDir): + assignment_tag.is_dirname = True + assignment_tag.out_filebase = self.out_filebase + self.expanded_lines.append(assignment_tag) + return + + normal_line = NormalLine(line) + if isinstance(self, SubstrateFile): + normal_line.is_filename = True + normal_line.out_filebase = self.out_filebase + elif isinstance(self, SubstrateDir): + normal_line.is_dirname = True + normal_line.out_filebase = self.out_filebase + self.expanded_lines.append(normal_line) + + def expand(self): + """ + Expand the file or dir name first, eventually this ends up + creating the file or dir. + """ + self.expand_file_or_dir_name() + + +class SubstrateFile(SubstrateBase): + """ + Container for both expanded and unexpanded substrate files. + """ + def __init__(self, filename, filebase, out_filebase): + SubstrateBase.__init__(self, filename, filebase, out_filebase) + + def read(self): + if self.raw_lines: + return + f = open(self.filename) + self.raw_lines = f.readlines() + + def expand(self): + """Expand the contents of all template tags in the file""" + SubstrateBase.expand(self) + self.read() + + for lineno, line in enumerate(self.raw_lines): + expanded_line = self.expand_tag(line, lineno + 1) # humans not 0-based + if not expanded_line: + expanded_line = NormalLine(line.rstrip()) + self.expanded_lines.append(expanded_line) + + def gen(self, context = None): + """Generate the code that generates the BSP.""" + base_indent = 0 + + indent = new_indent = base_indent + + for line in self.expanded_lines: + genline = line.gen(context) + if not genline: + continue + if isinstance(line, InputLine): + line.generated_line = genline + continue + if genline.startswith(OPEN_START): + if indent == 1: + base_indent = 1 + if indent: + if genline == BLANKLINE_STR or (not genline.startswith(NORMAL_START) + and not genline.startswith(OPEN_START)): + indent = new_indent = base_indent + if genline.endswith(":"): + new_indent = base_indent + 1 + line.generated_line = (indent * INDENT_STR) + genline + indent = new_indent + + +class SubstrateDir(SubstrateBase): + """ + Container for both expanded and unexpanded substrate dirs. + """ + def __init__(self, filename, filebase, out_filebase): + SubstrateBase.__init__(self, filename, filebase, out_filebase) + + def expand(self): + SubstrateBase.expand(self) + + def gen(self, context = None): + """generate the code that generates the BSP.""" + indent = new_indent = 0 + for line in self.expanded_lines: + genline = line.gen(context) + if not genline: + continue + if genline.endswith(":"): + new_indent = 1 + else: + new_indent = 0 + line.generated_line = (indent * INDENT_STR) + genline + indent = new_indent + + +def expand_target(target, all_files, out_filebase): + """ + Expand the contents of all template tags in the target. This + means removing tags and categorizing or creating lines so that + future passes can process and present input lines and generate the + corresponding lines of the Python program that will be exec'ed to + actually produce the final BSP. 'all_files' includes directories. + """ + for root, dirs, files in os.walk(target): + for file in files: + if file.endswith("~") or file.endswith("#"): + continue + f = os.path.join(root, file) + sfile = SubstrateFile(f, target, out_filebase) + sfile.expand() + all_files.append(sfile) + + for dir in dirs: + d = os.path.join(root, dir) + sdir = SubstrateDir(d, target, out_filebase) + sdir.expand() + all_files.append(sdir) + + +def gen_program_machine_lines(machine, program_lines): + """ + Use the input values we got from the command line. + """ + line = "machine = \"" + machine + "\"" + + program_lines.append(line) + + +def sort_inputlines(input_lines): + """Sort input lines according to priority (position)""" + input_lines.sort(key = lambda l: l.prio) + + +def find_parent_dependency(lines, depends_on): + for i, line in lines: + if isinstance(line, CodeLine): + continue + if line.props["name"] == depends_on: + return i + + return -1 + + +def process_inputline_dependencies(input_lines, all_inputlines): + """If any input lines depend on others, put the others first""" + for line in input_lines: + if isinstance(line, InputLineGroup): + group_inputlines = [] + process_inputline_dependencies(line.group, group_inputlines) + line.group = group_inputlines + all_inputlines.append(line) + continue + + if isinstance(line, CodeLine): + all_inputlines.append(line) + continue + + try: + depends_on = line.props["depends-on"] + depends_codeline = "if " + line.props["depends-on"] + " == \"" + line.props["depends-on-val"] + "\":" + all_inputlines.append(CodeLine(depends_codeline)) + all_inputlines.append(line) + except KeyError: + all_inputlines.append(line) + + +def conditional_filename(filename): + """ + Check if the filename itself contains a conditional statement. If + so, return a codeline for it. + """ + opentag_start = filename.find(OPEN_TAG) + + if opentag_start != -1: + if filename[opentag_start:].startswith(ASSIGN_TAG): + return None + end = filename.find(CLOSE_TAG, opentag_start) + if end == -1: + print "No close tag found for open tag in filename %s" % filename + sys.exit(1) + + # we have a {{ tag i.e. code + tag = filename[opentag_start + len(OPEN_TAG):end].strip() + if not tag.lstrip().startswith(IF_TAG): + print "Only 'if' tags are allowed in file or directory names, filename: %s" % filename + sys.exit(1) + + return CodeLine(tag) + + return None + + +class InputLineGroup(InputLine): + """ + InputLine that does nothing but group other input lines + corresponding to all the input lines in a SubstrateFile so they + can be generated as a group. prio is the only property used. + """ + def __init__(self, codeline): + InputLine.__init__(self, {}, "", 0) + self.group = [] + self.prio = sys.maxint + self.group.append(codeline) + + def append(self, line): + self.group.append(line) + if line.prio < self.prio: + self.prio = line.prio + + def len(self): + return len(self.group) + + +def gather_inputlines(files): + """ + Gather all the InputLines - we want to generate them first + """ + all_inputlines = [] + input_lines = [] + + for file in files: + if isinstance(file, SubstrateFile): + group = None + basename = os.path.basename(file.filename) + + codeline = conditional_filename(basename) + if codeline: + group = InputLineGroup(codeline) + + for line in file.expanded_lines: + if isinstance(line, InputLine): + if group: + group.append(line) + else: + input_lines.append(line) + + if group and group.len() > 1: + input_lines.append(group) + + sort_inputlines(input_lines) + process_inputline_dependencies(input_lines, all_inputlines) + + return all_inputlines + + +def run_program_lines(linelist, codedump): + """ + For a single file, print all the python code into a buf and execute it + """ + buf = "\n".join(linelist) + + if codedump: + of = open("bspgen.out", "w") + of.write(buf) + of.close() + exec buf + + +def gen_target(files, context = None): + """ + Generate the python code for each file + """ + for file in files: + file.gen(context) + + +def gen_program_header_lines(program_lines): + """ + Generate any imports we need + """ + pass + + +def gen_supplied_property_vals(properties, program_lines): + """ + Generate user-specified entries for input values instead of + generating input prompts. + """ + for name, val in properties.iteritems(): + program_line = name + " = \"" + val + "\"" + program_lines.append(program_line) + + +def gen_initial_property_vals(input_lines, program_lines): + """ + Generate null or default entries for input values, so we don't + have undefined variables. + """ + for line in input_lines: + if isinstance(line, InputLineGroup): + gen_initial_property_vals(line.group, program_lines) + continue + + if isinstance(line, InputLine): + try: + name = line.props["name"] + try: + default_val = "\"" + line.props["default"] + "\"" + except: + default_val = "\"\"" + program_line = name + " = " + default_val + program_lines.append(program_line) + except KeyError: + pass + + +def gen_program_input_lines(input_lines, program_lines, context, in_group = False): + """ + Generate only the input lines used for prompting the user. For + that, we only have input lines and CodeLines that affect the next + input line. + """ + indent = new_indent = 0 + + for line in input_lines: + if isinstance(line, InputLineGroup): + gen_program_input_lines(line.group, program_lines, context, True) + continue + + genline = line.gen(context) + if not genline: + continue + if genline.endswith(":"): + new_indent += 1 + else: + if indent > 1 or (not in_group and indent): + new_indent -= 1 + + line.generated_line = (indent * INDENT_STR) + genline + program_lines.append(line.generated_line) + + indent = new_indent + + +def gen_program_lines(target_files, program_lines): + """ + Generate the program lines that make up the BSP generation + program. This appends the generated lines of all target_files to + program_lines, and skips input lines, which are dealt with + separately, or omitted. + """ + for file in target_files: + if file.filename.endswith("noinstall"): + continue + + for line in file.expanded_lines: + if isinstance(line, InputLine): + continue + + program_lines.append(line.generated_line) + + +def create_context(machine, arch, scripts_path): + """ + Create a context object for use in deferred function invocation. + """ + context = {} + + context["machine"] = machine + context["arch"] = arch + context["scripts_path"] = scripts_path + + return context + + +def expand_targets(context, bsp_output_dir): + """ + Expand all the tags in both the common and machine-specific + 'targets'. + """ + target_files = [] + + machine = context["machine"] + arch = context["arch"] + scripts_path = context["scripts_path"] + + lib_path = scripts_path + '/lib' + bsp_path = lib_path + '/bsp' + arch_path = bsp_path + '/substrate/target/arch' + + common = os.path.join(arch_path, "common") + expand_target(common, target_files, bsp_output_dir) + + arches = os.listdir(arch_path) + if arch not in arches or arch == "common": + print "Invalid karch, exiting\n" + parser.print_help() + exit(1) + + target = os.path.join(arch_path, arch) + expand_target(target, target_files, bsp_output_dir) + + gen_target(target_files, context) + + return target_files + + +def yocto_bsp_create(machine, arch, scripts_path, bsp_output_dir, codedump, properties_file): + """ + create bsp + + machine - user-defined machine name + arch - the arch the bsp will be based on, must be one in + scripts/lib/bsp/substrate/target/arch + scripts_path - absolute path to yocto /scripts dir + bsp_output_dir - dirname to create for BSP + codedump - dump generated code to bspgen.out + properties_file - use values from here if nonempty i.e no prompting + """ + if os.path.exists(bsp_output_dir): + print "\nBSP output dir already exists, exiting. (%s)" % bsp_output_dir + sys.exit(1) + + properties = None + + if properties_file: + try: + infile = open(properties_file, "r") + except IOError: + print "Couldn't open properties file %s for reading, exiting" % properties_file + sys.exit(1) + + properties = json.load(infile) + + os.mkdir(bsp_output_dir) + + context = create_context(machine, arch, scripts_path) + target_files = expand_targets(context, bsp_output_dir) + + if not properties: + input_lines = gather_inputlines(target_files) + + program_lines = [] + + gen_program_header_lines(program_lines) + + if properties: + gen_supplied_property_vals(properties, program_lines) + else: + gen_initial_property_vals(input_lines, program_lines) + + gen_program_machine_lines(machine, program_lines) + + if not properties: + gen_program_input_lines(input_lines, program_lines, context) + + gen_program_lines(target_files, program_lines) + + run_program_lines(program_lines, codedump) + + print "New %s BSP created in %s" % (arch, bsp_output_dir) + + +def print_dict(items, indent = 0): + """ + Print the values in a possibly nested dictionary. + """ + for key, val in items.iteritems(): + print " "*indent + "\"%s\" :" % key, + if type(val) == dict: + print "{" + print_dict(val, indent + 1) + print " "*indent + "}" + else: + print "%s" % val + + +def get_properties(input_lines): + """ + Get the complete set of properties for all the input items in the + BSP, as a possibly nested dictionary. + """ + properties = {} + + for line in input_lines: + if isinstance(line, InputLineGroup): + statement = line.group[0].line + group_properties = get_properties(line.group) + properties[statement] = group_properties + continue + + if not isinstance(line, InputLine): + continue + + if isinstance(line, ChoiceInputLine): + continue + + props = line.props + item = {} + name = props["name"] + for key, val in props.items(): + if not key == "name": + item[key] = val + properties[name] = item + + return properties + + +def yocto_bsp_list_properties(arch, scripts_path, properties_file): + """ + List the complete set of properties for all the input items in the + BSP. If properties_file is non-null, write the complete set of + properties as a nested JSON object corresponding to a possibly + nested dictionary. + """ + context = create_context("unused", arch, scripts_path) + target_files = expand_targets(context, "unused") + + input_lines = gather_inputlines(target_files) + + properties = get_properties(input_lines) + if properties_file: + try: + of = open(properties_file, "w") + except IOError: + print "Couldn't open properties file %s for writing, exiting" % properties_file + sys.exit(1) + + json.dump(properties, of) + + print_dict(properties) + + +def find_input_line(name, input_lines): + """ + Find the input line with the specified name. + """ + for line in input_lines: + if isinstance(line, InputLineGroup): + l = find_input_line(name, line.group) + if l: + return l + + if isinstance(line, InputLine): + try: + if line.props["name"] == name: + return line + except KeyError: + pass + + return None + + +def print_values(type, values_list): + """ + Print the values in the given list of values. + """ + if type == "choicelist": + for value in values_list: + print "[\"%s\", \"%s\"]" % (value[0], value[1]) + elif type == "boolean": + for value in values_list: + print "[\"%s\", \"%s\"]" % (value[0], value[1]) + + +def yocto_bsp_list_property_values(arch, property, scripts_path, properties_file): + """ + List the possible values for a given input property. If + properties_file is non-null, write the complete set of properties + as a JSON object corresponding to an array of possible values. + """ + context = create_context("unused", arch, scripts_path) + context["name"] = property + + target_files = expand_targets(context, "unused") + + input_lines = gather_inputlines(target_files) + + properties = get_properties(input_lines) + + input_line = find_input_line(property, input_lines) + if not input_line: + print "Couldn't find values for property %s" % property + + values_list = [] + + type = input_line.props["type"] + if type == "boolean": + values_list.append(["y", "n"]) + elif type == "choicelist" or type == "checklist": + try: + gen_fn = input_line.props["gen"] + values_list = input_line.gen_choices_list(context, False) + except KeyError: + for choice in input_line.choices: + choicepair = [] + choicepair.append(choice.val) + choicepair.append(choice.desc) + values_list.append(choicepair) + + if properties_file: + try: + of = open(properties_file, "w") + except IOError: + print "Couldn't open properties file %s for writing, exiting" % properties_file + sys.exit(1) + + json.dump(values_list, of) + + print_values(type, values_list) + + +def yocto_bsp_list(args, scripts_path, properties_file): + """ + Print available architectures, or the complete list of properties + defined by the BSP, or the possible values for a particular BSP + property. + """ + if not len(args): + return False + + if args[0] == "karch": + lib_path = scripts_path + '/lib' + bsp_path = lib_path + '/bsp' + arch_path = bsp_path + '/substrate/target/arch' + print "Architectures available:" + for arch in os.listdir(arch_path): + if arch == "common": + continue + print " %s" % arch + else: + arch = args[0] + + if len(args) == 2: + if args[1] == "properties": + yocto_bsp_list_properties(arch, scripts_path, properties_file) + else: + return False + + if len(args) == 3: + if args[1] == "property": + yocto_bsp_list_property_values(arch, args[2], scripts_path, properties_file) + else: + return False + + return True
Signature · 1 line
1.7.0.4
Re: [PATCH 3/8] yocto-bsp: add templating engine
Quoted 18 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
The main implementation of the Yocto BSP templating engine, essentially containing the internal implementation of the 'yocto-bsp create' and yocto-bsp list' commands.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1336 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/engine.pyscripts/lib/bsp/engine.py new file +0
-0
scripts/lib/bsp/engine.py line 5
Quoted 5 lines
scripts/lib/bsp/engine.py new file +5
-0@@ -0,0 +1,1336 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>
same comments here...
Quoted 11 lines
scripts/lib/bsp/engine.py new file +11
-0+# +# 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
scripts/lib/bsp/engine.py line 26
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os +import sys +from abc import ABCMeta, abstractmethod +from tags import * +import shlex +import json +
This looks like a healthy list of dependencies. Do we need to augment the required packages list?
scripts/lib/bsp/engine.py line 32
Quoted 6 lines
scripts/lib/bsp/engine.py new file +6
-0+class Line(): + """ + Generic (abstract) container representing a line that will appear + in the BSP-generating program. + """ + __metaclass__ = ABCMeta
Oh, I didn't know about that. My ABCs have been rather amateur by comparison. Nice.
Quoted 13 lines
scripts/lib/bsp/engine.py new file +13
-0+ + def __init__(self, line): + self.line = line + self.generated_line = "" + + @abstractmethod + def gen(self, context = None): + """ + Generate the final executable line that will appear in the + BSP-generation program. + """ + pass +
scripts/lib/bsp/engine.py line 55
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ def escape(self, line): + """ + Escape single and double quotes and backslashes until I find + something better (re.escape() escapes way too much) + """ + return line.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "\\'") + + def parse_error(self, msg, lineno, line): + raise SyntaxError("%s: %s" % (msg, line)) +
Very nicely pythonic Tom. Classes, PyDoc, decorators, exceptions. Nice work!
Quoted 175 lines
scripts/lib/bsp/engine.py new file +175
-0+ +class NormalLine(Line): + """ + Container for normal (non-tag) lines. + """ + def __init__(self, line): + Line.__init__(self, line) + self.is_filename = False + self.is_dirname = False + self.out_filebase = None + + def gen(self, context = None): + if self.is_filename: + line = "of = open(\"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, self.escape(self.line)) + line = "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + line = "of.write(\"" + self.escape(self.line) + "\\n\")" + return line + + +class CodeLine(Line): + """ + Container for Python code tag lines. + """ + def __init__(self, line): + Line.__init__(self, line) + + def gen(self, context = None): + return self.line + + +class Assignment: + """ + Representation of everything we know about {{=name }} tags. + Instances of these are used by Assignment lines. + """ + def __init__(self, start, end, name): + self.start = start + self.end = end + self.name = name + + +class AssignmentLine(NormalLine): + """ + Container for normal lines containing assignment tags. Assignment + tags must be in ascending order of 'start' value. + """ + def __init__(self, line): + NormalLine.__init__(self, line) + self.assignments = [] + + def add_assignment(self, start, end, name): + self.assignments.append(Assignment(start, end, name)) + + def gen(self, context = None): + line = self.escape(self.line) + + for assignment in self.assignments: + replacement = "\" + " + assignment.name + " + \"" + idx = line.find(ASSIGN_TAG) + line = line[:idx] + replacement + line[idx + assignment.end - assignment.start:] + if self.is_filename: + return "of = open(\"" + os.path.join(self.out_filebase, line) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, line) + return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + return "of.write(\"" + line + "\\n\")" + + +class InputLine(Line): + """ + Base class for Input lines. + """ + def __init__(self, props, tag, lineno): + Line.__init__(self, tag) + self.props = props + self.lineno = lineno + + try: + self.prio = int(props["prio"]) + except KeyError: + self.prio = sys.maxint + + def gen(self, context = None): + try: + depends_on = self.props["depends-on"] + try: + depends_on_val = self.props["depends-on-val"] + except KeyError: + self.parse_error("No 'depends-on-val' for 'depends-on' property", + self.lineno, self.line) + except KeyError: + pass + + +class EditBoxInputLine(InputLine): + """ + Base class for 'editbox' Input lines. + + props: + name: example - "Load address" + msg: example - "Please enter the load address" + result: + Sets the value of the variable specified by 'name' to + whatever the user typed. + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = default(raw_input(" + msg + " ), " + name + ")" + + return line + + +class BooleanInputLine(InputLine): + """ + Base class for boolean Input lines. + props: + name: example - "keyboard" + msg: example - "Got keyboard?" + result: + Sets the value of the variable specified by 'name' to "yes" or "no" + example - keyboard = "yes" + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = boolean(raw_input(\"" + msg + " \"), " + name + ")" + + return line + + +class ListInputLine(InputLine): + """
scripts/lib/bsp/engine.py line 240
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ Base class for List-based Input lines. e.g. Choicelist, Checklist + """ + __metaclass__ = ABCMeta + + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + self.choices = [] + + def gen_choicepair_list(self): + """generate a list of 2-item val:desc lists from self.choices"""
Nitpic, initial caps and period.
Quoted 5 lines
scripts/lib/bsp/engine.py new file +5
-0+ if not self.choices: + return None + + choicepair_list = list() +
scripts/lib/bsp/engine.py line 255
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ for choice in self.choices: + choicepair = [] + choicepair.append(choice.val) + choicepair.append(choice.desc) + choicepair_list.append(choicepair) + + return choicepair_list + + def gen_degenerate_choicepair_list(self, choices): + """generate a list of 2-item val:desc with val=desc from passed-in choices"""
Nitpic, initial caps and period.
Quoted 4 lines
scripts/lib/bsp/engine.py new file +4
-0+ choicepair_list = list() + + for choice in choices: + choicepair = []
scripts/lib/bsp/engine.py line 269
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ choicepair.append(choice) + choicepair.append(choice) + choicepair_list.append(choicepair) + + return choicepair_list + + def exec_listgen_fn(self, context = None): + """ + execute the list-generating function contained as a string in + the "gen" property.
Nitpic, initial caps.
And I'm stopping here. It looks really good, but it is a bit more than I can review very closely right now. So I'd only have superficial comments, which aren't so helpful right now. Nice work!
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [PATCH 3/8] yocto-bsp: add templating engine
Quoted 45 lines · Darren Hart
Quoted 18 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
The main implementation of the Yocto BSP templating engine, essentially containing the internal implementation of the 'yocto-bsp create' and yocto-bsp list' commands.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 1336 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/engine.pyscripts/lib/bsp/engine.py new file +0
-0scripts/lib/bsp/engine.py line 5
Quoted 5 lines
scripts/lib/bsp/engine.py new file +5
-0@@ -0,0 +1,1336 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>same comments here...
Quoted 17 lines
scripts/lib/bsp/engine.py new file +17
-0+# +# 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. + +import os +import sys +from abc import ABCMeta, abstractmethod
Quoted 9 lines
scripts/lib/bsp/engine.py line 26
Quoted 4 lines
scripts/lib/bsp/engine.py new file +4
-0+from tags import * +import shlex +import json +This looks like a healthy list of dependencies. Do we need to augment the required packages list?
This is all standard Python 2.6 stuff, so nothing special needed if we have Python.
Quoted 29 lines
scripts/lib/bsp/engine.py line 32
Quoted 7 lines
scripts/lib/bsp/engine.py new file +6
-0+class Line(): + """ + Generic (abstract) container representing a line that will appear + in the BSP-generating program. + """ + __metaclass__ = ABCMetaOh, I didn't know about that. My ABCs have been rather amateur by comparison. Nice.
Quoted 18 lines
scripts/lib/bsp/engine.py new file +18
-0+ + def __init__(self, line): + self.line = line + self.generated_line = "" + + @abstractmethod + def gen(self, context = None): + """ + Generate the final executable line that will appear in the + BSP-generation program. + """ + pass + + def escape(self, line): + """ + Escape single and double quotes and backslashes until I find + something better (re.escape() escapes way too much) + """
Quoted 9 lines
scripts/lib/bsp/engine.py line 55
Quoted 5 lines
scripts/lib/bsp/engine.py new file +5
-0+ return line.replace("\\", "\\\\").replace("\"", "\\\"").replace("'", "\\'") + + def parse_error(self, msg, lineno, line): + raise SyntaxError("%s: %s" % (msg, line)) +Very nicely pythonic Tom. Classes, PyDoc, decorators, exceptions. Nice work!
Heh, thanks, and then we have isinstance() everywhere, which is not. Need to fix that. ;-)
Quoted 224 lines
Quoted 175 lines
scripts/lib/bsp/engine.py new file +175
-0+ +class NormalLine(Line): + """ + Container for normal (non-tag) lines. + """ + def __init__(self, line): + Line.__init__(self, line) + self.is_filename = False + self.is_dirname = False + self.out_filebase = None + + def gen(self, context = None): + if self.is_filename: + line = "of = open(\"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, self.escape(self.line)) + line = "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + line = "of.write(\"" + self.escape(self.line) + "\\n\")" + return line + + +class CodeLine(Line): + """ + Container for Python code tag lines. + """ + def __init__(self, line): + Line.__init__(self, line) + + def gen(self, context = None): + return self.line + + +class Assignment: + """ + Representation of everything we know about {{=name }} tags. + Instances of these are used by Assignment lines. + """ + def __init__(self, start, end, name): + self.start = start + self.end = end + self.name = name + + +class AssignmentLine(NormalLine): + """ + Container for normal lines containing assignment tags. Assignment + tags must be in ascending order of 'start' value. + """ + def __init__(self, line): + NormalLine.__init__(self, line) + self.assignments = [] + + def add_assignment(self, start, end, name): + self.assignments.append(Assignment(start, end, name)) + + def gen(self, context = None): + line = self.escape(self.line) + + for assignment in self.assignments: + replacement = "\" + " + assignment.name + " + \"" + idx = line.find(ASSIGN_TAG) + line = line[:idx] + replacement + line[idx + assignment.end - assignment.start:] + if self.is_filename: + return "of = open(\"" + os.path.join(self.out_filebase, line) + "\", \"w\")" + elif self.is_dirname: + dirname = os.path.join(self.out_filebase, line) + return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")" + else: + return "of.write(\"" + line + "\\n\")" + + +class InputLine(Line): + """ + Base class for Input lines. + """ + def __init__(self, props, tag, lineno): + Line.__init__(self, tag) + self.props = props + self.lineno = lineno + + try: + self.prio = int(props["prio"]) + except KeyError: + self.prio = sys.maxint + + def gen(self, context = None): + try: + depends_on = self.props["depends-on"] + try: + depends_on_val = self.props["depends-on-val"] + except KeyError: + self.parse_error("No 'depends-on-val' for 'depends-on' property", + self.lineno, self.line) + except KeyError: + pass + + +class EditBoxInputLine(InputLine): + """ + Base class for 'editbox' Input lines. + + props: + name: example - "Load address" + msg: example - "Please enter the load address" + result: + Sets the value of the variable specified by 'name' to + whatever the user typed. + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = default(raw_input(" + msg + " ), " + name + ")" + + return line + + +class BooleanInputLine(InputLine): + """ + Base class for boolean Input lines. + props: + name: example - "keyboard" + msg: example - "Got keyboard?" + result: + Sets the value of the variable specified by 'name' to "yes" or "no" + example - keyboard = "yes" + """ + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + + def query_user(self): + msg = self.props["name"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + return self.show_prompt(msg) + + def gen(self, context = None): + InputLine.gen(self, context) + name = self.props["name"] + if not name: + self.parse_error("No input 'name' property found", + self.lineno, self.line) + msg = self.props["msg"] + if not msg: + self.parse_error("No input 'msg' property found", + self.lineno, self.line) + + line = name + " = boolean(raw_input(\"" + msg + " \"), " + name + ")" + + return line + + +class ListInputLine(InputLine): + """scripts/lib/bsp/engine.py line 240
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ Base class for List-based Input lines. e.g. Choicelist, Checklist + """ + __metaclass__ = ABCMeta + + def __init__(self, props, tag, lineno): + InputLine.__init__(self, props, tag, lineno) + self.choices = [] + + def gen_choicepair_list(self): + """generate a list of 2-item val:desc lists from self.choices"""Nitpic, initial caps and period.
Quoted 5 lines
scripts/lib/bsp/engine.py new file +5
-0+ if not self.choices: + return None + + choicepair_list = list() +scripts/lib/bsp/engine.py line 255
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ for choice in self.choices: + choicepair = [] + choicepair.append(choice.val) + choicepair.append(choice.desc) + choicepair_list.append(choicepair) + + return choicepair_list + + def gen_degenerate_choicepair_list(self, choices): + """generate a list of 2-item val:desc with val=desc from passed-in choices"""Nitpic, initial caps and period.
Quoted 4 lines
scripts/lib/bsp/engine.py new file +4
-0+ choicepair_list = list() + + for choice in choices: + choicepair = []scripts/lib/bsp/engine.py line 269
Quoted 10 lines
scripts/lib/bsp/engine.py new file +10
-0+ choicepair.append(choice) + choicepair.append(choice) + choicepair_list.append(choicepair) + + return choicepair_list + + def exec_listgen_fn(self, context = None): + """ + execute the list-generating function contained as a string in + the "gen" property.Nitpic, initial caps.
Quoted 4 lines
And I'm stopping here. It looks really good, but it is a bit more than I can review very closely right now. So I'd only have superficial comments, which aren't so helpful right now. Nice work!
Thanks for the comments,
Tom
PATCH 4/8 yocto-bsp: add kernel interface
In reply to [email protected]From: Tom Zanussi <[email protected]>
Yocto BSP kernel-related functions, for interacting with the kernel tools and implementing the machinery behind the 'yocto-kernel' command.
--- scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 679 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/kernel.py
scripts/lib/bsp/kernel.py new file +679 -0
@@ -0,0 +1,679 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +import sys +import os +import shutil +from tags import * +import glob + + +def find_bblayers(scripts_path): + """ + Find and return a sanitized list of the layers found in BBLAYERS. + """ + bblayers_conf = os.path.join(scripts_path, "../build/conf/bblayers.conf") + + layers = [] + + f = open(bblayers_conf, "r") + lines = f.readlines() + for line in lines: + line = line.strip() + in_bblayers = False + if line.startswith("BBLAYERS"): + in_bblayers = True + if line.startswith("/"): + if line.endswith("\\"): + line = line[:-1].strip() + layers.append(line) + f.close() + + return layers + + +def find_meta_layer(scripts_path): + """ + Find and return the meta layer in BBLAYERS. + """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if layer.endswith("meta"): + return layer + + return None + + +def find_bsp_layer(scripts_path, machine): + """ + Find and return a machine's BSP layer in BBLAYERS. + """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if machine in layer: + return layer + + print "Unable to find the BSP layer for machine %s." % machine + print "Please make sure it is listed in bblayers.conf" + sys.exit(1) + + +def gen_choices_str(choices): + """ + Generate a numbered list of choices from a list of choices for + display to the user. + """ + choices_str = "" + + for i, choice in enumerate(choices): + choices_str += "\t" + str(i + 1) + ") " + choice + "\n" + + return choices_str + + +def read_config_items(scripts_path, machine): + """ + Find and return a list of config items (CONFIG_XXX) in a machine's + user-defined config fragment [user-config.cfg] + """ + config_items = [] + + layer = find_bsp_layer(scripts_path, machine) + cfg = os.path.join(layer, "recipes-kernel/linux/files/user-config.cfg") + + f = open(cfg, "r") + lines = f.readlines() + for line in lines: + s = line.strip() + if s: + config_items.append(s) + f.close() + + return config_items + + +def write_config_items(scripts_path, machine, config_items): + """ + Write (replace) the list of config items (CONFIG_XXX) in a + machine's user-defined config fragment [user-config.cfg] + """ + layer = find_bsp_layer(scripts_path, machine) + cfg = os.path.join(layer, "recipes-kernel/linux/files/user-config.cfg") + + f = open(cfg, "w") + for item in config_items: + f.write(item + "\n") + f.close() + + kernel_contents_changed(scripts_path, machine) + + +def yocto_kernel_config_list(scripts_path, machine): + """ + Display the list of config items (CONFIG_XXX) in a machine's + user-defined config fragment [user-config.cfg] + """ + config_items = read_config_items(scripts_path, machine) + + print "The current set of machine-specific kernel config items for %s is:" % machine + print gen_choices_str(config_items) + + +def map_choice(choice_str, array): + """ + Match the text of a choice with a list of choices, returning the + index of the match, or -1 if not found. + """ + for i, item in enumerate(array): + if choice_str == array[i]: + return i + + return -1 + + +def yocto_kernel_config_rm(scripts_path, machine): + """ + Display the list of config items (CONFIG_XXX) in a machine's + user-defined config fragment [user-config.cfg], prompt the user + for one or more to remove, and remove them. + """ + config_items = read_config_items(scripts_path, machine) + + print "Specify the kernel config items to remove:" + input = raw_input(gen_choices_str(config_items)) + rm_choices = input.split() + rm_choices.sort() + + removed = [] + + for choice in reversed(rm_choices): + idx = int(choice) - 1 + if idx < 0 or idx >= len(config_items): + print "Invalid choice (%d), exiting" % idx + sys.exit(1) + removed.append(config_items.pop(idx)) + + write_config_items(scripts_path, machine, config_items) + + print "Removed items:" + for r in removed: + print "\t%s" % r + + +def yocto_kernel_config_add(scripts_path, machine, config_items): + """ + Add one or more config items (CONFIG_XXX) to a machine's + user-defined config fragment [user-config.cfg]. + """ + new_items = [] + + for item in config_items: + if not item.startswith("CONFIG") or (not "=y" in item and not "=m" in item): + print "Invalid config item (%s), exiting" % item + sys.exit(1) + new_items.append(item) + + cur_items = read_config_items(scripts_path, machine) + cur_items.extend(new_items) + + write_config_items(scripts_path, machine, cur_items) + + print "Added items:" + for n in new_items: + print "\t%s" % n + + +def find_current_kernel(bsp_layer, machine): + """ + Determine the kernel and version currently being used in the BSP. + """ + machine_conf = os.path.join(bsp_layer, "conf/machine/" + machine + ".conf") + + preferred_kernel = preferred_kernel_version = preferred_version_varname = None + + f = open(machine_conf, "r") + lines = f.readlines() + for line in lines: + if line.strip().startswith("PREFERRED_PROVIDER_virtual/kernel"): + preferred_kernel = line.split()[-1] + preferred_kernel = preferred_kernel.replace('\"','') + preferred_version_varname = "PREFERRED_VERSION_" + preferred_kernel + if preferred_version_varname and line.strip().startswith(preferred_version_varname): + preferred_kernel_version = line.split()[-1] + preferred_kernel_version = preferred_kernel_version.replace('\"','') + preferred_kernel_version = preferred_kernel_version.replace('%','') + + if preferred_kernel and preferred_kernel_version: + return preferred_kernel + "_" + preferred_kernel_version + + +def find_bsp_kernel_src_uri(scripts_path, machine, start_end_only = False): + """ + Parse the SRC_URI append in the kernel .bbappend, returing a list + of individual components, and the start/end positions of the + SRC_URI statement, so it can be regenerated in the same position. + If start_end_only is True, don't return the list of elements, only + the start and end positions. + + Returns (SRC_URI start line, SRC_URI end_line, list of split + SRC_URI items). + + If no SRC_URI, start line = -1. + + NOTE: this and all the src_uri functions are temporary and + deprecated and will be removed, but are needed until the + equivalent .scc mechanism works. i.e. for now we unfortunately + can't get around putting patches in the SRC_URI. + """ + layer = find_bsp_layer(scripts_path, machine) + + kernel = find_current_kernel(layer, machine) + if not kernel: + print "Couldn't determine the kernel for this BSP, exiting." + sys.exit(1) + + kernel_bbappend = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend") + + f = open(kernel_bbappend, "r") + src_uri_line = "" + in_src_uri = False + lines = f.readlines() + first_line = last_line = -1 + quote_start = quote_end = -1 + for n, line in enumerate(lines): + line = line.strip() + if line.startswith("SRC_URI"): + first_line = n + in_src_uri = True + if in_src_uri: + src_uri_line += line + if quote_start == -1: + idx = line.find("\"") + if idx != -1: + quote_start = idx + 1 + idx = line.find("\"", quote_start) + quote_start = 0 # set to 0 for all but first line + if idx != -1: + quote_end = idx + last_line = n + break + + if first_line == -1: # no SRC_URI, which is fine too + return (-1, -1, None) + if quote_start == -1: + print "Bad kernel SRC_URI (missing opening quote), exiting." + sys.exit(1) + if quote_end == -1: + print "Bad SRC_URI (missing closing quote), exiting." + sys.exit(1) + if start_end_only: + return (first_line, last_line, None) + + idx = src_uri_line.find("\"") + src_uri_line = src_uri_line[idx + 1:] + idx = src_uri_line.find("\"") + src_uri_line = src_uri_line[:idx] + + src_uri = src_uri_line.split() + for i, item in enumerate(src_uri): + idx = item.find("\\") + if idx != -1: + src_uri[i] = item[idx + 1:] + + if not src_uri[len(src_uri) - 1]: + src_uri.pop() + + for i, item in enumerate(src_uri): + idx = item.find(SRC_URI_FILE) + if idx == -1: + print "Bad SRC_URI (invalid item, %s), exiting." % item + sys.exit(1) + src_uri[i] = item[idx + len(SRC_URI_FILE):] + + return (first_line, last_line, src_uri) + + +def find_patches(src_uri): + """ + Filter out the top-level patches from the SRC_URI. + """ + patches = [] + for item in src_uri: + if item.endswith(".patch") and "/" not in item: + patches.append(item) + return patches + + +def read_patch_items(scripts_path, machine): + """ + Find and return a list of patch items in a machine's user-defined + patch list [user-patches.scc] + """ + patch_items = [] + + layer = find_bsp_layer(scripts_path, machine) + patches = os.path.join(layer, "recipes-kernel/linux/files/user-patches.scc") + + f = open(patches, "r") + lines = f.readlines() + for line in lines: + s = line.strip() + if s: + fields = s.split() + if not fields[0] == "patch": + continue + patch_items.append(fields[1]) + f.close() + + return patch_items + + +def write_patch_items(scripts_path, machine, patch_items): + """ + Write (replace) the list of patches in a machine's user-defined + patch list [user-patches.scc] + """ + layer = find_bsp_layer(scripts_path, machine) + + patches = os.path.join(layer, "recipes-kernel/linux/files/user-patches.scc") + + f = open(patches, "w") + for item in patch_items: + pass + # this currently breaks do_patch, but is really what we want + # once this works, we can remove all the src_uri stuff + # f.write("patch " + item + "\n") + f.close() + + kernel_contents_changed(scripts_path, machine) + + +def yocto_kernel_patch_list(scripts_path, machine): + """ + Display the list of patches in a machine's user-defined patch list + [user-patches.scc] + """ + (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) + patches = find_patches(src_uri) + + print "The current set of machine-specific patches for %s is:" % machine + print gen_choices_str(patches) + + +def yocto_kernel_patch_rm(scripts_path, machine): + """ + Remove one or more patches from a machine's user-defined patch + list [user-patches.scc] + """ + (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) + patches = find_patches(src_uri) + + print "Specify the patches to remove:" + input = raw_input(gen_choices_str(patches)) + rm_choices = input.split() + rm_choices.sort() + + removed = [] + + for choice in reversed(rm_choices): + idx = int(choice) - 1 + if idx < 0 or idx >= len(patches): + print "Invalid choice (%d), exiting" % idx + sys.exit(1) + idx = map_choice(patches[idx], src_uri) + removed.append(src_uri.pop(idx)) + + write_patch_items(scripts_path, machine, patches) + write_kernel_src_uri(scripts_path, machine, src_uri) + + print "Removed patches:" + for r in removed: + print "\t%s" % r + + +def yocto_kernel_patch_add(scripts_path, machine, patches): + """ + Add one or more patches to a machine's user-defined patch list + [user-patches.scc] + """ + layer = find_bsp_layer(scripts_path, machine) + src_uri_dir = os.path.join(layer, "recipes-kernel/linux/files") + + new_patches = [] + + for patch in patches: + if not os.path.isfile(patch): + print "Couldn't find patch (%s), exiting" % patch + sys.exit(1) + basename = os.path.basename(patch) + src_uri_patch = os.path.join(src_uri_dir, basename) + shutil.copyfile(patch, src_uri_patch) + new_patches.append(basename) + + cur_items = read_patch_items(scripts_path, machine) + cur_items.extend(new_patches) + write_patch_items(scripts_path, machine, cur_items) + + (unused, unused, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine) + src_uri.extend(new_patches) + write_kernel_src_uri(scripts_path, machine, src_uri) + + print "Added patches:" + for n in new_patches: + print "\t%s" % n + + +def write_uri_lines(ofile, src_uri): + """ + Write URI elements to output file ofile. + """ + ofile.write("SRC_URI += \" \\\n") + for item in src_uri: + ofile.write("\t%s%s \\\n" % (SRC_URI_FILE, item)) + ofile.write("\t\"\n") + + +def inc_pr(line): + """ + Add 1 to the PR value in the given bbappend PR line. For the PR + lines in kernel .bbappends after modifications. + """ + idx = line.find("\"") + + pr_str = line[idx:] + pr_str = pr_str.replace('\"','') + fields = pr_str.split('.') + fields[1] = str(int(fields[1]) + 1) + pr_str = "\"" + '.'.join(fields) + "\"\n" + + idx2 = line.find("\"", idx + 1) + line = line[:idx] + pr_str + + return line + + +def kernel_contents_changed(scripts_path, machine): + """ + Do what we need to do to notify the system that the kernel + recipe's contents have changed. + """ + layer = find_bsp_layer(scripts_path, machine) + + kernel = find_current_kernel(layer, machine) + if not kernel: + print "Couldn't determine the kernel for this BSP, exiting." + sys.exit(1) + + kernel_bbappend = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend") + kernel_bbappend_prev = kernel_bbappend + ".prev" + shutil.copyfile(kernel_bbappend, kernel_bbappend_prev) + + ifile = open(kernel_bbappend_prev, "r") + ofile = open(kernel_bbappend, "w") + ifile_lines = ifile.readlines() + for ifile_line in ifile_lines: + if ifile_line.strip().startswith("PR"): + ifile_line = inc_pr(ifile_line) + ofile.write(ifile_line) + ofile.close() + ifile.close() + + +def write_kernel_src_uri(scripts_path, machine, src_uri): + """ + Write (replace) the SRC_URI append for a machine from a list + SRC_URI elements. + """ + layer = find_bsp_layer(scripts_path, machine) + + kernel = find_current_kernel(layer, machine) + if not kernel: + print "Couldn't determine the kernel for this BSP, exiting." + sys.exit(1) + + kernel_bbappend = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend") + + (uri_start_line, uri_end_line, unused) = find_bsp_kernel_src_uri(scripts_path, machine, True) + + kernel_bbappend_prev = kernel_bbappend + ".prev" + shutil.copyfile(kernel_bbappend, kernel_bbappend_prev) + ifile = open(kernel_bbappend_prev, "r") + ofile = open(kernel_bbappend, "w") + + ifile_lines = ifile.readlines() + if uri_start_line == -1: + uri_end_line = len(ifile_lines) # make sure we add at end + wrote_src_uri = False + for i, ifile_line in enumerate(ifile_lines): + if ifile_line.strip().startswith("PR"): + ifile_line = inc_pr(ifile_line) + if i < uri_start_line: + ofile.write(ifile_line) + elif i > uri_end_line: + ofile.write(ifile_line) + else: + if not wrote_src_uri: + write_uri_lines(ofile, src_uri) + wrote_src_uri = True + if uri_start_line == -1: + write_uri_lines(ofile, src_uri) + + +def kernels(context): + """ + Return the list of available kernels in the BSP i.e. corresponding + to the kernel .bbappends found in the layer. + """ + archdir = os.path.join(context["scripts_path"], "lib/bsp/substrate/target/arch/" + context["arch"]) + kerndir = os.path.join(archdir, "recipes-kernel/linux") + bbglob = os.path.join(kerndir, "*.bbappend") + + bbappends = glob.glob(bbglob) + + kernels = [] + + for kernel in bbappends: + filename = os.path.splitext(os.path.basename(kernel))[0] + idx = filename.find(CLOSE_TAG) + if idx != -1: + filename = filename[idx + len(CLOSE_TAG):].strip() + kernels.append(filename) + + return kernels + + +def extract_giturl(file): + """ + Extract the git url of the kernel repo from the kernel recipe's + SRC_URI + """ + f = open(file, "r") + lines = f.readlines() + for line in lines: + line = line.strip() + if line.startswith("SRC_URI"): + line = line[len("SRC_URI"):].strip() + if line.startswith("="): + line = line[1:].strip() + if line.startswith("\""): + line = line[1:].strip() + fields = line.split(";") + if fields: + return fields[0] + return None + + +def find_giturl(context): + """ + Find the git url of the kernel repo from the kernel recipe's + SRC_URI + """ + name = context["name"] + scripts_path = context["scripts_path"] + + meta_layer = find_meta_layer(scripts_path) + + kerndir = os.path.join(meta_layer, "recipes-kernel/linux") + bbglob = os.path.join(kerndir, "*.bb") + bbs = glob.glob(bbglob) + for kernel in bbs: + filename = os.path.splitext(os.path.basename(kernel))[0] + filename = filename.replace("-", "_") + filename = filename.replace(".", "_") + if filename in name: + giturl = extract_giturl(kernel) + return giturl + + return None + + +def base_branches(context): + """ + Return a list of the base branches found in the kernel git repo. + """ + giturl = find_giturl(context) + + print "Getting branches from remote repo %s..." % giturl + + gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) + tmp = os.popen(gitcmd).read() + + branches = [] + + if tmp: + tmpline = tmp.split("\n") + for line in tmpline: + if len(line)==0: + break; + if not line.endswith("base"): + continue; + idx = line.find("refs/heads/") + kbranch = line[idx + len("refs/heads/"):] + if kbranch.find("/") == -1 and kbranch.find("base") == -1: + continue + idx = kbranch.find("base") + branches.append(kbranch[:idx - 1]) + + return branches + + +def all_branches(context): + """ + Return a list of all the branches found in the kernel git repo. + """ + giturl = find_giturl(context) + + print "Getting branches from remote repo %s..." % giturl + + gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl) + tmp = os.popen(gitcmd).read() + + branches = [] + + if tmp: + tmpline = tmp.split("\n") + for line in tmpline: + if len(line)==0: + break; + idx = line.find("refs/heads/") + kbranch = line[idx + len("refs/heads/"):] + # throw away topic branches, but not "base" + if kbranch.find("/") == -1 and kbranch.find("base") == -1: + continue + branches.append(kbranch) + + return branches + + +def features(context): + """ + Return a list of all the features found in the kernel git repo. + For testing only. + """ + features = [ "features/debugfs", + "features/drm-emgd", + "features/ftrace", + "features/ericsson-3g", + "features/intel-e1xxxx", + "features/taskstats", + "features/yaffs2",] + + return features
Signature · 1 line
1.7.0.4
Re: [PATCH 4/8] yocto-bsp: add kernel interface
Quoted 53 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Yocto BSP kernel-related functions, for interacting with the kernel tools and implementing the machinery behind the 'yocto-kernel' command.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 679 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/kernel.pyscripts/lib/bsp/kernel.py new file +35
-0@@ -0,0 +1,679 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +import sys +import os +import shutil +from tags import * +import glob + + +def find_bblayers(scripts_path): + """ + Find and return a sanitized list of the layers found in BBLAYERS. + """ + bblayers_conf = os.path.join(scripts_path, "../build/conf/bblayers.conf") + + layers = [] + + f = open(bblayers_conf, "r")
scripts/lib/bsp/kernel.py line 45
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +10
-0+ lines = f.readlines() + for line in lines: + line = line.strip() + in_bblayers = False + if line.startswith("BBLAYERS"): + in_bblayers = True + if line.startswith("/"): + if line.endswith("\\"): + line = line[:-1].strip() + layers.append(line)
This does not appear to handle something like:
BBLAYERS = " \
/path/to/layer1 \
/path/to/layer2"Need to strip the " from the end of the last line.
Also doesn't handle:
BBLAYERS += "/path/to/layer3"
As it looks for lines starting with / and doesn't handle the " as mentioned above.
Quoted 6 lines
scripts/lib/bsp/kernel.py new file +6
-0+ f.close() + + return layers + + +def find_meta_layer(scripts_path):
scripts/lib/bsp/kernel.py line 61
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +10
-0+ """ + Find and return the meta layer in BBLAYERS. + """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if layer.endswith("meta"): + return layer + + return None
I wonder if you could just use the bitbake-layers show-layers command?
$ bitbake-layers show-layers Parsing recipes..WARNING: No recipes available for:
/home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev/recipes-kernel/linux/linux-yocto_2.6.34.bbappend
/home/dvhart/source/poky/layers/meta-intel/meta-fri2/recipes-kernel/linux/linux-yocto-tiny_3.2.bbappend
/home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev/recipes-kernel/linux/linux-yocto-rt_2.6.34.bbappend done.
layer path priority
==========================================================================
meta /home/dvhart/source/poky/meta 5 meta-yocto /home/dvhart/source/poky/meta-yocto 5 meta-intel /home/dvhart/source/poky/layers/meta-intel 5
meta-fri2 /home/dvhart/source/poky/layers/meta-intel/meta-fri2 5 meta-kernel-dev /home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev 0
It's slow as snot in January in Toronto, but it avoids having to re-implement all the bblayers parsing and the various corner cases that bitbake already handles...
Quoted 4 lines
scripts/lib/bsp/kernel.py new file +4
-0+ +def find_bsp_layer(scripts_path, machine): + """ + Find and return a machine's BSP layer in BBLAYERS.
scripts/lib/bsp/kernel.py line 76
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +10
-0+ """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if machine in layer: + return layer + + print "Unable to find the BSP layer for machine %s." % machine + print "Please make sure it is listed in bblayers.conf" + sys.exit(1)
You would probably need to cache the result of the bitbake-layers as it is way to slow to use repeatedly like you need to here...
The rest looks good to me.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [PATCH 4/8] yocto-bsp: add kernel interface
Quoted 122 lines · Darren Hart
Quoted 53 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Yocto BSP kernel-related functions, for interacting with the kernel tools and implementing the machinery behind the 'yocto-kernel' command.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 679 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/kernel.pyscripts/lib/bsp/kernel.py new file +35
-0@@ -0,0 +1,679 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +import sys +import os +import shutil +from tags import * +import glob + + +def find_bblayers(scripts_path): + """ + Find and return a sanitized list of the layers found in BBLAYERS. + """ + bblayers_conf = os.path.join(scripts_path, "../build/conf/bblayers.conf") + + layers = [] + + f = open(bblayers_conf, "r")scripts/lib/bsp/kernel.py line 45
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +10
-0+ lines = f.readlines() + for line in lines: + line = line.strip() + in_bblayers = False + if line.startswith("BBLAYERS"): + in_bblayers = True + if line.startswith("/"): + if line.endswith("\\"): + line = line[:-1].strip() + layers.append(line)This does not appear to handle something like:
BBLAYERS = " \ /path/to/layer1 \ /path/to/layer2"Need to strip the " from the end of the last line.
Also doesn't handle:
BBLAYERS += "/path/to/layer3"
As it looks for lines starting with / and doesn't handle the " as mentioned above.
Quoted 6 lines
scripts/lib/bsp/kernel.py new file +6
-0+ f.close() + + return layers + + +def find_meta_layer(scripts_path):scripts/lib/bsp/kernel.py line 61
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +10
-0+ """ + Find and return the meta layer in BBLAYERS. + """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if layer.endswith("meta"): + return layer + + return NoneI wonder if you could just use the bitbake-layers show-layers command?
$ bitbake-layers show-layers Parsing recipes..WARNING: No recipes available for:
/home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev/recipes-kernel/linux/linux-yocto_2.6.34.bbappend
/home/dvhart/source/poky/layers/meta-intel/meta-fri2/recipes-kernel/linux/linux-yocto-tiny_3.2.bbappend
/home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev/recipes-kernel/linux/linux-yocto-rt_2.6.34.bbappenddone.layer path priority
==========================================================================meta /home/dvhart/source/poky/meta 5 meta-yocto /home/dvhart/source/poky/meta-yocto 5 meta-intel /home/dvhart/source/poky/layers/meta-intel 5meta-fri2
/home/dvhart/source/poky/layers/meta-intel/meta-fri25 meta-kernel-dev/home/dvhart/source/poky/layers/poky-extras/meta-kernel-dev0
Quoted 4 lines
It's slow as snot in January in Toronto, but it avoids having to re-implement all the bblayers parsing and the various corner cases that bitbake already handles...
Yeah, good suggestion - makes a lot of sense to me - I'll see what I can do to leverage that work.
Quoted 10 lines
Quoted 10 lines
scripts/lib/bsp/kernel.py new file +9
-0+ +def find_bsp_layer(scripts_path, machine): + """ + Find and return a machine's BSP layer in BBLAYERS. + """ + layers = find_bblayers(scripts_path) + + for layer in layers: + if machine in layer:
Quoted 9 lines
scripts/lib/bsp/kernel.py line 76
Quoted 5 lines
scripts/lib/bsp/kernel.py new file +5
-0+ return layer + + print "Unable to find the BSP layer for machine %s." % machine + print "Please make sure it is listed in bblayers.conf" + sys.exit(1)You would probably need to cache the result of the bitbake-layers as it is way to slow to use repeatedly like you need to here...
Right, makes sense.
Thanks,
Tom
Quoted 2 lines
The rest looks good to me.
PATCH 5/8 yocto-bsp-tools: add help/usage
In reply to [email protected]From: Tom Zanussi <[email protected]>
This is essentially 'the documentation' for the Yocto BSP tools, along with a few related functions.
--- scripts/lib/bsp/help.py | 588 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 588 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/help.py
scripts/lib/bsp/help.py new file +588 -0
@@ -0,0 +1,588 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +import subprocess +import logging + + +def subcommand_error(args): + logging.info("invalid subcommand %s" % args[0]) + + +def display_help(subcommand, subcommands): + if subcommand not in subcommands: + return False + + help = subcommands.get(subcommand, subcommand_error)[2] + pager = subprocess.Popen('less', stdin=subprocess.PIPE) + pager.communicate(help) + + return True + + +def yocto_help(args, usage_str, subcommands): + """ + subcommand help dispatcher + """ + if len(args) == 1 or not display_help(args[1], subcommands): + print(usage_str) + + +def invoke_subcommand(args, parser, main_command_usage, subcommands): + """ + Dispatch to subcommand handler + borrowed from combo-layer + Should use argparse, but has to work in 2.6 + """ + if not args: + logging.error("No subcommand specified, exiting") + parser.print_help() + elif args[0] == "help": + yocto_help(args, main_command_usage, subcommands) + elif args[0] not in subcommands: + logging.error("Unsupported subcommand %s, exiting\n" % (args[0])) + parser.print_help() + else: + usage = subcommands.get(args[0], subcommand_error)[1] + subcommands.get(args[0], subcommand_error)[0](args[1:], usage) + + +## +# yocto-bsp help and usage strings +## + +yocto_bsp_usage = """ + + Create a customized Yocto BSP layer. + + usage: yocto-bsp [--version] [--help] COMMAND [ARGS] + + The most commonly used 'yocto-bsp' commands are: + create Create a new Yocto BSP + list List available values for options and BSP properties + + See 'yocto-bsp help COMMAND' for more information on a specific command. +""" + +yocto_bsp_help_usage = """ + + usage: yocto-bsp help <subcommand> + + This command displays detailed help for the specified subcommand. +""" + +yocto_bsp_create_usage = """ + + Create a new Yocto BSP + + usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] + [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] + + This command creates a Yocto BSP based on the specified parameters. + The new BSP will be a new Yocto BSP layer contained by default within + the top-level directory specified as 'meta-bsp-name'. The -o option + can be used to place the BSP layer in a directory with a different + name and location. + + The value of the 'karch' parameter determines the set of files that + will be generated for the BSP, along with the specific set of + 'properties' that will be used to fill out the BSP-specific portions + of the BSP. + + The BSP-specific properties that define the values that will be used + to generate a particular BSP can be specified on the command-line + using the -i option and supplying a JSON object consisting of the set + of name:value pairs needed by the BSP. If the -i option is not used, + the user will be interactively prompted for each of the required + property values, which will then be used as values for BSP + generation. The set of properties available for a given architecture + can be listed using the 'yocto-bsp list' command. + + Specifying -c causes the Python code generated and executed to create + the BSP to be dumped to the 'bspgen.out' file in the current + directory, and is useful for debugging. + + NOTE: Once created, you should add your new layer to your + bblayers.conf file in order for it to be subsquently seen and + modified by the yocto-kernel tool. + + NOTE for x86- and x86_64-based BSPs: The generated BSP assumes the + presence of the of the meta-intel layer, so you should also have a + meta-intel layer present and added to your bblayers.conf as well. +""" + +yocto_bsp_create_help = """ + +NAME + yocto-bsp create - Create a new Yocto BSP + +SYNOPSIS + yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] + [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>] + +DESCRIPTION + This command creates a Yocto BSP based on the specified + parameters. The new BSP will be a new Yocto BSP layer contained + by default within the top-level directory specified as + 'meta-bsp-name'. The -o option can be used to place the BSP layer + in a directory with a different name and location. + + The value of the 'karch' parameter determines the set of files + that will be generated for the BSP, along with the specific set of + 'properties' that will be used to fill out the BSP-specific + portions of the BSP. + + The BSP-specific properties that define the values that will be + used to generate a particular BSP can be specified on the + command-line using the -i option and supplying a JSON object + consisting of the set of name:value pairs needed by the BSP. + + If the -i option is not used, the user will be interactively + prompted for each of the required property values, which will then + be used as values for BSP generation. + + The set of properties available for a given architecture can be + listed using the 'yocto-bsp list' command. + + Specifying -c causes the Python code generated and executed to + create the BSP to be dumped to the 'bspgen.out' file in the + current directory, and is useful for debugging. + + + NOTE: Once created, you should add your new layer to your + bblayers.conf file in order for it to be subsquently seen and + modified by the yocto-kernel tool. + + NOTE for x86- and x86_64-based BSPs: The generated BSP assumes the + presence of the of the meta-intel layer, so you should also have a + meta-intel layer present and added to your bblayers.conf as well. +""" + +yocto_bsp_list_usage = """ + + usage: yocto-bsp list karch + yocto-bsp list <karch> properties + [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] + yocto-bsp list <karch> property <xxx> + [-o <JSON PROPERTY FILE> | --outfile <JSON PROPERTY_FILE>] + + This command enumerates the complete set of possible values for a + specified option or property needed by the BSP creation process. + + The first form enumerates all the possible values that exist and can + be specified for the 'karch' parameter to the 'yocto bsp create' + command. + + The second form enumerates all the possible properties that exist and + must have values specified for them in the 'yocto bsp create' command + for the given 'karch'. If the -o option is specified, the list of + properties, in addition to being displayed, will be written to the + specified file as a JSON object. In this case, the object will + consist of the set of name:value pairs corresponding to the (possibly + nested) dictionary of properties defined by the input statements + used by the BSP. + + The third form enumerates all the possible values that exist and can + be specified for any of the enumerable properties of the given + 'karch' in the 'yocto bsp create' command. If the -o option is + specified, the list of values for the given property, in addition to + being displayed, will be written to the specified file as a JSON + object. In this case, the object will consist of the set of + name:value pairs corresponding to the array of property values + associated with the property. +""" + +yocto_bsp_list_help = """ + +NAME + yocto-bsp list - List available values for options and BSP properties + +SYNOPSIS + yocto-bsp list karch + yocto-bsp list <karch> properties + [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] + yocto-bsp list <karch> property <xxx> + [--o <JSON PROPERTY FILE> | -outfile <JSON PROPERTY_FILE>] + +DESCRIPTION + This command enumerates the complete set of possible values for a + specified option or property needed by the BSP creation process. + + The first form enumerates all the possible values that exist and + can be specified for the 'karch' parameter to the 'yocto bsp + create' command. Example output for the 'list karch' command: + + $ yocto-bsp list karch + Architectures available: + arm + powerpc + i386 + mips + x86_64 + qemu + + The second form enumerates all the possible properties that exist + and must have values specified for them in the 'yocto bsp create' + command for the given 'karch'. This command is mainly meant to + allow the development user interface alternatives to the default + text-based prompting interface. If the -o option is specified, + the list of properties, in addition to being displayed, will be + written to the specified file as a JSON object. In this case, the + object will consist of the set of name:value pairs corresponding + to the (possibly nested) dictionary of properties defined by the + input statements used by the BSP. Some example output for the + 'list properties' command: + + $ yocto-bsp list arm properties + "touchscreen" : { + "msg" : Does your BSP have a touchscreen? (y/N) + "default" : n + "type" : boolean + } + "uboot_loadaddress" : { + "msg" : Please specify a value for UBOOT_LOADADDRESS. + "default" : 0x80008000 + "type" : edit + "prio" : 40 + } + "kernel_choice" : { + "prio" : 10 + "default" : linux-yocto_3.2 + "depends-on" : use_default_kernel + "depends-on-val" : n + "msg" : Please choose the kernel to use in this BSP => + "type" : choicelist + "gen" : bsp.kernel.kernels + } + "if kernel_choice == "linux-yocto_3.0":" : { + "base_kbranch_linux_yocto_3_0" : { + "prio" : 20 + "default" : yocto/standard + "depends-on" : new_kbranch_linux_yocto_3_0 + "depends-on-val" : y + "msg" : Please choose a machine branch to base this BSP on => + "type" : choicelist + "gen" : bsp.kernel.all_branches + } + . + . + . + + Each entry in the output consists of the name of the input element + e.g. "touchscreen", followed by the properties defined for that + element enclosed in braces. This information should provide + sufficient information to create a complete user interface with. + Two features of the scheme provide for conditional input. First, + if a Python "if" statement appears in place of an input element + name, the set of enclosed input elements apply and should be + presented to the user only if the 'if' statement evaluates to + true. The test in the if statement will always reference another + input element in the list, which means that the element being + tested should be presented to the user before the elements + enclosed by the if block. Secondly, in a similar way, some + elements contain "depends-on" and depends-on-val" tags, which mean + that the affected input element should only be presented to the + user if the element it depends on has already been presented to + the user and the user has selected the specified value for that + element. + + The third form enumerates all the possible values that exist and + can be specified for any of the enumerable properties of the given + 'karch' in the 'yocto bsp create' command. If the -o option is + specified, the list of values for the given property, in addition + to being displayed, will be written to the specified file as a + JSON object. In this case, the object will consist of the set of + name:value pairs corresponding to the array of property values + associated with the property. + + $ yocto-bsp list i386 property xserver_choice + ["xserver_vesa", "VESA xserver support"] + ["xserver_emgd", "EMGD xserver support (proprietary)"] + ["xserver_i915", "i915 xserver support"] + + $ yocto-bsp list arm property base_kbranch_linux_yocto_3_0 + Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.0... + ["yocto/base", "yocto/base"] + ["yocto/eg20t", "yocto/eg20t"] + ["yocto/emgd", "yocto/emgd"] + ["yocto/emgd-1.10", "yocto/emgd-1.10"] + ["yocto/gma500", "yocto/gma500"] + ["yocto/pvr", "yocto/pvr"] + ["yocto/standard/arm-versatile-926ejs", "yocto/standard/arm-versatile-926ejs"] + ["yocto/standard/base", "yocto/standard/base"] + ["yocto/standard/beagleboard", "yocto/standard/beagleboard"] + ["yocto/standard/cedartrail", "yocto/standard/cedartrail"] + . + . + . + ["yocto/standard/qemu-ppc32", "yocto/standard/qemu-ppc32"] + ["yocto/standard/routerstationpro", "yocto/standard/routerstationpro"] + + The third form as well is meant mainly for developers of + alternative interfaces - it allows the developer to fetch the + possible values for a given input element on-demand. This + on-demand capability is especially valuable for elements that + require relatively expensive remote operations to fulfill, such as + the example that returns the set of branches available in a remote + git tree above. + +""" + +## +# yocto-kernel help and usage strings +## + +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. + +""" + + +yocto_kernel_help_usage = """ + + usage: yocto-kernel help <subcommand> + + This command displays detailed help for the specified subcommand. +""" + +yocto_kernel_config_list_usage = """ + + List the modifiable set of bare kernel config options for a BSP + + usage: yocto-kernel config list <bsp-name> + + This command lists the 'modifiable' config items for a BSP i.e. the + items which are eligible for modification or removal by other + yocto-kernel commands. + + 'modifiable' config items are the config items contained a BSP's + user-config.cfg base config. +""" + + +yocto_kernel_config_list_help = """ + +NAME + yocto-kernel config list - List the modifiable set of bare kernel + config options for a BSP + +SYNOPSIS + yocto-kernel config list <bsp-name> + +DESCRIPTION + This command lists the 'modifiable' config items for a BSP + i.e. the items which are eligible for modification or removal by + other yocto-kernel commands. +""" + + +yocto_kernel_config_add_usage = """ + + Add or modify bare kernel config options for a BSP + + usage: yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...] + + This command adds one or more CONFIG_XXX=x items to a BSP's user-config.cfg + base config. +""" + + +yocto_kernel_config_add_help = """ + +NAME + yocto-kernel config add - Add or modify bare kernel config options + for a BSP + +SYNOPSIS + yocto-kernel config add <bsp-name> [<CONFIG_XXX=x> ...] + +DESCRIPTION + This command adds one or more CONFIG_XXX=x items to a BSP's + foo.cfg base config. + + NOTE: It's up to the user to determine whether or not the config + options being added make sense or not - this command does no + sanity checking or verification of any kind to ensure that a + config option really makes sense and will actually be set in in + the final config. For example, if a config option depends on + other config options, it will be turned off by kconfig if the + other options aren't set correctly. +""" + + +yocto_kernel_config_rm_usage = """ + + Remove bare kernel config options from a BSP + + usage: yocto-kernel config rm <bsp-name> + + This command removes (turns off) one or more CONFIG_XXX items from a + BSP's user-config.cfg base config. + + The set of config items available to be removed by this command for a + BSP is listed and the user prompted for the specific items to remove. +""" + + +yocto_kernel_config_rm_help = """ + +NAME + yocto-kernel config rm - Remove bare kernel config options from a + BSP + +SYNOPSIS + yocto-kernel config rm <bsp-name> + +DESCRIPTION + This command removes (turns off) one or more CONFIG_XXX items from a + BSP's user-config.cfg base config. + + The set of config items available to be removed by this command + for a BSP is listed and the user prompted for the specific items + to remove. +""" + + +yocto_kernel_patch_list_usage = """ + + List the patches associated with the kernel for a BSP + + usage: yocto-kernel patch list <bsp-name> + + This command lists the patches associated with a BSP. + + NOTE: this only applies to patches listed in the kernel recipe's + user-patches.scc file (and currently repeated in its SRC_URI). +""" + + +yocto_kernel_patch_list_help = """ + +NAME + yocto-kernel patch list - List the patches associated with the kernel + for a BSP + +SYNOPSIS + yocto-kernel patch list <bsp-name> + +DESCRIPTION + This command lists the patches associated with a BSP. + + NOTE: this only applies to patches listed in the kernel recipe's + user-patches.scc file (and currently repeated in its SRC_URI). +""" + + +yocto_kernel_patch_add_usage = """ + + Patch the Yocto kernel for a specific BSP + + usage: yocto-kernel patch add <bsp-name> [<PATCH> ...] + + This command adds one or more patches to a BSP's machine branch. The + patch will be added to the BSP's linux-yocto kernel user-patches.scc + file (and currently repeated in its SRC_URI) and will be guaranteed + to be applied in the order specified. +""" + + +yocto_kernel_patch_add_help = """ + +NAME + yocto-kernel patch add - Patch the Yocto kernel for a specific BSP + +SYNOPSIS + yocto-kernel patch add <bsp-name> [<PATCH> ...] + +DESCRIPTION + This command adds one or more patches to a BSP's machine branch. + The patch will be added to the BSP's linux-yocto kernel + user-patches.scc file (and currently repeated in its SRC_URI) and + will be guaranteed to be applied in the order specified. + + NOTE: It's up to the user to determine whether or not the patches + being added makes sense or not - this command does no sanity + checking or verification of any kind to ensure that a patch can + actually be applied to the BSP's kernel branch; it's assumed that + the user has already done that. +""" + + +yocto_kernel_patch_rm_usage = """ + + Remove a patch from the Yocto kernel for a specific BSP + + usage: yocto-kernel patch rm <bsp-name> + + This command removes one or more patches from a BSP's machine branch. + The patch will be removed from the BSP's linux-yocto kernel + user-patches.scc file (and currently repeated in its SRC_URI) and + kernel SRC_URI dir. + + The set of patches available to be removed by this command for a BSP + is listed and the user prompted for the specific patches to remove. +""" + + +yocto_kernel_patch_rm_help = """ + +NAME + yocto-kernel patch rm - Remove a patch from the Yocto kernel for a specific BSP + +SYNOPSIS + yocto-kernel patch rm <bsp-name> + +DESCRIPTION + This command removes one or more patches from a BSP's machine + branch. The patch will be removed from the BSP's linux-yocto + kernel user-patches.scc file (and currently repeated in its + SRC_URI). + + The set of patches available to be removed by this command for a + BSP is listed and the user prompted for the specific patches to + remove. +""" + +## +# test code +## + +test_bsp_properties = { + 'smp': 'yes', + 'touchscreen': 'yes', + 'keyboard': 'no', + 'xserver': 'yes', + 'xserver_choice': 'xserver-i915', + 'features': ['goodfeature', 'greatfeature'], + 'tunefile': 'tune-quark', +} +
Signature · 1 line
1.7.0.4
Re: [PATCH 5/8] yocto-bsp-tools: add help/usage
Quoted 17 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
This is essentially 'the documentation' for the Yocto BSP tools, along with a few related functions.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/help.py | 588 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 588 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/help.pyscripts/lib/bsp/help.py new file +0
-0
scripts/lib/bsp/help.py line 5
Quoted 5 lines
scripts/lib/bsp/help.py new file +5
-0@@ -0,0 +1,588 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>
Same comment here...
Otherwise, all looks very nice.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
PATCH 6/8 yocto-bsp: add some useful constants
In reply to [email protected]From: Tom Zanussi <[email protected]>
Some constants used by the templating engine.
--- scripts/lib/bsp/tags.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/tags.py
scripts/lib/bsp/tags.py new file +39 -0
@@ -0,0 +1,39 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +OPEN_TAG = "{{" +CLOSE_TAG = "}}" +ASSIGN_TAG = "{{=" +INPUT_TAG = "input" +IF_TAG = "if" + +INDENT_STR = " " + +BLANKLINE_STR = "of.write(\"\\n\")" +NORMAL_START = "of.write" +OPEN_START = "of = open" + +INPUT_TYPE_PROPERTY = "type" + +SRC_URI_FILE = "file://" + + + + +
Signature · 1 line
1.7.0.4
Re: [PATCH 6/8] yocto-bsp: add some useful constants
Quoted 16 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Some constants used by the templating engine.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/lib/bsp/tags.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/tags.pyscripts/lib/bsp/tags.py new file +0
-0
scripts/lib/bsp/tags.py line 5
Quoted 5 lines
scripts/lib/bsp/tags.py new file +5
-0@@ -0,0 +1,39 @@ +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>
same comment..
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
PATCH 7/8 yocto-bsp: new script
In reply to [email protected]From: Tom Zanussi <[email protected]>
Implementation of the 'yocto-bsp' command-line tool, for creating BSPs and listing BSP properties.
--- scripts/yocto-bsp | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 131 insertions(+), 0 deletions(-) create mode 100755 scripts/yocto-bsp
scripts/yocto-bsp new file +131 -0
@@ -0,0 +1,131 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +__version__ = "0.1.0" + +import os +import sys +import optparse +import logging + +scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) +lib_path = scripts_path + '/lib' +sys.path = sys.path + [lib_path] + +from bsp.help import * +from bsp.engine import * + + +def yocto_bsp_create_subcommand(args, usage_str): + """ + Command-line handling for BSP creation. The real work is done by + bsp.engine.yocto_bsp_create() + """ + parser = optparse.OptionParser(usage = usage_str) + + parser.add_option("-o", "--outdir", dest = "outdir", action = "store", + help = "name of BSP dir to create") + parser.add_option("-i", "--infile", dest = "properties_file", action = "store", + help = "name of file containing the values for BSP properties as a JSON file") + parser.add_option("-c", "--codedump", dest = "codedump", action = "store_true", + default = False, help = "dump the generated code to bspgen.out") + (options, args) = parser.parse_args(args) + + if len(args) != 2: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + machine = args[0] + karch = args[1] + + if options.outdir: + bsp_output_dir = options.outdir + else: + bsp_output_dir = "meta-" + machine + + yocto_bsp_create(machine, karch, scripts_path, bsp_output_dir, options.codedump, options.properties_file) + + +def yocto_bsp_list_subcommand(args, usage_str): + """ + Command-line handling for listing available BSP properties and + values. The real work is done by bsp.engine.yocto_bsp_list() + """ + parser = optparse.OptionParser(usage = usage_str) + + parser.add_option("-o", "--outfile", action = "store", dest = "properties_file", + help = "dump the possible values for BSP properties to a JSON file") + + (options, args) = parser.parse_args(args) + + if not yocto_bsp_list(args, scripts_path, options.properties_file): + logging.error("Bad list arguments, exiting\n") + parser.print_help() + exit(1) + + +subcommands = { + "create": [yocto_bsp_create_subcommand, + yocto_bsp_create_usage, + yocto_bsp_create_help], + "list": [yocto_bsp_list_subcommand, + yocto_bsp_list_usage, + yocto_bsp_list_help], +} + + +def start_logging(loglevel): + logging.basicConfig(filname = 'yocto-bsp.log', filemode = 'w', level=loglevel) + + +def main(): + parser = optparse.OptionParser(version = "yocto-bsp version %s" % __version__, + usage = yocto_bsp_usage) + + parser.disable_interspersed_args() + parser.add_option("-D", "--debug", dest = "debug", action = "store_true", + default = False, help = "output debug information") + + (options, args) = parser.parse_args() + + loglevel = logging.INFO + if options.debug: + loglevel = logging.DEBUG + start_logging(loglevel) + + if len(args): + if args[0] == "help": + if len(args) == 1: + parser.print_help() + exit(1) + + invoke_subcommand(args, parser, yocto_bsp_help_usage, subcommands) + + +if __name__ == "__main__": + try: + ret = main() + except Exception: + ret = 1 + import traceback + traceback.print_exc(5) + sys.exit(ret) +
Signature · 1 line
1.7.0.4
Re: [PATCH 7/8] yocto-bsp: new script
Quoted 17 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Implementation of the 'yocto-bsp' command-line tool, for creating BSPs and listing BSP properties.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/yocto-bsp | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 131 insertions(+), 0 deletions(-) create mode 100755 scripts/yocto-bspscripts/yocto-bsp new file +0
-0
scripts/yocto-bsp line 7
Quoted 7 lines
scripts/yocto-bsp new file +7
-0@@ -0,0 +1,131 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +#
same comment...
...
Quoted 6 lines
scripts/yocto-bsp new file +6
-0+def yocto_bsp_list_subcommand(args, usage_str): + """ + Command-line handling for listing available BSP properties and + values. The real work is done by bsp.engine.yocto_bsp_list() + """ + parser = optparse.OptionParser(usage = usage_str)
scripts/yocto-bsp line 82
Quoted 10 lines
scripts/yocto-bsp new file +10
-0+ + parser.add_option("-o", "--outfile", action = "store", dest = "properties_file", + help = "dump the possible values for BSP properties to a JSON file") + + (options, args) = parser.parse_args(args) + + if not yocto_bsp_list(args, scripts_path, options.properties_file): + logging.error("Bad list arguments, exiting\n") + parser.print_help() + exit(1)
I see sys.exit() below and just exit() here, and above you "import sys", so I believe this should also be sys.exit()
...
Quoted 9 lines
scripts/yocto-bsp new file +9
-0+if __name__ == "__main__": + try: + ret = main() + except Exception: + ret = 1 + import traceback + traceback.print_exc(5) + sys.exit(ret) +
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
PATCH 8/8 yocto-kernel: new script
In reply to [email protected]From: Tom Zanussi <[email protected]>
Implementation of the 'yocto-kernel' command-line tool, for modifying the kernel portion of a Yocto BSP.
--- scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 219 insertions(+), 0 deletions(-) create mode 100755 scripts/yocto-kernel
scripts/yocto-kernel new file +219 -0
@@ -0,0 +1,219 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]> +# +# 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. + +__version__ = "0.1.0" + +import os +import sys +import optparse +import logging + +scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) +lib_path = scripts_path + '/lib' +sys.path = sys.path + [lib_path] + +from bsp.help import * +from bsp.kernel import * + + +def yocto_kernel_config_list_subcommand(args, usage_str): + """ + Command-line handling for listing BSP config options. The + real work is done by bsp.kernel.yocto_kernel_config_list(). + """ + logging.debug("yocto_kernel_config_list_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + yocto_kernel_config_list(scripts_path, args[0]) + + +def yocto_kernel_config_add_subcommand(args, usage_str): + """ + Command-line handling for adding BSP config items. The real work + is done by bsp.kernel.yocto_kernel_config_add(). + """ + logging.debug("yocto_kernel_config_add_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) < 2: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + machine = args.pop(0) + yocto_kernel_config_add(scripts_path, machine, args) + + +def yocto_kernel_config_rm_subcommand(args, usage_str): + """ + Command-line handling for removing BSP config items. The real + work is done by bsp.kernel.yocto_kernel_config_rm(). + """ + logging.debug("yocto_kernel_config_rm_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + yocto_kernel_config_rm(scripts_path, args[0]) + + +def yocto_kernel_patch_list_subcommand(args, usage_str): + """ + Command-line handling for listing BSP (SRC_URI patches. The real + work is done by bsp.kernel.yocto_kernel_patch_list(). + """ + logging.debug("yocto_kernel_patch_list_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + yocto_kernel_patch_list(scripts_path, args[0]) + + +def yocto_kernel_patch_add_subcommand(args, usage_str): + """ + Command-line handling for adding BSP patches. The real work is + done by bsp.kernel.yocto_kernel_patch_add(). + """ + logging.debug("yocto_kernel_patch_add_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) < 2: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + machine = args.pop(0) + yocto_kernel_patch_add(scripts_path, machine, args) + + +def yocto_kernel_patch_rm_subcommand(args, usage_str): + """ + Command-line handling for removing BSP patches. The real work is + done by bsp.kernel.yocto_kernel_patch_rm(). + """ + logging.debug("yocto_kernel_patch_rm_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1) + + yocto_kernel_patch_rm(scripts_path, args[0]) + + +subcommands = { + "config-list": [yocto_kernel_config_list_subcommand, + yocto_kernel_config_list_usage, + yocto_kernel_config_list_help], + "config-add": [yocto_kernel_config_add_subcommand, + yocto_kernel_config_add_usage, + yocto_kernel_config_add_help], + "config-rm": [yocto_kernel_config_rm_subcommand, + yocto_kernel_config_rm_usage, + yocto_kernel_config_rm_help], + "patch-list": [yocto_kernel_patch_list_subcommand, + yocto_kernel_patch_list_usage, + yocto_kernel_patch_list_help], + "patch-add": [yocto_kernel_patch_add_subcommand, + yocto_kernel_patch_add_usage, + yocto_kernel_patch_add_help], + "patch-rm": [yocto_kernel_patch_rm_subcommand, + yocto_kernel_patch_rm_usage, + yocto_kernel_patch_rm_help], +} + + +def start_logging(loglevel): + logging.basicConfig(filname = 'yocto-kernel.log', filemode = 'w', level=loglevel) + + +def main(): + parser = optparse.OptionParser(version = "yocto-kernel version %s" % __version__, + usage = yocto_kernel_usage) + + parser.disable_interspersed_args() + parser.add_option("-D", "--debug", dest = "debug", action = "store_true", + default = False, help = "output debug information") + + (options, args) = parser.parse_args() + + loglevel = logging.INFO + if options.debug: + loglevel = logging.DEBUG + start_logging(loglevel) + + if len(args): + if args[0] == "help": + if len(args) == 1: + parser.print_help() + exit(1) + sc = 1 + else: + sc = 0 + + if args[sc] == "config" or args[sc] == "patch": + if len(args) < 2 + sc: + parser.print_help() + exit(1) + args[sc] += "-" + args[sc + 1] + args.pop(sc + 1) + + invoke_subcommand(args, parser, yocto_kernel_help_usage, subcommands) + + +if __name__ == "__main__": + try: + ret = main() + except Exception: + ret = 1 + import traceback + traceback.print_exc(5) + sys.exit(ret)
Signature · 1 line
1.7.0.4
Re: [PATCH 8/8] yocto-kernel: new script
Quoted 17 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Implementation of the 'yocto-kernel' command-line tool, for modifying the kernel portion of a Yocto BSP.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 219 insertions(+), 0 deletions(-) create mode 100755 scripts/yocto-kernelscripts/yocto-kernel new file +0
-0
scripts/yocto-kernel line 6
Quoted 6 lines
scripts/yocto-kernel new file +6
-0@@ -0,0 +1,219 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>
same comment...
Quoted 34 lines
scripts/yocto-kernel new file +34
-0+# +# 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. + +__version__ = "0.1.0" + +import os +import sys +import optparse +import logging + +scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) +lib_path = scripts_path + '/lib' +sys.path = sys.path + [lib_path] + +from bsp.help import * +from bsp.kernel import * + + +def yocto_kernel_config_list_subcommand(args, usage_str): + """ + Command-line handling for listing BSP config options. The + real work is done by bsp.kernel.yocto_kernel_config_list(). + """
scripts/yocto-kernel line 50
Quoted 10 lines
scripts/yocto-kernel new file +10
-0+ logging.debug("yocto_kernel_config_list_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1)
Same comment on exit here as 7/8. Maybe there is a subtle difference that I'm missing? Same throughout the other subcommands...
Tom, this is all really great work. It's well-formed python, properly documented both in comments and user visible help. Very nice.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [PATCH 8/8] yocto-kernel: new script
Quoted 68 lines · Darren Hart
Quoted 17 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
Implementation of the 'yocto-kernel' command-line tool, for modifying the kernel portion of a Yocto BSP.
Signed-off-by Tom Zanussi <[email protected]>--- scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 219 insertions(+), 0 deletions(-) create mode 100755 scripts/yocto-kernelscripts/yocto-kernel new file +0
-0scripts/yocto-kernel line 6
Quoted 6 lines
scripts/yocto-kernel new file +6
-0@@ -0,0 +1,219 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2012 Intel Corporation +# Authored-by: Tom Zanussi <[email protected]>same comment...
Quoted 40 lines
scripts/yocto-kernel new file +40
-0+# +# 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. + +__version__ = "0.1.0" + +import os +import sys +import optparse +import logging + +scripts_path = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0]))) +lib_path = scripts_path + '/lib' +sys.path = sys.path + [lib_path] + +from bsp.help import * +from bsp.kernel import * + + +def yocto_kernel_config_list_subcommand(args, usage_str): + """ + Command-line handling for listing BSP config options. The + real work is done by bsp.kernel.yocto_kernel_config_list(). + """ + logging.debug("yocto_kernel_config_list_subcommand") + + parser = optparse.OptionParser(usage = usage_str) + + (options, args) = parser.parse_args(args) +
Quoted 9 lines
scripts/yocto-kernel line 50
Quoted 4 lines
scripts/yocto-kernel new file +4
-0+ if len(args) != 1: + logging.error("Wrong number of arguments, exiting\n") + parser.print_help() + exit(1)Same comment on exit here as 7/8. Maybe there is a subtle difference that I'm missing? Same throughout the other subcommands...
No, those are basically typos that work. I think they should all be sys.exit. Thanks for noticing and pointing it out.
Quoted 3 lines
Tom, this is all really great work. It's well-formed python, properly documented both in comments and user visible help. Very nice.
Thanks, I appreciate your comments.
Tom
Re: [PATCH 1/8] yocto-bsp: add BSP template files
In reply to [email protected]Quoted 80 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
BSP template files for all supported Yocto architectures, plus qemu versions of the same.
Signed-off-by Tom Zanussi <[email protected]>--- .../target/arch/arm/conf/machine/{{=machine}}.conf | 87 +++++ .../{{ if xserver == \"y\": }} xorg.conf" | 34 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-non_hardware.cfg | 30 ++ .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 336 ++++++++++++++++++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 7 + .../arm/recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../bsp/substrate/target/arch/common/COPYING.MIT | 17 + .../lib/bsp/substrate/target/arch/common/README | 118 +++++++ .../substrate/target/arch/common/README.sources | 17 + .../substrate/target/arch/common/conf/layer.conf | 10 + .../formfactor/formfactor/{{=machine}}/machconfig | 5 + .../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 + .../tasks/task-core-tools-profile.bbappend | 2 + .../arch/i386/conf/machine/{{=machine}}.conf | 44 +++ ...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 +++ ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++ ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 54 ++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 30 ++ .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/mips/conf/machine/{{=machine}}.conf | 28 ++ .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 1 + .../recipes-kernel/linux/files/{{=machine}}.scc | 8 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/powerpc/conf/machine/{{=machine}}.conf | 53 +++ .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 163 ++++++++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 11 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/qemu/conf/machine/{{=machine}}.conf | 59 ++++ .../xserver-xf86-config/{{=machine}}/xorg.conf | 69 ++++ ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 30 ++ .../linux/files/{{=machine}}-standard.scc | 30 ++ .../recipes-kernel/linux/files/{{=machine}}.scc | 6 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/x86_64/conf/machine/{{=machine}}.conf | 29 ++ ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++ ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 +
Quoted 8 lines
.../recipes-kernel/linux/files/{{=machine}}.cfg | 47 +++
.../recipes-kernel/linux/files/{{=machine}}.scc | 17 +
.../recipes-kernel/linux/kernel-list.noinstall | 3 +
...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++
...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++
...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++
...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++
80 files changed, 2436 insertions(+), 0 deletions(-)WOW! I suppose this is the initial patch, so a files are going in whole
- but WOW! Are all of these created by hand? I'm thinking about supporting this going forward, will we have to create 10+ new files for every kernel release manually?
A few comments inline below...
...
Quoted 26 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg new file +20
-0@@ -0,0 +1,30 @@ +# +# Miscellaneous filesystems +# +CONFIG_NFS_DEF_FILE_IO_SIZE=1024 + +# +# Multiple Device Support +# +# CONFIG_MD is not set + +# Kernel Features +# +CONFIG_NO_HZ=y + +# +# CPUIdle +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg line 30
Quoted 10 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg new file +10
-0+ +# +# Kernel hacking +# +CONFIG_DEBUG_FS=y + +# +# Power management options +# +CONFIG_PM_DEBUG=y
This seems odd to be defined in the bsp tool. This appears to be all policy related, which should really be defined by the ktype scc file in the linux-yocto meta branch.
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg line 7
Quoted 13 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg new file +7
-0@@ -0,0 +1,336 @@ +# +# System Type +# +CONFIG_ARCH_OMAP=y +CONFIG_HAVE_PWM=y +CONFIG_ARM_L1_CACHE_SHIFT_6=y +
...
Again, default settings for an architecture the linux-yocto meta data already supports. We should be able to specify this with scc inclusions right?
My concern here is having to manage "policy" and "defaults" in both the linux-yocto meta data AND in the yocto-bsp template files.
Comments would be basically the same from here on down...
<snip>
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Re: [PATCH 1/8] yocto-bsp: add BSP template files
Quoted 92 lines · Darren Hart
Quoted 80 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
BSP template files for all supported Yocto architectures, plus qemu versions of the same.
Signed-off-by Tom Zanussi <[email protected]>--- .../target/arch/arm/conf/machine/{{=machine}}.conf | 87 +++++ .../{{ if xserver == \"y\": }} xorg.conf" | 34 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-non_hardware.cfg | 30 ++ .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 336 ++++++++++++++++++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 7 + .../arm/recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../bsp/substrate/target/arch/common/COPYING.MIT | 17 + .../lib/bsp/substrate/target/arch/common/README | 118 +++++++ .../substrate/target/arch/common/README.sources | 17 + .../substrate/target/arch/common/conf/layer.conf | 10 + .../formfactor/formfactor/{{=machine}}/machconfig | 5 + .../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 + .../tasks/task-core-tools-profile.bbappend | 2 + .../arch/i386/conf/machine/{{=machine}}.conf | 44 +++ ...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 +++ ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++ ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 54 ++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 30 ++ .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/mips/conf/machine/{{=machine}}.conf | 28 ++ .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 1 + .../recipes-kernel/linux/files/{{=machine}}.scc | 8 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/powerpc/conf/machine/{{=machine}}.conf | 53 +++ .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 163 ++++++++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 11 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/qemu/conf/machine/{{=machine}}.conf | 59 ++++ .../xserver-xf86-config/{{=machine}}/xorg.conf | 69 ++++ ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 30 ++ .../linux/files/{{=machine}}-standard.scc | 30 ++ .../recipes-kernel/linux/files/{{=machine}}.scc | 6 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ .../arch/x86_64/conf/machine/{{=machine}}.conf | 29 ++ ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 ++ ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 ++ ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 +Quoted 8 lines
.../recipes-kernel/linux/files/{{=machine}}.cfg | 47 +++ .../recipes-kernel/linux/files/{{=machine}}.scc | 17 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 ++ ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 ++ ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 ++ ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 ++ 80 files changed, 2436 insertions(+), 0 deletions(-)
Quoted 5 lines
WOW! I suppose this is the initial patch, so a files are going in whole
- but WOW! Are all of these created by hand? I'm thinking about supporting this going forward, will we have to create 10+ new files for every kernel release manually?
Yeah, as I was fleshing things out, I noticed some unnecessary duplication that it would make sense to try and factor out. They are however template files, so are kind of expected to be 'wordy' by nature, and they do each require small custom tweaks, so there may be a practical limit to how much it really makes sense to modularize.
Also, as far as the total number of files, I expect similar numbers to be retired each round as well, so the total would stay relatively constant. And I'd say 10 files per kernel upgrade is fairly reasonable, considering it happens once every cycle essentially.
Quoted 37 lines
A few comments inline below...
...
Quoted 33 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg new file +27
-0@@ -0,0 +1,30 @@ +# +# Miscellaneous filesystems +# +CONFIG_NFS_DEF_FILE_IO_SIZE=1024 + +# +# Multiple Device Support +# +# CONFIG_MD is not set + +# Kernel Features +# +CONFIG_NO_HZ=y + +# +# CPUIdle +# +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y + +# +# Kernel hacking +# +CONFIG_DEBUG_FS=y + +#
Quoted 9 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg line 30
Quoted 3 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg new file +3
-0+# Power management options +# +CONFIG_PM_DEBUG=yThis seems odd to be defined in the bsp tool. This appears to be all policy related, which should really be defined by the ktype scc file in the linux-yocto meta branch.
I agree - this is definitely something we can and should tweak depending on what the goals are for this tool i.e. there are tradeoffs between creating something immediately useful boot-wise for the user vs a minimalistic canonical starting point. I guess my bent has so far been the former, assuming the user understands that this is just a starting point and they'll probably need to go in and tweak settings, possibly deeply, in order to get things running on actual hardware.
Quoted 16 lines
Quoted 13 lines
scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg new file +7
-0@@ -0,0 +1,336 @@ +# +# System Type +# +CONFIG_ARCH_OMAP=y +CONFIG_HAVE_PWM=y +CONFIG_ARM_L1_CACHE_SHIFT_6=y +...
Quoted 7 lines
Again, default settings for an architecture the linux-yocto meta data already supports. We should be able to specify this with scc inclusions right?
My concern here is having to manage "policy" and "defaults" in both the linux-yocto meta data AND in the yocto-bsp template files.
Right, we need to sort this out and decide what should and should not go into the template files. This was a first pass and especially for the non-x86 and x86_64 architectures I knew these settings would have to be changed.
The i386 and x86_64 architectures do however work out of the box on my generic systems here, which is why I chose the initial settings there for those...
Tom
Quoted 5 lines
Comments would be basically the same from here on down...
<snip>
Quoted 18 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
This patchset implements the 'yocto-bsp' and 'yocto-kernel' BSP tools previously described in some detail in this RFC posting:
https://lists.yoctoproject.org/pipermail/yocto/2011-December/006111.html
With the functionality implemented by this patchset, you can:
- create a new Yocto BSP for any architecture supported Yocto, as well as qemu versions of the same. The default mode of operation when invoked from the command-line is to prompt the user for information needed to generate the BSP. For the current set of BSPs, the user is prompted for various important parameters such as which kernel to use, which branch of that kernel to use (or re-use), whether or not to use X, and if so, which drivers to use, whether to turn on SMP, whether the BSP has a keyboard, touchscreen, etc.
Quoted 7 lines
There's also an option (-i) that allows all the necessary information to be supplied directly as a JSON object instead, which allows the built-in prompting to be bypassed. This is mainly for use by developers of alternate UIs, such as the ADT integration that should now be possible with what's provided here.
(available via the 'yocto-bsp create' command)
This -i approach is adequate for an initial pass. However, a python module API would be preferable. However, if the ADT integration is written in java.... perhaps -i is the best way as I'm not sure if any of the Python bindings for Java (JPI, JPE, ...) are robust enough for our use.
Quoted 68 lines
- list the architectures available for BSP generation (using the 'yocto-bsp list karch' command). You can also list the properties and possible values for those properties for all the input items needed for a given architecture in order to create a bsp. The latter is mainly useful for developers of alternate UIs. See the documention in the built-in help system for details of the extensive data displayed by this command.
(available via the 'yocto-bsp list' command)
- add and remove kernel patches to/from the BSP, as well as list the kernel patches attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel patch add/rm/list' commands)
- add and remove kernel config items to/from the BSP, as well as list the user-defined config items attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel config add/rm/list' commands)
The built-in help system that makes it easy to drill down at any time and remind oneself of the syntax required for any specific command:
Simply entering the name of the command, or the command along with 'help' will display a list of the available sub-commands. For example:
$ yocto-bsp $ yocto-bsp helpUsage:
Create a customized Yocto BSP layer.
usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
The most commonly used 'yocto-bsp' commands are:
create Create a new Yocto BSP
list List available values for options and BSP propertiesSee 'yocto-bsp 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 informationSimilarly, entering just the name of the subcommand will show the detailed usage for that command:
$ yocto-bsp createUsage:
Create a new Yocto BSP
usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>]
[-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within
the top-level directory specified as 'meta-bsp-name'. The -o option
can be used to place the BSP layer in a directory with a different name and location.
Quoted 8 lines
...
For any subcommand, you can also use the word 'help' just before the subcommand to get more extensive documentation on the subcommand:
$ yocto-bsp help create
I believe it is more typical to have the "help" argument after the command:
git branch -h, for example (since you used git-like in your description). Not a big deal, but some might trip over this.
Quoted 118 lines
NAME
yocto-bsp create - Create a new Yocto BSPSYNOPSIS
yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]DESCRIPTION
This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within the top-level directory specified as 'meta-bsp-name'. The -o option can be used to place the BSP layer in a directory with a different name and location.The value of the 'karch' parameter determines the set of files that will be generated for the BSP, along with the specific set of 'properties' that will be used to fill out the BSP-specific portions of the BSP.
...
NOTE: Once created, you should add your new layer to your bblayers.conf file in order for it to be subsquently seen and modified by the yocto-kernel tool.
NOTE for x86- and x86_64-based BSPs: The generated BSP assumes the presence of the of the meta-intel layer, so you should also have a meta-intel layer present and added to your bblayers.conf as well.
So, armed simply with the knowledge that there are two Yocto BSP commands, 'yocto-bsp' and 'yocto-kernel', with the help of the help system and what's implemented by those commands, you should be able to create a BSP from scratch and do basic configuration and maintenance of the kernel without ever seeing a Yocto metadata file.
What's not implemented, or what still needs work:
- No support yet for kernel features.
- The 'publish' mechanism isn't yet implemented; currently this is all done in 'recipe-space'.
- The template data (the BSP-specific files in the bsp/substrate dir) for some specific architectures is untested and probably woefully incomplete or too specific (I didn't test what I don't have hardware for)
- I need to document the template 'language' in order to make that easier. Conceptually, it should be relatively easy to understand by looking at the other template files - basically they're just straight Yocto metadata files marked up with variable replacement tags {{=xxx}} and inline Python in any other tag.I have tested all the commands for the entire workflow - BSP creation, kernel patch and configuration commands - for the following architectures, and have successfully built and booted the generated and modified BSPs for each:
- qemuarm
- qemux86
- x86
-x86_64Aside from any other bugs, some work probably still needs to be done for some of the other non-qemu architectures in order to get them to a point where BSPs generated for them would stand a reasonable chance of booting as do the machines tested above.
My plans are to implement the missing functionality as follow-on patches shortly. In the meantime, I think the tools should be functional enough to allow people to accomplish the basic tasks related to BSP creation and kernel configuration for a Yocto BSP.
To provide a starting point for using the tools and as a quick illustration of their basic capabilities, I've captured the output of a couple different sessions below.
The first thing you need to do is source the build environment just as you would when building an image. Because the tools are contained in the /scripts directory, doing so makes them directly available:
$ source oe-init-build-envOnce you've done that, you can invoke the 'yocto-bsp create' command to create the BSP. The example below uses 'myarm' as the machine name, and tells it to use the 'qemu' architecture (the specific qemu machine architecture to use will be prompte for). You can use the 'yocto-bsp list karch' command to list the aviailable architectures for BSP creation:
$ yocto-bsp list karch Architectures available: arm powerpc i386 mips x86_64 qemuThe 'yocto-bsp create' command for the qemu architecture will display the following prompts along the way to gather the input required for BSP generation. Each prompt asks for input, but has a default value [in brackets]. If you press 'enter' (or any invalid value), the default value will automatically be used.
In the case of the qemu architecture, the first prompt asks which emulated architecture to use. It then asks if the default (3.2) is ok, and we press enter, essentially telling it 'yes'. Once we've selected the kernel, the prompt asks whether we need to have a new branch in the Yocto kernel git repository created for this BSP, which is where any patches we add can later be pushed (once we have publish functionality). For now, the patches and configuration live only in recipe-space, but we generate different code for later use in that regard depending on the answer. We're then given the opportunity to select a particular machine branch to use (or re-use if we elected not to create a new branch). Because we're generating an arm BSP, we choose #3 at that prompt to select the arm-versatile branch. The rest of the prompts are routine, and once all the questions have been completed, the BSP is generated along with a message telling you so.
Quoted 9 lines
$ yocto-bsp create myarm qemu Which qemu architecture would you like to use? [default: x86] 1) common 32-bit x86 2) common 64-bit x86 3) common 32-bit ARM 4) common 32-bit PowerPC 5) common 32-bit MIPS 3 Would you like to use the default (3.2) kernel? (Y/n)
You mentioned default value being in [] square brackets. Here it appears to be the Capital Y..
Quoted 1 line
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]
And here capital again, but in square brackets. This should be made consistent.
Quoted 2 lines
Getting branches from remote repo
git://git.yoctoproject.org/linux-yocto-3.2...
Please choose a machine branch to base this BSP on => [default: standard/default/common-pc]
Hrm.... I think I'd prefer to see the default be "standard/base" which includes all our patches that go into every BSP, but does not impose and configuration on the BSP.
Perhaps your thinking is that making the default include some basic hardware support new users will have less trouble? If they select arch=ARM, is the default still standard/default/common-pc? If so, I think the best fix is moving to something common to all architectures, "standard/base".
Quoted 22 lines
1) base
2) standard/base
3) standard/default/arm-versatile-926ejs
4) standard/default/base
5) standard/default/beagleboard
6) standard/default/cedartrail
7) standard/default/common-pc-64/base
8) standard/default/common-pc-64/jasperforest
9) standard/default/common-pc-64/romley
10) standard/default/common-pc-64/sugarbay
11) standard/default/common-pc/atom-pc
12) standard/default/common-pc/base
13) standard/default/crownbay
14) standard/default/emenlow
15) standard/default/fishriver
16) standard/default/fri2
17) standard/default/fsl-mpc8315e-rdb
18) standard/default/mti-malta32-be
19) standard/default/mti-malta32-le
20) standard/default/preempt-rt
21) standard/default/qemu-ppc32
22) standard/default/routerstationpro
Quoted 8 lines
23) standard/preempt-rt/base
24) standard/preempt-rt/qemu-ppc32
25) standard/preempt-rt/routerstationpro
26) standard/tiny
3
Do you need SMP support? (Y/n)
Does your BSP have a touchscreen? (y/N)
Does your BSP have a keyboard? (Y/n)
Same default consistency comments.
Quoted 110 lines
New qemu BSP created in meta-myarm
Now that we have our BSP created, we need to add it to our bblayers.conf. This of course is required in order to build the BSP, but it's also required in order for the 'yocto-kernel' tool to be able to find the layer and other metadata it needs to operate on.
$ emacs -nw conf/bblayers.conf Add the BSP layer to e.g. BBLAYERS /home/trz/bsptest/build/meta-myarm \We can now use the 'yocto-kernel' command to add patches and config items to the BSP's kernel.
First, let's see what's available via in 'yocto-kernel' command:
$ 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 BSPSee 'yocto-kernel help COMMAND' for more information on a specific command.
Let's add a couple patches:
$ yocto-kernel patch add myarm//home/trz/junk.patch Added patches: junk.patch$ yocto-kernel patch add myarm /home/trz/yocto-testmod.patch Added patches: yocto-testmod.patchWe can list the patches associated with the kernel and verify what we added:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) junk.patch 2) yocto-testmod.patchLet's remove one of the patches, junk.patch:
$ yocto-kernel patch rm myarm Specify the patches to remove: 1) junk.patch 2) yocto-testmod.patch 1 Removed patches: junk.patchListing again shows that it's been removed:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) yocto-testmod.patchSimilarly, we can add kernel config items by using the 'yocto-kernel config add' command:
$ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y Added items: CONFIG_MISC_DEVICES=y$ yocto-kernel config add myarm KCONFIG_YOCTO_TESTMOD=y Added items: CONFIG_YOCTO_TESTMOD=yFinally, we can list the config items now associated with the BSP and see the config items we added along with some others.
$ yocto-kernel config list myarm The current set of machine-specific kernel config items for myarm is: 1) CONFIG_FTRACE_SYSCALLS=y 2) CONFIG_SCHED_TRACER=y 3) CONFIG_IRQSOFF_TRACER=y 4) CONFIG_PREEMPT_TRACER=y 5) CONFIG_MISC_DEVICES=y 6) CONFIG_YOCTO_TESTMOD=yFinally, as an example of a BSP for some actual hardware, below we generate an i386 BSP for an Atom board. We specify the 3.0 kernel instead of the default 3.2 kernel and in this case specify that we'll re-use an existing branch and take the default kernel branch suggested. We also specify that we want to use the Atom tuning and that we also want support for X and in this case we'll start by using the vesa driver. Again, the remaining items are straightforward, and finally, building this BSP might stand a good chance of actually booting and running on the actual Atom hardware, or it may not (most likely). If it's the kernel that needs tweaking, then of course, the 'yocto-kernel' command can be used to make those modifications.
Quoted 8 lines
$ yocto-bsp create myatom i386 Would you like to use the default (3.2) kernel? (Y/n) n Please choose the kernel to use in this BSP => [default: linux-yocto_3.2] 1) linux-yocto-rt_3.2 2) linux-yocto_3.2 3) linux-yocto_3.0 4) linux-yocto-rt_3.0 3
Oh very cool!
Quoted 1 line
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] n
defaults...
Quoted 2 lines
Getting branches from remote repo
git://git.yoctoproject.org/linux-yocto-3.0...
Please choose a machine branch to base this BSP on => [default: yocto/standard/base]
Hrm, so this time it is yocto/standard/base.... what changed?
Quoted 30 lines
1) yocto/base
2) yocto/eg20t
3) yocto/emgd
4) yocto/emgd-1.10
5) yocto/gma500
6) yocto/pvr
7) yocto/standard/arm-versatile-926ejs
8) yocto/standard/base
9) yocto/standard/beagleboard
10) yocto/standard/cedartrail
11) yocto/standard/common-pc-64/base
12) yocto/standard/common-pc-64/jasperforest
13) yocto/standard/common-pc-64/romley
14) yocto/standard/common-pc-64/sugarbay
15) yocto/standard/common-pc/atom-pc
16) yocto/standard/common-pc/base
17) yocto/standard/crownbay
18) yocto/standard/emenlow
19) yocto/standard/fishriver
20) yocto/standard/fri2
21) yocto/standard/fsl-mpc8315e-rdb
22) yocto/standard/mti-malta32-be
23) yocto/standard/mti-malta32-le
24) yocto/standard/pandaboard
25) yocto/standard/preempt-rt/base
26) yocto/standard/preempt-rt/qemu-ppc32
27) yocto/standard/preempt-rt/routerstationpro
28) yocto/standard/qemu-ppc32
29) yocto/standard/routerstationpro
Quoted 15 lines
Do you need SMP support? (Y/n)
Which machine tuning would you like to use? [default:tune_core2]
1) Atom tuning optimizations
2) Core2 tuning optimizations
1
Do you need support for X? (Y/n)
Please select an xserver for this machine [default:xserver_i915]
1) VESA xserver support
2) EMGD xserver support (proprietary)
3) i915 xserver support
1
Does your BSP have a touchscreen? (y/N)
Does your BSP have a keyboard? (Y/n)
New i386 BSP created in meta-myatom
defaults...
--
Darren
Quoted 224 lines
Hopefully the above examples along with the documentation contained in the built-in help system are enough to start becoming productive with these tools; please let me know of anything lacking, bugs, etc. Any and all input appreciated,
Tom
The following changes since commit
6b6aa170d5c618cfcd016dd1de926db647f7f932:
Gary Thomas (1):
busybox: Restore 'date' compatabilityare available in the git repository at:
git://git.yoctoproject.org/poky-contrib.gittzanussi/yocto-bsp-tools
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=tzanussi/yocto-bsp-toolsTom Zanussi (8):
yocto-bsp: add BSP template files
yocto-bsp-tools: add bsp library
yocto-bsp: add templating engine
yocto-bsp: add kernel interface
yocto-bsp-tools: add help/usage
yocto-bsp: add some useful constants
yocto-bsp: new script
yocto-kernel: new scriptscripts/lib/bsp/__init__.py | 17 + scripts/lib/bsp/engine.py | 1336 ++++++++++++++++++++ scripts/lib/bsp/help.py | 588 +++++++++ scripts/lib/bsp/kernel.py | 679 ++++++++++ .../target/arch/arm/conf/machine/{{=machine}}.conf | 87 ++ .../{{ if xserver == \"y\": }} xorg.conf" | 34 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-non_hardware.cfg | 30 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 336 +++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 7 + .../arm/recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../bsp/substrate/target/arch/common/COPYING.MIT | 17 + .../lib/bsp/substrate/target/arch/common/README | 118 ++ .../substrate/target/arch/common/README.sources | 17 + .../substrate/target/arch/common/conf/layer.conf | 10 + .../formfactor/formfactor/{{=machine}}/machconfig | 5 + .../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 + .../tasks/task-core-tools-profile.bbappend | 2 + .../arch/i386/conf/machine/{{=machine}}.conf | 44 + ...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 + ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 + ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 54 + .../recipes-kernel/linux/files/{{=machine}}.scc | 30 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/mips/conf/machine/{{=machine}}.conf | 28 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 1 + .../recipes-kernel/linux/files/{{=machine}}.scc | 8 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/powerpc/conf/machine/{{=machine}}.conf | 53 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 163 +++ .../recipes-kernel/linux/files/{{=machine}}.scc | 11 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/qemu/conf/machine/{{=machine}}.conf | 59 + .../xserver-xf86-config/{{=machine}}/xorg.conf | 69 + ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 30 + .../linux/files/{{=machine}}-standard.scc | 30 + .../recipes-kernel/linux/files/{{=machine}}.scc | 6 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/x86_64/conf/machine/{{=machine}}.conf | 29 + ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 + ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 47 + .../recipes-kernel/linux/files/{{=machine}}.scc | 17 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + scripts/lib/bsp/tags.py | 39 + scripts/yocto-bsp | 131 ++ scripts/yocto-kernel | 219 ++++ 87 files changed, 5445 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/__init__.py create mode 100644 scripts/lib/bsp/engine.py create mode 100644 scripts/lib/bsp/help.py create mode 100644 scripts/lib/bsp/kernel.py create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README.sources create mode 100644 scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/tags.py create mode 100755 scripts/yocto-bsp create mode 100755 scripts/yocto-kernel_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Quoted 26 lines · Darren Hart
Quoted 24 lines · On 03/01/2012 11:01 PM, [email protected] wrote:
From: Tom Zanussi <[email protected]>
This patchset implements the 'yocto-bsp' and 'yocto-kernel' BSP tools previously described in some detail in this RFC posting:
https://lists.yoctoproject.org/pipermail/yocto/2011-December/006111.html
With the functionality implemented by this patchset, you can:
- create a new Yocto BSP for any architecture supported Yocto, as well as qemu versions of the same. The default mode of operation when invoked from the command-line is to prompt the user for information needed to generate the BSP. For the current set of BSPs, the user is prompted for various important parameters such as which kernel to use, which branch of that kernel to use (or re-use), whether or not to use X, and if so, which drivers to use, whether to turn on SMP, whether the BSP has a keyboard, touchscreen, etc.
There's also an option (-i) that allows all the necessary information to be supplied directly as a JSON object instead, which allows the built-in prompting to be bypassed. This is mainly for use by developers of alternate UIs, such as the ADT integration that should now be possible with what's provided here.
Quoted 7 lines
Quoted 1 line
(available via the 'yocto-bsp create' command)
This -i approach is adequate for an initial pass. However, a python module API would be preferable. However, if the ADT integration is written in java.... perhaps -i is the best way as I'm not sure if any of the Python bindings for Java (JPI, JPE, ...) are robust enough for our use.
Agreed - this first pass as far as the input I/O was mainly to enable the ADT developers to start integrating now, and I believe they're starting out using the command-line versions. This can easily be changed to something more appropriate, but I'll wait on actual need to make those changes.
Quoted 74 lines
Quoted 74 lines
- list the architectures available for BSP generation (using the 'yocto-bsp list karch' command). You can also list the properties and possible values for those properties for all the input items needed for a given architecture in order to create a bsp. The latter is mainly useful for developers of alternate UIs. See the documention in the built-in help system for details of the extensive data displayed by this command.
(available via the 'yocto-bsp list' command)
- add and remove kernel patches to/from the BSP, as well as list the kernel patches attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel patch add/rm/list' commands)
- add and remove kernel config items to/from the BSP, as well as list the user-defined config items attached to the active kernel recipe for the BSP.
(available via the 'yocto-kernel config add/rm/list' commands)
The built-in help system that makes it easy to drill down at any time and remind oneself of the syntax required for any specific command:
Simply entering the name of the command, or the command along with 'help' will display a list of the available sub-commands. For example:
$ yocto-bsp $ yocto-bsp helpUsage:
Create a customized Yocto BSP layer.
usage: yocto-bsp [--version] [--help] COMMAND [ARGS]
The most commonly used 'yocto-bsp' commands are:
create Create a new Yocto BSP
list List available values for options and BSP propertiesSee 'yocto-bsp 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 informationSimilarly, entering just the name of the subcommand will show the detailed usage for that command:
$ yocto-bsp createUsage:
Create a new Yocto BSP
usage: yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>]
[-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within
the top-level directory specified as 'meta-bsp-name'. The -o option
can be used to place the BSP layer in a directory with a different name and location....
For any subcommand, you can also use the word 'help' just before the subcommand to get more extensive documentation on the subcommand:
Quoted 8 lines
Quoted 2 lines
$ yocto-bsp help createI believe it is more typical to have the "help" argument after the command:
git branch -h, for example (since you used git-like in your description). Not a big deal, but some might trip over this.
Since it's advertised as a git-like tool, it's behaves as expected ;-)
$ git
See 'git help COMMAND' for more information on a specific command.
Quoted 129 lines
Quoted 118 lines
NAME
yocto-bsp create - Create a new Yocto BSPSYNOPSIS
yocto-bsp create <bsp-name> <karch> [-o <DIRNAME> | --outdir <DIRNAME>] [-i <JSON PROPERTY FILE> | --infile <JSON PROPERTY_FILE>]DESCRIPTION
This command creates a Yocto BSP based on the specified parameters. The new BSP will be a new Yocto BSP layer contained by default within the top-level directory specified as 'meta-bsp-name'. The -o option can be used to place the BSP layer in a directory with a different name and location.The value of the 'karch' parameter determines the set of files that will be generated for the BSP, along with the specific set of 'properties' that will be used to fill out the BSP-specific portions of the BSP.
...
NOTE: Once created, you should add your new layer to your bblayers.conf file in order for it to be subsquently seen and modified by the yocto-kernel tool.
NOTE for x86- and x86_64-based BSPs: The generated BSP assumes the presence of the of the meta-intel layer, so you should also have a meta-intel layer present and added to your bblayers.conf as well.
So, armed simply with the knowledge that there are two Yocto BSP commands, 'yocto-bsp' and 'yocto-kernel', with the help of the help system and what's implemented by those commands, you should be able to create a BSP from scratch and do basic configuration and maintenance of the kernel without ever seeing a Yocto metadata file.
What's not implemented, or what still needs work:
- No support yet for kernel features.
- The 'publish' mechanism isn't yet implemented; currently this is all done in 'recipe-space'.
- The template data (the BSP-specific files in the bsp/substrate dir) for some specific architectures is untested and probably woefully incomplete or too specific (I didn't test what I don't have hardware for)
- I need to document the template 'language' in order to make that easier. Conceptually, it should be relatively easy to understand by looking at the other template files - basically they're just straight Yocto metadata files marked up with variable replacement tags {{=xxx}} and inline Python in any other tag.I have tested all the commands for the entire workflow - BSP creation, kernel patch and configuration commands - for the following architectures, and have successfully built and booted the generated and modified BSPs for each:
- qemuarm
- qemux86
- x86
-x86_64Aside from any other bugs, some work probably still needs to be done for some of the other non-qemu architectures in order to get them to a point where BSPs generated for them would stand a reasonable chance of booting as do the machines tested above.
My plans are to implement the missing functionality as follow-on patches shortly. In the meantime, I think the tools should be functional enough to allow people to accomplish the basic tasks related to BSP creation and kernel configuration for a Yocto BSP.
To provide a starting point for using the tools and as a quick illustration of their basic capabilities, I've captured the output of a couple different sessions below.
The first thing you need to do is source the build environment just as you would when building an image. Because the tools are contained in the /scripts directory, doing so makes them directly available:
$ source oe-init-build-envOnce you've done that, you can invoke the 'yocto-bsp create' command to create the BSP. The example below uses 'myarm' as the machine name, and tells it to use the 'qemu' architecture (the specific qemu machine architecture to use will be prompte for). You can use the 'yocto-bsp list karch' command to list the aviailable architectures for BSP creation:
$ yocto-bsp list karch Architectures available: arm powerpc i386 mips x86_64 qemuThe 'yocto-bsp create' command for the qemu architecture will display the following prompts along the way to gather the input required for BSP generation. Each prompt asks for input, but has a default value [in brackets]. If you press 'enter' (or any invalid value), the default value will automatically be used.
In the case of the qemu architecture, the first prompt asks which emulated architecture to use. It then asks if the default (3.2) is ok, and we press enter, essentially telling it 'yes'. Once we've selected the kernel, the prompt asks whether we need to have a new branch in the Yocto kernel git repository created for this BSP, which is where any patches we add can later be pushed (once we have publish functionality). For now, the patches and configuration live only in recipe-space, but we generate different code for later use in that regard depending on the answer. We're then given the opportunity to select a particular machine branch to use (or re-use if we elected not to create a new branch). Because we're generating an arm BSP, we choose #3 at that prompt to select the arm-versatile branch. The rest of the prompts are routine, and once all the questions have been completed, the BSP is generated along with a message telling you so.
Quoted 9 lines
$ yocto-bsp create myarm qemu Which qemu architecture would you like to use? [default: x86] 1) common 32-bit x86 2) common 64-bit x86 3) common 32-bit ARM 4) common 32-bit PowerPC 5) common 32-bit MIPS 3 Would you like to use the default (3.2) kernel? (Y/n)
Quoted 8 lines
You mentioned default value being in [] square brackets. Here it appears to be the Capital Y..
Quoted 1 line
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n]
And here capital again, but in square brackets. This should be made consistent.
Definitely, the boolean inputs missed that...
Quoted 7 lines
Quoted 2 lines
Getting branches from remote repo
git://git.yoctoproject.org/linux-yocto-3.2...
Please choose a machine branch to base this BSP on => [default: standard/default/common-pc]Hrm.... I think I'd prefer to see the default be "standard/base" which includes all our patches that go into every BSP, but does not impose and configuration on the BSP.
This is only for the qemu architecture - the other architectures do use standard base. The defaults can be different per-architecture and here are.
Quoted 6 lines
Perhaps your thinking is that making the default include some basic hardware support new users will have less trouble? If they select arch=ARM, is the default still standard/default/common-pc? If so, I think the best fix is moving to something common to all architectures, "standard/base".
You're right, currently for the qemu architecture it doesn't choose a different default for a different qemu architecture, but it should. The 'real' architectures do use standard/base though (or can be whatever they need to be, it's all easily modifiable.)
And, yeah, the goal so far has been to give the user something to start with that stands a reasonable chance of booting. That may mean some things over and above the absolute minimum, which we could also do instead, but then it may limit out-of-box usefulness and user gratification.
Quoted 158 lines
Quoted 22 lines
1) base
2) standard/base
3) standard/default/arm-versatile-926ejs
4) standard/default/base
5) standard/default/beagleboard
6) standard/default/cedartrail
7) standard/default/common-pc-64/base
8) standard/default/common-pc-64/jasperforest
9) standard/default/common-pc-64/romley
10) standard/default/common-pc-64/sugarbay
11) standard/default/common-pc/atom-pc
12) standard/default/common-pc/base
13) standard/default/crownbay
14) standard/default/emenlow
15) standard/default/fishriver
16) standard/default/fri2
17) standard/default/fsl-mpc8315e-rdb
18) standard/default/mti-malta32-be
19) standard/default/mti-malta32-le
20) standard/default/preempt-rt
21) standard/default/qemu-ppc32
22) standard/default/routerstationproQuoted 8 lines
23) standard/preempt-rt/base
24) standard/preempt-rt/qemu-ppc32
25) standard/preempt-rt/routerstationpro
26) standard/tiny
3
Do you need SMP support? (Y/n)
Does your BSP have a touchscreen? (y/N)
Does your BSP have a keyboard? (Y/n)Same default consistency comments.
Quoted 110 lines
New qemu BSP created in meta-myarm
Now that we have our BSP created, we need to add it to our bblayers.conf. This of course is required in order to build the BSP, but it's also required in order for the 'yocto-kernel' tool to be able to find the layer and other metadata it needs to operate on.
$ emacs -nw conf/bblayers.conf Add the BSP layer to e.g. BBLAYERS /home/trz/bsptest/build/meta-myarm \We can now use the 'yocto-kernel' command to add patches and config items to the BSP's kernel.
First, let's see what's available via in 'yocto-kernel' command:
$ 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 BSPSee 'yocto-kernel help COMMAND' for more information on a specific command.
Let's add a couple patches:
$ yocto-kernel patch add myarm//home/trz/junk.patch Added patches: junk.patch$ yocto-kernel patch add myarm /home/trz/yocto-testmod.patch Added patches: yocto-testmod.patchWe can list the patches associated with the kernel and verify what we added:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) junk.patch 2) yocto-testmod.patchLet's remove one of the patches, junk.patch:
$ yocto-kernel patch rm myarm Specify the patches to remove: 1) junk.patch 2) yocto-testmod.patch 1 Removed patches: junk.patchListing again shows that it's been removed:
$ yocto-kernel patch list myarm The current set of machine-specific patches for myarm is: 1) yocto-testmod.patchSimilarly, we can add kernel config items by using the 'yocto-kernel config add' command:
$ yocto-kernel config add myarm CONFIG_MISC_DEVICES=y Added items: CONFIG_MISC_DEVICES=y$ yocto-kernel config add myarm KCONFIG_YOCTO_TESTMOD=y Added items: CONFIG_YOCTO_TESTMOD=yFinally, we can list the config items now associated with the BSP and see the config items we added along with some others.
$ yocto-kernel config list myarm The current set of machine-specific kernel config items for myarm is: 1) CONFIG_FTRACE_SYSCALLS=y 2) CONFIG_SCHED_TRACER=y 3) CONFIG_IRQSOFF_TRACER=y 4) CONFIG_PREEMPT_TRACER=y 5) CONFIG_MISC_DEVICES=y 6) CONFIG_YOCTO_TESTMOD=yFinally, as an example of a BSP for some actual hardware, below we generate an i386 BSP for an Atom board. We specify the 3.0 kernel instead of the default 3.2 kernel and in this case specify that we'll re-use an existing branch and take the default kernel branch suggested. We also specify that we want to use the Atom tuning and that we also want support for X and in this case we'll start by using the vesa driver. Again, the remaining items are straightforward, and finally, building this BSP might stand a good chance of actually booting and running on the actual Atom hardware, or it may not (most likely). If it's the kernel that needs tweaking, then of course, the 'yocto-kernel' command can be used to make those modifications.
Quoted 8 lines
$ yocto-bsp create myatom i386 Would you like to use the default (3.2) kernel? (Y/n) n Please choose the kernel to use in this BSP => [default: linux-yocto_3.2] 1) linux-yocto-rt_3.2 2) linux-yocto_3.2 3) linux-yocto_3.0 4) linux-yocto-rt_3.0 3Oh very cool!
Quoted 1 line
Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] n
Quoted 7 lines
defaults...
Quoted 2 lines
Getting branches from remote repo
git://git.yoctoproject.org/linux-yocto-3.0...
Please choose a machine branch to base this BSP on => [default: yocto/standard/base]Hrm, so this time it is yocto/standard/base.... what changed?
The architecture - different architectures provide different starting points and different defaults.
Quoted 46 lines
Quoted 30 lines
1) yocto/base
2) yocto/eg20t
3) yocto/emgd
4) yocto/emgd-1.10
5) yocto/gma500
6) yocto/pvr
7) yocto/standard/arm-versatile-926ejs
8) yocto/standard/base
9) yocto/standard/beagleboard
10) yocto/standard/cedartrail
11) yocto/standard/common-pc-64/base
12) yocto/standard/common-pc-64/jasperforest
13) yocto/standard/common-pc-64/romley
14) yocto/standard/common-pc-64/sugarbay
15) yocto/standard/common-pc/atom-pc
16) yocto/standard/common-pc/base
17) yocto/standard/crownbay
18) yocto/standard/emenlow
19) yocto/standard/fishriver
20) yocto/standard/fri2
21) yocto/standard/fsl-mpc8315e-rdb
22) yocto/standard/mti-malta32-be
23) yocto/standard/mti-malta32-le
24) yocto/standard/pandaboard
25) yocto/standard/preempt-rt/base
26) yocto/standard/preempt-rt/qemu-ppc32
27) yocto/standard/preempt-rt/routerstationpro
28) yocto/standard/qemu-ppc32
29) yocto/standard/routerstationproQuoted 15 lines
Do you need SMP support? (Y/n)
Which machine tuning would you like to use? [default:tune_core2]
1) Atom tuning optimizations
2) Core2 tuning optimizations
1
Do you need support for X? (Y/n)
Please select an xserver for this machine [default:xserver_i915]
1) VESA xserver support
2) EMGD xserver support (proprietary)
3) i915 xserver support
1
Does your BSP have a touchscreen? (y/N)
Does your BSP have a keyboard? (Y/n)
New i386 BSP created in meta-myatom
Quoted 2 lines
defaults...
Thanks for the comments!
Tom
Quoted 228 lines
--
DarrenQuoted 224 lines
Hopefully the above examples along with the documentation contained in the built-in help system are enough to start becoming productive with these tools; please let me know of anything lacking, bugs, etc. Any and all input appreciated,
Tom
The following changes since commit
6b6aa170d5c618cfcd016dd1de926db647f7f932:
Gary Thomas (1):
busybox: Restore 'date' compatabilityare available in the git repository at:
git://git.yoctoproject.org/poky-contrib.gittzanussi/yocto-bsp-tools
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=tzanussi/yocto-bsp-toolsTom Zanussi (8):
yocto-bsp: add BSP template files
yocto-bsp-tools: add bsp library
yocto-bsp: add templating engine
yocto-bsp: add kernel interface
yocto-bsp-tools: add help/usage
yocto-bsp: add some useful constants
yocto-bsp: new script
yocto-kernel: new scriptscripts/lib/bsp/__init__.py | 17 + scripts/lib/bsp/engine.py | 1336 ++++++++++++++++++++ scripts/lib/bsp/help.py | 588 +++++++++ scripts/lib/bsp/kernel.py | 679 ++++++++++ .../target/arch/arm/conf/machine/{{=machine}}.conf | 87 ++ .../{{ if xserver == \"y\": }} xorg.conf" | 34 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-non_hardware.cfg | 30 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 336 +++++ .../recipes-kernel/linux/files/{{=machine}}.scc | 7 + .../arm/recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../bsp/substrate/target/arch/common/COPYING.MIT | 17 + .../lib/bsp/substrate/target/arch/common/README | 118 ++ .../substrate/target/arch/common/README.sources | 17 + .../substrate/target/arch/common/conf/layer.conf | 10 + .../formfactor/formfactor/{{=machine}}/machconfig | 5 + .../recipes-bsp/formfactor/formfactor_0.0.bbappend | 3 + .../tasks/task-core-tools-profile.bbappend | 2 + .../arch/i386/conf/machine/{{=machine}}.conf | 44 + ...erver_choice == \"xserver_emgd\": }} xorg.conf" | 48 + ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 + ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 54 + .../recipes-kernel/linux/files/{{=machine}}.scc | 30 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/mips/conf/machine/{{=machine}}.conf | 28 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 1 + .../recipes-kernel/linux/files/{{=machine}}.scc | 8 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/powerpc/conf/machine/{{=machine}}.conf | 53 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 163 +++ .../recipes-kernel/linux/files/{{=machine}}.scc | 11 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/qemu/conf/machine/{{=machine}}.conf | 59 + .../xserver-xf86-config/{{=machine}}/xorg.conf | 69 + ..."x86_64\": }} xserver-xf86-config_0.1.bbappend" | 2 + .../recipes-kernel/linux/files/user-config.cfg | 4 + .../linux/files/{{=machine}}-preempt-rt.scc | 30 + .../linux/files/{{=machine}}-standard.scc | 30 + .../recipes-kernel/linux/files/{{=machine}}.scc | 6 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 32 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 32 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 34 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + .../arch/x86_64/conf/machine/{{=machine}}.conf | 29 + ...erver_choice == \"xserver_i915\": }} xorg.conf" | 26 + ...erver_choice == \"xserver_vesa\": }} xorg.conf" | 26 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 3 + .../linux/files/{{=machine}}-preempt-rt.scc | 8 + .../linux/files/{{=machine}}-standard.scc | 8 + .../recipes-kernel/linux/files/{{=machine}}.cfg | 47 + .../recipes-kernel/linux/files/{{=machine}}.scc | 17 + .../recipes-kernel/linux/kernel-list.noinstall | 3 + ...yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" | 34 + ...yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" | 34 + ...linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" | 36 + ...linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" | 34 + scripts/lib/bsp/tags.py | 39 + scripts/yocto-bsp | 131 ++ scripts/yocto-kernel | 219 ++++ 87 files changed, 5445 insertions(+), 0 deletions(-) create mode 100644 scripts/lib/bsp/__init__.py create mode 100644 scripts/lib/bsp/engine.py create mode 100644 scripts/lib/bsp/help.py create mode 100644 scripts/lib/bsp/kernel.py create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README.sources create mode 100644 scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" create mode 100644 scripts/lib/bsp/tags.py create mode 100755 scripts/yocto-bsp create mode 100755 scripts/yocto-kernel_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto
Quoted 14 lines · Tom Zanussi
Quoted 11 lines · Darren Hart
Quoted 5 lines
For any subcommand, you can also use the word 'help' just before the subcommand to get more extensive documentation on the subcommand:
$ yocto-bsp help createI believe it is more typical to have the "help" argument after the command:
git branch -h, for example (since you used git-like in your description). Not a big deal, but some might trip over this.
Quoted 5 lines
Since it's advertised as a git-like tool, it's behaves as expected ;-)
$ gitSee 'git help COMMAND' for more information on a specific command.
hah, I stand corrected :-)
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel