/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: 2014-10-08 21:07:10 UTC
  • Revision ID: teddy@recompile.se-20141008210710-x0rg80z2aabdg05d
Handle local Zeroconf service name collisions.

Service name collisions from other servers have always been handled,
but not *local* name collisions from services on the same host.

* mandos (AvahiService/rename): Handle local Zeroconf service name
                                collision.
  (AvahiServiceToSyslog.rename): Pass on any extra arguments.

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 the
 
6
# happens when a new 'linux-image' package is installed, or when an
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 /usr/local; do
33
 
    if [ -d "$d"/lib/mandos ]; then
34
 
        prefix="$d"
 
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"
35
37
        break
36
38
    fi
37
39
done
38
 
if [ -z "$prefix" ]; then
 
40
if [ -z "$libdir" ]; then
39
41
    # Mandos not found
40
42
    exit 1
41
43
fi
77
79
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
78
80
 
79
81
# Copy the Mandos plugin runner
80
 
copy_exec "$prefix"/lib/mandos/plugin-runner "${MANDOSDIR}"
 
82
copy_exec "$libdir"/mandos/plugin-runner "${MANDOSDIR}"
81
83
 
82
84
# Copy the plugins
83
85
 
84
86
# Copy the packaged plugins
85
 
for file in "$prefix"/lib/mandos/plugins.d/*; do
 
87
for file in "$libdir"/mandos/plugins.d/*; do
86
88
    base="`basename \"$file\"`"
87
89
    # Is this plugin overridden?
88
90
    if [ -e "/etc/mandos/plugins.d/$base" ]; then
147
149
    fi
148
150
done
149
151
 
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
 
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
156
170
 
157
171
# Config files
158
172
for file in /etc/mandos/plugin-runner.conf; do