summaryrefslogtreecommitdiff
path: root/packages/altboot/files/spitz/altboot-menu/00-Default
blob: c18633a13678897e0864e1af69206a21284179be (plain)
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
47
48
49
# !/bin/sh
M_TITLE="Normal Boot"

# Note for Spitz: The HDD has already been mounted in /media/hdd from
# /etc/altboot.rc/00-Default.sh

die() {
	echo "ERROR: $1" >/dev/tty0
	exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
}

run_module() {
	
	test -e /etc/altboot.func && . /etc/altboot.func || die "ERROR: /etc/altboot.func not found. Check your installation!"	
	
	test -z "$SPITZ_HDD_PART" && SPITZ_HDD_PART="/dev/hda1"
	echo "Spitz: Mounting [$SPITZ_HDD_PART] as /media/hdd"
	mount -t proc proc /proc || echo "Mounting /proc failed!"

	mount -o remount,rw / 

	# Note: Redirecting STDIN & STDOUT is required, cardmg will die otherwise
	cardmgr -o < /dev/tty0 > /dev/tty0 2>&1 || echo "cardmgr -o failed!"
	
	# I've seen busybox die a horrible death on "!"...
	if (mount -t auto $SPITZ_HDD_PART /media/hdd)
	then
		a=a
	else
		echo "ERROR: mount -t ext3 $SPITZ_HDD_PART /media/hdd failed!"
		exec $SH_SHELL </dev/tty0 >/dev/tty0 2>&1
	fi

	# There are no device files on Spitz yet, requires HDD (bad for testing
	# with CF)
	for n in 1 2 3 4 5
	do
		mknod /dev/loop$n b 7 $n
	done
	
	# Check for /sbin/init and / or loop-images	
	check_target "/media/hdd" 5
}

case "$1" in
title)	echo "$M_TITLE";;
run)	run_module;;
esac