* [PATCH 01/12] yocto-bsp: add custom kernel support
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 02/12] yocto-bsp: add 'custom' choice to kernels() tom.zanussi
` (10 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Add a template to support custom kernels via a custom kernel recipe
derived from linux-yocto-custom.bb.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
.../recipes-kernel/linux/kernel-list.noinstall | 26 ++++++++++
...choice == \"custom\": }} linux-yocto-custom.bb" | 57 ++++++++++++++++++++++
.../defconfig" | 4 ++
.../user-config.cfg" | 8 +++
.../user-patches.scc" | 8 +++
.../{{=machine}}.cfg" | 3 ++
.../{{=machine}}.scc" | 17 +++++++
7 files changed, 123 insertions(+)
create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom.bb"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-config.cfg"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-patches.scc"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.cfg"
create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.scc"
diff --git a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall
new file mode 100644
index 0000000..2c180cc
--- /dev/null
+++ b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall
@@ -0,0 +1,26 @@
+{{ if kernel_choice == "custom": }}
+{{ input type:"boolean" name:"custom_kernel_remote" prio:"20" msg:"Is the custom kernel you'd like to use in a remote git repo? (y/n)" default:"y"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "y": }}
+{{ input type:"edit-git-repo" name:"custom_kernel_remote_path" prio:"20" msg:"Please enter the full URI to the remote git repo (the default corresponds to linux-stable v3.4.21)" default:"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "n": }}
+{{ input type:"edit-git-repo" name:"custom_kernel_local_path" prio:"20" msg:"You've indicated that you're not using a remote git repo. Please enter the full path to the local git repo you want to use (the default assumes a local linux-stable v3.4.21)" default:"/home/trz/yocto/kernels/linux-stable.git"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"boolean" name:"custom_kernel_need_kbranch" prio:"20" msg:"Do you need to use a specific (non-master) branch? (y/n)" default:"n"}}
+
+{{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y": }}
+{{ input type:"edit" name:"custom_kernel_kbranch" prio:"20" msg:"Please enter the branch you want to use (the default branch corresponds to the linux-stable 'linux-3.4.y' branch):" default:"linux-3.4.y"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_srcrev" prio:"20" msg:"Please enter the SRCREV (commit id) you'd like to use (use '${AUTOREV}' to track the current HEAD):" default:"${AUTOREV}"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_linux_version" prio:"20" msg:"Please enter the Linux version of the kernel you've specified:" default:"3.4.21"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit" name:"custom_kernel_linux_version_extension" prio:"20" msg:"Please enter a Linux version extension if you want (it will show up at the end of the kernel name shown by uname):" default:"-custom"}}
+
+{{ if kernel_choice == "custom": }}
+{{ input type:"edit-file" name:"custom_kernel_defconfig" prio:"20" msg:"It's recommended (but not required) that custom kernels be built using a defconfig. Please enter the full path to the defconfig for your kernel (NOTE: if you don't specify a defconfig the kernel probably won't build or boot):" default:""}}
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom.bb" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom.bb"
new file mode 100644
index 0000000..5471c93
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom.bb"
@@ -0,0 +1,57 @@
+# This file was derived from the linux-yocto-custom.bb recipe in
+# oe-core.
+#
+# linux-yocto-custom.bb:
+#
+# A yocto-bsp-generated kernel recipe that uses the linux-yocto and
+# oe-core kernel classes to apply a subset of yocto kernel
+# management to git managed kernel repositories.
+#
+# Warning:
+#
+# Building this kernel without providing a defconfig or BSP
+# configuration will result in build or boot errors. This is not a
+# bug.
+#
+# Notes:
+#
+# patches: patches can be merged into to the source git tree itself,
+# added via the SRC_URI, or controlled via a BSP
+# configuration.
+#
+# example configuration addition:
+# SRC_URI += "file://smp.cfg"
+# example patch addition:
+# SRC_URI += "file://0001-linux-version-tweak.patch
+# example feature addition:
+# SRC_URI += "file://feature.scc"
+#
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+{{ if kernel_choice == "custom" and custom_kernel_remote == "y": }}
+SRC_URI = "{{=custom_kernel_remote_path}};protocol=git;bareclone=1"
+{{ if kernel_choice == "custom" and custom_kernel_remote == "n": }}
+SRC_URI = "git://{{=custom_kernel_local_path}};protocol=file;bareclone=1"
+
+SRC_URI += "file://defconfig"
+
+SRC_URI += "file://{{=machine}}.scc \
+ file://{{=machine}}.cfg \
+ file://user-config.cfg \
+ file://user-patches.scc \
+ "
+
+{{ if kernel_choice == "custom" and custom_kernel_need_kbranch == "y" and custom_kernel_kbranch and custom_kernel_kbranch != "master": }}
+KBRANCH = "{{=custom_kernel_kbranch}}"
+
+LINUX_VERSION ?= "{{=custom_kernel_linux_version}}"
+LINUX_VERSION_EXTENSION ?= "{{=custom_kernel_linux_version_extension}}"
+
+SRCREV="{{=custom_kernel_srcrev}}"
+
+PR = "r0"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+COMPATIBLE_MACHINE_{{=machine}} = "{{=machine}}"
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
new file mode 100644
index 0000000..c2745c5
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
@@ -0,0 +1,4 @@
+#
+# Placeholder for custom default kernel configuration. yocto-bsp will
+# replace this file with a user-specified defconfig.
+#
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-config.cfg" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-config.cfg"
new file mode 100644
index 0000000..17c8b50
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-config.cfg"
@@ -0,0 +1,8 @@
+#
+# Used by yocto-kernel to manage config options.
+#
+# yocto-kernel may change the contents of this file in any
+# way it sees fit, including removing comments like this,
+# so don't manually make any modifications you don't want
+# to lose.
+#
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-patches.scc" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-patches.scc"
new file mode 100644
index 0000000..7a598d9
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/user-patches.scc"
@@ -0,0 +1,8 @@
+#
+# Used by yocto-kernel to manage patches.
+#
+# yocto-kernel may change the contents of this file in any
+# way it sees fit, including removing comments like this,
+# so don't manually make any modifications you don't want
+# to lose.
+#
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.cfg" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.cfg"
new file mode 100644
index 0000000..95170b1
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.cfg"
@@ -0,0 +1,3 @@
+#
+# A convenient place to add config options, nothing more.
+#
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.scc" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.scc"
new file mode 100644
index 0000000..8b94e58
--- /dev/null
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.scc"
@@ -0,0 +1,17 @@
+#
+# The top-level 'feature' for the {{=machine}} custom kernel.
+#
+# Essentially this is a convenient top-level container or starting
+# point for adding lower-level config fragements and features.
+#
+
+# {{=machine}}.cfg in the linux-yocto-custom subdir is just a
+# convenient place for adding random config fragments.
+
+kconf hardware {{=machine}}.cfg
+
+# These are used by yocto-kernel to add config fragments and features.
+# Don't remove if you plan on using yocto-kernel with this BSP.
+
+kconf hardware user-config.cfg
+include user-patches.scc
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 02/12] yocto-bsp: add 'custom' choice to kernels()
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
2012-12-13 4:56 ` [PATCH 01/12] yocto-bsp: add custom kernel support tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 03/12] yocto-bsp: update existing templates for linux-yocto-custom tom.zanussi
` (9 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Add a synthetic choice for linux-yocto-custom to the list of available
kernels. Choosing this will lead the user down the path of options
needed to specify a custom kernel.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 128fad0..a953372 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -623,6 +623,8 @@ def kernels(context):
filename = filename[idx + len(CLOSE_TAG):].strip()
kernels.append(filename)
+ kernels.append("custom")
+
return kernels
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 03/12] yocto-bsp: update existing templates for linux-yocto-custom
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
2012-12-13 4:56 ` [PATCH 01/12] yocto-bsp: add custom kernel support tom.zanussi
2012-12-13 4:56 ` [PATCH 02/12] yocto-bsp: add 'custom' choice to kernels() tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 04/12] yocto-bsp: add 'edit-git-repo' input line tom.zanussi
` (8 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Update existing templates to integrate with linux-yocto-custom.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
.../target/arch/arm/conf/machine/{{=machine}}.conf | 9 +++++++--
.../arch/arm/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-non_hardware.cfg" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
.../target/arch/i386/conf/machine/{{=machine}}.conf | 16 +++++++++++++---
.../arch/i386/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
.../target/arch/mips/conf/machine/{{=machine}}.conf | 9 +++++++--
.../arch/mips/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
.../target/arch/powerpc/conf/machine/{{=machine}}.conf | 9 +++++++--
.../powerpc/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
.../target/arch/qemu/conf/machine/{{=machine}}.conf | 9 +++++++--
.../arch/qemu/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
.../target/arch/x86_64/conf/machine/{{=machine}}.conf | 9 +++++++--
.../x86_64/recipes-kernel/linux/kernel-list.noinstall | 3 ++-
.../user-config.cfg" | 0
.../user-patches.scc" | 0
.../{{=machine}}-preempt-rt.scc" | 0
.../{{=machine}}-standard.scc" | 0
.../{{=machine}}.cfg" | 0
.../{{=machine}}.scc" | 0
49 files changed, 60 insertions(+), 19 deletions(-)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-non_hardware.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" (100%)
rename scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc => "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" (100%)
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
index 1990ef6..d9ac3ff 100644
--- a/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
+++ b/scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf
@@ -70,8 +70,13 @@ EXTRA_IMAGECMD_jffs2 = "-lnp "
# earlier kernels use ttyS2
SERIAL_CONSOLE = "115200 ttyO2"
-{{ preferred_kernel = kernel_choice.split('_')[0] }}
-{{ preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-non_hardware.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-non_hardware.cfg
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-non_hardware.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
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
index 1da2306..86d6a53 100644
--- a/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
+++ b/scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf
@@ -3,8 +3,13 @@
#@DESCRIPTION: Machine configuration for {{=machine}} systems
-{{ preferred_kernel = kernel_choice.split('_')[0] }}
-{{ preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
@@ -31,7 +36,12 @@ require conf/machine/include/meta-intel.inc
{{ input type:"choice" val:"xserver_emgd" msg:"EMGD xserver support (proprietary)" }}
{{ input type:"choice" val:"xserver_i915" msg:"i915 xserver support" }}
-{{ if xserver == "y" and kernel_choice != "linux-yocto_3.4": xserver_choice = "xserver_i915" }}
+{{ if xserver == "y" and kernel_choice == "custom": }}
+{{ input type:"choicelist" name:"xserver_choice" prio:"50" msg:"Please select an xserver for this machine:" 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" and kernel_choice != "linux-yocto_3.4" and kernel_choice != "custom": xserver_choice = "xserver_i915" }}
{{ if xserver == "y": }}
XSERVER ?= "${XSERVER_IA32_BASE} \
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
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
index b7c86e8..4dd5940 100644
--- a/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
+++ b/scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf
@@ -10,8 +10,13 @@ MACHINE_FEATURES = "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] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
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
index 1d6143a..52a5a8a 100644
--- a/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
+++ b/scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf
@@ -34,8 +34,13 @@ SERIAL_CONSOLE = "115200 ttyS0"
MACHINE_FEATURES = "keyboard pci ext2 ext3 serial"
-{{ preferred_kernel = kernel_choice.split('_')[0] }}
-{{ preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
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
index 01e646d..de3b279 100644
--- a/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
+++ b/scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf
@@ -3,8 +3,13 @@
#@DESCRIPTION: Machine configuration for {{=machine}} systems
-{{ preferred_kernel = kernel_choice.split('_')[0] }}
-{{ preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
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
index 6c2db22..52a96df 100644
--- 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
@@ -3,8 +3,13 @@
#@DESCRIPTION: Machine configuration for {{=machine}} systems
-{{ preferred_kernel = kernel_choice.split('_')[0] }}
-{{ preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice == "custom": preferred_kernel = "linux-yocto-custom" }}
+{{ if kernel_choice == "custom": }}
+PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
+
+{{ if kernel_choice != "custom": preferred_kernel = kernel_choice.split('_')[0] }}
+{{ if kernel_choice != "custom": preferred_kernel_version = kernel_choice.split('_')[1] }}
+{{ if kernel_choice != "custom": }}
PREFERRED_PROVIDER_virtual/kernel ?= "{{=preferred_kernel}}"
PREFERRED_VERSION_{{=preferred_kernel}} ?= "{{=preferred_kernel_version}}%"
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
index 13009cf..e2b13ac 100644
--- 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
@@ -1,4 +1,5 @@
+{{ if kernel_choice != "custom": }}
{{ input type:"boolean" name:"use_default_kernel" prio:"10" msg:"Would you like to use the default (3.4) kernel? (y/n)" default:"y"}}
-{{ if use_default_kernel == "n": }}
+{{ if kernel_choice != "custom" and use_default_kernel == "n": }}
{{ input type:"choicelist" name:"kernel_choice" gen:"bsp.kernel.kernels" prio:"10" msg:"Please choose the kernel to use in this BSP:" default:"linux-yocto_3.4"}}
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/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-config.cfg
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-config.cfg"
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/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/user-patches.scc
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/user-patches.scc"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-preempt-rt.scc
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}-standard.scc
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.cfg
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg"
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/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
similarity index 100%
rename from scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/files/{{=machine}}.scc
rename to "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc"
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 04/12] yocto-bsp: add 'edit-git-repo' input line
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (2 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 03/12] yocto-bsp: update existing templates for linux-yocto-custom tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 05/12] yocto-bsp: add 'edit-file' " tom.zanussi
` (7 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Add a subclassed edit box that verifies the existence of a
user-specified git repo.
Also adds a verify_git_repo() function that can be used as a basic
sanity check for local git setup.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/engine.py | 76 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
index 8d47bbf..bd776b2 100644
--- a/scripts/lib/bsp/engine.py
+++ b/scripts/lib/bsp/engine.py
@@ -37,6 +37,7 @@ from abc import ABCMeta, abstractmethod
from tags import *
import shlex
import json
+import subprocess
class Line():
"""
@@ -204,6 +205,45 @@ class EditBoxInputLine(InputLine):
return line
+class GitRepoEditBoxInputLine(EditBoxInputLine):
+ """
+ Base class for 'editbox' Input lines for user input of remote git
+ repos. This class verifies the existence and connectivity of the
+ specified git repo.
+
+ 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):
+ EditBoxInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ EditBoxInputLine.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)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = get_verified_git_repo(\"" + msg + "\"," + name + ")"
+
+ return line
+
+
class BooleanInputLine(InputLine):
"""
Base class for boolean Input lines.
@@ -435,6 +475,40 @@ def default(input_str, name):
return input_str.strip()
+def verify_git_repo(giturl):
+ """
+ Verify that the giturl passed in can be connected to. This can be
+ used as a check for the existence of the given repo and/or basic
+ git remote connectivity.
+
+ Returns True if the connection was successful, fals otherwise
+ """
+ if not giturl:
+ return False
+
+ gitcmd = "git ls-remote %s > /dev/null 2>&1" % (giturl)
+ rc = subprocess.call(gitcmd, shell=True)
+ if rc == 0:
+ return True
+
+ return False
+
+
+def get_verified_git_repo(input_str, name):
+ """
+ Return git repo if verified, otherwise loop forever asking user
+ for filename.
+ """
+ msg = input_str.strip() + " "
+
+ giturl = default(raw_input(msg), name)
+
+ while True:
+ if verify_git_repo(giturl):
+ return giturl
+ giturl = default(raw_input(msg), name)
+
+
def boolean(input_str, name):
"""
Return lowercase version of first char in string, or value in name.
@@ -649,6 +723,8 @@ class SubstrateBase(object):
return BooleanInputLine(props, tag, lineno)
if input_type == "edit":
return EditBoxInputLine(props, tag, lineno)
+ if input_type == "edit-git-repo":
+ return GitRepoEditBoxInputLine(props, tag, lineno)
elif input_type == "choicelist":
self.prev_choicelist = ChoicelistInputLine(props, tag, lineno)
return self.prev_choicelist
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 05/12] yocto-bsp: add 'edit-file' input line
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (3 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 04/12] yocto-bsp: add 'edit-git-repo' input line tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 06/12] yocto-bsp: add replace_file() tom.zanussi
` (6 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Add a subclassed edit box that verifies the existence of a
user-specified file.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/engine.py | 57 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
index bd776b2..6309e29 100644
--- a/scripts/lib/bsp/engine.py
+++ b/scripts/lib/bsp/engine.py
@@ -244,6 +244,44 @@ class GitRepoEditBoxInputLine(EditBoxInputLine):
return line
+class FileEditBoxInputLine(EditBoxInputLine):
+ """
+ Base class for 'editbox' Input lines for user input of existing
+ files. This class verifies the existence of the specified file.
+
+ 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):
+ EditBoxInputLine.__init__(self, props, tag, lineno)
+
+ def gen(self, context = None):
+ EditBoxInputLine.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)
+
+ try:
+ default_choice = self.props["default"]
+ except KeyError:
+ default_choice = ""
+
+ msg += " [default: " + default_choice + "]"
+
+ line = name + " = get_verified_file(\"" + msg + "\"," + name + ", True)"
+
+ return line
+
+
class BooleanInputLine(InputLine):
"""
Base class for boolean Input lines.
@@ -509,6 +547,23 @@ def get_verified_git_repo(input_str, name):
giturl = default(raw_input(msg), name)
+def get_verified_file(input_str, name, filename_can_be_null):
+ """
+ Return filename if the file exists, otherwise loop forever asking
+ user for filename.
+ """
+ msg = input_str.strip() + " "
+
+ filename = default(raw_input(msg), name)
+
+ while True:
+ if not filename and filename_can_be_null:
+ return filename
+ if os.path.isfile(filename):
+ return filename
+ filename = default(raw_input(msg), name)
+
+
def boolean(input_str, name):
"""
Return lowercase version of first char in string, or value in name.
@@ -725,6 +780,8 @@ class SubstrateBase(object):
return EditBoxInputLine(props, tag, lineno)
if input_type == "edit-git-repo":
return GitRepoEditBoxInputLine(props, tag, lineno)
+ if input_type == "edit-file":
+ return FileEditBoxInputLine(props, tag, lineno)
elif input_type == "choicelist":
self.prev_choicelist = ChoicelistInputLine(props, tag, lineno)
return self.prev_choicelist
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 06/12] yocto-bsp: add replace_file()
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (4 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 05/12] yocto-bsp: add 'edit-file' " tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 07/12] yocto-kernel: create open_user_file() wrapper function tom.zanussi
` (5 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Add a function that can be used to replace a template file by a
user-specified file. The initial use of this capability is to allow
users-specified defconfigs.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/engine.py | 18 +++++++++++++++---
.../defconfig" | 1 +
scripts/lib/bsp/tags.py | 2 +-
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/bsp/engine.py b/scripts/lib/bsp/engine.py
index 6309e29..8985544 100644
--- a/scripts/lib/bsp/engine.py
+++ b/scripts/lib/bsp/engine.py
@@ -38,6 +38,7 @@ from tags import *
import shlex
import json
import subprocess
+import shutil
class Line():
"""
@@ -83,7 +84,7 @@ class NormalLine(Line):
def gen(self, context = None):
if self.is_filename:
- line = "of = open(\"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\", \"w\")"
+ line = "current_file = \"" + os.path.join(self.out_filebase, self.escape(self.line)) + "\"; of = open(current_file, \"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 + "\")"
@@ -134,7 +135,7 @@ class AssignmentLine(NormalLine):
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\")"
+ return "current_file = \"" + os.path.join(self.out_filebase, line) + "\"; of = open(current_file, \"w\")"
elif self.is_dirname:
dirname = os.path.join(self.out_filebase, line)
return "if not os.path.exists(\"" + dirname + "\"): os.mkdir(\"" + dirname + "\")"
@@ -564,6 +565,17 @@ def get_verified_file(input_str, name, filename_can_be_null):
filename = default(raw_input(msg), name)
+def replace_file(replace_this, with_this):
+ """
+ Replace the given file with the contents of filename, retaining
+ the original filename.
+ """
+ try:
+ shutil.copy(with_this, replace_this)
+ except IOError:
+ pass
+
+
def boolean(input_str, name):
"""
Return lowercase version of first char in string, or value in name.
@@ -1197,7 +1209,7 @@ def gen_program_header_lines(program_lines):
"""
Generate any imports we need.
"""
- pass
+ program_lines.append("current_file = \"\"")
def gen_supplied_property_vals(properties, program_lines):
diff --git "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig" "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
index c2745c5..e544a0a 100644
--- "a/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
+++ "b/scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig"
@@ -2,3 +2,4 @@
# Placeholder for custom default kernel configuration. yocto-bsp will
# replace this file with a user-specified defconfig.
#
+{{ if custom_kernel_defconfig: replace_file(current_file, custom_kernel_defconfig) }}
diff --git a/scripts/lib/bsp/tags.py b/scripts/lib/bsp/tags.py
index 869b1d0..256b25c 100644
--- a/scripts/lib/bsp/tags.py
+++ b/scripts/lib/bsp/tags.py
@@ -35,7 +35,7 @@ INDENT_STR = " "
BLANKLINE_STR = "of.write(\"\\n\")"
NORMAL_START = "of.write"
-OPEN_START = "of = open"
+OPEN_START = "current_file ="
INPUT_TYPE_PROPERTY = "type"
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 07/12] yocto-kernel: create open_user_file() wrapper function
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (5 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 06/12] yocto-bsp: add replace_file() tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 08/12] yocto-kernel: don't list comments in config and patch listings tom.zanussi
` (4 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
With the addition of custom kernels, we can no longer rely on a
hard-coded /files directory for BSPs - we need to be able to find the
user_config/patches files in a number of different directories.
We now hide the search inside a new open_user_file() function that
accomplishes the same thing as before but with a more flexible scope.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 45 ++++++++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index a953372..0b7e69b 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -133,6 +133,30 @@ def gen_choices_str(choices):
return choices_str
+def open_user_file(scripts_path, machine, userfile, mode):
+ """
+ Find one of the user files (user-config.cfg, user-patches.scc)
+ associated with the machine (could be in files/,
+ linux-yocto-custom/, etc). Returns the open file if found, None
+ otherwise.
+
+ The caller is responsible for closing the file returned.
+ """
+ layer = find_bsp_layer(scripts_path, machine)
+ linuxdir = os.path.join(layer, "recipes-kernel/linux")
+ linuxdir_list = os.listdir(linuxdir)
+ for fileobj in linuxdir_list:
+ fileobj_path = os.path.join(linuxdir, fileobj)
+ if os.path.isdir(fileobj_path):
+ userfile_name = os.path.join(fileobj_path, userfile)
+ try:
+ f = open(userfile_name, mode)
+ return f
+ except IOError:
+ continue
+ return None
+
+
def read_config_items(scripts_path, machine):
"""
Find and return a list of config items (CONFIG_XXX) in a machine's
@@ -140,10 +164,7 @@ def read_config_items(scripts_path, machine):
"""
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")
+ f = open_user_file(scripts_path, machine, "user-config.cfg", "r")
lines = f.readlines()
for line in lines:
s = line.strip()
@@ -159,10 +180,7 @@ 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")
+ f = open_user_file(scripts_path, machine, "user-config.cfg", "w")
for item in config_items:
f.write(item + "\n")
f.close()
@@ -377,10 +395,7 @@ def read_patch_items(scripts_path, machine):
"""
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")
+ f = open_user_file(scripts_path, machine, "user-patches.scc", "r")
lines = f.readlines()
for line in lines:
s = line.strip()
@@ -399,11 +414,7 @@ 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")
+ f = open_user_file(scripts_path, machine, "user-patches.scc", "w")
for item in patch_items:
pass
# this currently breaks do_patch, but is really what we want
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 08/12] yocto-kernel: don't list comments in config and patch listings
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (6 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 07/12] yocto-kernel: create open_user_file() wrapper function tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 09/12] yocto-kernel: remove assumption that kernel has a version tom.zanussi
` (3 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
After adding comments to the config and patch templates, I noticed
they were displayed as items, which they shouldn't be. This prevents
them from being displayed.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 0b7e69b..272c3eb 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -168,7 +168,7 @@ def read_config_items(scripts_path, machine):
lines = f.readlines()
for line in lines:
s = line.strip()
- if s:
+ if s and not s.startswith("#"):
config_items.append(s)
f.close()
@@ -399,7 +399,7 @@ def read_patch_items(scripts_path, machine):
lines = f.readlines()
for line in lines:
s = line.strip()
- if s:
+ if s and not s.startswith("#"):
fields = s.split()
if not fields[0] == "patch":
continue
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 09/12] yocto-kernel: remove assumption that kernel has a version
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (7 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 08/12] yocto-kernel: don't list comments in config and patch listings tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 10/12] yocto-kernel: handle SRC_URIs in .bb files tom.zanussi
` (2 subsequent siblings)
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Kernels don't need to have a PREFERRED_VERSION, so remove that
assumption from the code that looks for the kernel definition.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 272c3eb..f2ec9fd 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -289,6 +289,8 @@ def find_current_kernel(bsp_layer, machine):
if preferred_kernel and preferred_kernel_version:
return preferred_kernel + "_" + preferred_kernel_version
+ elif preferred_kernel:
+ return preferred_kernel
def find_bsp_kernel_src_uri(scripts_path, machine, start_end_only = False):
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 10/12] yocto-kernel: handle SRC_URIs in .bb files
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (8 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 09/12] yocto-kernel: remove assumption that kernel has a version tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 11/12] yocto-bsp: remove patch-related SRC_URI processing tom.zanussi
2012-12-13 4:56 ` [PATCH 12/12] yocto-kernel: add support for PRs of the form rN to pr_inc() tom.zanussi
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
Previously we assumed we were always dealing with .bbappends. With
custom kernels, we now have SRC_URIs in .bb files, so add .bb files to
the list of file types we examine and modify.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 51 +++++++++++++++++++++++++++++++----------------
1 file changed, 34 insertions(+), 17 deletions(-)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index f2ec9fd..d2e4f40 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -295,11 +295,11 @@ def find_current_kernel(bsp_layer, machine):
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.
+ Parse the SRC_URI append in the kernel .bb or .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).
@@ -318,9 +318,17 @@ def find_bsp_kernel_src_uri(scripts_path, machine, start_end_only = False):
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_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
+ try:
+ f = open(kernel_bbfile, "r")
+ except IOError:
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
+ try:
+ f = open(kernel_bbfile, "r")
+ except IOError:
+ print "Couldn't find a .bb or .bbappend file for this BSP's kernel, exiting."
+ sys.exit(1)
- f = open(kernel_bbappend, "r")
src_uri_line = ""
in_src_uri = False
lines = f.readlines()
@@ -561,12 +569,16 @@ def kernel_contents_changed(scripts_path, machine):
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)
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
+ if not os.path.isfile(kernel_bbfile):
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
+ if not os.path.isfile(kernel_bbfile):
+ return
+ kernel_bbfile_prev = kernel_bbfile + ".prev"
+ shutil.copyfile(kernel_bbfile, kernel_bbfile_prev)
- ifile = open(kernel_bbappend_prev, "r")
- ofile = open(kernel_bbappend, "w")
+ ifile = open(kernel_bbfile_prev, "r")
+ ofile = open(kernel_bbfile, "w")
ifile_lines = ifile.readlines()
for ifile_line in ifile_lines:
if ifile_line.strip().startswith("PR"):
@@ -588,14 +600,19 @@ def write_kernel_src_uri(scripts_path, machine, src_uri):
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_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
+ if not os.path.isfile(kernel_bbfile):
+ kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
+ if not os.path.isfile(kernel_bbfile):
+ print "Couldn't find a .bb or .bbappend file for this BSP's kernel, exiting."
+ sys.exit(1)
(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")
+ kernel_bbfile_prev = kernel_bbfile + ".prev"
+ shutil.copyfile(kernel_bbfile, kernel_bbfile_prev)
+ ifile = open(kernel_bbfile_prev, "r")
+ ofile = open(kernel_bbfile, "w")
ifile_lines = ifile.readlines()
if uri_start_line == -1:
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 11/12] yocto-bsp: remove patch-related SRC_URI processing
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (9 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 10/12] yocto-kernel: handle SRC_URIs in .bb files tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
2012-12-13 4:56 ` [PATCH 12/12] yocto-kernel: add support for PRs of the form rN to pr_inc() tom.zanussi
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
We no longer have to include patches in the SRC_URI, since things now
work using only patch in the .scc file, so remove anything to do with
maintaining patches in the SRC_URI and fix up all previous users of
that code.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 227 +++++++---------------------------------------
1 file changed, 34 insertions(+), 193 deletions(-)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index d2e4f40..883beac 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -199,18 +199,6 @@ def yocto_kernel_config_list(scripts_path, 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
@@ -293,109 +281,24 @@ def find_current_kernel(bsp_layer, machine):
return preferred_kernel
-def find_bsp_kernel_src_uri(scripts_path, machine, start_end_only = False):
+def find_filesdir(scripts_path, machine):
"""
- Parse the SRC_URI append in the kernel .bb or .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.
+ Find the name of the 'files' dir associated with the machine
+ (could be in files/, linux-yocto-custom/, etc). Returns the name
+ of the files dir if found, None otherwise.
"""
layer = find_bsp_layer(scripts_path, machine)
+ filesdir = None
+ linuxdir = os.path.join(layer, "recipes-kernel/linux")
+ linuxdir_list = os.listdir(linuxdir)
+ for fileobj in linuxdir_list:
+ fileobj_path = os.path.join(linuxdir, fileobj)
+ if os.path.isdir(fileobj_path):
+ # this could be files/ or linux-yocto-custom/, we have no way of distinguishing
+ # so we take the first (and normally only) dir we find as the 'filesdir'
+ filesdir = fileobj_path
- kernel = find_current_kernel(layer, machine)
- if not kernel:
- print "Couldn't determine the kernel for this BSP, exiting."
- sys.exit(1)
-
- kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
- try:
- f = open(kernel_bbfile, "r")
- except IOError:
- kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
- try:
- f = open(kernel_bbfile, "r")
- except IOError:
- print "Couldn't find a .bb or .bbappend file for this BSP's kernel, exiting."
- sys.exit(1)
-
- 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
+ return filesdir
def read_patch_items(scripts_path, machine):
@@ -426,10 +329,7 @@ def write_patch_items(scripts_path, machine, patch_items):
"""
f = open_user_file(scripts_path, machine, "user-patches.scc", "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.write("patch " + item + "\n")
f.close()
kernel_contents_changed(scripts_path, machine)
@@ -440,8 +340,7 @@ 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)
+ patches = read_patch_items(scripts_path, machine)
print "The current set of machine-specific patches for %s is:" % machine
print gen_choices_str(patches)
@@ -452,8 +351,7 @@ 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)
+ patches = read_patch_items(scripts_path, machine)
print "Specify the patches to remove:"
input = raw_input(gen_choices_str(patches))
@@ -462,8 +360,10 @@ def yocto_kernel_patch_rm(scripts_path, machine):
removed = []
- layer = find_bsp_layer(scripts_path, machine)
- src_uri_dir = os.path.join(layer, "recipes-kernel/linux/files")
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't rm patch(es) since we couldn't find a 'files' dir"
+ sys.exit(1)
for choice in reversed(rm_choices):
try:
@@ -474,14 +374,13 @@ def yocto_kernel_patch_rm(scripts_path, machine):
if idx < 0 or idx >= len(patches):
print "Invalid choice (%d), exiting" % (idx + 1)
sys.exit(1)
- src_uri_patch = os.path.join(src_uri_dir, patches[idx])
- if os.path.isfile(src_uri_patch):
- os.remove(src_uri_patch)
- idx = map_choice(patches[idx], src_uri)
- removed.append(src_uri.pop(idx))
+ filesdir_patch = os.path.join(filesdir, patches[idx])
+ if os.path.isfile(filesdir_patch):
+ os.remove(filesdir_patch)
+ removed.append(patches[idx])
+ patches.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:
@@ -493,16 +392,17 @@ 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].
"""
- (start_line, end_line, src_uri) = find_bsp_kernel_src_uri(scripts_path, machine)
- src_uri_patches = find_patches(src_uri)
+ existing_patches = read_patch_items(scripts_path, machine)
for patch in patches:
- if os.path.basename(patch) in src_uri_patches:
+ if os.path.basename(patch) in existing_patches:
print "Couldn't add patch (%s) since it's already been added" % os.path.basename(patch)
sys.exit(1)
- layer = find_bsp_layer(scripts_path, machine)
- src_uri_dir = os.path.join(layer, "recipes-kernel/linux/files")
+ filesdir = find_filesdir(scripts_path, machine)
+ if not filesdir:
+ print "Couldn't add patch (%s) since we couldn't find a 'files' dir to add it to" % os.path.basename(patch)
+ sys.exit(1)
new_patches = []
@@ -511,33 +411,19 @@ def yocto_kernel_patch_add(scripts_path, machine, patches):
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)
+ filesdir_patch = os.path.join(filesdir, basename)
+ shutil.copyfile(patch, filesdir_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
@@ -588,51 +474,6 @@ def kernel_contents_changed(scripts_path, machine):
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_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bbappend")
- if not os.path.isfile(kernel_bbfile):
- kernel_bbfile = os.path.join(layer, "recipes-kernel/linux/" + kernel + ".bb")
- if not os.path.isfile(kernel_bbfile):
- print "Couldn't find a .bb or .bbappend file for this BSP's kernel, exiting."
- sys.exit(1)
-
- (uri_start_line, uri_end_line, unused) = find_bsp_kernel_src_uri(scripts_path, machine, True)
-
- kernel_bbfile_prev = kernel_bbfile + ".prev"
- shutil.copyfile(kernel_bbfile, kernel_bbfile_prev)
- ifile = open(kernel_bbfile_prev, "r")
- ofile = open(kernel_bbfile, "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
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* [PATCH 12/12] yocto-kernel: add support for PRs of the form rN to pr_inc()
2012-12-13 4:56 [PATCH 00/12] BSP tools: add support for custom kernel tom.zanussi
` (10 preceding siblings ...)
2012-12-13 4:56 ` [PATCH 11/12] yocto-bsp: remove patch-related SRC_URI processing tom.zanussi
@ 2012-12-13 4:56 ` tom.zanussi
11 siblings, 0 replies; 13+ messages in thread
From: tom.zanussi @ 2012-12-13 4:56 UTC (permalink / raw)
To: poky
From: Tom Zanussi <tom.zanussi@intel.com>
With the addition of custom kernel support, we also need to handle the
normal PR format found in .bb files.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
scripts/lib/bsp/kernel.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/bsp/kernel.py b/scripts/lib/bsp/kernel.py
index 883beac..5935e66 100644
--- a/scripts/lib/bsp/kernel.py
+++ b/scripts/lib/bsp/kernel.py
@@ -427,16 +427,20 @@ def yocto_kernel_patch_add(scripts_path, machine, patches):
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.
+ lines in kernel .bbappends after modifications. Handles PRs of
+ the form PR := "${PR}.1" as well as PR = "r0".
"""
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"
-
+ if len(fields) > 1:
+ fields[1] = str(int(fields[1]) + 1)
+ pr_str = "\"" + '.'.join(fields) + "\"\n"
+ else:
+ pr_val = pr_str[1:]
+ pr_str = "\"" + "r" + str(int(pr_val) + 1) + "\"\n"
idx2 = line.find("\"", idx + 1)
line = line[:idx] + pr_str
--
1.7.11.4
^ permalink raw reply related [flat|nested] 13+ messages in thread