/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

* initramfs-tools-hook: Install network hooks (and any required files)
                        in the initramfs image.
* plugins.d/mandos-client.c (main): Also set MANDOSNETHOOKDIR for
                                    network hooks.
* plugins.d/mandos-client.xml (OPTIONS): Use <filename
                                         class="directory">, not
                                         <directory>.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
CONFDIR="/conf/conf.d/mandos"
69
69
MANDOSDIR="/lib/mandos"
70
70
PLUGINDIR="${MANDOSDIR}/plugins.d"
 
71
HOOKDIR="${MANDOSDIR}/network-hooks.d"
71
72
 
72
73
# Make directories
73
74
install --directory --mode=u=rwx,go=rx "${DESTDIR}${CONFDIR}" \
106
107
    esac
107
108
done
108
109
 
 
110
# Copy network hooks
 
111
for hook in /etc/mandos/network-hooks.d/*; do
 
112
    case "`basename \"$hook\"`" in
 
113
        "*") continue ;;
 
114
        *[!A-Za-z0-9_-]*) continue ;;
 
115
        *) test -d "$hook" || copy_exec "$hook" "${HOOKDIR}" ;;
 
116
    esac
 
117
    # Copy any files needed by the network hook
 
118
    MANDOSNETHOOKDIR=/etc/mandos/network-hooks.d MODE=files \
 
119
        "$hook" files | while read file target; do
 
120
        if [ -z "${target}" ]; then
 
121
            copy_exec "$file"
 
122
        else
 
123
            copy_exec "$file" "$target"
 
124
        fi
 
125
    done
 
126
done
 
127
 
109
128
# GPGME needs /usr/bin/gpg
110
129
if [ ! -e "${DESTDIR}/usr/bin/gpg" \
111
130
    -a -n "`ls \"${DESTDIR}\"/usr/lib/libgpgme.so* \
114
133
fi
115
134
 
116
135
# Config files
117
 
for file in /etc/mandos/*; do
 
136
for file in /etc/mandos/plugin-runner.conf; do
118
137
    if [ -d "$file" ]; then
119
138
        continue
120
139
    fi
131
150
        "${DESTDIR}${CONFDIR}/plugin-runner.conf"
132
151
fi
133
152
 
134
 
# Key files 
 
153
# Key files
135
154
for file in "$keydir"/*; do
136
155
    if [ -d "$file" ]; then
137
156
        continue