forked from mcproxy/mcproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_kernel-sh
executable file
·60 lines (51 loc) · 1.51 KB
/
install_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
#!/bin/bash
# reference http://wiki.ubuntuusers.de/Kernel/Kompilierung
if [ "$1" = "all" ]; then
./install_kernel-sh 1
./install_kernel-sh 2
./install_kernel-sh 3
./install_kernel-sh 4
./install_kernel-sh 5
elif [ "$1" = "help" ] || [ "$1" = "-h" ] || [ "$1" = "" ]; then
echo "This script download, configure, compile and install a linux kernel."
echo "You can run this script step-by-step ($0 1, $0 2, ...)"
echo "or you can run it all at once ($0 all)"
echo ""
echo -e "\t$0 1: download all kernel sources and essential programms"
echo -e "\t$0 2: unpack all kernel sources"
echo -e "\t$0 3: configure the kernel modules with a ncurses based programm"
echo -e "\t$0 4: compile the kernel source"
echo -e "\t$0 5: install the kernel with a ncurses based programm"
echo "tested with Ubuntu 13.04 with kernel 3.8.13.4 x86_64"
else
if [ "$1" = "1" ]; then
sudo apt-get install linux-source build-essential kernel-package ncurses-dev
fi
if [ "$1" = "2" ]; then
mkdir kernel
cd kernel/
tar xfvj /usr/src/linux-*tar.bz2
cd ..
fi
if [ "$1" = "3" ]; then
cd kernel/
cd *
cp /boot/config-`uname -r` .config
yes "" | make oldconfig
make menuconfig
cd ../..
fi
if [ "$1" = "4" ]; then
cd kernel
cd *
make-kpkg -j4 --initrd buildpackage
cd ../..
fi
if [ "$1" = "5" ]; then
cd kernel
cd *
sudo dpkg -i $(ls | grep linux-image.*\.deb | grep -v dbg)
echo "Reboot your system to adopt changes!!"
cd ../..
fi
fi