View | Details | Raw Unified | Return to bug 6397
Collapse All | Expand All

(-)rc.sysinit.orig (-4 / +27 lines)
Lines 285-295 Link Here
285
fi
285
fi
286
286
287
# Add raid devices
287
# Add raid devices
288
if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat -a -s /etc/raidtab ] && ! grep -iwqs noraidtab /proc/cmdline; then
289
	echo -n "Starting up RAID devices: " 
290
288
291
	rc=0
289
raid_helpers_found() {
292
	
290
	[ -s /etc/mdadm.conf ] && [ -x /sbin/mdadm -o -x /usr/sbin/mdadm ] && return 0
291
	[ -s /etc/raidtab ] && return 0
292
	return 1
293
}
294
295
mount_raid_using_mdadm() {
296
	local MDADM=/sbin/mdadm
297
	[ -s /etc/mdadm.conf ] || return 1
298
	if [ ! -x "$MDADM" ]; then
299
		MDADM=/usr/sbin/mdadm
300
		[ -x "$MDADM" ] || return 1
301
	fi
302
	"$MDADM" --assemble --scan
303
}
304
305
mount_raid_using_raidtools() {
306
	local rc=0
307
	[ -s /etc/raidtab ] || return 1
293
	for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
308
	for i in `grep -s "^raiddev" /etc/raidtab | awk '{print $2}'`; do
294
		RAIDDEV="${i##*/}"
309
		RAIDDEV="${i##*/}"
295
		RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
310
		RAIDSTAT=`grep -s "^$RAIDDEV : active" /proc/mdstat`
Lines 315-320 Link Here
315
		fi
330
		fi
316
		echo -n "$RAIDDEV "
331
		echo -n "$RAIDDEV "
317
	done
332
	done
333
	return $rc
334
}
335
336
if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ] && raid_helpers_found && ! grep -iwqs noraidtab /proc/cmdline; then
337
338
	echo -n "Starting up RAID devices: " 
339
	rc=0
340
	mount_raid_using_mdadm || mount_raid_using_raidtools || rc=1
318
	echo
341
	echo
319
342
320
	# A non-zero return means there were problems.
343
	# A non-zero return means there were problems.

Return to bug 6397