pwndbg/setup-dev.sh

236 lines
5.9 KiB
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -e
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
echo "# --------------------------------------"
echo "# Install testing tools."
echo "# Only works with Ubuntu / APT or Arch / Pacman."
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
echo "# --------------------------------------"
hook_script_path=".git/hooks/pre-push"
hook_script=$(
cat << 'EOF'
#!/usr/bin/env bash
diff_command="git diff --no-ext-diff --ignore-submodules"
old_diff=$($diff_command)
./lint.sh -f
exit_code=$?
new_diff=$($diff_command)
if [[ "$new_diff" != "$old_diff" ]]; then
echo "Files were modified by the linter, amend your commit and try again"
exit 1
fi
exit $exit_code
EOF
)
if [ -t 1 ] && [ ! -f $hook_script_path ]; then
echo "Install a git hook to automatically lint files before pushing? (y/N)"
read yn
if [[ "$yn" == [Yy]* ]]; then
echo "$hook_script" > "$hook_script_path"
2024-03-20 00:11:00 +08:00
# make the hook executable
chmod ug+x "$hook_script_path"
echo "pre-push hook installed to $hook_script_path and made executable"
fi
fi
# If we are a root in a container and `sudo` doesn't exist
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
# lets overwrite it with a function that just executes things passed to sudo
# (yeah it won't work for sudo executed with flags)
if ! hash sudo 2> /dev/null && whoami | grep root; then
sudo() {
${*}
}
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
fi
linux() {
uname | grep -i Linux &> /dev/null
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
}
set_zigpath() {
if [[ -z "$ZIGPATH" ]]; then
# If ZIGPATH is not set, set it
# In Docker environment this should by default be set to /opt/zig (APT) or /usr/bin (Pacman)
export ZIGPATH="$1"
fi
echo "ZIGPATH set to $ZIGPATH"
}
download_zig_binary() {
# Install zig to current directory
# We use zig to compile some test binaries as it is much easier than with gcc
2023-03-17 01:16:49 +08:00
ZIG_TAR_URL="https://ziglang.org/download/0.10.1/zig-linux-x86_64-0.10.1.tar.xz"
ZIG_TAR_SHA256="6699f0e7293081b42428f32c9d9c983854094bd15fee5489f12c4cf4518cc380"
curl --output /tmp/zig.tar.xz "${ZIG_TAR_URL}"
ACTUAL_SHA256=$(sha256sum /tmp/zig.tar.xz | cut -d' ' -f1)
if [ "${ACTUAL_SHA256}" != "${ZIG_TAR_SHA256}" ]; then
echo "Zig binary checksum mismatch"
echo "Expected: ${ZIG_TAR_SHA256}"
echo "Actual: ${ACTUAL_SHA256}"
exit 1
fi
tar -C /tmp -xJf /tmp/zig.tar.xz
mv /tmp/zig-linux-x86_64-* ${ZIGPATH} &> /dev/null || true
echo "Zig installed to ${ZIGPATH}"
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
}
install_apt() {
set_zigpath "$(pwd)/.zig"
sudo apt-get update || true
sudo apt-get install -y \
nasm \
gcc \
libc6-dev \
curl \
build-essential \
gdb \
2023-01-19 10:58:28 +08:00
gdb-multiarch \
parallel \
2023-01-19 10:58:28 +08:00
netcat-openbsd \
Qemu user test structure (#2275) * Initial version of qemu-user tests * Refactor testing files to reduce file duplication, introduce qemu-user-tests * lint and edit github actions workflow file. Move old qemu-user tests to seperate directory * Add iproute2 so ss command is available * test ubuntu 24 * funkiness with current working directory... * Further remote old test_qemu.sh and integrate into a Pytest fixture * lint * Disable ASLR, add test for aarch64 jumps * Use Popen.kill() function to make sure it closes. Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com> * qemu.kill() on the other fixture as well * comment * comment * lint * system test path stuff * remove old try-catch block * revert * revert path change * Use os._exit to pass return code, and move qemu-user tests above system tests because they run significantly faster * lint * Flush stdout before os._exit * Comment out flaky check for the address of main in old qemu tests * rename qemu-user to cross-arch * rename qemu-user to cross-arch and hotfix to not run pytest when cross-arch is used * remove todo comment * another comment * Test pwndbg.gdblib.symbol.address is not None and revert setarch -R * Revert os.exit change * Revert os.exit change * Revert os.exit change * readd os.exit in new exit places * lint * rebase * delete file introduced in rebase * break up tests into 3 files to invoke separately. Update GitHub workflow, remove code duplication in existing test * code coverage * fix code coverage * lint * test difference between Ubuntu 22 and 24 in Kernel tests * lint --------- Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2024-08-17 07:49:45 +08:00
iproute2 \
2023-01-19 10:58:28 +08:00
qemu-system-x86 \
qemu-system-arm \
qemu-user \
gcc-aarch64-linux-gnu \
Qemu user test structure (#2275) * Initial version of qemu-user tests * Refactor testing files to reduce file duplication, introduce qemu-user-tests * lint and edit github actions workflow file. Move old qemu-user tests to seperate directory * Add iproute2 so ss command is available * test ubuntu 24 * funkiness with current working directory... * Further remote old test_qemu.sh and integrate into a Pytest fixture * lint * Disable ASLR, add test for aarch64 jumps * Use Popen.kill() function to make sure it closes. Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com> * qemu.kill() on the other fixture as well * comment * comment * lint * system test path stuff * remove old try-catch block * revert * revert path change * Use os._exit to pass return code, and move qemu-user tests above system tests because they run significantly faster * lint * Flush stdout before os._exit * Comment out flaky check for the address of main in old qemu tests * rename qemu-user to cross-arch * rename qemu-user to cross-arch and hotfix to not run pytest when cross-arch is used * remove todo comment * another comment * Test pwndbg.gdblib.symbol.address is not None and revert setarch -R * Revert os.exit change * Revert os.exit change * Revert os.exit change * readd os.exit in new exit places * lint * rebase * delete file introduced in rebase * break up tests into 3 files to invoke separately. Update GitHub workflow, remove code duplication in existing test * code coverage * fix code coverage * lint * test difference between Ubuntu 22 and 24 in Kernel tests * lint --------- Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
2024-08-17 07:49:45 +08:00
gcc-riscv64-linux-gnu \
gcc-arm-linux-gnueabihf \
gcc-mips-linux-gnu \
gcc-mips64-linux-gnuabi64
if [[ "$1" != "" ]]; then
sudo apt install shfmt
fi
command -v go &> /dev/null || sudo apt-get install -y golang
download_zig_binary
}
install_pacman() {
set_zigpath "$(pwd)/.zig"
# add debug repo for glibc-debug if it doesn't already exist
if ! grep -q "\[core-debug\]" /etc/pacman.conf; then
cat << EOF | sudo tee -a /etc/pacman.conf
[core-debug]
Include = /etc/pacman.d/mirrorlist
EOF
fi
if ! grep -q "\[extra-debug\]" /etc/pacman.conf; then
cat << EOF | sudo tee -a /etc/pacman.conf
[extra-debug]
Include = /etc/pacman.d/mirrorlist
EOF
fi
if ! grep -q "\[multilib-debug\]" /etc/pacman.conf; then
cat << EOF | sudo tee -a /etc/pacman.conf
[multilib-debug]
Include = /etc/pacman.d/mirrorlist
EOF
fi
sudo pacman -Syu --noconfirm || true
sudo pacman -S --needed --noconfirm \
nasm \
gcc \
glibc-debug \
curl \
base-devel \
gdb \
parallel
# check if netcat exists first, as it might it may be installed from some other netcat packages
if [ ! -f /usr/bin/nc ]; then
sudo pacman -S --needed --noconfirm gnu-netcat
fi
command -v go &> /dev/null || sudo pacman -S --noconfirm go
download_zig_binary
}
install_dnf() {
set_zigpath "$(pwd)/.zig"
sudo dnf upgrade || true
sudo dnf install -y \
nasm \
gcc \
curl \
gdb \
parallel \
qemu-system-arm \
qemu-user
command -v go &> /dev/null || sudo dnf install -y go
if [[ "$1" != "" ]]; then
sudo dnf install shfmt
fi
download_zig_binary
}
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
if linux; then
distro=$(
. /etc/os-release
echo ${ID}
)
Unit test fix (#868) * Fixed the failed unit testing; Improved the Dockerfile, again. * Fixed missing new line joiner in the Dockerfile. * Fixed the default Python version from 2 to 3. * Moved the installation of the nasm and golang packages to the setup script. * Fixed the extra quotes which fails the sudo check. * Added to the Git ignore file the output files assembled and linked in the test binaries. * Removed the output files from test binaries. * Added to the Git ignore file the virtual environment directory. * Added sudo to the remove and link the Python3 binary. * Added commands related to GO, to check why is failing. * Fixed the installation of GO, only install if not exists in Ubuntu. * Fixed the first test built in Assembler. Checks if it is working in GitHub. * Fixed the problem with all the assembler tests; Extracted the asserts into methods, avoiding duplicates. * Fixed some test, should be fail the Travis tests. * Fixed one test for Travis. * Fixed the asserts, now find all ecpected items into the output. * Fixed the split message, joined again. * Fixed the last error test for loads binary. * Fixed one missing number in the comparison. * Fixed the first Lint errors. * Added comment in the Dockerfile. The commented line about `git submodule`. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075767 * Removed NASM and Go from the setup. Created a new bash script to install them and added to the Dockerfile. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Added the setup script in the GitHub test workflow. https://github.com/pwndbg/pwndbg/pull/868/files#r549075931 https://github.com/pwndbg/pwndbg/pull/868/files#r549076078 * Testing the emulate cases. It should be fail. I commented the emulation for the address 0x401000. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 * Fixed the different start addresses in the assembler test. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549111511 https://github.com/pwndbg/pwndbg/pull/868#discussion_r549075485 * Experimenting with the python location. Commented the remove python binary and added some logs. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170 * Removed the commands about delete Python and link the Python3. https://github.com/pwndbg/pwndbg/pull/868#discussion_r549076170
2020-12-31 11:35:52 +08:00
case $distro in
"ubuntu")
ubuntu_version=$(
. /etc/os-release
echo ${VERSION_ID}
)
install_apt $ubuntu_version
;;
"arch")
install_pacman
;;
"fedora")
fedora_version=$(
. /etc/os-release
echo ${VERSION_ID} version
)
install_dnf $fedora_verion
;;
*) # we can add more install command for each distros.
echo "\"$distro\" is not supported distro. Will search for 'apt' or 'pacman' package managers."
if hash apt; then
install_apt
elif hash pacman; then
install_pacman
else
echo "\"$distro\" is not supported and your distro don't have apt or pacman that we support currently."
exit
fi
;;
esac
if [[ -z "${PWNDBG_VENV_PATH}" ]]; then
PWNDBG_VENV_PATH="./.venv"
fi
echo "Using virtualenv from path: ${PWNDBG_VENV_PATH}"
source "${PWNDBG_VENV_PATH}/bin/activate"
~/.local/bin/poetry install --with dev
# Create a developer marker file
DEV_MARKER_PATH="${PWNDBG_VENV_PATH}/dev.marker"
touch "${DEV_MARKER_PATH}"
echo "Developer marker created at ${DEV_MARKER_PATH}"
fi