/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: 2011-12-31 23:05:34 UTC
  • Revision ID: teddy@recompile.se-20111231230534-o5w0uhwx30gwhmk7
Updated year in copyright notices.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# This script will be run by 'mkinitramfs' when it creates the image.
4
4
# Its job is to decide which files to install, then install them into
5
5
# the staging area, where the initramfs is being created.  This
6
 
# happens when a new 'linux-image' package is installed, or when an
 
6
# happens when a new 'linux-image' package is installed, or when the
7
7
# administrator runs 'update-initramfs' by hand to update an initramfs
8
8
# image.
9
9
 
29
29
 
30
30
. /usr/share/initramfs-tools/hook-functions
31
31
 
32
 
for d in /usr/lib \
33
 
    "/usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null`" \
34
 
    "`rpm --eval='%{_libdir}' 2>/dev/null`" /usr/local/lib; do
35
 
    if [ -d "$d"/mandos ]; then
36
 
        libdir="$d"
 
32
for d in /usr /usr/local; do
 
33
    if [ -d "$d"/lib/mandos ]; then
 
34
        prefix="$d"
37
35
        break
38
36
    fi
39
37
done
40
 
if [ -z "$libdir" ]; then
 
38
if [ -z "$prefix" ]; then
41
39
    # Mandos not found
42
40
    exit 1
43
41
fi
79
77
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
80
78
 
81
79
# Copy the Mandos plugin runner
82
 
copy_exec "$libdir"/mandos/plugin-runner "${MANDOSDIR}"
 
80
copy_exec "$prefix"/lib/mandos/plugin-runner "${MANDOSDIR}"
83
81
 
84
82
# Copy the plugins
85
83
 
86
84
# Copy the packaged plugins
87
 
for file in "$libdir"/mandos/plugins.d/*; do
 
85
for file in "$prefix"/lib/mandos/plugins.d/*; do
88
86
    base="`basename \"$file\"`"
89
87
    # Is this plugin overridden?
90
88
    if [ -e "/etc/mandos/plugins.d/$base" ]; then
149
147
    fi
150
148
done
151
149
 
152
 
# GPGME needs GnuPG
153
 
gpg=/usr/bin/gpg
154
 
libgpgme11_version="`dpkg-query --showformat='${Version}' --show libgpgme11`"
155
 
if dpkg --compare-versions "$libgpgme11_version" ge 1.5.0-0.1; then
156
 
    if [ -e /usr/bin/gpgconf ]; then
157
 
        if [ ! -e "${DESTDIR}/usr/bin/gpgconf" ]; then
158
 
            copy_exec /usr/bin/gpgconf
159
 
        fi
160
 
        gpg="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg:[^:]*://p'`"
161
 
    fi
162
 
elif dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
163
 
    gpg=/usr/bin/gpg2
164
 
fi
165
 
if [ ! -e "${DESTDIR}$gpg" ]; then
166
 
    copy_exec "$gpg"
167
 
fi
168
 
unset gpg
169
 
unset libgpgme11_version
 
150
# GPGME needs /usr/bin/gpg
 
151
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
 
152
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
 
153
                2>/dev/null`" ]; then
 
154
    copy_exec /usr/bin/gpg
 
155
fi
170
156
 
171
157
# Config files
172
158
for file in /etc/mandos/plugin-runner.conf; do