summaryrefslogtreecommitdiff
blob: d2fcd0ec57ae11a2191a021c83cc221b32d11a50 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#!/bin/sh
# Daniel Robbins <drobbins@gentoo.org>
# Copyright 2003 Gentoo Technologies, Inc.
# Distributed under the GPL

PATH=/usr/sbin:/usr/bin:/sbin:/bin
BACK_UP="\033[1K\033[0G"
HILITE="\033[1m"
NORMAL="\033[0m"
WARN="\033[1m"
BAD="\033[1m"
#mount -o remount,rw /
mount /proc
INITRD="true"
SCSI="yes"
CDCACHE="no"
IDEBUG="no"
FIREWIRE="no"
ATARAID="no"
PCMCIA="no"
DETECT="no"
USB="yes"
KEYMAP="no"
if [ ! -e /dev/.devfsd ]
then
        #mount devfs
        mount -t devfs devfs /dev
fi

CMDLINE="`cat /proc/cmdline`"
for x in $CMDLINE
do
	if [ "$x" = "doscsi" ]
	then
		SCSI="yes"
	elif [ "$x" = "cdcache" ]
	then
		CDCACHE="yes"
	elif [ "$x" = "idebug" ]
	then
		IDEBUG="yes"
	fi
done

for x in $CMDLINE
do
	if [ "$x" = "dofirewire" ]
        then
                FIREWIRE="yes"
	fi
done
for x in $CMDLINE
do
        if [ "$x" = "nousb" ]
        then
                USB="no"
        fi
done

for x in $CMDLINE
do
	if [ "$x" = "doataraid" ]
        then
                ATARAID="yes"
	fi
done
for x in $CMDLINE
do
        if [ "$x" = "dopcmcia" ]
        then
                PCMCIA="yes"
        fi
done

for x in $CMDLINE
do
        if [ "$x" = "dokeymap" ]
        then
                KEYMAP="yes"
        fi
done

blurb() {
	echo -ne ${HILITE}${1}
}

backup() {
	echo -ne "\033[0G\033[0K"
}
if [ -e /dev/.devfsd ]
        then
                RAM_DEVICE="rd"
        else
                RAM_DEVICE="ram0"
fi


# Create the new root FS

mounted=""

initmsg() {
	echo -e "${HILITE}${*}${NORMAL}"
}

getkeymap() {
	local mykeymap
	echo -ne ${HILITE}
	cat /keymaps/key.lst
	echo -ne ${NORMAL}
	read -p "Keymap selection: " mykeymap
	if [ -e /keymaps/${mykeymap}.map ]
	then
		echo -e "${HILITE}---- Loading ${mykeymap} keymap${NORMAL}"
		loadkmap < /keymaps/${mykeymap}.map
	elif [ "$mykeymap" = "" ]
	then
		#default keymap is "us"
		echo -e "${HILITE}---- Loading default (US) keymap${NORMAL}"
		loadkmap < /keymaps/us.map
	else	
		getkeymap
	fi
}

modules_scan() {
	local type
	type=${1}; shift
	for x in "$@"
	do
		blurb "---- Scanning for ${x}..."
		insmod -f /modules/${type}/${x}.o > /dev/null 2>&1
		if [ $? -eq 0 ]
		then
			backup
			echo -e "${GOOD}---- Detected ${x} hardware${NORMAL}"
		else
			backup
			echo -ne "${NORMAL}"
		fi
	done
}
echo "${GOOD} Initial RAMDISK Loading Starting..."
# Mount the CD

if [ "$SCSI" = "yes" ]
then
DEVICE=SCSI
	echo -e "${HILITE} ---- Beginning storage detection${NORMAL}"
	# This next "## ##" gets sed tweaked:
	modules_scan storage ##STORAGE_MODULES##
fi

if [ "$FIREWIRE" = "yes" ]
then
DEVICE=FIREWIRE
        echo -e "${HILITE} ---- Beginning firewire detection${NORMAL}"
        # This next "## ##" gets sed tweaked:
        modules_scan firewire ##FIREWIRE_MODULES##
fi
if [ "$ATARAID" = "yes" ]
then
DEVICE=ATARAID
        echo -e "${HILITE} ---- Beginning ata detection${NORMAL}"
        # This next "## ##" gets sed tweaked:
        modules_scan ataraid ##ATARAID_MODULES##
fi

if [ "$PCMCIA" = "yes" ]
then
DEVICE=PCMCIA
        echo -e "${HILITE} ---- Beginning pcmcia detection${NORMAL}"
        # This next "## ##" gets sed tweaked:
        modules_scan ##PCMCIA_MODULES##
fi
if [ "$USB" = "yes" ]
then
DEVICE=USB
        echo -e "${HILITE} ---- Beginning usb detection${NORMAL}"
        # This next "## ##" gets sed tweaked:
        modules_scan usb ##USB_MODULES##
fi

if [ "$KEYMAP" = "yes" ]
then
getkeymap
fi

exit