]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/90dmraid/module-setup.sh
90dmraid: don't install non-existent dmraid-cleanup
[thirdparty/dracut.git] / modules.d / 90dmraid / module-setup.sh
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 check() {
6 local _rootdev
7 # if we don't have dmraid installed on the host system, no point
8 # in trying to support it in the initramfs.
9 type -P dmraid >/dev/null || return 1
10
11 . $dracutfunctions
12 [[ $debug ]] && set -x
13
14 is_dmraid() { get_fs_type /dev/block/$1 |grep -v linux_raid_member | \
15 grep -q _raid_member; }
16
17 [[ $hostonly ]] && {
18 _rootdev=$(find_root_block_device)
19 if [[ $_rootdev ]]; then
20 # root lives on a block device, so we can be more precise about
21 # hostonly checking
22 check_block_and_slaves is_dmraid "$_rootdev" || return 1
23 else
24 # root is not on a block device, use the shotgun approach
25 dmraid -r | grep -q ok || return 1
26 fi
27 }
28
29 return 0
30 }
31
32 depends() {
33 echo dm rootfs-block
34 return 0
35 }
36
37 install() {
38 local _i
39 dracut_install dmraid partx kpartx
40
41 inst "$moddir/dmraid.sh" /sbin/dmraid_scan
42
43 if [ ! -x /lib/udev/vol_id ]; then
44 inst_rules 64-md-raid.rules
45 fi
46
47 inst_rules "$moddir/61-dmraid-imsm.rules"
48 #inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup
49 inst_hook pre-trigger 30 "$moddir/parse-dm.sh"
50 }