-
Notifications
You must be signed in to change notification settings - Fork 6
/
runme_1unpack64.sh
executable file
·51 lines (41 loc) · 1.02 KB
/
runme_1unpack64.sh
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
#!/bin/sh
if [ -d work ]; then
rm -rf ./work
fi
# ELF format (SIN v1 ~ SIN v3)
if [ ! -e kernel.elf ]; then
if [ -e kernel*.elf ]; then
mv kernel*.elf kernel.elf
fi
if [ -e kernel*.ext4 ]; then
mv kernel*.ext4 kernel.elf
fi
fi
# Android image format (SIN v4 ~ )
if [ ! -e kernel.bin ]; then
if [ -e kernel*.bin ]; then
mv kernel*.bin kernel.bin
fi
if [ -e kernel*.img ]; then
mv kernel*.img kernel.bin
fi
fi
mkdir work
if [ -e kernel.elf ]; then
mv kernel.elf work/kernel.sin
cp -a tools/unpack-kernelsin64.pl work/unpack-kernelsin64.pl
elif [ -e kernel.bin ]; then
mv kernel.bin work/kernel.bin
fi
cd work
if [ -e kernel.sin ]; then
chmod 777 unpack-kernelsin64.pl
./unpack-kernelsin64.pl kernel.sin
elif [ -e kernel.bin ]; then
../tools/unpackbootimg -i kernel.bin
mkdir kernel.sin-ramdisk
mv kernel.bin-ramdisk.gz kernel.sin-ramdisk/kernel.bin-ramdisk.gz
cd kernel.sin-ramdisk
gunzip -c kernel.bin-ramdisk.gz | cpio -i
rm -f kernel.bin-ramdisk.gz
fi