From fc467df58e357785e4796dbf74f5191bfa98acea Mon Sep 17 00:00:00 2001 From: Vivek Radhakrishnan Date: Tue, 30 Sep 2025 13:19:50 -0400 Subject: [PATCH 1/2] Update setup_hw1.sh Added check for apt presence and diverted to pacman (for Arch) --- Linux/setup_hw1.sh | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/Linux/setup_hw1.sh b/Linux/setup_hw1.sh index 86895e8..79e139d 100755 --- a/Linux/setup_hw1.sh +++ b/Linux/setup_hw1.sh @@ -1,17 +1,33 @@ #!/usr/bin/env bash -set -ex +set -ex -sudo apt-get update -echo "Installing git..." -sudo apt install git +apt_status=$(apt --version) +if [[ $apt_status == *not found* ]]; then + sudo pacman -Su + echo "Installing git..." + sudo pacman -S git -echo "Installing lcov..." -sudo apt-get -y install lcov + echo "Installing lcov..." + sudo pacman -S lcov -echo "Installing AFL++..." -sudo apt-get -y install afl++ + echo "Installing AFL++..." + sudo pacman -S afl++ -echo "Installing GDB..." -sudo apt-get -y install gdb + echp "Installing GDB..." + sudo pacman -S gdb +else + sudo apt-get update + echo "Installing git..." + sudo apt install git -echo "Setup for HW1 complete..." \ No newline at end of file + echo "Installing lcov..." + sudo apt-get -y install lcov + + echo "Installing AFL++..." + sudo apt-get -y install afl++ + + echo "Installing GDB..." + sudo apt-get -y install gdb +fi + +echo "Setup for HW1 complete..." From 68977cda04d74176f59fc2988b5bfaa1cb06d479 Mon Sep 17 00:00:00 2001 From: Vivek Radhakrishnan Date: Wed, 8 Oct 2025 10:55:00 -0400 Subject: [PATCH 2/2] Update setup_hw1.sh Added checks for no supported package managers (and fixed a typo) --- Linux/setup_hw1.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Linux/setup_hw1.sh b/Linux/setup_hw1.sh index 79e139d..bebce66 100755 --- a/Linux/setup_hw1.sh +++ b/Linux/setup_hw1.sh @@ -3,19 +3,25 @@ set -ex apt_status=$(apt --version) if [[ $apt_status == *not found* ]]; then - sudo pacman -Su - echo "Installing git..." - sudo pacman -S git - - echo "Installing lcov..." - sudo pacman -S lcov - - echo "Installing AFL++..." - sudo pacman -S afl++ - - echp "Installing GDB..." - sudo pacman -S gdb -else + pacman_status=$(pacman --version) + if [[ $pacman_status == *not found* ]]; then # unsupported + echo "Package manager not supported! Install apt or pacman" + exit 1 + else # pacman supported + sudo pacman -Su + echo "Installing git..." + sudo pacman -S git + + echo "Installing lcov..." + sudo pacman -S lcov + + echo "Installing AFL++..." + sudo pacman -S afl++ + + echo "Installing GDB..." + sudo pacman -S gdb + fi +else # apt supported sudo apt-get update echo "Installing git..." sudo apt install git