-
Notifications
You must be signed in to change notification settings - Fork 23
/
copy_kernel.sh
executable file
·60 lines (51 loc) · 977 Bytes
/
copy_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
#!/bin/sh
old_dir=`pwd`
show_help () {
echo
echo "Before use, create modules with prepare_modules.sh"
echo "and attach N9 to USB and let it mount."
echo
echo Usage:
echo
echo "sudo $0 <directory-of-mounted-device-root>"
echo
echo example:
echo "sudo $0 /media/6b787b38-56e5-44fd-8fec-1b40f67770e1"
echo
}
if [ `whoami` != root ]
then
echo "You must be root to run the script!"
show_help
exit
fi
if [ ! -d mods ]
then
show_help
exit
fi
if [ -z "$1" ]
then
show_help
exit
fi
if [ ! -d "$1" ]
then
echo "Given directory does not exist!"
show_help
exit
fi
echo Copying modules
cd mods
cp -R lib $1
echo "Copying zImage to /boot"
cp ../arch/arm/boot/zImage $1/boot/
cd $1/boot
echo "linking /boot/bzImage to point to zImage instead of vmlinuz*"
ln -f -s zImage bzImage
cd $old_dir
echo "Copy done."
echo
echo "If you want to revert back to old kernel"
echo "change the bzImage symlink to point back to"
echo "original vmlinuz-2.6* file in $1/boot dir"