Advertisement
pulchroxloom

QuickCompileRun.sh

Feb 14th, 2021
602
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Variables
  4. PA=P2
  5. dependencies=("copykernel.sh" "dev_kernel_grub.img" "bochsrc.bxrc" "BIOS-bochs-latest" "VGABIOS-lgpl-latest")
  6.  
  7. # Script
  8. if [ ! -d ~/copykernel/ ]; then
  9.     mkdir -p ~/copykernel
  10. fi
  11. rm -f ~/copykernel/kernel.bin
  12. cd ~/vbshare/CSCE410-2021-A/$PA/
  13. make $@
  14. if [ $? -ne 0 ]; then
  15.     exit $?
  16. fi
  17. cp kernel.bin ~/copykernel/
  18. DEPMET=true
  19. for dependency in ${dependencies[@]}; do
  20.     if [ ! -f ~/copykernel/$dependency ]; then
  21.         if [ ! -f $dependency ]; then
  22.             echo "Dependency $dependency is not present in $(pwd)"
  23.             echo "Similar Files:"
  24.             echo "$(ls | grep ${dependency:0:3})"
  25.             $DEPMET=false
  26.         fi
  27.         echo "Fetching $dependency"
  28.         cp $dependency ~/copykernel/
  29.         if [ $? -ne 0 ]; then
  30.             echo "Dependency: $dependency appears to be missing."
  31.             $DEPMET=false
  32.         fi
  33.     fi
  34. done
  35. if [ ! $DEPMET ]; then
  36.     exit 1
  37. fi
  38. cd ~/copykernel
  39. ./copykernel.sh
  40. bochs -f bochsrc.bxrc
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement