/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Teddy Hogeborn
  • Date: 2008-09-04 14:12:10 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080904141210-ig3or8uiz3cpxatj
* plugins.d/password-request.xml (EXAMPLE): Improved wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
. /usr/share/initramfs-tools/hook-functions
31
31
 
32
 
for d in /usr /usr/local; do
33
 
    if [ -d "$d"/lib/mandos ]; then
34
 
        prefix="$d"
35
 
        break
36
 
    fi
37
 
done
38
 
if [ -z "$prefix" ]; then
 
32
if [ -d /usr/lib/mandos ]; then
 
33
    prefix=/usr
 
34
elif [ -d /usr/local/lib/mandos ]; then
 
35
    prefix=/usr/local
 
36
else
39
37
    # Mandos not found
40
38
    exit 1
41
39
fi
42
40
 
43
 
for d in /etc/keys/mandos /usr/local/lib/mandos/keys; do
44
 
    if [ -d "$d" ]; then
45
 
        keydir="$d"
46
 
        break
47
 
    fi
48
 
done
49
 
if [ -z "$keydir" ]; then
50
 
    # Mandos key directory not found
51
 
    exit 1
52
 
fi
53
 
 
54
41
# The Mandos network client uses the network
55
42
auto_add_modules net
56
43
# The Mandos network client uses IPv6
66
53
mkdir --parents "${DESTDIR}${PLUGINDIR}"
67
54
 
68
55
# Copy the Mandos plugin runner
69
 
copy_exec "$prefix"/lib/mandos/plugin-runner "${MANDOSDIR}"
 
56
copy_exec "$prefix"/lib/mandos/plugin-runner "${DESTDIR}${MANDOSDIR}"
70
57
 
71
58
# Copy the plugins
72
59
 
79
66
    fi
80
67
    case "$base" in
81
68
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
82
 
        "*") :;;
83
69
        *) copy_exec "$file" "${PLUGINDIR}";;
84
70
    esac
85
71
done
89
75
    base="`basename \"$file\"`"
90
76
    case "$base" in
91
77
        *~|.*|\#*\#|*.dpkg-old|*.dpkg-new|*.dpkg-divert) : ;;
92
 
        "*") :;;
93
78
        *) copy_exec "$file" "${PLUGINDIR}";;
94
79
    esac
95
80
done
100
85
    copy_exec /usr/bin/gpg
101
86
fi
102
87
 
103
 
# Config files and key files 
104
 
for file in /etc/mandos/* "$keydir"/*; do
 
88
# Key files and config files
 
89
for file in /etc/mandos/*; do
105
90
    if [ -d "$file" ]; then
106
91
        continue
107
92
    fi
130
115
# Reset some other things to sane permissions which we have
131
116
# inadvertently affected with our umask setting.
132
117
for dir in / /bin /etc /keyscripts /sbin /scripts /usr /usr/bin; do
133
 
    if [ -d "${DESTDIR}$dir" ]; then
134
 
        chmod a+rX "${DESTDIR}$dir"
135
 
    fi
 
118
    chmod a+rX "${DESTDIR}$dir"
136
119
done
137
120
for dir in /lib /usr/lib; do
138
121
    find "${DESTDIR}$dir" \! -perm /u+rw,g+r -prune -o -print0 \
139
 
        | xargs --null --no-run-if-empty chmod a+rX
 
122
        | xargs --null chmod a+rX
140
123
done