-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathmykernel.sh
executable file
·64 lines (54 loc) · 1.46 KB
/
mykernel.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
#!/bin/bash
if which qemu-system-i386
then
echo ""
echo "**************** QEMUE has been install already ***"
echo ""
echo "**************** Checking for existing file *******"
else
echo ""
echo "**************** QEMUE doesn't install ************"
echo ""
echo "**************** Install qemu now *****************"
sudo apt-get install -y qemu >> /dev/null
sudo ln -s /usr/bin/qemu-system-x86_64 /usr/bin/qemu
fi
if [ -d "mykernel" ];
then
echo ""
echo "**************** directory mykernel exist ******"
echo ""
echo "**************** Checking for existing file *******"
else
echo "git mykernel"
git clone [email protected]:gatieme/mykernel.git
fi
if [ -d "linux-3.9.4" ];
then
echo ""
echo "**************** directory linux-3.9.4 exist ******"
echo ""
echo "**************** Checking for existing file *******"
if [ ! -a "./linux-3.9.4/arch/x86/boot/bzImage" ];
then
echo ""
echo "**************** bzImage exist *******"
else
cd linux-3.9.4
patch -p1 < ../mykernel/mykernel_for_linux3.9.4sc.patch
make allnoconfig
make
cd ..
fi
else
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.9.4.tar.xz
xz -d linux-3.9.4.tar.xz
tar -xvf linux-3.9.4.tar
cd linux-3.9.4
patch -p1 < ../mykernel/mykernel_for_linux3.9.4sc.patch
make allnoconfig
make
cd ..
fi
pwd
qemu -kernel linux-3.9.4/arch/x86/boot/bzImage