forked from xiaoxindada/SGSI-build-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunpackboot_test.sh
More file actions
executable file
·36 lines (30 loc) · 901 Bytes
/
unpackboot_test.sh
File metadata and controls
executable file
·36 lines (30 loc) · 901 Bytes
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
#!/bin/bash
# Copyright (C) 2021 Xiaoxindada <2245062854@qq.com>
LOCALDIR=`cd "$( dirname $0 )" && pwd`
cd $LOCALDIR
source ./bin.sh
bb="busybox"
testdir=$bin/boot_tools/test
unpacknootimg=$testdir/unpack_bootimg.py
mkbootimg=$testdir/mkbootimg.py
dumpimage=$testdir/dumpimage
cpio=$testdir/cpio
bootdir=$LOCALDIR/boot
ramdiskdir=$bootdir/ramdisk
kernel_file=$bootdir/kernel
ramdisk_file=$bootdir/ramdisk
rm -rf $bootdir
rm -rf $ramdiskdir
mkdir -p $bootdir
$unpacknootimg --boot_img "$LOCALDIR/boot.img" --out "$bootdir"
[ -f $bootdir/ramdisk* ] && mv -f $bootdir/ramdisk* $bootdir/ramdisk.gz
$bb gunzip -c -k -f "$bootdir/ramdisk.gz" > "$bootdir/ramdisk.img"
mkdir -p $ramdiskdir
cd $ramdiskdir
$cpio -i --no-absolute-filenames < "$bootdir/ramdisk.img"
rm -rf $bootdir/ramdisk.img
chmod 777 -R $bootdir
cd $LOCALDIR
#cd $ramdiskdir
#find ./ | $cpio -o -H newc > ../ramdisk.img
#cd $LOCALDIR