Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Variables
- PA=P2
- dependencies=("copykernel.sh" "dev_kernel_grub.img" "bochsrc.bxrc" "BIOS-bochs-latest" "VGABIOS-lgpl-latest")
- # Script
- if [ ! -d ~/copykernel/ ]; then
- mkdir -p ~/copykernel
- fi
- rm -f ~/copykernel/kernel.bin
- cd ~/vbshare/CSCE410-2021-A/$PA/
- make $@
- if [ $? -ne 0 ]; then
- exit $?
- fi
- cp kernel.bin ~/copykernel/
- DEPMET=true
- for dependency in ${dependencies[@]}; do
- if [ ! -f ~/copykernel/$dependency ]; then
- if [ ! -f $dependency ]; then
- echo "Dependency $dependency is not present in $(pwd)"
- echo "Similar Files:"
- echo "$(ls | grep ${dependency:0:3})"
- $DEPMET=false
- fi
- echo "Fetching $dependency"
- cp $dependency ~/copykernel/
- if [ $? -ne 0 ]; then
- echo "Dependency: $dependency appears to be missing."
- $DEPMET=false
- fi
- fi
- done
- if [ ! $DEPMET ]; then
- exit 1
- fi
- cd ~/copykernel
- ./copykernel.sh
- bochs -f bochsrc.bxrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement