summaryrefslogtreecommitdiffstats
path: root/debian/09console-setup/module-setup.sh
blob: 10821b0e57bff15b0ee8f8be7736d5f1cd234796 (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
#!/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 vardir
    vardir=/var/lib/dracut

    [ -x /bin/setupcon ] || return 1
    setupcon --help 2>&1 | grep "\-\-setup-dir" > /dev/null || return 1

    rm -rf $vardir/console-setup-dir
    mkdir -p $vardir/console-setup-dir || return 1
    setupcon --setup-dir $vardir/console-setup-dir || return 1
    mv $vardir/console-setup-dir/morefiles $vardir/console-setup-files
}

depends() {
    return 0
}

install() {
    local vardir
    vardir=/var/lib/dracut

    cp -a $vardir/console-setup-dir/bin/* $initdir/bin/
    cp -a $vardir/console-setup-dir/etc/* $initdir/etc/
    # gzip is workaround a bug in current console-setup
    inst_multiple gzip $(cat $vardir/console-setup-files)
    inst ${moddir}/console-setup.sh /lib/udev/console-setup
    inst_rules ${moddir}/10-console.rules
}