-
Notifications
You must be signed in to change notification settings - Fork 1
/
change_cmdline
112 lines (87 loc) · 2.07 KB
/
change_cmdline
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
############################################################################
#
# 本定制工具完全免费,DsiXDA版权所有,由MAL神族-沉默之星完成汉化翻译。
#
# 理论上支持所有民间刷机包的定制,完美支持HTC的所有民间和官方刷机包!
#
# 欢迎光临全球最大中兴社区:神族论坛(http://bbs.malshenzu.com/)
#
############################################################################
clear
if [ ! -d WORKING_* ]
then
echo "未发现工作文件夹!"
exit 0
fi
cd WORKING_*
if [ ! -e boot.img ]
then
echo "未发现 boot.img!"
exit 0
fi
cd ..
current_cmd=`scripts/get_cmdline`
if [ "$current_cmd" == "" ]
then
current_cmd2="(None)"
else
current_cmd2=$current_cmd
fi
echo
echo "在当前命令行值的boot.img文件:"
echo
echo "$current_cmd2"
echo
echo
echo "注意: 通常你不应该改变这个值"
echo "此功能适用于想要尝试不同值的高级用户。"
echo
echo -n "你想更改它 (y/n)? (默认: y): "
read do_change
echo
if [ "$do_change" == "n" ]
then
echo "OK, 命令行没有更改"
else
echo -n "请输入新的命令行(或按回车键清除): "
read new_cmd
echo
if [ "$new_cmd" == "" ]
then
echo "警告: 为命令行输入空字符串"
elif [ ${#new_cmd} -lt 3 ]
then
echo "错误: 字符串必须长于2个字符"
echo
exit 0
fi
if [ "$new_cmd" == "$current_cmd" ]
then
echo "您的命令代码值与原始值相同"
echo
exit 0
fi
base_addr=`scripts/get_kernel_base_addr`
page_size=`scripts/get_boot_img_page_size`
scripts/ensure_boot_extracted
scripts/build_boot_img $page_size $base_addr "$new_cmd"
current_cmd=`scripts/get_cmdline`
if [ "$current_cmd" == "" ]
then
current_cmd2="(None)"
else
current_cmd2=$current_cmd
fi
echo
echo "------------------------------------------------------------"
echo
echo " 在 boot.img 中的命令行现在设置为:"
echo
echo "$current_cmd2"
if [ "$current_cmd" != "$new_cmd" ]
then
echo
echo "警告: 指定命令行不相同"
fi
fi
echo