-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·74 lines (64 loc) · 2.08 KB
/
install.sh
File metadata and controls
executable file
·74 lines (64 loc) · 2.08 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
function usage() {
echo "Usage: $0 target"
echo "where target: either [dilation], [freeze], or [both]"
exit 1
}
DST=~/build_kernel
TARGET=$1
if [ -e $DST ]; then
echo "Clean up previous build"
sudo rm -rf $DST
fi
if [ ! -e linux-3.16.3.tar.gz ]; then
wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.16.3.tar.gz
fi
echo "Step 0. Unpack kernel source"
tar -xzf linux-3.16.3.tar.gz
mv linux-3.16.3 $DST
# generate patch file
PATCH=VirtualTime.patch
echo " Patch file written to ${PATCH}"
diff -rup $DST ./ > ${PATCH}
echo ""
FILES="kernel/fork.c \
kernel/time.c \
kernel/hrtimer.c \
kernel/posix-timers.c \
kernel/time/timekeeping.c \
kernel/time/clockevents.c \
kernel/time/tick-sched.c \
kernel/futex.c \
arch/x86/vdso/vclock_gettime.c \
include/uapi/linux/sched.h \
include/linux/sched.h \
include/linux/init_task.h \
include/linux/time.h \
include/linux/ktime.h \
include/linux/timekeeper_internal.h \
fs/proc/base.c \
fs/eventpoll.c \
fs/select.c \
include/net/sch_generic.h \
Makefile \
build_all.sh"
#net_dilation/core/dev.c \
echo "Step 1. Transfer modified kernel source"
for f in $FILES; do
cp -v $f $DST/$f
done
if [ "dilation" = $TARGET ]; then
cp -v net_dilation/sched/sch_generic.c $DST/net/sched/sch_generic.c
cp -v net_dilation/sched/sch_htb.c $DST/net/sched/sch_htb.c
elif [ "freeze" = $TARGET ]; then
cp -v net_freeze/sched/sch_generic.c $DST/net/sched/sch_generic.c
cp -v net_freeze/sched/sch_htb.c $DST/net/sched/sch_htb.c
elif [ "both" = $TARGET ]; then
cp -v net_both/sched/sch_generic.c $DST/net/sched/sch_generic.c
cp -v net_both/sched/sch_htb.c $DST/net/sched/sch_htb.c
else
usage
fi
echo "Step 2. Build new kernel"
cd $DST
sudo ./build_all.sh