forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathensure_nand_extracted
More file actions
executable file
·88 lines (71 loc) · 1.75 KB
/
ensure_nand_extracted
File metadata and controls
executable file
·88 lines (71 loc) · 1.75 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
############################################################################
#
# Copyright (c) 2011 - 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 = if set to 'no_clear' then it won't clear at start
#
if [ "$1" == "" ]
then
clear
fi
scripts/prompt_remove_boot_extracted
if [ ! -d BOOT-EXTRACTED ]
then
if [ ! -d WORKING_* ]
then
echo
echo "Working folder not found, you will need to create one!"
exit 0
fi
cd WORKING_*
if [ -d system ]
then
if [ -d boot ]
then
if [ ! -e boot/initrd.gz ]
then
echo
echo "boot/initrd.gz not found in working folder!"
cd ..
exit 0
fi
if [ ! -e boot/zImage ]
then
echo
echo "boot/zImage not found in working folder!"
cd ..
exit 0
fi
echo "Making folder 'BOOT-EXTRACTED' ..."
mkdir ../BOOT-EXTRACTED
echo "Copying initrd.gz and zImage to BOOT-EXTRACTED"
cp boot/zImage ../BOOT-EXTRACTED/
cp boot/initrd.gz ../BOOT-EXTRACTED
echo "Extracting ramdisk contents ..."
cd ../BOOT-EXTRACTED
mkdir boot.img-ramdisk
cd boot.img-ramdisk
gzip -d -c ../initrd.gz | cpio -i
cd ..
rm -f initrd.gz
cd ..
else
echo "Error: boot folder not found!"
echo
cd ..
exit 0
fi
else
echo "Error: system folder not found under working folder!"
cd ..
exit 0
fi
fi