]>
Commit | Line | Data |
---|---|---|
7db7d5b7 JR |
1 | #!/bin/bash |
2 | # SPDX-License-Identifier: LGPL-2.1+ | |
3 | # | |
4 | # Copyright 2017 Jonathan Rudenberg | |
5 | # | |
6 | # systemd is free software; you can redistribute it and/or modify it | |
7 | # under the terms of the GNU Lesser General Public License as published by | |
8 | # the Free Software Foundation; either version 2.1 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # systemd is distributed in the hope that it will be useful, but | |
12 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 | # Lesser General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU Lesser General Public License | |
17 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | set -ex | |
20 | ||
21 | export LC_CTYPE=C.UTF-8 | |
22 | ||
7d941c06 JR |
23 | if [ -z "$WORK" ]; then |
24 | echo '$WORK must be set' | |
25 | exit 1 | |
26 | fi | |
27 | build=$WORK/build | |
28 | rm -rf $build | |
29 | mkdir -p $build | |
30 | ||
31 | meson $build -Doss-fuzz=true -Db_lundef=false | |
32 | ninja -C $build fuzzers | |
7db7d5b7 JR |
33 | |
34 | # get DNS packet corpus | |
7d941c06 | 35 | df=$build/dns-fuzzing |
7db7d5b7 JR |
36 | git clone --depth 1 https://github.com/CZ-NIC/dns-fuzzing $df |
37 | zip -jqr $OUT/fuzz-dns-packet_seed_corpus.zip $df/packet | |
38 | ||
39 | mkdir -p $OUT/src/shared | |
7d941c06 | 40 | mv $build/src/shared/libsystemd-shared-*.so $OUT/src/shared |
7db7d5b7 | 41 | |
7d941c06 JR |
42 | find $build -maxdepth 1 -type f -executable -name "fuzz-*" -exec mv {} $OUT \; |
43 | mv $build/*.so src/fuzz/*.options $OUT |