File: sparc.sh

package info (click to toggle)
base-installer 1.76
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 2,204 kB
  • ctags: 109
  • sloc: sh: 1,466; ansic: 380; makefile: 69; perl: 50
file content (46 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
arch_get_kernel_flavour () {
	case "$MACHINE" in
		sparc)		echo sparc32 ;;
		sparc64)	echo sparc64 ;;
	esac
	return 0
}

arch_check_usable_kernel () {
	case "$2" in
	    sparc32)
		if expr "$1" : '.*-2\.6.*-sparc32-smp' >/dev/null; then
			# No working SMP yet
			return 1
		fi
		if expr "$1" : '.*-sparc32.*' >/dev/null; then return 0; fi
		return 1
		;;
	    sparc64)
		if expr "$1" : '.*-sparc64.*' >/dev/null; then return 0; fi
		return 1
		;;
	esac

	# default to usable in case of strangeness
	warning "Unknown kernel usability: $1 / $2"
	return 0
}

arch_get_kernel () {
	if [ "$KERNEL_MAJOR" = 2.4 ]; then
		imgbase=kernel-image
	else
		imgbase=linux-image
	fi
	CPUS=`grep 'ncpus probed' "$CPUINFO" | cut -d: -f2`
	if [ "$CPUS" -ne 1 ]; then
		if [ "$1" = sparc32 ] && [ "$KERNEL_MAJOR" = 2.6 ]; then
			# No working SMP yet
			:
		else
			echo "$imgbase-$KERNEL_MAJOR-$1-smp"
		fi
	fi
	echo "$imgbase-$KERNEL_MAJOR-$1"
}