summaryrefslogtreecommitdiffstats
path: root/abs/core/plymouth/plymouth.install
blob: 9194805f8b37a20fdf59b5dacc5fb9a2eb1275d7 (plain)
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
build() {
    theme="$(get_theme "/etc/plymouth/plymouthd.conf")"
    if [[ "$theme" ]]; then
        add_file /etc/plymouth/plymouthd.conf
    else
        # fallback
        theme="$(get_theme "/usr/share/plymouth/plymouthd.defaults")"
        if [[ ! "$theme" ]]; then
            echo "no theme set for plymouth"
            exit 1
        fi
        add_file /usr/share/plymouth/plymouthd.defaults
    fi

    if [[ ! -d "/usr/share/plymouth/themes/$theme" ]]; then
        echo "invalid plymouth theme: $theme"
        exit 1
    fi

    module="$(get_module "$theme")"
    add_file /usr/share/plymouth/arch-logo.png

    add_binary /usr/bin/plymouthd
    add_binary /usr/bin/plymouth

    add_binary /usr/lib/plymouth/renderers/drm.so
    add_binary /usr/lib/plymouth/renderers/frame-buffer.so

    add_binary /usr/lib/plymouth/$module.so
    add_full_dir /usr/share/plymouth/themes/$theme

    add_runscript
}

# $1 = file
get_theme() {
    grep ^Theme= "$1" | cut -d = -f 2-
}

# $1 = theme
get_module() {
    grep ^ModuleName= "/usr/share/plymouth/themes/$1/$1.plymouth" | cut -d = -f 2-
}