forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_kernel_offset
More file actions
executable file
·80 lines (61 loc) · 1.41 KB
/
check_kernel_offset
File metadata and controls
executable file
·80 lines (61 loc) · 1.41 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
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
############################################################################
#
# Copyright (c) 2012 - dsixda ([email protected])
#
# Android Kitchen is 100% free. This script file is intended for personal
# and/or educational use only. It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################
#
# This script has one optional parameter:
#
# $1 = folder containing boot.img
#
base_dir=`pwd`
if [ "$1" == "" ]
then
if [ ! -d WORKING_* ]
then
echo Working folder not found!
exit 0
fi
cd WORKING_*
working_folder=`pwd`
else
cd $1
working_folder=`pwd`
fi
echo
if [ -e boot.img ]
then
cd $base_dir
dec_offset=`scripts/get_boot_img_page_size $working_folder`
if [ "$dec_offset" != "" ]
then
if [ "$dec_offset" == "0" ]
then
echo "Error: kernel offset (page size) is 0"
exit 1
fi
echo "Kernel found at offset $dec_offset in boot.img"
# Check for MT65XX
scripts/check_mt65xx_bootimg $working_folder $dec_offset
mt65xx=$?
if [ "$mt65xx" == "1" ]
then
type=mt65xx
else
type=""
fi
scripts/set_kernel_offset_files $dec_offset $type
exit $?
else
echo "Error: kernel offset (page size) not found in boot.img!"
exit 1
fi
else
echo "boot.img not found!"
cd $base_dir
exit 1
fi