-
Notifications
You must be signed in to change notification settings - Fork 0
/
initlab.sh
executable file
·51 lines (37 loc) · 1.23 KB
/
initlab.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
#!/usr/bin/env bash
workpath="${HOME}/6828"
if [[ -d ${workpath} ]];then
read -p "path \"${workpath}\" already exists. To force init,press 'f'; 'e' or others to exit." f1
case $f1 in
'f') rm -rf ${workpath} break ;;
* ) echo "exit." exit 0 ;;
esac
fi
mkdir ${workpath}
cd ${workpath}
read -p "where do you prefer to download the qemu code? press 'p' for personal; 'o' or others for offical(recommanded if your network is not good):" f2
case $f2 in
"p") qemupath="https://gitee.com/libinyl/6.828-qemu.git" ;;
* ) qemupath="https://github.com/mit-pdos/6.828-qemu.git" ;;
esac
labpath="https://pdos.csail.mit.edu/6.828/2018/jos.git"
# clone qemu code.
echo "start to clone qemu code..."
git clone ${qemupath} qemu
if [[ $? -ne 0 ]]; then
echo "clone qemu code failed.exit."
exit 0;
else
echo "clone qemu code done."
fi
# clone lab code
echo "start to clone lab code..."
git clone ${labpath} lab
if [[ $? != 0 ]]; then
echo "clone lab code failed.exit."
exit 0;
else
echo "clone lab code done."
fi
echo "init all lab code done,begin to install some useful packages..."
sudo apt install cmake gdb build-essential pkg-config libglib2.0-dev zlib1g-dev libpixman-1-dev