Repository navigation
Expand file tree
/
Copy pathconvert_updater_script
More file actions
executable file
·665 lines (525 loc) · 16.5 KB
/
Copy pathconvert_updater_script
File metadata and controls
executable file
·665 lines (525 loc) · 16.5 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
############################################################################
#
# Copyright (c) 2012 - dsixda (dislam@rocketmail.com)
#
# 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.
#
############################################################################
if [ "$1" == "" ]
then
clear
fi
echo
base_dir=`pwd`
if [ -d WORKING_* ]
then
cd WORKING_*
working_dir=`pwd`
cd META-INF/com/google/android
else
echo
echo Working folder not found, you will need to create one!
exit 0
fi
if [ "$1" == "" ]
then
echo "Conversion Tool: updater-script (Edify) to update-script (Amend)"
echo "--------------------------------------------------------------------"
echo
echo "This script will convert your updater-script into an update-script."
echo
echo "Ensure you have an updater-script under META-INF/com/google/android"
echo "of your working folder."
echo
echo -n "Proceed with conversion (y/n)? (default: y): "
read proceed_now
echo
if [ "$proceed_now" == "n" ]
then
cd ../../../../..
exit 0
fi
echo "--------------------------------------------------------------------"
echo
fi
if [ -e updater-script ]
then
if [ -e update-script ]
then
echo "Error: Although you have an updater-script, you also have an update-"
echo " script in the same folder. Remove one of them."
echo
echo -n "Remove update-script and continue conversion (y/n)? (default: y) "
read remove_it
echo
if [ "$remove_it" != "n" ]
then
rm -vf update-script
echo
echo
echo "--------------------------------------------------------------------"
echo
else
cd ../../../../..
exit 0
fi
fi
else
echo "Error: updater-script not found!"
cd ../../../../..
exit 0
fi
echo "Converting to update-script, please wait ..."
echo
# If there is no mount point definitions for this device in the
# tools/edify_defs folder, create a basic one based on the
# updater-script contents
cd ../../../../..
scripts/create_edify_def
cd WORKING_*
cd META-INF/com/google/android
echo "- Initial formatting ..."
# The 'strings' command is used in case the ui_print statement has special symbols in it
more updater-script \
| sed -e ':a;N;$!ba;s/([ ]*\n/(/g' \
| sed -e ':a;N;$!ba;s/\n[ ]*\&\&/ \&\&/g' \
| sed -e ':a;N;$!ba;s/\n[ ]*||/ ||/g' \
| sed -e ':a;N;$!ba;s/\n);/);/g' \
| strings \
| sed -e ':a;N;$!ba;s/ui_print("[^"]*");//g' \
| sed -e ':a;N;$!ba;s/||[ ]*\n//g' \
| sed -e ':a;N;$!ba;s/,[ ]*\n//g' \
| sed -e 's/","/", "/g' \
-e 's/\([0-9]*\),[ ]*\([0-9]*\)/\1, \2/g' \
-e 's/^\([a-zA-Z_]*\)[ ]*(/\1(/g' \
> temp.log
#
# Replace tabs with spaces!
#
tr '\011' ' ' <temp.log >temp.log.new
mv -f temp.log.new temp.log
#
# Remove comments
#
sed -i -e '/^#/d' temp.log
#
# Some updater-scripts use alternatives to the regular mount/unmount commands
#
sed -i -e '/^run_program("\/sbin\/mount"/d' temp.log
sed -i -e '/^run_program("\/sbin\/umount"/d' temp.log
sed -i -e '/^run_program("\/sbin\/busybox", "mount"/d' temp.log
sed -i -e '/^run_program("\/sbin\/busybox", "umount"/d' temp.log
#
# For Samsung Galaxy S/S2 and equivalent
#
if [ -e ../../../../zImage ] && [ `grep -c boot.img temp.log` == 0 ]
then
sed -i \
-e '/zImage"/d' \
-e '/flash_image"/d' \
-e '/redbend_ua"/d' \
temp.log
echo "flash_zimage" >> temp.log
fi
if [ -e ../../../../modem.bin ]
then
sed -i \
-e '/modem.bin"/d' \
-e '/flash_image"/d' \
-e '/redbend_ua"/d' \
temp.log
echo "flash_modem" >> temp.log
fi
#
# assert
#
echo "- assert ..."
line_num=`sed -n -e '/assert(/{=;q}' temp.log`
while [ "$line_num" != "" ]
do
sed -i \
-e ''$line_num' s/assert(\(.*\)").*);/\1");/g' \
-e ''$line_num' s/^.*getprop.*;//g' \
temp.log
if [ -e ../../../../radio.img ]
then
sed -i -e ''$line_mum' s/^.*install_radio.*;/write_radio_image PACKAGE:radio.img/g' temp.log
else
sed -i -e ''$line_num' s/^.*install_radio.*;//g' temp.log
fi
if [ -e ../../../../hboot.img ]
then
sed -i -e ''$line_mum' s/^.*install_hboot.*;/write_hboot_image PACKAGE:hboot.img/g' temp.log
else
sed -i -e ''$line_num' s/^.*install_hboot.*;//g' temp.log
fi
sed -i \
-e ''$line_num' s/)[ ]*/);\n/g' \
-e 's/^;$//g' \
temp.log
line_num=`sed -n -e '/assert(/{=;q}' temp.log`
done
#
# Fix the mess left over sometimes by the assert statement
#
sed -i \
-e 's/^==[ ]*\(.*$\)/\1/g' \
-e 's/^||[ ]*\(.*$\)/\1/g' \
-e 's/^&&[ ]*\(.*$\)/\1/g' \
-e 's/^[^a-z]*\([a-z]*\)/\1/g' \
-e '/^ui_print/d' \
temp.log
#
# boot.img / radio.img / bootloader.img
#
echo "- write_raw_image ..."
img_list=( boot radio bootloader )
temp_list=( tmp cache )
for (( t = 0 ; t < ${#temp_list[@]} ; t++ ))
do
temp_name=${temp_list[${t}]}
for (( i = 0 ; i < ${#img_list[@]} ; i++ ))
do
#
# Replace 3 consecutive lines if they match the required strings
#
img_name=${img_list[${i}]}
if [ -e ../../../../$img_name.img ]
then
sed -i -e ':a;N;$!ba;s/package_extract_file("'"$img_name"'.img", "\/'"$temp_name"'\/'"$img_name"'.img");\n[ ]*write_raw_image("\/'"$temp_name"'\/'"$img_name"'.img", "[^"]*");\n[ ]*delete("\/'"$temp_name"'\/'"$img_name"'.img");/write_raw_image PACKAGE:'"$img_name"'.img/g' temp.log
else
sed -i -e ':a;N;$!ba;s/package_extract_file("'"$img_name"'.img", "\/'"$temp_name"'\/'"$img_name"'.img");\n[ ]*write_raw_image("\/'"$temp_name"'\/'"$img_name"'.img", "[^"]*");\n[ ]*delete("\/'"$temp_name"'\/'"$img_name"'.img");//g' temp.log
fi
done
done
sed -i -e 's/write_raw_image("boot.img", "boot");/write_raw_image PACKAGE:boot.img BOOT:/g' temp.log
sed -i -e 's/write_raw_image PACKAGE:boot.img$/write_raw_image PACKAGE:boot.img BOOT:/g' temp.log
#
# Dell Streak
#
if [ -e ../../../../boot.img ]
then
sed -i -e ':a;N;$!ba;s/package_extract_file("boot.img", "\/tmp\/boot.img");\n[ ]*write_boot_raw_image("\/tmp\/boot.img", "boot");\n[ ]*delete("\/tmp\/boot.img");/write_raw_image PACKAGE:boot.img BOOT:/g' temp.log
else
sed -i -e ':a;N;$!ba;s/package_extract_file("boot.img", "\/tmp\/boot.img");\n[ ]*write_boot_raw_image("\/tmp\/boot.img", "boot");\n[ ]*delete("\/tmp\/boot.img");//g' temp.log
fi
if [ -e ../../../../blob ]
then
sed -i -e ':a;N;$!ba;s/package_extract_file("blob", "\/tmp\/blob");\n[ ]*write_blob_raw_image("\/tmp\/blob", "staging");\n[ ]*delete("\/tmp\/blob");/write_blob_raw_image PACKAGE:blob/g' temp.log
else
sed -i -e ':a;N;$!ba;s/package_extract_file("blob", "\/tmp\/blob");\n[ ]*write_blob_raw_image("\/tmp\/blob", "staging");\n[ ]*delete("\/tmp\/blob");//g' temp.log
fi
#
# run_program
#
echo "- run_program ..."
line_num=`sed -n -e '/run_program(/{=;q}' temp.log`
while [ "$line_num" != "" ]
do
# run_program spans multiple lines
has_end=`sed -n -e ''$line_num'p' temp.log | grep -c "\");[ ]*$"`
# Combine the next line
while [ $has_end == 0 ]
do
# N = read next line
sed -i -e ''$line_num'N;s/\n/[cr]/g' temp.log
has_end=`sed -n -e ''$line_num'p' temp.log | grep -c "\");[ ]*$"`
done
sed -i \
-e ''$line_num' s/ /\[sp\]/g' \
-e ''$line_num' s/",\[sp\]"/ /g' \
-e ''$line_num' s/,/\[co\]/g' \
-e ''$line_num' s/run_program("/run_program /g' \
-e ''$line_num' s/run_program \/\([a-zA-Z]*\)/run_program PACKAGE:\1/g' \
-e ''$line_num' s/run_program PACKAGE:\//run_program \//g' \
-e ''$line_num' s/);//g' \
-e ''$line_num' s/;/\[sc\]/g' \
temp.log
line_num=`sed -n -e '/run_program(/{=;q}' temp.log`
done
#
# delete
#
echo "- delete ..."
line_num=`sed -n -e '/delete(/{=;q}' temp.log`
while [ "$line_num" != "" ]
do
sed -i \
-e ''$line_num' s/delete(/delete /g' \
-e ''$line_num' s/"//g' \
-e ''$line_num' s/, /\ndelete /g' \
-e ''$line_num' s/)//g' \
-e ''$line_num' s/;//g' \
temp.log
line_num=`sed -n -e '/delete(/{=;q}' temp.log`
done
#
# Remove apply_patch
#
sed -i -e 's/apply_patch.*[;]//g' temp.log
#
# symlink
#
echo "- symlink ..."
# If the symlink command consists of only target file, then use this
sed -i -e 's/symlink("\([^\"]*\)", "\([^\"]*\)");/symlink \1 \2/g' temp.log
line_num=`sed -n -e '/symlink(/{=;q}' temp.log`
while [ "$line_num" != "" ]
do
cp -f temp.log temp.log.old
src=`sed -ne ''$line_num' s/symlink("\([^"]*\)".*/\1/pg' temp.log`
# Fix sed issue where backslashes in $src are misinterpreted as part of the sed syntax
# rather than the string
src=`echo $src | sed -e 's/\//dsixda_slash/g'`
# sed1 : The formatting code near the top of this conversion script may have removed some commas
# sed2 : All targets will be moved to their own line
# sed3 : Substitute back the backslashes, if any
# sed4 : Fix up last line of symlink set
sed -i \
-e ''$line_num' s/"[ ]*"/", "/g' \
-e ''$line_num' s/", [ ]*"/\nsymlink '"$src"' /g' \
-e ''$line_num' s/dsixda_slash/\//g' \
-e ''$line_num' s/");//g' \
temp.log
# No longer need first line after all targets moved to other lines
sed -i -e ''$line_num'd' temp.log
#
# Ensure we are not stuck in an endless loop doing nothing
#
if [ "`diff temp.log temp.log.old`" == "" ]
then
echo
echo "ERROR: Problem converting symlinks"
rm -f temp.log.old temp.log
exit 1
fi
line_num=`sed -n -e '/symlink(/{=;q}' temp.log`
done
rm -rf temp.log.old
echo "- Final formatting ..."
#
# Fix up the update-script
#
sed -i \
-e 's/;//g' \
-e 's/,//g' \
-e 's/(/ /g' \
-e 's/)//g' \
-e 's/^mount .*//g' \
-e 's/^unmount .*//g' \
-e 's/package_extract_dir \"\([^ ]*\)/copy_dir PACKAGE:\1/g' \
\
-e 's/\/system\//SYSTEM:/g' \
-e 's/ \/system/ SYSTEM:/g' \
-e 's/"\/system"/SYSTEM:/g' \
-e 's/\"system\"/SYSTEM:/g' \
-e 's/\"SYSTEM:\"/SYSTEM:/g' \
-e 's/\" SYSTEM/ SYSTEM/g' \
-e 's/\"SYSTEM:\([^\"]*\)\"/SYSTEM:\1/g' \
-e 's/symlink SYSTEM:/symlink \/system\//g' \
\
-e 's/\/preload\//PRELOAD:/g' \
-e 's/ \/preload/ PRELOAD:/g' \
-e 's/"\/preload"/PRELOAD:/g' \
-e 's/\"preload\"/PRELOAD:/g' \
-e 's/\"PRELOAD:\"/PRELOAD:/g' \
-e 's/\" PRELOAD/ PRELOAD/g' \
-e 's/\"PRELOAD:\([^\"]*\)\"/PRELOAD:\1/g' \
-e 's/symlink PRELOAD:/symlink \/preload\//g' \
\
-e 's/\/tmp\//TMP:/g' \
-e 's/ \/tmp/ TMP:/g' \
-e 's/"\/tmp"/TMP:/g' \
-e 's/\"tmp\"/TMP:/g' \
-e 's/\"TMP:\"/TMP:/g' \
-e 's/\" TMP/ TMP/g' \
-e 's/ \"TMP:/ TMP:/g' \
\
-e 's/\/data\//DATA:/g' \
-e 's/ \/data/ DATA:/g' \
-e 's/"\/data"/DATA:/g' \
-e 's/\"data\"/DATA:/g' \
-e 's/\"DATA:\"/DATA:/g' \
-e 's/\" DATA/ DATA/g' \
-e 's/"userdata"/DATA:/g' \
-e 's/\"DATA:\([^\"]*\)\"/DATA:\1/g' \
-e 's/symlink DATA:/symlink \/data\//g' \
\
-e 's/\/sdcard\//SDCARD:/g' \
-e 's/ \/sdcard/ SDCARD:/g' \
-e 's/"\/sdcard"/SDCARD:/g' \
-e 's/\"sdcard\"/SDCARD:/g' \
-e 's/\"SDCARD:\"/SDCARD:/g' \
-e 's/\" SDCARD/ SDCARD/g' \
\
-e 's/\/cache\//CACHE:/g' \
-e 's/ \/cache/ CACHE:/g' \
-e 's/"\/cache"/CACHE:/g' \
-e 's/\"cache\"/CACHE:/g' \
-e 's/\"CACHE:\"/CACHE:/g' \
-e 's/\" CACHE/ CACHE/g' \
\
-e 's/\/sdext\//SDEXT:/g' \
-e 's/ \/sdext/ SDEXT:/g' \
-e 's/"\/sdext"/SDEXT:/g' \
-e 's/\"sdext\"/SDEXT:/g' \
-e 's/\"SDEXT:\"/SDEXT:/g' \
-e 's/\" SDEXT/ SDEXT/g' \
\
-e 's/"\/boot\//BOOT:/g' \
-e 's/"\/boot/BOOT:/g' \
-e 's/ \/boot\// BOOT:/g' \
-e 's/"\/boot"/BOOT:/g' \
-e 's/\"boot\"/BOOT:/g' \
-e 's/\"BOOT:\"/BOOT:/g' \
-e 's/\" BOOT/ BOOT/g' \
\
-e 's/\"MTD //g' \
-e 's/set_perm\([^\"]*\)\"\([^\"]*\)\"/set_perm\1\2/g' \
-e 's/\"\([^\"]*\)\"/\1/g' \
-e 's/^[ \t]*//g' \
-e 's/\/$//g' \
-e 's/"$/\n/g' \
temp.log
#
# Patch up any conversion issues here
#
sed -i \
-e 's/MTD //g' \
-e 's/ system\// SYSTEM:/g' \
-e 's/ preload\// PRELOAD:/g' \
-e 's/ tmp\// TMP:/g' \
-e 's/ data\// DATA:/g' \
-e 's/ sdcard\// SDCARD:/g' \
-e 's/ cache\// CACHE:/g' \
-e 's/ sdext\// SDEXT:/g' \
-e 's/ boot\// BOOT:/g' \
-e 's/\(symlink [^ ]*\)SYSTEM:/\1\/system\//g' \
-e 's/\(symlink [^ ]*\)PRELOAD:/\1\/preload\//g' \
-e 's/\(symlink [^ ]*\)DATA:/\1\/data\//g' \
-e 's/\(symlink [^ ]*\)CACHE:/\1\/cache\//g' \
-e 's/\(symlink [^ ]*\)TMP:/\1\/tmp\//g' \
-e 's/\(symlink [^ ]*\)SDCARD:/\1\/sdcard\//g' \
-e 's/\(symlink [^ ]*\)SDEXT:/\1\/sdext\//g' \
-e 's/\(symlink [^ ]*\)BOOT:/\1\/boot\//g' \
-e 's/\(set_perm.*\/.*\)SYSTEM:/\1\/system\//g' \
-e 's/\(set_perm.*\/.*\)PRELOAD:/\1\/preload\//g' \
-e 's/\(set_perm.*\/.*\)DATA:/\1\/data\//g' \
-e 's/\(set_perm.*\/.*\)CACHE:/\1\/cache\//g' \
-e 's/\(set_perm.*\/.*\)TMP:/\1\/tmp\//g' \
-e 's/\(set_perm.*\/.*\)SDCARD:/\1\/sdcard\//g' \
-e 's/\(set_perm.*\/.*\)SDEXT:/\1\/sdext\//g' \
-e 's/\(set_perm.*\/.*\)BOOT:/\1\/boot\//g' \
-e 's/\(package_extract_file\) SYSTEM:/\1 system\//g' \
-e 's/\(package_extract_file\) PRELOAD:/\1 preload\//g' \
-e 's/\(package_extract_file\) DATA:/\1 data\//g' \
-e 's/\(package_extract_file\) CACHE:/\1 cache\//g' \
-e 's/\(package_extract_file\) TMP:/\1 tmp\//g' \
-e 's/\(package_extract_file\) SDCARD:/\1 sdcard\//g' \
-e 's/\(package_extract_file\) SDEXT:/\1 sdext\//g' \
-e 's/\(package_extract_file\) BOOT:/\1 boot\//g' \
-e 's/^format[ ]*\([^ ]*\)[ ]*\(.*\)/format \1 \2/g' \
temp.log
#
# Remove blank lines
#
sed -i -e '/^$/d' temp.log
#
# Replace the 3 consecutive lines created in updater-script when a script from the
# *base directory* of ROM is used in run_program.
#
# e.g.
#
# package_extract_file("backuptool.sh", "/tmp/backuptool.sh");
# set_perm(0, 0, 0777, "/tmp/backuptool.sh");
# run_program("/tmp/backuptool.sh", "backup");
#
# (Ensure there are no blank lines in file)
#
line_list=`grep -n package_extract_file temp.log`
line_num_list=`echo "$line_list" | sed -e 's/\([0-9]*\).*/\1/g'`
# Increase this if the lines are changed
move_lines=0
for line_num in $line_num_list
do
line_num1=$(($line_num-$move_lines))
curr_line=`sed -n -e ''$line_num1'p' temp.log`
src=`echo "$curr_line" | sed -e 's/package_extract_file \(.*\) .*/\1/'`
test_src=`echo "$src" | grep -c "/"`
if [ $test_src == 1 ]
then
continue
else
sed -i -e ''$line_num1' s/\(package_extract_file \)\(.*\) /\1PACKAGE:\2 /g' temp.log
fi
partition=`echo "$curr_line" | sed -e 's/package_extract_file .* \([^:]*\):\(.*\)/\1/'`
filename=`echo "$curr_line" | sed -n -e ''$line_num1'p' temp.log | sed -e 's/package_extract_file .* \([^:]*\):\(.*\)/\2/'`
if [ "$partition" == "TMP" ] || [ "$partition" == "CACHE" ]
then
line_num2=$(($line_num1+1))
expect_line2="set_perm 0 0 0777 $partition:$filename"
actual_line2=`sed -n -e ''$line_num2'p' temp.log`
if [ "$actual_line2" == "$expect_line2" ]
then
line_num3=$(($line_num2+1))
small_partition=`echo $partition | sed 's/\([A-Z]*\)/\L\1/g'`
expect_line3="run_program PACKAGE:$small_partition/$filename"
actual_line3=`sed -n -e ''$line_num3'p' temp.log`
res=`echo $actual_line3 | grep -c "$expect_line3"`
if [ $res == 1 ]
then
sed -i -e ''"$line_num1"','"$line_num2"'d' temp.log
sed -i -e ''$line_num1' s/run_program PACKAGE:'"$small_partition"'\/\(.*\)/run_program PACKAGE:\1/g' temp.log
move_lines=$(($move_lines+2))
fi
fi
fi
done
#
# Finished
#
mv -f temp.log update-script
rm -f temp.log.old
#
# Device-specific mount points
#
cd ../../../../..
scripts/adjust_mnt update-script
cd WORKING_*
cd META-INF/com/google/android
echo
if [ -e update-script ]
then
mv -f updater-script updater-script.orig
echo "--------------------------------------------------------------------"
echo
echo "An update-script has been created under META-INF/com/google/android"
echo "of your working folder. Please review it for potential errors."
echo ""
echo "The original updater-script has been renamed to updater-script.orig."
echo "It will not be included in your completed ROM's ZIP file, but please"
echo "DO NOT remove it, as it may be required by the kitchen."
echo
if [ -e update-binary ]
then
mv -f update-binary update-binary.orig
echo "The update-binary has also been renamed to update-binary.orig."
fi
cd $base_dir
scripts/update_script_should_convert_back
if [ "$?" == "1" ]
then
echo
echo "NOTE: Because we cannot fully convert Edify syntax into Amend"
echo " format, this update-script will automatically be converted"
echo " back to an updater-script in the final ROM's update.zip."
echo " However, your working folder will still contain the update-"
echo " script."
echo
fi
else
echo "Error: update-script not created!"
fi
cd $base_dir