File: module-setup.sh

package info (click to toggle)
dracut 020-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,536 kB
  • sloc: sh: 11,827; ansic: 1,960; makefile: 183; python: 165; perl: 55
file content (38 lines) | stat: -rwxr-xr-x 871 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

check() {
    local _rootdev
    # if we don't have btrfs installed on the host system,
    # no point in trying to support it in the initramfs.
    type -P btrfs >/dev/null || return 1

    [[ $hostonly ]] || [[ $mount_needs ]] && {
        local _found
        for fs in ${host_fs_types[@]}; do
            strstr "$fs" "\|btrfs" && _found="1"
        done
        [[ $_found ]] || return 1
        unset _found
    }

    return 0
}

depends() {
    echo udev-rules
    return 0
}

installkernel() {
    instmods btrfs crc32c
}

install() {
    inst_rules "$moddir/80-btrfs.rules"
    inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished
    inst_script "$moddir/btrfs_timeout.sh" /sbin/btrfs_timeout
    dracut_install btrfs btrfsck
}