-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathkernel_install.sh
More file actions
executable file
·45 lines (36 loc) · 1.33 KB
/
kernel_install.sh
File metadata and controls
executable file
·45 lines (36 loc) · 1.33 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
#!/bin/bash
# Author: Jesper Dangaard Brouer <brouer@redhat.com>
# License: GPL
#
# This script "kernel_install.sh" just installs/copies the binaries into
# a directory (~/git/kernel/install) with the kernel version (extracted
# from include/config/kernel.release).
#
# It is connected to "kernel_push.sh" which rsync the kernel
# binaries+modules to a remote host (usually a KVM virtual guest).
export INSTALL_MOD_PATH=~/git/kernel/install/
export VER=`cat include/config/kernel.release`
echo $VER
CPUS=24
if [ ! -d "$INSTALL_MOD_PATH" ]; then
echo "ERROR: Install dir for kernel binaries \"$INSTALL_MOD_PATH\" does not exist"
exit 3
fi
if [ -z "$VER" ]; then
echo "ERROR: Cannot detect version"
exit 2
fi
rm -rf $INSTALL_MOD_PATH/lib/modules/$VER/kernel/
make -j${CPUS} modules_install
export BOOT="$INSTALL_MOD_PATH/boot/"
[ -d $BOOT ] || mkdir $BOOT
#cp -v arch/x86/boot/bzImage $BOOT/vmlinuz-$VER
#cp -v arch/i386/boot/bzImage $BOOT/vmlinuz-$VER
cp -v arch/x86_64/boot/bzImage $BOOT/vmlinuz-$VER
cp -v System.map $BOOT/System.map-$VER
cp -v vmlinux $BOOT/vmlinux-$VER
cp -v .config $BOOT/config-$VER
cp -v Module.symvers $BOOT/Module.symvers-$VER
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo "-=-=-=- DONE installed kernel:[$VER] -=-=-=-"
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"