summaryrefslogtreecommitdiff
blob: a26554431ed5eea1cc700c4a57b663ece184f19b (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
#!/sbin/runscript
. /etc/mrgssv.sh

depend() {
	after *
}

CLEAN_TMP() {
	[ -z "${VARMERGE}" ] && return
	find ${VARMERGE}/tmp -atime +1 -type f -exec rm {} \;
	return
}

Work_Around() {
	[ "_${SYSTEMTYPE} != "_linux" ] && return
	# In certain situations on Linux systems, the Win4Lin installation
	# script does not complete.
	# If it looks like that situation then re-run the installation script
	# and force the making of the images. (Even though the images should
	# have been automatically created in this situation.)

	# When the images are not there, but Windows files are loaded, then
	# re-run the install script and then explicitly make images.
	[ -r "${VARMERGE}"/image/std/mono/mono.img ] && return
	[ ! -r "${VARMERGE}"/dosroot/wincabs/info.txt ] && return

	# Don't continue if the modules are not loaded.
	modules=`/sbin/lsmod|grep Mmerge`
	[ "x$modules" = "x" ] && return

	[ -r "${VARMERGE}"/postinst-running ] && return
	touch "${VARMERGE}"/postinst-running
	sh "${STATICMERGE}"/postinst_rpm.sh \
		> "${VARMERGE}"/log/postinst-boot.log 2>&1

	ls -l "${VARMERGE}"/image/std/* > "${VARMERGE}"/log/mkimg-boot.log 2>&1
	/usr/bin/mkimg >> "${VARMERGE}"/log/mkimg-boot.log 2>&1
	rm -f "${VARMERGE}"/postinst-running
}

start() {
	if [ "_${SYSTEMTYPE}" != "_linux" ]
	then
		ebegin "Starting ${MERGENAME}"
	else
		ebegin "Starting ${MERGENAME}:"

	CLEAN_TMP
	sh ${STATICMERGE}mrg_setup.sh
	Work_Around
	eend $?
}


stop() {
	if [ "_${SYSTEMTYPE}" != "_linux" ]
	then
		ebegin "Stopping ${MERGENAME}"
		eend $?
		return
	fi

	ebegin "Stopping ${MERGENAME}:"
	( cd ${STATICMERGE}/drivers ; sh tools/unloadem )
	${STATICMERGE}/rlockshm -r > /dev/null 2>&1
	eend $?
}