/mandos/release

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

« back to all changes in this revision

Viewing changes to initramfs-tools-hook

  • Committer: Björn Påhlsson
  • Date: 2011-11-28 07:38:37 UTC
  • mto: (237.7.73 trunk)
  • mto: This revision was merged to the branch mainline in revision 290.
  • Revision ID: belorn@recompile.se-20111128073837-rom2ul1agen1iu3y
todo updates

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
 
107
107
    esac
108
108
done
109
109
 
110
 
# Get DEVICE from initramfs.conf and other files
111
 
. /etc/initramfs-tools/initramfs.conf
112
 
for conf in /etc/initramfs-tools/conf.d/*; do
113
 
    if [ -n `basename \"$conf\" | grep '^[[:alnum:]][[:alnum:]\._-]*$' \
114
 
        | grep -v '\.dpkg-.*$'` ]; then
115
 
        [ -f ${conf} ] && . ${conf}
116
 
    fi
117
 
done
118
 
export DEVICE
119
 
 
120
110
# Copy network hooks
121
111
for hook in /etc/mandos/network-hooks.d/*; do
122
112
    case "`basename \"$hook\"`" in
128
118
        # Copy any files needed by the network hook
129
119
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
130
120
            VERBOSITY=0 "$hook" files | while read file target; do
131
 
            if [ ! -e "${file}" ]; then
132
 
                echo "WARNING: file ${file} not found, requested by Mandos network hook '${hook##*/}'" >&2
133
 
            fi
134
121
            if [ -z "${target}" ]; then
135
122
                copy_exec "$file"
136
123
            else
147
134
    fi
148
135
done
149
136
 
150
 
# GPGME needs GnuPG
151
 
libgpgme11_version="`dpkg-query --showformat='${Version}' --show libgpgme11`"
152
 
if dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
153
 
    gpg=/usr/bin/gpg2
154
 
else
155
 
    gpg=/usr/bin/gpg
156
 
fi
157
 
if [ ! -e "${DESTDIR}$gpg" ]; then
158
 
    copy_exec "$gpg"
159
 
fi
160
 
unset gpg
161
 
unset libgpgme11_version
 
137
# GPGME needs /usr/bin/gpg
 
138
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
 
139
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
 
140
                2>/dev/null`" ]; then
 
141
    copy_exec /usr/bin/gpg
 
142
fi
162
143
 
163
144
# Config files
164
145
for file in /etc/mandos/plugin-runner.conf; do