forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextract_initramfs
More file actions
executable file
·72 lines (57 loc) · 1.42 KB
/
extract_initramfs
File metadata and controls
executable file
·72 lines (57 loc) · 1.42 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
############################################################################
#
# 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.
#
############################################################################
##
## The unpack-initramfs script does not work with all zImages!!
##
clear
scripts/prompt_remove_boot_extracted
if [ ! -d BOOT-EXTRACTED ]
then
if [ -d WORKING_* ]
then
echo
echo Working folder found
else
echo
echo Working folder not found, you will need to create one!
exit 0
fi
initramfs_dir=BOOT-EXTRACTED
mkdir $initramfs_dir
cd WORKING_*
if [ -e zImage ]
then
cp zImage ../BOOT-EXTRACTED
cd ..
cp tools/samsung_files/unpack-initramfs BOOT-EXTRACTED/
cd BOOT-EXTRACTED
./unpack-initramfs zImage
if [ ! -e kernel ]
then
echo "Error: No kernel found!"
fi
if [ ! -d initramfs_root ]
then
echo "Error: No initramfs_root folder found!"
else
mv -f initramfs_root boot.img-ramdisk
fi
rm -f unpack-initramfs zImage
cd ..
echo
else
echo "Error: zImage not found!"
echo
cd ..
echo "Removing initramfs_dir folder"
rm -rf $initramfs_dir
exit 0
fi
fi