forked from JohnStarich/docker-pintos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·31 lines (24 loc) · 1.05 KB
/
setup.sh
File metadata and controls
executable file
·31 lines (24 loc) · 1.05 KB
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
#! /bin/bash
PROJECT=$1
export TERM=xterm
set -xe
if [ ! -d utils.old ]; then
mv -n utils utils.old
fi
rm -rf utils
cp -R /pintos_utils utils
if [ ! -d tests.old ]; then
mv -n tests tests.old
fi
rm -rf tests
cp -R /pintos_tests tests
sed -i 's/\/pintos\/userprog\/build\/loader.bin/\/pintos\/'$PROJECT'\/build\/loader.bin/' /pintos/utils/Pintos.pm
sed -i 's/\/pintos\/userprog\/build\/kernel.bin/\/pintos\/'$PROJECT'\/build\/kernel.bin/' /pintos/utils/pintos
sed -i 's/#define\s*LOGGING_ENABLE\s*[0-9]*/#define LOGGING_ENABLE 0/' /pintos/lib/log.h
# Clean Code
sed -i 's/while\s*(\s*1\s*)\s*{[^}]*}/printf("Removed while(1){} in process.c");"/' /pintos/userprog/process.c
sed -i 's/while\s*(\s*true\s*)\s*{[^}]*}/printf("Removed while(true){} in process.c");/' /pintos/userprog/process.c
sed -i 's/while\s*(\s*1\s*)\s*;/printf("Removed while(1); in process.c");/' /pintos/userprog/process.c
sed -i 's/while\s*(\s*true\s*)\s*;/printf("Removed while(true); in process.c");/' /pintos/userprog/process.c
echo $PROJECT > make_check_module
chmod -R 777 .