[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 1/3] kernel: Clone script for sparc64 from sparc, add it to Makefile.



Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
---
 kernel/Makefile   |  2 +-
 kernel/sparc64.sh | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 kernel/sparc64.sh

diff --git a/kernel/Makefile b/kernel/Makefile
index e3275fd..ba94653 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,4 +1,4 @@
-ARCHES = alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64el s390x sh4 sparc kfreebsd-amd64 kfreebsd-i386
+ARCHES = alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64el s390x sh4 sparc sparc64 kfreebsd-amd64 kfreebsd-i386
 
 test:
 	@STATUS=0; \
diff --git a/kernel/sparc64.sh b/kernel/sparc64.sh
new file mode 100644
index 0000000..f7b2a4d
--- /dev/null
+++ b/kernel/sparc64.sh
@@ -0,0 +1,20 @@
+arch_get_kernel_flavour () {
+	echo "$MACHINE"
+	return 0
+}
+
+arch_check_usable_kernel () {
+	if echo "$1" | grep -Eq -- "-sparc64(-.*)?$"; then return 0; fi
+	return 1
+}
+
+arch_get_kernel () {
+	imgbase=linux-image
+
+	CPUS=`grep 'ncpus probed' "$CPUINFO" | cut -d: -f2`
+	TYPE=`grep '^type' "$CPUINFO" | head -n1 | cut -d: -f2 | sed -e 's/^[[:space:]]//'`
+	if [ "$CPUS" -ne 1 ] || [ "$TYPE" = "sun4v" ]; then
+		echo "$imgbase-$1-smp"
+	fi
+	echo "$imgbase-$1"
+}
-- 
2.6.4


Reply to: