File: module-setup.sh

package info (click to toggle)
dracut 109-5
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,592 kB
  • sloc: sh: 24,498; ansic: 5,234; makefile: 346; perl: 186; python: 48; javascript: 19
file content (30 lines) | stat: -rwxr-xr-x 817 bytes parent folder | download | duplicates (6)
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
#!/bin/bash

# called by dracut
check() {
    return 255
}

# due to the dependencies below, this dracut module needs to be ordered later than network-manager, systemd-networkd, connman and network-legacy dracut modules

# called by dracut
depends() {
    for module in network-manager systemd-networkd connman network-legacy; do
        if dracut_module_included "$module"; then
            echo "$module"
            return 0
        fi
    done

    for module in network-manager systemd-networkd connman; do
        # install the first viable module, unless there omitted
        module_check $module > /dev/null 2>&1
        if [[ $? == 255 ]] && ! [[ " $omit_dracutmodules " == *\ $module\ * ]]; then
            echo "$module"
            return 0
        fi
    done

    echo "network-legacy"
    return 0
}