This repository has been archived by the owner on Sep 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
install.sh
executable file
·68 lines (58 loc) · 3.16 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
if [[ -z "${PREFIX}" ]]; then
echo "No PREFIX specified. Dont know where to install rd files!"
echo ""
echo "e.g. $ PREFIX=~/myrd ./install.sh"
echo " This command will install rd files and directories to ~/myrd "
echo " rd related files will be stored in ~/myrd/bin, ~/myrd/lib and ~/myrd/share"
exit 1
fi
if [[ -d "${PREFIX}" ]]; then
echo "Installing rd to: ${PREFIX}"
echo "NOTE: ${PREFIX}/bin, ${PREFIX}/lib, ${PREFIX}/share will be populated with rd files..."
else
echo "'${PREFIX}' does not exist. Trying to create it"
install -v -d "${PREFIX}"
fi
if [[ -n "${DEBUG}" ]]; then
echo "Debug version will be compiled"
DEBUG="--debug"
fi
set -x
cargo install ${DEBUG} --locked --force --path . --root "${PREFIX}"
set +x
echo "Installing additional files and directories"
install -v -d "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/rd_page_64 "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/rd_page_64_replay "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/rd_page_32 "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/rd_page_32_replay "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/32bit-avx.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/32bit-core.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/32bit-linux.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/32bit-sse.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/64bit-avx.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/64bit-core.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/64bit-linux.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/64bit-seg.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/64bit-sse.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/amd64-avx-linux.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/amd64-linux.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/i386-avx-linux.xml "${PREFIX}/share/rd"
install -v -m 0644 -C target/share/rd/i386-linux.xml "${PREFIX}/share/rd"
install -v -d "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/syscall_hook.S "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/syscallbuf.c "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/raw_syscall.S "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/breakpoint_table.S "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/overrides.c "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/preload_interface.h "${PREFIX}/share/rd/src/preload"
install -v -m 0644 -C target/share/rd/src/preload/syscallbuf.h "${PREFIX}/share/rd/src/preload"
install -v -d "${PREFIX}/lib/rd"
install -v -m 0644 -C target/lib/rd/librdpreload.so "${PREFIX}/lib/rd"
install -v -m 0644 -C target/lib/rd/librdpreload_32.so "${PREFIX}/lib/rd"
install -v -d "${PREFIX}/bin"
install -v -m 0755 -C target/bin/rd_exec_stub "${PREFIX}/bin"
install -v -m 0755 -C target/bin/rd_exec_stub_32 "${PREFIX}/bin"
echo "Done"