Patchwork [23/26] linux-yocto: apply meta data to external repos

login
register
mail settings
Submitter Saul Wold
Date May 5, 2011, 7:57 a.m.
Message ID <c23a8013d8c4e7a538ed7186e42bc8712b2080ed.1304581770.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/3239/
State New, archived
Headers show

Comments

Saul Wold - May 5, 2011, 7:57 a.m.
From: Bruce Ashfield <bruce.ashfield@windriver.com>

To support quick uprev and testing, it is desireable to build
repositories that do not have embedded meta data. In this scenario
the meta data can be automatically created or provided externally.
This commit supports the first situation by detecting the lack
of meta data and then automatically creating a base set of meta
files.

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/classes/kernel-yocto.bbclass                  |   27 +++++++++++++++----
 .../kern-tools/kern-tools-native_git.bb            |    2 +-
 2 files changed, 22 insertions(+), 7 deletions(-)

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index fc9f3a7..78a1309 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -66,8 +66,15 @@  IFS='
 	fi
 	cd ${S}
 
-	# checkout and clobber and unimportant files
-	git checkout -f ${KBRANCH}
+	set +e
+	git show-ref --quiet --verify -- "refs/heads/${KBRANCH}"
+	if [ $? -eq 0 ]; then
+		# checkout and clobber and unimportant files
+		git checkout -f ${KBRANCH}
+	else
+		echo "Not checking out ${KBRANCH}, it will be created later"
+		git checkout -f master
+	fi
 }
 do_kernel_checkout[dirs] = "${S}"
 
@@ -105,21 +112,29 @@  python do_kernel_configcheck() {
     bb.plain( "%s" % result )
 }
 
+# overrides the base kernel_do_configure, since we don't want all the
+# defconfig processing in there
+kernel_do_configure() {
+        yes '' | oe_runmake oldconfig
+}
+
+
 # Ensure that the branches (BSP and meta) are on the locatios specified by
 # their SRCREV values. If they are NOT on the right commits, the branches
 # are reset to the correct commit.
 do_validate_branches() {
 	cd ${S}
- 	branch_head=`git show-ref -s --heads ${KBRANCH}`
- 	meta_head=`git show-ref -s --heads ${KMETA}`
- 	target_branch_head="${SRCREV_machine}"
- 	target_meta_head="${SRCREV_meta}"
 
 	# nothing to do if bootstrapping
  	if [ -n "${YOCTO_KERNEL_EXTERNAL_BRANCH}" ]; then
  	 	return
  	fi
 
+ 	branch_head=`git show-ref -s --heads ${KBRANCH}`
+ 	meta_head=`git show-ref -s --heads ${KMETA}`
+ 	target_branch_head="${SRCREV_machine}"
+ 	target_meta_head="${SRCREV_meta}"
+
 	current=`git branch |grep \*|sed 's/^\* //'`
 	if [ -n "$target_branch_head" ] && [ "$branch_head" != "$target_branch_head" ]; then
 		if [ -n "${KERNEL_REVISION_CHECKING}" ]; then
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
index 00cc666..cc71179 100644
--- a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -4,7 +4,7 @@  LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=e2bf4415f3d8
 
 DEPENDS = "git-native guilt-native"
 
-SRCREV = "8f61abb6344e78677450994e8930cabc86102d78"
+SRCREV = "92b965b02e3ac32badde3ee71a1e7d3a85cedeb8"
 PR = r10
 PV = "0.1+git${SRCPV}"