Patchwork [oe,meta-oe,v2] kernel.bbclass: kernel_do_install fails with kernel <2.6.30

login
register
mail settings
Submitter Marco Cavallini
Date Jan. 8, 2013, 7:51 a.m.
Message ID <1357631504-22614-1-git-send-email-m.cavallini@koansoftware.com>
Download mbox | patch
Permalink /patch/42279/
State New
Headers show

Comments

Marco Cavallini - Jan. 8, 2013, 7:51 a.m.
* kernels <2.6.30 don't have $kerneldir/tools directory
 * so we got this error:
 * sed: can't read ...SNIP...linux/2.6.30-r0/image/usr/src/kernel/tools/perf/Makefile: No such file or directory
 * ERROR: Function failed: do_install

Signed-off-by: Marco Cavallini <m.cavallini@koansoftware.com>
---
 meta/classes/kernel.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 96b23bc..aff8842 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -204,8 +204,11 @@  kernel_do_install() {
 		rm -f $kerneldir/$entry
 	done
 
-	# Fix SLANG_INC for slang.h
-	sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
+	# kernels <2.6.30 don't have $kerneldir/tools directory so we check if it exists before calling sed
+	if [ -f $kerneldir/tools/perf/Makefile ]; then
+		# Fix SLANG_INC for slang.h
+		sed -i 's#-I/usr/include/slang#-I=/usr/include/slang#g' $kerneldir/tools/perf/Makefile
+	fi
 }
 
 sysroot_stage_all_append() {