/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 at recompile
  • Date: 2019-12-04 23:52:20 UTC
  • Revision ID: teddy@recompile.se-20191204235220-yn88brp0scmqwy2t
Remove non-project-specific pattern from .bzrignore

Only project-specific patterns should be in the .bzrignore file.
Other generic patterns should be in the ~/.config/breezy/ignore and
~/.bazaar/ignore files.

* .bzrignore (.tramp_history): Remove.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
 
76
76
# Make directories
77
77
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
78
 
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}" \
 
78
        "${DESTDIR}${MANDOSDIR}" "${DESTDIR}${HOOKDIR}"
 
79
install --owner=${mandos_user} --group=${mandos_group} --directory \
 
80
        --mode=u=rwx "${DESTDIR}${PLUGINDIR}" \
79
81
        "${DESTDIR}${PLUGINHELPERDIR}"
80
 
install --owner=${mandos_user} --group=${mandos_group} --directory \
81
 
    --mode=u=rwx "${DESTDIR}${PLUGINDIR}"
 
82
 
 
83
copy_exec "$libdir"/mandos/mandos-to-cryptroot-unlock "${MANDOSDIR}"
82
84
 
83
85
# Copy the Mandos plugin runner
84
86
copy_exec "$libdir"/mandos/plugin-runner "${MANDOSDIR}"
142
144
for conf in /etc/initramfs-tools/conf.d/*; do
143
145
    if [ -n `basename \"$conf\" | grep '^[[:alnum:]][[:alnum:]\._-]*$' \
144
146
        | grep -v '\.dpkg-.*$'` ]; then
145
 
        [ -f ${conf} ] && . ${conf}
 
147
        [ -f "${conf}" ] && . "${conf}"
146
148
    fi
147
149
done
148
150
export DEVICE
157
159
    if [ -x "$hook" ]; then
158
160
        # Copy any files needed by the network hook
159
161
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
160
 
            VERBOSITY=0 "$hook" files | while read file target; do
 
162
            VERBOSITY=0 "$hook" files | while read -r file target; do
161
163
            if [ ! -e "${file}" ]; then
162
164
                echo "WARNING: file ${file} not found, requested by Mandos network hook '${hook##*/}'" >&2
163
165
            fi
169
171
        done
170
172
        # Copy and load any modules needed by the network hook
171
173
        MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=modules \
172
 
            VERBOSITY=0 "$hook" modules | while read module; do
173
 
            if [ -z "${target}" ]; then
174
 
                force_load "$module"
175
 
            fi
 
174
            VERBOSITY=0 "$hook" modules | while read -r module; do
 
175
            force_load "$module"
176
176
        done
177
177
    fi
178
178
done
186
186
            copy_exec /usr/bin/gpgconf
187
187
        fi
188
188
        gpg="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg:[^:]*://p'`"
 
189
        gpgagent="`/usr/bin/gpgconf|sed --quiet --expression='s/^gpg-agent:[^:]*://p'`"
 
190
        # Newer versions of GnuPG 2 requires the gpg-agent binary
 
191
        if [ -e "$gpgagent" ] && [ ! -e "${DESTDIR}$gpgagent" ]; then
 
192
            copy_exec "$gpgagent"
 
193
        fi
189
194
    fi
190
195
elif dpkg --compare-versions "$libgpgme11_version" ge 1.4.1-0.1; then
191
196
    gpg=/usr/bin/gpg2
247
252
# initrd; it is intended to affect the initrd.img file itself, since
248
253
# it now contains secret key files.  There is, however, no other way
249
254
# to set the permission of the initrd.img file without a race
250
 
# condition.  This umask is set by "initramfs-tools-hook-conf",
251
 
# installed as "/usr/share/initramfs-tools/conf-hooks.d/mandos".)
 
255
# condition.  This umask is set by "initramfs-tools-conf", installed
 
256
# as "/usr/share/initramfs-tools/conf.d/mandos-conf".)
252
257
253
258
for full in "${MANDOSDIR}" "${CONFDIR}"; do
254
259
    while [ "$full" != "/" ]; do
266
271
done
267
272
for dir in "${DESTDIR}"/lib* "${DESTDIR}"/usr/lib*; do
268
273
    if [ -d "$dir" ]; then
269
 
        find "$dir" \! -perm -u+rw,g+r -prune -or -print0 \
270
 
            | xargs --null --no-run-if-empty chmod a+rX
 
274
        find "$dir" \! -perm -u+rw,g+r -prune -or \! -type l -print0 \
 
275
            | xargs --null --no-run-if-empty chmod a+rX --
271
276
    fi
272
277
done