-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrunme-mlwg2.sh
executable file
·41 lines (28 loc) · 978 Bytes
/
runme-mlwg2.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
#!/bin/sh
#sudo apt-get -y install u-boot-tools
FW_IMAGE=mlwG2_v2.0.0.6
[ ! -e ${FW_IMAGE}.zip ] && curl -O http://media.kingston.com/support/downloads/${FW_IMAGE}.zip
[ ! -e ${FW_IMAGE}.bin ] && unzip ${FW_IMAGE}.zip
head -c+52 <${FW_IMAGE}.bin >fw_header.bin
od -A x -t x1z -v fw_header.bin
tail -c+53 <${FW_IMAGE}.bin >uImage
#file uImage
mkimage -l uImage
#echo "INFO: Contents of file: uImage"
#od -A x -t x1z -v uImage | head
tail -c+65 <uImage >out.dat.xz
#echo "INFO: Contents of file: out.dat.xz"
#od -A x -t x1z -v out.dat.xz | head
xz --test out.dat.xz
xz --decompress --force --keep out.dat.xz
#echo "INFO: Contents of file: out.dat"
#od -A x -t x1z -v out.dat | less
if [ ! -x extract-vmlinux ]; then
curl -O https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux
chmod a+x extract-vmlinux
fi
#./extract-vmlinux out.dat.xz
#tail -c+731464 out.dat.xz | bunzip2 >out
strings -n 11 out.dat
grep -abo "Linux" out.dat
# EOF