* [PATCH 1/8] yocto-bsp: add BSP template files
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 16:35 ` Darren Hart
2012-03-02 7:01 ` [PATCH 2/8] yocto-bsp-tools: add bsp library tom.zanussi
` (7 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
BSP template files for all supported Yocto architectures, plus qemu
versions of the same.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
.../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"
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/.gitignore b/scripts/lib/bsp/substrate/target/arch/arm/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..e1b5e1c
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
@@ -0,0 +1,87 @@
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+{{ 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-xorg-lite"
+XSERVER = "xserver-xorg-lite \
+ xf86-input-evdev \
+ xf86-input-mouse \
+ xf86-video-omapfb \
+ xf86-input-keyboard"
+
+# Ship all kernel modules by default
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
+
+# Allow for MMC booting (required by the NAND-less Beagleboard XM)
+EXTRA_IMAGEDEPENDS += "u-boot x-load"
+
+# Uncomment the following line to enable the hard floating point abi. Note that
+# this breaks some binary libraries and 3D (neither of which ship with
+# meta-yocto). For maximum compatibility, leave this disabled.
+#DEFAULTTUNE ?= "cortexa8hf-neon"
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_cortexa8" }}
+{{ input type:"choice" val:"tune_arm1136jf_s" msg:"arm1136jf-s tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm920t" msg:"arm920t tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm926ejs" msg:"arm926ejs tuning optimizations" }}
+{{ input type:"choice" val:"tune_arm9tdmi" msg:"arm9tdmi tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa8" msg:"cortexa8 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexa9" msg:"cortexa9 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexm1" msg:"cortexm1 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexm3" msg:"cortexm3 tuning optimizations" }}
+{{ input type:"choice" val:"tune_cortexr4" msg:"cortexr4 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ep9312" msg:"ep9312 tuning optimizations" }}
+{{ input type:"choice" val:"tune_iwmmxt" msg:"iwmmxt tuning optimizations" }}
+{{ input type:"choice" val:"tune_strongarm1100" msg:"strongarm1100 tuning optimizations" }}
+{{ input type:"choice" val:"tune_xscale" msg:"xscale tuning optimizations" }}
+{{ if tunefile == "tune_arm1136jf_s": }}
+include conf/machine/include/tune-arm1136jf-s.inc
+{{ if tunefile == "tune_arm920t": }}
+include conf/machine/include/tune-arm920t.inc
+{{ if tunefile == "tune_arm926ejs": }}
+include conf/machine/include/tune-arm926ejs.inc
+{{ if tunefile == "tune_arm9tdmi": }}
+include conf/machine/include/tune-arm9tdmi.inc
+{{ if tunefile == "tune_cortexa8": }}
+include conf/machine/include/tune-cortexa8.inc
+{{ if tunefile == "tune_cortexa9": }}
+include conf/machine/include/tune-cortexa9.inc
+{{ if tunefile == "tune_cortexm1": }}
+include conf/machine/include/tune-cortexm1.inc
+{{ if tunefile == "tune_cortexm3": }}
+include conf/machine/include/tune-cortexm3.inc
+{{ if tunefile == "tune_cortexr4": }}
+include conf/machine/include/tune-cortexr4.inc
+{{ if tunefile == "tune_ep9312": }}
+include conf/machine/include/tune-ep9312.inc
+{{ if tunefile == "tune_iwmmxt": }}
+include conf/machine/include/tune-iwmmxt.inc
+{{ if tunefile == "tune_strongarm1100": }}
+include conf/machine/include/tune-strongarm1100.inc
+{{ if tunefile == "tune_xscale": }}
+include conf/machine/include/tune-xscale.inc
+
+IMAGE_FSTYPES += "tar.bz2 jffs2"
+EXTRA_IMAGECMD_jffs2 = "-lnp "
+
+# 2.6.37 and later kernels use OMAP_SERIAL, ttyO2
+# earlier kernels use ttyS2
+SERIAL_CONSOLE = "115200 ttyO2"
+
+{{ 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}}%"
+
+KERNEL_IMAGETYPE = "uImage"
+
+{{ input type:"edit" name:"uboot_machine" prio:"40" msg:"Please specify a value for UBOOT_MACHINE." default:"omap3_beagle_config" }}
+UBOOT_MACHINE = "{{=uboot_machine}}"
+{{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT." default:"0x80008000" }}
+UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}"
+{{ input type:"edit" name:"uboot_loadaddress" prio:"40" msg:"Please specify a value for UBOOT_LOADADDRESS." default:"0x80008000" }}
+UBOOT_LOADADDRESS = "{{=uboot_loadaddress}}"
+
+MACHINE_FEATURES = "kernel26 apm usbgadget usbhost vfat alsa"
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf"
new file mode 100644
index 0000000..0335e6a
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf"
@@ -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
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
new file mode 100644
index 0000000..4b8d0e6
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
@@ -0,0 +1,3 @@
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
+
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
new file mode 100644
index 0000000..361343b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..22ff307
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..cd8fa9c
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -0,0 +1,8 @@
+define KMACHINE {{=machine}}
+define KTYPE standard
+define KARCH arm
+
+include ktypes/standard
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..994e034
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
@@ -0,0 +1,336 @@
+#
+# System Type
+#
+CONFIG_ARCH_OMAP=y
+CONFIG_HAVE_PWM=y
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+
+#
+# TI OMAP Implementations
+#
+# CONFIG_ARCH_OMAP2 is not set
+CONFIG_ARCH_OMAP3=y
+
+#
+# TI OMAP Common Features
+#
+CONFIG_ARCH_OMAP2PLUS=y
+
+#
+# OMAP Feature Selections
+#
+CONFIG_OMAP_32K_TIMER=y
+CONFIG_OMAP_32K_TIMER_HZ=128
+CONFIG_OMAP_DM_TIMER=y
+CONFIG_OMAP_RESET_CLOCKS=y
+CONFIG_OMAP_SMARTREFLEX=y
+CONFIG_OMAP_SMARTREFLEX_CLASS3=y
+CONFIG_OMAP_MBOX_FWK=m
+CONFIG_OMAP_MBOX_KFIFO_SIZE=256
+CONFIG_OMAP_IOMMU=m
+CONFIG_OMAP_IOMMU_DEBUG=m
+
+#
+# OMAP Board Type
+#
+CONFIG_MACH_OMAP3_BEAGLE=y
+
+#
+# Processor Features
+#
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_ERRATA_430973=y
+
+#
+# Kernel Features
+#
+CONFIG_LEDS=y
+
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_RSA=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_8250_DETECT_IRQ=y
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_NEON=y
+
+#
+# Power management options
+#
+CONFIG_PM=y
+CONFIG_PM_RUNTIME=y
+
+#
+# Generic Driver Options
+#
+CONFIG_MTD=y
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_INTELEXT=y
+
+#
+# Disk-On-Chip Device Drivers
+#
+CONFIG_MTD_NAND=y
+
+CONFIG_MTD_NAND_OMAP2=y
+# CONFIG_MTD_NAND_OMAP_PREFETCH is not set
+
+CONFIG_MTD_UBI=y
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_SMSC911X=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_EVDEV=y
+
+#
+# Input Device Drivers
+#
+CONFIG_KEYBOARD_TWL4030=y
+CONFIG_INPUT_TOUCHSCREEN=y
+CONFIG_TOUCHSCREEN_ADS7846=y
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_I2C=y
+CONFIG_I2C_OMAP=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_OMAP24XX=y
+
+#
+# I2C GPIO expanders:
+#
+CONFIG_GPIO_TWL4030=y
+
+#
+# SPI GPIO expanders:
+#
+CONFIG_OMAP_WATCHDOG=y
+CONFIG_WATCHDOG_NOWAYOUT=y
+
+#
+# Multifunction device drivers
+#
+CONFIG_TWL4030_CORE=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_DUMMY=y
+CONFIG_REGULATOR_TWL4030=y
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_DRM=m
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FIRMWARE_EDID is not set
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+CONFIG_FB_SYS_FILLRECT=m
+CONFIG_FB_SYS_COPYAREA=m
+CONFIG_FB_SYS_IMAGEBLIT=m
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_DEFERRED_IO=y
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+CONFIG_FB_MODE_HELPERS=y
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+CONFIG_FB_OMAP=y
+CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=2
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_TMIO is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_MB862XX is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_OMAP_BOOTLOADER_INIT is not set
+CONFIG_OMAP2_VRAM=y
+CONFIG_OMAP2_VRFB=y
+CONFIG_OMAP2_DSS=y
+CONFIG_OMAP2_VRAM_SIZE=14
+CONFIG_OMAP2_DSS_DEBUG_SUPPORT=y
+# CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS is not set
+CONFIG_OMAP2_DSS_DPI=y
+# CONFIG_OMAP2_DSS_RFBI is not set
+CONFIG_OMAP2_DSS_VENC=y
+# CONFIG_OMAP2_DSS_SDI is not set
+CONFIG_OMAP2_DSS_DSI=y
+CONFIG_OMAP2_DSS_USE_DSI_PLL=y
+# CONFIG_OMAP2_DSS_FAKE_VSYNC is not set
+CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0
+CONFIG_FB_OMAP2=y
+CONFIG_FB_OMAP2_DEBUG_SUPPORT=y
+CONFIG_FB_OMAP2_NUM_FBS=2
+
+#
+# OMAP2/3 Display Device Drivers
+#
+CONFIG_PANEL_GENERIC=y
+CONFIG_PANEL_SHARP_LS037V7DW01=y
+# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
+# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
+# CONFIG_PANEL_SHARP_LQ043T1DG01 is not set
+# CONFIG_PANEL_TAAL is not set
+CONFIG_PANEL_TOPPOLY_TDO35S=m
+CONFIG_PANEL_TPO_TD043MTEA1=m
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+
+#
+# Display device support
+#
+CONFIG_DISPLAY_SUPPORT=y
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
+CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+# CONFIG_LOGO_LINUX_MONO is not set
+# CONFIG_LOGO_LINUX_VGA16 is not set
+
+#
+# Console display driver support
+#
+CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_LOGO=y
+# CONFIG_VGA_CONSOLE is not set
+
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+
+#
+# USB Input Devices
+#
+CONFIG_USB=y
+CONFIG_USB_SUPPORT=y
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+CONFIG_USB_OTG=y
+# CONFIG_USB_OTG_WHITELIST is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
+CONFIG_USB_MUSB_HDRC=y
+CONFIG_USB_MUSB_OMAP2PLUS=y
+CONFIG_USB_MUSB_SOC=y
+
+#
+# OMAP 343x high speed USB support
+#
+CONFIG_USB_MUSB_OTG=y
+CONFIG_USB_GADGET_MUSB_HDRC=y
+CONFIG_USB_MUSB_HDRC_HCD=y
+CONFIG_USB_INVENTRA_DMA=y
+
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+CONFIG_USB_STORAGE=y
+
+#
+# USB Miscellaneous drivers
+#
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DUALSPEED=y
+CONFIG_USB_OTG_UTILS=y
+CONFIG_TWL4030_USB=y
+
+CONFIG_MMC=y
+
+#
+# MMC/SD Host Controller Drivers
+#
+CONFIG_MMC_OMAP_HS=y
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_TWL4030=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_VFAT_FS=y
+
+#
+# Multimedia core support
+#
+
+CONFIG_VIDEO_OMAP3_ISP=y
+# CONFIG_VIDEO_OMAP34XX_ISP_PREVIEWER is not set
+CONFIG_VIDEO_OMAP34XX_ISP_RESIZER=y
+# CONFIG_VIDEO_HELPER_CHIPS_AUTO is not set
+
+#
+# Advanced Power Management Emulation support
+#
+CONFIG_APM_EMULATION=y
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..39f87f5
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" "b/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 mode 100644
index 0000000..fa0b60e
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" "b/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 mode 100644
index 0000000..df9fe6f
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
new file mode 100644
index 0000000..482d521
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
new file mode 100644
index 0000000..2f6db36
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT b/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT
new file mode 100644
index 0000000..fb950dc
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT
@@ -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.
diff --git a/scripts/lib/bsp/substrate/target/arch/common/README b/scripts/lib/bsp/substrate/target/arch/common/README
new file mode 100644
index 0000000..928659f
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/README
@@ -0,0 +1,118 @@
+This README file contains information on building the meta-{{=machine}}
+BSP layer, and booting the images contained in the /binary directory.
+Please see the corresponding sections below for details.
+
+
+Dependencies
+============
+
+This layer depends on:
+
+ URI: git://git.openembedded.org/bitbake
+ branch: master
+
+ URI: git://git.openembedded.org/openembedded-core
+ layers: meta
+ branch: master
+
+ URI: git://git.yoctoproject.org/xxxx
+ layers: xxxx
+ branch: master
+
+
+Patches
+=======
+
+Please submit any patches against this BSP to the Yocto mailing list
+(yocto@yoctoproject.org) and cc: the maintainer:
+
+Maintainer: XXX YYYYYY <xxx.yyyyyy@zzzzz.com>
+
+Please see the meta-xxxx/MAINTAINERS file for more details.
+
+
+Table of Contents
+=================
+
+ I. Building the meta-{{=machine}} BSP layer
+ II. Booting the images in /binary
+
+
+I. Building the meta-{{=machine}} BSP layer
+========================================
+
+--- replace with specific instructions for your layer ---
+
+In order to build an image with BSP support for a given release, you
+need to download the corresponding BSP tarball from the 'Board Support
+Package (BSP) Downloads' page of the Yocto Project website.
+
+Having done that, and assuming you extracted the BSP tarball contents
+at the top-level of your yocto build tree, you can build a
+{{=machine}} image by adding the location of the meta-{{=machine}}
+layer to bblayers.conf, along with any other layers needed (to access
+common metadata shared between BSPs) e.g.:
+
+ yocto/meta-xxxx \
+ yocto/meta-xxxx/meta-{{=machine}} \
+
+To enable the {{=machine}} layer, add the {{=machine}} MACHINE to local.conf:
+
+ MACHINE ?= "{{=machine}}"
+
+You should then be able to build a {{=machine}} image as such:
+
+ $ source oe-init-build-env
+ $ bitbake core-image-sato
+
+At the end of a successful build, you should have a live image that
+you can boot from a USB flash drive (see instructions on how to do
+that below, in the section 'Booting the images from /binary').
+
+As an alternative to downloading the BSP tarball, you can also work
+directly from the meta-xxxx git repository. For each BSP in the
+'meta-xxxx' repository, there are multiple branches, one corresponding
+to each major release starting with 'laverne' (0.90), in addition to
+the latest code which tracks the current master (note that not all
+BSPs are present in every release). Instead of extracting a BSP
+tarball at the top level of your yocto build tree, you can
+equivalently check out the appropriate branch from the meta-xxxx
+repository at the same location.
+
+
+II. Booting the images in /binary
+=================================
+
+--- replace with specific instructions for your platform ---
+
+This BSP contains bootable live images, which can be used to directly
+boot Yocto off of a USB flash drive.
+
+Under Linux, insert a USB flash drive. Assuming the USB flash drive
+takes device /dev/sdf, use dd to copy the live image to it. For
+example:
+
+# dd if=core-image-sato-{{=machine}}-20101207053738.hddimg of=/dev/sdf
+# sync
+# eject /dev/sdf
+
+This should give you a bootable USB flash device. Insert the device
+into a bootable USB socket on the target, and power on. This should
+result in a system booted to the Sato graphical desktop.
+
+If you want a terminal, use the arrows at the top of the UI to move to
+different pages of available applications, one of which is named
+'Terminal'. Clicking that should give you a root terminal.
+
+If you want to ssh into the system, you can use the root terminal to
+ifconfig the IP address and use that to ssh in. The root password is
+empty, so to log in type 'root' for the user name and hit 'Enter' at
+the Password prompt: and you should be in.
+
+----
+
+If you find you're getting corrupt images on the USB (it doesn't show
+the syslinux boot: prompt, or the boot: prompt contains strange
+characters), try doing this first:
+
+# dd if=/dev/zero of=/dev/sdf bs=1M count=512
diff --git a/scripts/lib/bsp/substrate/target/arch/common/README.sources b/scripts/lib/bsp/substrate/target/arch/common/README.sources
new file mode 100644
index 0000000..3c4cb7b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/README.sources
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore b/scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf b/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
new file mode 100644
index 0000000..921d976
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig
new file mode 100644
index 0000000..77b8685
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig
@@ -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}}
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
new file mode 100644
index 0000000..54da0ff
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend
@@ -0,0 +1,3 @@
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PRINC = "1"
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend b/scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend
new file mode 100644
index 0000000..9e8e5c8
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-core/tasks/task-core-tools-profile.bbappend
@@ -0,0 +1,2 @@
+RRECOMMENDS_task-core-tools-profile_append_{{=machine}} = " systemtap"
+
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..e800dfd
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
@@ -0,0 +1,44 @@
+#@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}}%"
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_core2" }}
+{{ input type:"choice" val:"tune_atom" msg:"Atom tuning optimizations" }}
+{{ input type:"choice" val:"tune_core2" msg:"Core2 tuning optimizations" }}
+{{ if tunefile == "tune_atom": }}
+include conf/machine/include/tune-atom.inc
+{{ if tunefile == "tune_core2": }}
+include conf/machine/include/tune-core2.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_emgd" msg:"EMGD xserver support (proprietary)" }}
+{{ 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_emgd": }}
+ ${XSERVER_IA32_EMGD} \
+{{ if xserver_choice == "xserver_i915": }}
+ ${XSERVER_IA32_I915} \
+{{ if xserver == "y": }}
+ "
+
+{{ if xserver_choice == "xserver_emgd": }}
+PREFERRED_VERSION_xserver-xorg ?= "1.9.3"
+PREFERRED_VERSION_mesa-dri ?= "7.11"
+PREFERRED_VERSION_emgd-driver-bin ?= "1.8"
+
+{{ if xserver_choice == "xserver_vesa" or xserver_choice == "xserver_emgd": }}
+APPEND += "video=vesafb vga=0x318"
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf"
new file mode 100644
index 0000000..662f60f
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_emgd\": }} xorg.conf"
@@ -0,0 +1,48 @@
+##
+## X Config options generated from CED
+## x11 conf skeleton
+## DriverVer=
+##
+
+Section "Screen"
+ Identifier "Screen0"
+ Device "IntelEMGD-0"
+ Monitor "Monitor0"
+ SubSection "Display"
+ EndSubSection
+EndSection
+
+# Primary (First/only) display
+Section "Device"
+ Identifier "IntelEMGD-0"
+ Driver "emgd"
+ VendorName "Intel(R) DEG"
+ BoardName "Embedded Graphics"
+ BusID "0:2:0"
+ Screen 0
+ Option "PcfVersion" "1792"
+ Option "ConfigId" "1"
+ Option "ALL/1/name" "e6xx"
+ Option "ALL/1/General/PortOrder" "24000"
+ Option "ALL/1/General/DisplayConfig" "1"
+ Option "ALL/1/General/DisplayDetect" "1"
+ Option "ALL/1/General/TuningWA" "1"
+ Option "ALL/1/Port/4/General/name" "lvds"
+ Option "ALL/1/Port/4/General/EdidAvail" "3"
+ Option "ALL/1/Port/4/General/EdidNotAvail" "1"
+ Option "ALL/1/Port/4/General/Rotation" "0"
+ Option "ALL/1/Port/4/General/Edid" "0"
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen 0 "Screen0" 0 0
+ # InputDevice "Mouse0" "CorePointer"
+ # InputDevice "Keyboard0" "CoreKeyboard"
+ # InputDevice "DevInputMice" "SendCoreEvents"
+EndSection
+
+Section "ServerFlags"
+ Option "DontZap" "0"
+ Option "AutoAddDevices" "False"
+EndSection
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
new file mode 100644
index 0000000..96b94b4
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
@@ -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
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
new file mode 100644
index 0000000..da4fc3c
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
@@ -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
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
new file mode 100644
index 0000000..4b8d0e6
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
@@ -0,0 +1,3 @@
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
+
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..9fb8002
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..28c353b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -0,0 +1,8 @@
+define KMACHINE {{=machine}}
+define KTYPE standard
+define KARCH i386
+
+include ktypes/standard
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..e93c0b8
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg
@@ -0,0 +1,54 @@
+CONFIG_X86_32=y
+CONFIG_MATOM=y
+CONFIG_PRINTK=y
+
+# Basic hardware support for the box - network, USB, PCI, sound
+CONFIG_NETDEVICES=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_SFF=y
+CONFIG_PCI=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_R8169=y
+CONFIG_PATA_SCH=y
+CONFIG_MMC_SDHCI_PCI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_NET=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_HDA_INTEL=y
+CONFIG_SATA_AHCI=y
+CONFIG_AGP=y
+CONFIG_PM=y
+CONFIG_ACPI=y
+CONFIG_BACKLIGHT_LCD_SUPPORT=y
+CONFIG_BACKLIGHT_CLASS_DEVICE=y
+CONFIG_INPUT=y
+
+# Make sure these are on, otherwise the bootup won't be fun
+CONFIG_EXT3_FS=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_MODULES=y
+CONFIG_SHMEM=y
+CONFIG_TMPFS=y
+CONFIG_PACKET=y
+
+# Needed for booting (and using) USB memory sticks
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+
+CONFIG_RD_GZIP=y
+
+# Needed for booting (and using) CD images
+CONFIG_BLK_DEV_SR=y
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..325f8c8
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" "b/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 mode 100644
index 0000000..fa0b60e
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" "b/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 mode 100644
index 0000000..df9fe6f
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
new file mode 100644
index 0000000..ce980a6
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
new file mode 100644
index 0000000..14af437
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/.gitignore b/scripts/lib/bsp/substrate/target/arch/mips/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..4acfa41
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..792c4d5
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..c6139f0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -0,0 +1,8 @@
+define KMACHINE {{=machine}}
+define KTYPE standard
+define KARCH mips
+
+include ktypes/standard
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..a1b333c
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg
@@ -0,0 +1 @@
+CONFIG_MIPS=y
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..7d29541
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc
@@ -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
+
diff --git a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" "b/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 mode 100644
index 0000000..fa0b60e
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" "b/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 mode 100644
index 0000000..df9fe6f
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
new file mode 100644
index 0000000..482d521
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
new file mode 100644
index 0000000..2f6db36
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore b/scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..84d0cda
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
@@ -0,0 +1,53 @@
+#@TYPE: Machine
+#@NAME: {{=machine}}
+
+#@DESCRIPTION: Machine configuration for {{=machine}} systems
+
+TARGET_FPU = ""
+
+{{ input type:"choicelist" name:"tunefile" prio:"40" msg:"Which machine tuning would you like to use?" default:"tune_ppc603e" }}
+{{ input type:"choice" val:"tune_ppc603e" msg:"ppc603e tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce300c2" msg:"ppce300c2 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500" msg:"ppce500 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500mc" msg:"ppce500mc tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce500v2" msg:"ppce500v2 tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce5500_32b" msg:"ppce5500-32b tuning optimizations" }}
+{{ input type:"choice" val:"tune_ppce5500_64b" msg:"ppce5500-64b tuning optimizations" }}
+{{ if tunefile == "tune_ppc603e": }}
+include conf/machine/include/tune-ppc603e.inc
+{{ if tunefile == "tune_ppce300c2": }}
+include conf/machine/include/tune-ppce300c2.inc
+{{ if tunefile == "tune_ppce500": }}
+include conf/machine/include/tune-ppce500.inc
+{{ if tunefile == "tune_ppce500mc": }}
+include conf/machine/include/tune-ppce500mc.inc
+{{ if tunefile == "tune_ppce500v2": }}
+include conf/machine/include/tune-ppce500v2.inc
+{{ if tunefile == "tune_ppce5500_32b": }}
+include conf/machine/include/tune-ppce5500-32b.inc
+{{ if tunefile == "tune_ppce5500_64b": }}
+include conf/machine/include/tune-ppce5500-64b.inc
+
+KERNEL_IMAGETYPE = "uImage"
+
+SERIAL_CONSOLE = "115200 ttyS0"
+
+MACHINE_FEATURES = "kernel26 keyboard pci ext2 ext3 serial"
+
+{{ 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"
+
+{{ input type:"edit" name:"uboot_entrypoint" prio:"40" msg:"Please specify a value for UBOOT_ENTRYPOINT." default:"0x00000000" }}
+UBOOT_ENTRYPOINT = "{{=uboot_entrypoint}}"
+
+{{ input type:"edit" name:"kernel_devicetree" prio:"40" msg:"Please specify a [arch/powerpc/boot/dts/xxx] value for KERNEL_DEVICETREE." default:"mpc8315erdb.dts" }}
+KERNEL_DEVICETREE = "${S}/arch/powerpc/boot/dts/{{=kernel_devicetree}}"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..2ee921b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg
@@ -0,0 +1,4 @@
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_SCHED_TRACER=y
+CONFIG_IRQSOFF_TRACER=y
+CONFIG_PREEMPT_TRACER=y
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..4a182a3
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..1213e61
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -0,0 +1,8 @@
+define KMACHINE {{=machine}}
+define KTYPE standard
+define KARCH powerpc
+
+include ktypes/standard
+branch {{=machine}}
+
+include {{=machine}}.scc
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..9f37d07
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg
@@ -0,0 +1,163 @@
+..........................................................................
+. WARNING
+.
+. This file is a kernel configuration fragment, and not a full kernel
+. configuration file. The final kernel configuration is made up of
+. an assembly of processed fragments, each of which is designed to
+. capture a specific part of the final configuration (e.g. platform
+. configuration, feature configuration, and board specific hardware
+. configuration). For more information on kernel configuration, please
+. consult the product documentation.
+.
+..........................................................................
+CONFIG_PPC32=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+
+#
+# Processor support
+#
+CONFIG_PPC_83xx=y
+
+#
+# Platform support
+#
+CONFIG_MPC831x_RDB=y
+# CONFIG_PPC_CHRP is not set
+# CONFIG_PPC_PMAC is not set
+
+#
+# Bus options
+#
+CONFIG_PCI=y
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+CONFIG_MTD_PARTITIONS=y
+CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_OF_PARTS=y
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_CFI_AMDSTD=y
+
+#
+# Mapping drivers for chip access
+#
+CONFIG_MTD_PHYSMAP_OF=y
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+
+#
+# Ethernet (1000 Mbit)
+#
+CONFIG_GIANFAR=y
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=2
+
+#
+# Watchdog Device Drivers
+#
+CONFIG_8xxx_WDT=y
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Hardware Bus support
+#
+CONFIG_I2C_MPC=y
+
+CONFIG_SENSORS_LM75=y
+
+CONFIG_MISC_DEVICES=y
+
+#
+# Miscellaneous I2C Chip support
+#
+CONFIG_EEPROM_AT24=y
+
+#
+# SPI support
+#
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+CONFIG_SPI_MPC8xxx=y
+
+#
+# SPI Protocol Masters
+#
+CONFIG_HWMON=y
+
+#
+# SCSI device support
+#
+CONFIG_SCSI=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SCSI_LOGGING=y
+
+CONFIG_ATA=y
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_SATA_FSL=y
+CONFIG_ATA_SFF=y
+
+#
+# USB support
+#
+CONFIG_USB=m
+CONFIG_USB_DEVICEFS=y
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=m
+CONFIG_USB_EHCI_FSL=y
+CONFIG_USB_STORAGE=m
+
+#
+# Real Time Clock
+#
+CONFIG_RTC_CLASS=y
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+
+CONFIG_KGDB_8250=m
+
+CONFIG_CRYPTO_DEV_TALITOS=m
+
+CONFIG_FSL_DMA=y
+
+CONFIG_MMC=y
+CONFIG_MMC_SPI=m
+
+CONFIG_USB_FSL_MPH_DR_OF=y
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..17d5033
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" "b/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 mode 100644
index 0000000..fa0b60e
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" "b/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 mode 100644
index 0000000..df9fe6f
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
new file mode 100644
index 0000000..482d521
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
new file mode 100644
index 0000000..2f6db36
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..b8d00db
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
@@ -0,0 +1,59 @@
+#@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}}%"
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+
+{{ input type:"choicelist" name:"qemuarch" prio:"5" msg:"Which qemu architecture would you like to use?" default:"x86" }}
+{{ input type:"choice" val:"x86" msg:"common 32-bit x86" }}
+{{ input type:"choice" val:"x86_64" msg:"common 64-bit x86" }}
+{{ input type:"choice" val:"arm" msg:"common 32-bit ARM" }}
+{{ input type:"choice" val:"powerpc" msg:"common 32-bit PowerPC" }}
+{{ input type:"choice" val:"mips" msg:"common 32-bit MIPS" }}
+{{ if qemuarch == "x86": }}
+require conf/machine/include/tune-i586.inc
+{{ if qemuarch == "x86_64": }}
+require conf/machine/include/tune-i586.inc
+{{ if qemuarch == "arm": }}
+require conf/machine/include/tune-arm926ejs.inc
+{{ if qemuarch == "powerpc": }}
+require conf/machine/include/tune-ppc603e.inc
+{{ if qemuarch == "mips": }}
+require conf/machine/include/tune-mips32.inc
+
+require conf/machine/include/qemu.inc
+
+{{ if qemuarch == "x86" or qemuarch == "x86_64": }}
+MACHINE_FEATURES += "x86"
+KERNEL_IMAGETYPE = "bzImage"
+SERIAL_CONSOLE = "115200 ttyS0"
+# We bypass swrast but we need it to be present for X to load correctly
+XSERVER ?= "xserver-xorg \
+ mesa-dri-driver-swrast \
+ xf86-input-vmmouse \
+ xf86-input-keyboard \
+ xf86-input-evdev \
+ xf86-video-vmware \
+ qemugl"
+GLIBC_ADDONS = "nptl"
+GLIBC_EXTRA_OECONF = "--with-tls"
+
+{{ if qemuarch == "arm": }}
+KERNEL_IMAGETYPE = "zImage"
+SERIAL_CONSOLE = "115200 ttyAMA0"
+
+{{ if qemuarch == "powerpc": }}
+KERNEL_IMAGETYPE = "vmlinux"
+SERIAL_CONSOLE = "115200 ttyS0"
+
+{{ if qemuarch == "mips": }}
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+SERIAL_CONSOLE = "115200 ttyS0"
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf
new file mode 100644
index 0000000..10a6d9a
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "evdev"
+ Option "CoreKeyboard"
+ Option "Device" "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "evdev"
+ Option "XkbLayout" "us"
+EndSection
+
+Section "InputDevice"
+ Identifier "Configured Mouse"
+ Driver "vmmouse"
+ Option "CorePointer"
+ Option "Device" "/dev/input/mice"
+ Option "Protocol" "ImPS/2"
+ Option "ZAxisMapping" "4 5"
+ Option "Emulate3Buttons" "true"
+EndSection
+
+Section "InputDevice"
+ Identifier "Qemu Tablet"
+ Driver "evdev"
+ Option "CorePointer"
+ Option "Device" "/dev/input/touchscreen0"
+ Option "USB" "on"
+EndSection
+
+Section "Device"
+ Identifier "Graphics Controller"
+ Driver "vmware"
+EndSection
+
+Section "Monitor"
+ Identifier "Generic Monitor"
+ Option "DPMS"
+ # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+ Modeline "1024x600_60.00" 49.00 1024 1072 1168 1312 600 603 613 624 -hsync +vsync
+ # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+ ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
+ # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+ ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -hsync -vsync
+ # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+ ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -hsync -vsync
+ # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+ ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -hsync -vsync
+EndSection
+
+Section "Screen"
+ Identifier "Default Screen"
+ Device "Graphics Controller"
+ Monitor "Generic Monitor"
+ SubSection "Display"
+ Modes "640x480"
+ EndSubSection
+EndSection
+
+Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ InputDevice "Generic Keyboard"
+ # InputDevice "Configured Mouse"
+ InputDevice "QEMU Tablet"
+ Option "AllowEmptyInput" "no"
+EndSection
diff --git "a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend" "b/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 mode 100644
index 0000000..d3420e0
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/{{ if qemuarch == \"x86\" or qemuarch == \"x86_64\": }} xserver-xf86-config_0.1.bbappend"
@@ -0,0 +1,2 @@
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..2ee921b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg
@@ -0,0 +1,4 @@
+CONFIG_FTRACE_SYSCALLS=y
+CONFIG_SCHED_TRACER=y
+CONFIG_IRQSOFF_TRACER=y
+CONFIG_PREEMPT_TRACER=y
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..3794d1b
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..31d1166
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..e301b22
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc
@@ -0,0 +1,6 @@
+kconf hardware {{=machine}}.cfg
+
+include features/logbuf/size-normal.scc
+
+kconf hardware user-config.cfg
+include user-patches.scc
diff --git a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend" "b/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 mode 100644
index 0000000..670ff05
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.0\": }} linux-yocto-rt_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend" "b/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 mode 100644
index 0000000..8bf4e69
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.2\": }} linux-yocto-rt_3.2.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
new file mode 100644
index 0000000..ad2a003
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
new file mode 100644
index 0000000..3266c97
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore b/scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf
new file mode 100644
index 0000000..480e3a7
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf" "b/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 mode 100644
index 0000000..96b94b4
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_i915\": }} xorg.conf"
@@ -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
diff --git "a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf" "b/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 mode 100644
index 0000000..da4fc3c
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver_choice == \"xserver_vesa\": }} xorg.conf"
@@ -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
diff --git "a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
new file mode 100644
index 0000000..4b8d0e6
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend"
@@ -0,0 +1,3 @@
+THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
+FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
+
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc
new file mode 100644
index 0000000..e69de29
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
new file mode 100644
index 0000000..ecb0f01
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc
new file mode 100644
index 0000000..2a32fea
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg
new file mode 100644
index 0000000..b4b82d7
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg
@@ -0,0 +1,47 @@
+CONFIG_PRINTK=y
+
+# Basic hardware support for the box - network, USB, PCI, sound
+CONFIG_NETDEVICES=y
+CONFIG_ATA=y
+CONFIG_ATA_GENERIC=y
+CONFIG_ATA_SFF=y
+CONFIG_PCI=y
+CONFIG_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_R8169=y
+CONFIG_PATA_SCH=y
+CONFIG_MMC_SDHCI_PCI=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_NET=y
+CONFIG_USB_UHCI_HCD=y
+CONFIG_BLK_DEV_SD=y
+CONFIG_CHR_DEV_SG=y
+CONFIG_SOUND=y
+CONFIG_SND=y
+CONFIG_SND_HDA_INTEL=y
+
+# Make sure these are on, otherwise the bootup won't be fun
+CONFIG_EXT3_FS=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_MODULES=y
+CONFIG_SHMEM=y
+CONFIG_TMPFS=y
+CONFIG_PACKET=y
+
+CONFIG_I2C=y
+CONFIG_AGP=y
+CONFIG_PM=y
+CONFIG_ACPI=y
+CONFIG_INPUT=y
+
+# Needed for booting (and using) USB memory sticks
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_ISO8859_1=y
+
+CONFIG_RD_GZIP=y
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc
new file mode 100644
index 0000000..35541f5
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc
@@ -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
diff --git a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..32454a0
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall
@@ -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"}}
+
diff --git "a/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" "b/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 mode 100644
index 0000000..fa0b60e
--- /dev/null
+++ "b/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"
@@ -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"
diff --git "a/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" "b/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 mode 100644
index 0000000..df9fe6f
--- /dev/null
+++ "b/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"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend" "b/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 mode 100644
index 0000000..9932a6a
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.0\": }} linux-yocto_3.0.bbappend"
@@ -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"
diff --git "a/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend" "b/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 mode 100644
index 0000000..3a1997e
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.2\": }} linux-yocto_3.2.bbappend"
@@ -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"
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 1/8] yocto-bsp: add BSP template files
2012-03-02 7:01 ` [PATCH 1/8] yocto-bsp: add BSP template files tom.zanussi
@ 2012-03-02 16:35 ` Darren Hart
2012-03-02 17:19 ` Tom Zanussi
0 siblings, 1 reply; 24+ messages in thread
From: Darren Hart @ 2012-03-02 16:35 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> BSP template files for all supported Yocto architectures, plus qemu
> versions of the same.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> .../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(-)
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...
...
> diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
> new file mode 100644
> index 0000000..361343b
> --- /dev/null
> +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
> @@ -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
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.
> diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
> new file mode 100644
> index 0000000..994e034
> --- /dev/null
> +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
> @@ -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>
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 1/8] yocto-bsp: add BSP template files
2012-03-02 16:35 ` Darren Hart
@ 2012-03-02 17:19 ` Tom Zanussi
0 siblings, 0 replies; 24+ messages in thread
From: Tom Zanussi @ 2012-03-02 17:19 UTC (permalink / raw)
To: Darren Hart; +Cc: yocto
On Fri, 2012-03-02 at 08:35 -0800, Darren Hart wrote:
>
> On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi <tom.zanussi@intel.com>
> >
> > BSP template files for all supported Yocto architectures, plus qemu
> > versions of the same.
> >
> > Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> > ---
> > .../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(-)
>
>
> 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.
> A few comments inline below...
>
> ...
>
> > diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
> > new file mode 100644
> > index 0000000..361343b
> > --- /dev/null
> > +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
> > @@ -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
>
>
> 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.
>
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.
> > diff --git a/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
> > new file mode 100644
> > index 0000000..994e034
> > --- /dev/null
> > +++ b/scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
> > @@ -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.
>
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
>
> Comments would be basically the same from here on down...
>
> <snip>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 2/8] yocto-bsp-tools: add bsp library
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
2012-03-02 7:01 ` [PATCH 1/8] yocto-bsp: add BSP template files tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 16:41 ` Darren Hart
2012-03-02 7:01 ` [PATCH 3/8] yocto-bsp: add templating engine tom.zanussi
` (6 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
Create a home for the yocto bsp tools.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/__init__.py | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/__init__.py
diff --git a/scripts/lib/bsp/__init__.py b/scripts/lib/bsp/__init__.py
new file mode 100644
index 0000000..978c2e4
--- /dev/null
+++ b/scripts/lib/bsp/__init__.py
@@ -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.
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 2/8] yocto-bsp-tools: add bsp library
2012-03-02 7:01 ` [PATCH 2/8] yocto-bsp-tools: add bsp library tom.zanussi
@ 2012-03-02 16:41 ` Darren Hart
0 siblings, 0 replies; 24+ messages in thread
From: Darren Hart @ 2012-03-02 16:41 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
Responded privately to Tom on this one...
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> Create a home for the yocto bsp tools.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> scripts/lib/bsp/__init__.py | 17 +++++++++++++++++
> 1 files changed, 17 insertions(+), 0 deletions(-)
> create mode 100644 scripts/lib/bsp/__init__.py
>
> diff --git a/scripts/lib/bsp/__init__.py b/scripts/lib/bsp/__init__.py
> new file mode 100644
> index 0000000..978c2e4
> --- /dev/null
> +++ b/scripts/lib/bsp/__init__.py
> @@ -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.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 3/8] yocto-bsp: add templating engine
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
2012-03-02 7:01 ` [PATCH 1/8] yocto-bsp: add BSP template files tom.zanussi
2012-03-02 7:01 ` [PATCH 2/8] yocto-bsp-tools: add bsp library tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 16:57 ` Darren Hart
2012-03-02 7:01 ` [PATCH 4/8] yocto-bsp: add kernel interface tom.zanussi
` (5 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
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 <tom.zanussi@intel.com>
---
scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1336 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/engine.py
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
new file mode 100644
index 0000000..7bf3e92
--- /dev/null
+++ b/scripts/lib/bsp/engine.py
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+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
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 3/8] yocto-bsp: add templating engine
2012-03-02 7:01 ` [PATCH 3/8] yocto-bsp: add templating engine tom.zanussi
@ 2012-03-02 16:57 ` Darren Hart
2012-03-02 17:22 ` Tom Zanussi
0 siblings, 1 reply; 24+ messages in thread
From: Darren Hart @ 2012-03-02 16:57 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> 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 <tom.zanussi@intel.com>
> ---
> scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 1336 insertions(+), 0 deletions(-)
> create mode 100644 scripts/lib/bsp/engine.py
>
> diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
> new file mode 100644
> index 0000000..7bf3e92
> --- /dev/null
> +++ b/scripts/lib/bsp/engine.py
> @@ -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 <tom.zanussi@intel.com>
same comments here...
> +#
> +# 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
> +
This looks like a healthy list of dependencies. Do we need to augment
the required packages list?
> +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.
> +
> + 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))
> +
Very nicely pythonic Tom. Classes, PyDoc, decorators, exceptions. Nice work!
> +
> +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"""
Nitpic, initial caps and period.
> + 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"""
Nitpic, initial caps and period.
> + 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.
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!
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 3/8] yocto-bsp: add templating engine
2012-03-02 16:57 ` Darren Hart
@ 2012-03-02 17:22 ` Tom Zanussi
0 siblings, 0 replies; 24+ messages in thread
From: Tom Zanussi @ 2012-03-02 17:22 UTC (permalink / raw)
To: Darren Hart; +Cc: yocto
On Fri, 2012-03-02 at 08:57 -0800, Darren Hart wrote:
>
> On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi <tom.zanussi@intel.com>
> >
> > 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 <tom.zanussi@intel.com>
> > ---
> > scripts/lib/bsp/engine.py | 1336 +++++++++++++++++++++++++++++++++++++++++++++
> > 1 files changed, 1336 insertions(+), 0 deletions(-)
> > create mode 100644 scripts/lib/bsp/engine.py
> >
> > diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
> > new file mode 100644
> > index 0000000..7bf3e92
> > --- /dev/null
> > +++ b/scripts/lib/bsp/engine.py
> > @@ -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 <tom.zanussi@intel.com>
>
> same comments here...
>
> > +#
> > +# 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
> > +
>
>
> 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.
>
> > +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.
>
> > +
> > + 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))
> > +
>
>
> 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. ;-)
> > +
> > +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"""
>
> Nitpic, initial caps and period.
>
> > + 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"""
>
> Nitpic, initial caps and period.
>
> > + 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.
>
> 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!
>
Thanks for the comments,
Tom
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 4/8] yocto-bsp: add kernel interface
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (2 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 3/8] yocto-bsp: add templating engine tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 17:11 ` Darren Hart
2012-03-02 7:01 ` [PATCH 5/8] yocto-bsp-tools: add help/usage tom.zanussi
` (4 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
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 <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 679 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/kernel.py
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
new file mode 100644
index 0000000..1b88b2f
--- /dev/null
+++ b/scripts/lib/bsp/kernel.py
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+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
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 4/8] yocto-bsp: add kernel interface
2012-03-02 7:01 ` [PATCH 4/8] yocto-bsp: add kernel interface tom.zanussi
@ 2012-03-02 17:11 ` Darren Hart
2012-03-02 17:34 ` Tom Zanussi
0 siblings, 1 reply; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:11 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> 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 <tom.zanussi@intel.com>
> ---
> scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 679 insertions(+), 0 deletions(-)
> create mode 100644 scripts/lib/bsp/kernel.py
>
> diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
> new file mode 100644
> index 0000000..1b88b2f
> --- /dev/null
> +++ b/scripts/lib/bsp/kernel.py
> @@ -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 <tom.zanussi@intel.com>
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License version 2 as
> +# published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License along
> +# with this program; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> +
> +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)
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.
> + 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
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...
> +
> +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)
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.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 4/8] yocto-bsp: add kernel interface
2012-03-02 17:11 ` Darren Hart
@ 2012-03-02 17:34 ` Tom Zanussi
0 siblings, 0 replies; 24+ messages in thread
From: Tom Zanussi @ 2012-03-02 17:34 UTC (permalink / raw)
To: Darren Hart; +Cc: yocto
On Fri, 2012-03-02 at 09:11 -0800, Darren Hart wrote:
>
> On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi <tom.zanussi@intel.com>
> >
> > 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 <tom.zanussi@intel.com>
> > ---
> > scripts/lib/bsp/kernel.py | 679 +++++++++++++++++++++++++++++++++++++++++++++
> > 1 files changed, 679 insertions(+), 0 deletions(-)
> > create mode 100644 scripts/lib/bsp/kernel.py
> >
> > diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
> > new file mode 100644
> > index 0000000..1b88b2f
> > --- /dev/null
> > +++ b/scripts/lib/bsp/kernel.py
> > @@ -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 <tom.zanussi@intel.com>
> > +#
> > +# This program is free software; you can redistribute it and/or modify
> > +# it under the terms of the GNU General Public License version 2 as
> > +# published by the Free Software Foundation.
> > +#
> > +# This program is distributed in the hope that it will be useful,
> > +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > +# GNU General Public License for more details.
> > +#
> > +# You should have received a copy of the GNU General Public License along
> > +# with this program; if not, write to the Free Software Foundation, Inc.,
> > +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> > +
> > +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)
>
>
> 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.
>
> > + 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
>
> 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...
>
Yeah, good suggestion - makes a lot of sense to me - I'll see what I can
do to leverage that work.
>
> > +
> > +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)
>
> 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
> The rest looks good to me.
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 5/8] yocto-bsp-tools: add help/usage
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (3 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 4/8] yocto-bsp: add kernel interface tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 17:17 ` Darren Hart
2012-03-02 7:01 ` [PATCH 6/8] yocto-bsp: add some useful constants tom.zanussi
` (3 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
This is essentially 'the documentation' for the Yocto BSP tools, along
with a few related functions.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/help.py | 588 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 588 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/help.py
diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py
new file mode 100644
index 0000000..c7c6e6a
--- /dev/null
+++ b/scripts/lib/bsp/help.py
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+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',
+}
+
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 5/8] yocto-bsp-tools: add help/usage
2012-03-02 7:01 ` [PATCH 5/8] yocto-bsp-tools: add help/usage tom.zanussi
@ 2012-03-02 17:17 ` Darren Hart
0 siblings, 0 replies; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:17 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> This is essentially 'the documentation' for the Yocto BSP tools, along
> with a few related functions.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> scripts/lib/bsp/help.py | 588 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 588 insertions(+), 0 deletions(-)
> create mode 100644 scripts/lib/bsp/help.py
>
> diff --git a/scripts/lib/bsp/help.py b/scripts/lib/bsp/help.py
> new file mode 100644
> index 0000000..c7c6e6a
> --- /dev/null
> +++ b/scripts/lib/bsp/help.py
> @@ -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 <tom.zanussi@intel.com>
Same comment here...
Otherwise, all looks very nice.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 6/8] yocto-bsp: add some useful constants
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (4 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 5/8] yocto-bsp-tools: add help/usage tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 17:18 ` Darren Hart
2012-03-02 7:01 ` [PATCH 7/8] yocto-bsp: new script tom.zanussi
` (2 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
Some constants used by the templating engine.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/tags.py | 39 +++++++++++++++++++++++++++++++++++++++
1 files changed, 39 insertions(+), 0 deletions(-)
create mode 100644 scripts/lib/bsp/tags.py
diff --git a/scripts/lib/bsp/tags.py b/scripts/lib/bsp/tags.py
new file mode 100644
index 0000000..99b5785
--- /dev/null
+++ b/scripts/lib/bsp/tags.py
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+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://"
+
+
+
+
+
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 6/8] yocto-bsp: add some useful constants
2012-03-02 7:01 ` [PATCH 6/8] yocto-bsp: add some useful constants tom.zanussi
@ 2012-03-02 17:18 ` Darren Hart
0 siblings, 0 replies; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:18 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> Some constants used by the templating engine.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> scripts/lib/bsp/tags.py | 39 +++++++++++++++++++++++++++++++++++++++
> 1 files changed, 39 insertions(+), 0 deletions(-)
> create mode 100644 scripts/lib/bsp/tags.py
>
> diff --git a/scripts/lib/bsp/tags.py b/scripts/lib/bsp/tags.py
> new file mode 100644
> index 0000000..99b5785
> --- /dev/null
> +++ b/scripts/lib/bsp/tags.py
> @@ -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 <tom.zanussi@intel.com>
same comment..
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 7/8] yocto-bsp: new script
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (5 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 6/8] yocto-bsp: add some useful constants tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 17:20 ` Darren Hart
2012-03-02 7:01 ` [PATCH 8/8] yocto-kernel: " tom.zanussi
2012-03-02 16:24 ` [PATCH 0/8] Yocto BSP tools Darren Hart
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
Implementation of the 'yocto-bsp' command-line tool, for creating BSPs
and listing BSP properties.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/yocto-bsp | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 131 insertions(+), 0 deletions(-)
create mode 100755 scripts/yocto-bsp
diff --git a/scripts/yocto-bsp b/scripts/yocto-bsp
new file mode 100755
index 0000000..20fa89d
--- /dev/null
+++ b/scripts/yocto-bsp
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+__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)
+
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 7/8] yocto-bsp: new script
2012-03-02 7:01 ` [PATCH 7/8] yocto-bsp: new script tom.zanussi
@ 2012-03-02 17:20 ` Darren Hart
0 siblings, 0 replies; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:20 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> Implementation of the 'yocto-bsp' command-line tool, for creating BSPs
> and listing BSP properties.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> scripts/yocto-bsp | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 131 insertions(+), 0 deletions(-)
> create mode 100755 scripts/yocto-bsp
>
> diff --git a/scripts/yocto-bsp b/scripts/yocto-bsp
> new file mode 100755
> index 0000000..20fa89d
> --- /dev/null
> +++ b/scripts/yocto-bsp
> @@ -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 <tom.zanussi@intel.com>
> +#
same comment...
...
> +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)
I see sys.exit() below and just exit() here, and above you "import sys",
so I believe this should also be sys.exit()
...
> +if __name__ == "__main__":
> + try:
> + ret = main()
> + except Exception:
> + ret = 1
> + import traceback
> + traceback.print_exc(5)
> + sys.exit(ret)
> +
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread
* [PATCH 8/8] yocto-kernel: new script
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (6 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 7/8] yocto-bsp: new script tom.zanussi
@ 2012-03-02 7:01 ` tom.zanussi
2012-03-02 17:23 ` Darren Hart
2012-03-02 16:24 ` [PATCH 0/8] Yocto BSP tools Darren Hart
8 siblings, 1 reply; 24+ messages in thread
From: tom.zanussi @ 2012-03-02 7:01 UTC (permalink / raw)
To: yocto
From: Tom Zanussi <tom.zanussi@intel.com>
Implementation of the 'yocto-kernel' command-line tool, for modifying
the kernel portion of a Yocto BSP.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 219 insertions(+), 0 deletions(-)
create mode 100755 scripts/yocto-kernel
diff --git a/scripts/yocto-kernel b/scripts/yocto-kernel
new file mode 100755
index 0000000..97a7a7c
--- /dev/null
+++ b/scripts/yocto-kernel
@@ -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 <tom.zanussi@intel.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+__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)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 8/8] yocto-kernel: new script
2012-03-02 7:01 ` [PATCH 8/8] yocto-kernel: " tom.zanussi
@ 2012-03-02 17:23 ` Darren Hart
2012-03-02 17:27 ` Tom Zanussi
0 siblings, 1 reply; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:23 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> Implementation of the 'yocto-kernel' command-line tool, for modifying
> the kernel portion of a Yocto BSP.
>
> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> ---
> scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 219 insertions(+), 0 deletions(-)
> create mode 100755 scripts/yocto-kernel
>
> diff --git a/scripts/yocto-kernel b/scripts/yocto-kernel
> new file mode 100755
> index 0000000..97a7a7c
> --- /dev/null
> +++ b/scripts/yocto-kernel
> @@ -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 <tom.zanussi@intel.com>
same comment...
> +#
> +# 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)
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.
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 8/8] yocto-kernel: new script
2012-03-02 17:23 ` Darren Hart
@ 2012-03-02 17:27 ` Tom Zanussi
0 siblings, 0 replies; 24+ messages in thread
From: Tom Zanussi @ 2012-03-02 17:27 UTC (permalink / raw)
To: Darren Hart; +Cc: yocto
On Fri, 2012-03-02 at 09:23 -0800, Darren Hart wrote:
>
> On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi <tom.zanussi@intel.com>
> >
> > Implementation of the 'yocto-kernel' command-line tool, for modifying
> > the kernel portion of a Yocto BSP.
> >
> > Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
> > ---
> > scripts/yocto-kernel | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++
> > 1 files changed, 219 insertions(+), 0 deletions(-)
> > create mode 100755 scripts/yocto-kernel
> >
> > diff --git a/scripts/yocto-kernel b/scripts/yocto-kernel
> > new file mode 100755
> > index 0000000..97a7a7c
> > --- /dev/null
> > +++ b/scripts/yocto-kernel
> > @@ -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 <tom.zanussi@intel.com>
>
> same comment...
>
> > +#
> > +# 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)
>
>
> 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.
> 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
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 0/8] Yocto BSP tools
2012-03-02 7:01 [PATCH 0/8] Yocto BSP tools tom.zanussi
` (7 preceding siblings ...)
2012-03-02 7:01 ` [PATCH 8/8] yocto-kernel: " tom.zanussi
@ 2012-03-02 16:24 ` Darren Hart
2012-03-02 17:02 ` Tom Zanussi
8 siblings, 1 reply; 24+ messages in thread
From: Darren Hart @ 2012-03-02 16:24 UTC (permalink / raw)
To: tom.zanussi; +Cc: yocto
On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> From: Tom Zanussi <tom.zanussi@intel.com>
>
> 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)
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.
>
> - 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
>
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.
> 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
> qemu
>
> The '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)
You mentioned default value being in [] square brackets. Here it appears
to be the Capital Y..
> 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.
> 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".
> 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)
Same default consistency comments.
> 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
Oh very cool!
> Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] n
defaults...
> 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?
> 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
>
defaults...
--
Darren
>
> 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-kernel
>
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 0/8] Yocto BSP tools
2012-03-02 16:24 ` [PATCH 0/8] Yocto BSP tools Darren Hart
@ 2012-03-02 17:02 ` Tom Zanussi
2012-03-02 17:15 ` Darren Hart
0 siblings, 1 reply; 24+ messages in thread
From: Tom Zanussi @ 2012-03-02 17:02 UTC (permalink / raw)
To: Darren Hart; +Cc: yocto
On Fri, 2012-03-02 at 08:24 -0800, Darren Hart wrote:
>
> On 03/01/2012 11:01 PM, tom.zanussi@intel.com wrote:
> > From: Tom Zanussi <tom.zanussi@intel.com>
> >
> > 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)
>
> 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.
> >
> > - 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
> >
>
> 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.
>
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.
> > 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
> > qemu
> >
> > The '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)
>
>
> You mentioned default value being in [] square brackets. Here it appears
> to be the Capital Y..
>
> > 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...
> > 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.
> 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.
> > 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)
>
> Same default consistency comments.
>
> > 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
>
>
> Oh very cool!
>
> > Do you need a new machine branch for this BSP (the alternative is to re-use an existing branch)? [Y/n] n
>
>
> defaults...
>
> > 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.
> > 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
> >
>
> defaults...
>
Thanks for the comments!
Tom
> --
> Darren
>
> >
> > 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-kernel
> >
> > _______________________________________________
> > yocto mailing list
> > yocto@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/yocto
>
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 0/8] Yocto BSP tools
2012-03-02 17:02 ` Tom Zanussi
@ 2012-03-02 17:15 ` Darren Hart
0 siblings, 0 replies; 24+ messages in thread
From: Darren Hart @ 2012-03-02 17:15 UTC (permalink / raw)
To: Tom Zanussi; +Cc: yocto
On 03/02/2012 09:02 AM, Tom Zanussi wrote:
> On Fri, 2012-03-02 at 08:24 -0800, Darren Hart wrote:
>>> 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.
>>
>
> 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.
hah, I stand corrected :-)
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
^ permalink raw reply [flat|nested] 24+ messages in thread