summaryrefslogtreecommitdiffstats
path: root/dev-tools/exampleDracutModule/module-setup.sh
blob: 8a7d0e07248d1c74f144959bf3c4557f5f2e9bd7 (plain) (blame)
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
#!/usr/bin/env bash
# -*- coding: utf-8 -*-

source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd '../' && \
    cd *'dnbd3-rootfs/scripts/rebash' && pwd)/core.sh"
core.import exceptions
core.import logging

check() {
    local __doc__='
    Checks whether needed assumptions are satisfied.

    Example:

    `check`
    '

    # Here we could build our package file.

    # Tell dracut that this module should only be included if it is required
    # explicitly.
    return 255
}
depends() {
    local __doc__='
    Outputs all dependent dracut modules to make this module work.

    >>> depends
    +doc_test_contains
    base
    '
    echo dnbd3-rootfs
}
install() {
    local __doc__='
    Copies all needed files into the initramfs image and registers all needed
    dracut hooks.

    Example:

    `install`
    '
    inst_hook pre-pivot 00 "$moddir/apply-package.sh"
    inst_multiple tar wget
}