File: check

package info (click to toggle)
dracut 005-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,368 kB
  • ctags: 207
  • sloc: sh: 6,487; ansic: 192; makefile: 108
file content (23 lines) | stat: -rwxr-xr-x 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# No mdadm?  No mdraid support.
which mdadm >/dev/null 2>&1 || exit 1

. $dracutfunctions
[[ $debug ]] && set -x

is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }

[[ $1 = '-h' ]] && {
    rootdev=$(find_root_block_device)
    if [[ $rootdev ]]; then
	# root lives on a block device, so we can be more precise about 
	# hostonly checking
	check_block_and_slaves is_mdraid "$rootdev" || exit 1
    else
	# root is not on a block device, use the shotgun approach
	blkid | grep -q linux_raid || exit 1
    fi
}

exit 0