summaryrefslogtreecommitdiff
path: root/scripts/local
blob: 917528a892a1e1d83618d3d1a2fe33df9e9d3c00 (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
# Local filesystem mounting			-*- shell-script -*-

# Parameter: Where to mount the filesystem
mountroot ()
{
	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
	run_scripts /scripts/local-top
	[ "$quiet" != "y" ] && log_end_msg

	# Get the root filesystem type
	while [ ! -e "${ROOT}" ]; do
		panic "ALERT!  ${ROOT} does not exist.  Dropping to a shell!"
	done

	eval $(fstype < ${ROOT})

	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-premount"
	run_scripts /scripts/local-premount
	[ "$quiet" != "y" ] && log_end_msg

	if [ ${readonly} = y ]; then
		roflag=-r
	else
		roflag=-w
	fi

	# FIXME This has no error checking
	modprobe -q ${FSTYPE}

	# FIXME This has no error checking
	# Mount root
	mount ${roflag} -t ${FSTYPE} ${ROOT} ${rootmnt}

	[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/log-bottom"
	run_scripts /scripts/local-bottom
	[ "$quiet" != "y" ] && log_end_msg
}