summarylogtreecommitdiffstats
path: root/torhttp_install
blob: 7af6c2f03487265f57ddbbb0a6759678af10a4fc (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
#!/bin/bash

build ()
{
    local mod

    add_module dm-crypt
    if [[ $CRYPTO_MODULES ]]; then
        for mod in $CRYPTO_MODULES; do
            add_module "$mod"
        done
    else
        add_all_modules '/crypto/'
    fi

    add_binary "cryptsetup"
    add_binary "dmsetup"
    add_file "/usr/lib/libnss_dns.so.2" "/usr/lib/libnss_dns.so.2" "$(stat -Lc %a /usr/lib/libnss_dns.so.2)"
    add_file "/usr/lib/libnss_files.so.2" "/usr/lib/libnss_files.so.2" "$(stat -Lc %a /usr/lib/libnss_files.so.2)"
    add_file "/usr/lib/libgcc_s.so.1" "/usr/lib/libgcc_s.so.1" "$(stat -Lc %a /usr/lib/libgcc_s.so.1)"
    add_file "/etc/resolv.conf"
    add_file "/usr/lib/udev/rules.d/10-dm.rules"
    add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
    add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
    add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
    add_binary "/usr/bin/jq"
    add_binary "/usr/bin/sysctl"
    add_binary "/usr/bin/curl"
    add_binary "/usr/bin/killall"
    add_binary "/usr/bin/tor"
    add_file "/usr/share/mkinitcpio-tor-http/torrc" /torrc
    add_file "/etc/default/mkinitcpio-tor-http" /config.sh 0755
    add_runscript
}

help ()
{
    cat<<HELPEOF
This hook will add tor binary and configuration to the initramfs. It is meant
for situations where the server does not have direct connectivity or the user
wants to conceal the fact a server is using remote unlocking.
HELPEOF
}