-
Notifications
You must be signed in to change notification settings - Fork 5
/
build-kernel.sh
executable file
·80 lines (63 loc) · 1.71 KB
/
build-kernel.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
kerneldir=linux-kernel
kerneltar=linux-kernel-5.0.0-16.17
kernel01dir=linux-kernel-5.0.0-16.17-nvmecint
kernel02dir=linux-kernel-5.0.0-16.17-nvmecint-rocks
patch01=cinterrupts-01-basis.patch
patch02=cinterrupts-02-rocks-addon.patch
config=config-file
pushd $kerneldir
rm -rf $kernel01dir
rm -rf $kernel02dir
# first extract and compile kernel for microbenchamrks
echo -n "Extracting kernel...."
cat $kerneltar.tgz-part-* > $kerneltar.tgz
tar -zxf $kerneltar.tgz
echo "Done"
mv $kerneltar $kernel01dir
pushd $kernel01dir
echo "Applying patch01"
patch -p1 < ../$patch01
cp ../$config .config
echo "Start compilation"
make oldconfig
make bzImage -j 28
make modules -j 28
sudo make modules_install -j 28
sudo make install
popd
echo;echo;echo
# now extract and compile kernel for rocksdb
echo -n "Extracting kernel...."
cat $kerneltar.tgz-part-* > $kerneltar.tgz
tar -zxf $kerneltar.tgz
echo "Done"
mv $kerneltar $kernel02dir
pushd $kernel02dir
echo "Applying patch01 and patch02"
patch -p1 < ../$patch01
patch -p1 < ../$patch02
cp ../$config .config
echo "Start compilation"
make oldconfig
make bzImage -j 28
make modules -j 28
sudo make modules_install -j 28
sudo make install
popd
popd
echo "Done."
echo
echo "To boot cintereupts kernel for microbenchamrks run:"
echo "sudo grub-reboot \"Ubuntu, with Linux 5.0.8-nvmecint\""
echo "sudo reboot"
echo
echo "To boot cintereupts kernel for macrobenchamrks run:"
echo "sudo grub-reboot \"Ubuntu, with Linux 5.0.8-nvmecint-rocks\""
echo "sudo reboot"
echo
echo "For now set next boot entry for microbenchmarks kernel"
echo -n "Set grub to boot Linux 5.0.8-nvmecint kernel..."
sudo grub-reboot "Ubuntu, with Linux 5.0.8-nvmecint"
echo "Done."
echo "You can reboot the machine now."