[oe-commits] Walter Goossens : linux-libc-headers_nios2-2.6.28: Make hwselect headless.

git version control git at git.openembedded.org
Thu Nov 26 11:39:40 UTC 2009


Module: openembedded.git
Branch: nios2
Commit: f5e03a6815327da1c847e5d5e7ee7fd7e3f249cb
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=f5e03a6815327da1c847e5d5e7ee7fd7e3f249cb

Author: Walter Goossens <walter.goossens at axon.tv>
Date:   Thu Nov 26 12:38:44 2009 +0100

linux-libc-headers_nios2-2.6.28: Make hwselect headless.

Signed-off-by: Leon Woestenberg <leon at sidebranch.com>

---

 .../linux-libc-headers-nios2-2.6.28/hardware.mk    |    3 -
 .../headless_hwselect.patch                        |  120 ++++++++++++++++++++
 .../linux-libc-headers_nios2-2.6.28.bb             |    9 +-
 3 files changed, 126 insertions(+), 6 deletions(-)

diff --git a/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/defconfig b/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/defconfig
deleted file mode 100644
index e69de29..0000000
diff --git a/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/hardware.mk b/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/hardware.mk
deleted file mode 100644
index 0cbb2c7..0000000
--- a/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/hardware.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-SYSPTF = ../system.ptf
-CPU = cpu
-EXEMEM = cfi_flash
diff --git a/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/headless_hwselect.patch b/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/headless_hwselect.patch
new file mode 100644
index 0000000..3029f69
--- /dev/null
+++ b/recipes/linux-libc-headers/linux-libc-headers-nios2-2.6.28/headless_hwselect.patch
@@ -0,0 +1,120 @@
+diff -urPN nios2-linux-test-dm/linux-2.6/arch/nios2/Makefile nios2-linux/linux-2.6/arch/nios2/Makefile
+--- nios2-linux-test-dm/linux-2.6/arch/nios2/Makefile	2009-07-30 10:27:19.000000000 +0000
++++ nios2-linux/linux-2.6/arch/nios2/Makefile	2009-08-17 15:07:40.000000000 +0000
+@@ -134,7 +134,8 @@
+ 	mkdir -p $(dir $(objtree)/$(HARDWARE_MK)); \
+ 	perl -I$(TOPDIR)/arch/$(ARCH)/scripts \
+ 		$(srctree)/arch/$(ARCH)/scripts/hwselect.pl $(SYSPTF) \
+-		$(objtree)/$(HARDWARE_MK)
++		$(objtree)/$(HARDWARE_MK) \
++		$(CPU_SELECTION) $(MEM_SELECTION)
+ endef
+ 
+ .PHONY: hwselect
+diff -urPN nios2-linux-test-dm/linux-2.6/arch/nios2/scripts/hwselect.pl nios2-linux/linux-2.6/arch/nios2/scripts/hwselect.pl
+--- nios2-linux-test-dm/linux-2.6/arch/nios2/scripts/hwselect.pl	2009-07-30 10:27:19.000000000 +0000
++++ nios2-linux/linux-2.6/arch/nios2/scripts/hwselect.pl	2009-08-17 15:05:45.000000000 +0000
+@@ -14,6 +14,10 @@
+ my $index;
+ my $system;
+ 
++my $cpu_selection;
++my $cpu_index = -1;
++my $mem_selected;
++my $mem_index = -1;
+ #
+ # Subroutine: Prompt user for an answer
+ #
+@@ -36,8 +40,12 @@
+ #
+ # Check for correct number of args
+ #
+-
+-if (scalar (@ARGV) != 2) {
++if (scalar (@ARGV) == 4) {
++	$ptf_filename = $ARGV[0];
++	$target_filename = $ARGV[1];
++	$cpu_index = $ARGV[2];
++	$mem_index = $ARGV[3];	
++} elsif (scalar (@ARGV) != 2) {
+ 	print STDERR "ERROR: Invalid number of parameters.\n";
+ 	exit;
+ } else {
+@@ -67,27 +75,37 @@
+ # Grab listing of Nios II processors and force user to select one:
+ # 
+ 
+-print "\n--- Please select which CPU you wish to build the kernel against:\n\n";
+-
+ my @cpulist = $system->getCPUList ('altera_nios2');
+-my %cpuinfo;
+-
+-$index = 1;
+-foreach my $cpu (@cpulist) {
+-	my $cpu_module = $system->getCPU ($cpu);
+-	if ($cpu_module->isEnabled ()) {
+-		my $class = $cpu_module->getClass();
+-		my $type = $cpu_module->getWSAAssignment('cpu_selection');
+-		my $version = $cpu_module->getVersion();
+-
+-		print "($index) $cpu - Class: $class Type: $type Version: $version\n";
++if( scalar(@cpulist) == 1 )
++{
++# Only one CPU to choose from...
++	$cpu_index = 1;
++}
++if (($cpu_index <= 0) || ($cpu_index > scalar(@cpulist))) {
++	print "\n--- Please select which CPU you wish to build the kernel against:\n\n";
++
++	my %cpuinfo;
++	
++	$index = 1;
++	foreach my $cpu (@cpulist) {
++		my $cpu_module = $system->getCPU ($cpu);
++		if ($cpu_module->isEnabled ()) {
++			my $class = $cpu_module->getClass();
++			my $type = $cpu_module->getWSAAssignment('cpu_selection');
++			my $version = $cpu_module->getVersion();
++	
++			print "($index) $cpu - Class: $class Type: $type Version: $version\n";
++		}
++		$index += 1;
+ 	}
+-	$index += 1;
+-}
+ 
+-print "\n";
++	print "\n";
+ 
+-my $cpu_selection = $cpulist[request_answer (1, $index - 1) - 1];
++	$cpu_selection = $cpulist[request_answer (1, $index - 1) - 1];
++} else {
++	$cpu_selection = $cpulist[($cpu_index-1)];
++	print "Selected ($cpu_index) $cpu_selection as the main CPU";
++}
+ 
+ #
+ # Grab list of memory devices that $cpu_selection is hooked up to:
+@@ -109,6 +127,7 @@
+ #
+ # Select program memory to execute kernel from:
+ # 
++
+ print "\n--- Please select a device to execute kernel from:\n\n";
+ 
+ $index = 1;
+@@ -119,7 +138,13 @@
+ }
+ 
+ my @memlist = keys (%meminfo);
+-my $mem_selected = $memlist[request_answer (1, $index - 1) - 1];
++if( scalar(@memlist) == 1)
++{
++	$mem_index = 1;
++} elsif (($mem_index <= 0) || ($mem_index > scalar(@memlist))) {
++	$mem_index = request_answer (1, $index -1);
++}
++$mem_selected = $memlist[$mem_index - 1];
+ 
+ print "\n--- Summary using\n\n";
+ print "PTF: $ptf_filename\n";
diff --git a/recipes/linux-libc-headers/linux-libc-headers_nios2-2.6.28.bb b/recipes/linux-libc-headers/linux-libc-headers_nios2-2.6.28.bb
index 7e448b3..dbc8569 100644
--- a/recipes/linux-libc-headers/linux-libc-headers_nios2-2.6.28.bb
+++ b/recipes/linux-libc-headers/linux-libc-headers_nios2-2.6.28.bb
@@ -11,7 +11,10 @@ SRC_URI = "git://sopc.et.ntust.edu.tw/git/linux-2.6.git;branch=test-nios2;protoc
            file://procinfo.h \
            file://system.ptf \
            file://hardware.mk \
-           file://defconfig"
+           file://headless_hwselect.patch;patch=1;pnum=2 \
+	  "
+
+#           file://defconfig \
 
 S = "${WORKDIR}/git"
 
@@ -44,8 +47,8 @@ set_arch() {
 
 do_configure() {
 	set_arch
-	cp ../hardware.mk arch/nios2
-#	oe_runmake hwselect SYSPTF=../system.ptf CPU_SELECTION=1 MEM_SELECTION=2 ARCH=$ARCH
+#	cp ../hardware.mk arch/nios2
+	oe_runmake hwselect SYSPTF=../system.ptf CPU_SELECTION=1 MEM_SELECTION=2 ARCH=$ARCH
 	oe_runmake allnoconfig ARCH=$ARCH
 }
 





More information about the Openembedded-commits mailing list