forked from wtbdaaaa/device_nowplus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkrootfs.sh
executable file
·80 lines (60 loc) · 1.9 KB
/
mkrootfs.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
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
#!/bin/bash
function check_variant()
{
if [ "$ANDROID" = "" ]; then
echo "define \$ANDROID first."
exit 0
fi
# if [ "$KERNELDIR" = "" ]; then
# echo "define \$KERNELDIR first."
# exit 0
# fi
DEVICEDIR=$ANDROID/device/samsung/nowplus
OUTDIR=$DEVICEDIR/out
rm -rf $OUTDIR
mkdir -p $OUTDIR
}
function copy_modules()
{
echo "copying kernel modules."
}
function create_rootfs()
{
echo "creating rootfs."
ANDROIDROOTFS=$OUTDIR/rootfs
copy_modules
mkdir -p $ANDROIDROOTFS
mkdir -p $ANDROIDROOTFS/lib/firmware
mkdir -p $ANDROIDROOTFS/system/lib/dsp
cp -Rdpf $ANDROID/out/target/product/nowplus/root/* $ANDROIDROOTFS/
cp -Rdpf $ANDROID/out/target/product/nowplus/system/* $ANDROIDROOTFS/system/
cp -Rdpf $ANDROID/out/target/product/nowplus/data/* $ANDROIDROOTFS/data/
cp -Rdpf $DEVICEDIR/prebuilt/xbin/* $ANDROIDROOTFS/system/xbin/
cp -Rdpf $DEVICEDIR/proprietary/sgx/bin/* $ANDROIDROOTFS/system/bin/
cp -Rdpf $DEVICEDIR/lib/firmware/* $ANDROIDROOTFS/lib/firmware/
cp -Rdpf $DEVICEDIR/proprietary/sgx/lib/* $ANDROIDROOTFS/system/lib/
cp -Rdpf $DEVICEDIR/proprietary/dsp/img/* $ANDROIDROOTFS/system/lib/dsp/
cp -Rdpf $DEVICEDIR/proprietary/dsp/lib/* $ANDROIDROOTFS/system/lib/
echo "creating rootfs.tar.bz2"
cd $ANDROIDROOTFS
sudo chown -R wtbdaaaa:users *
sudo chmod 777 -R *
sudo chown root:users system/xbin/su
tar jcpf ../rootfs.tar.bz2 ./
echo "done."
}
function create_img()
{
echo "creating image."
ANDROIDIMG=$OUTDIR/img
copy_modules
#patch init.rc
mkdir -p $ANDROIDIMG
#mkcramfs $ANDROID/out/target/product/nowplus/root/ $ANDROIDIMG/initrd.cramfs
#mkcramfs $ANDROID/out/target/product/nowplus/system/ $ANDROIDIMG/factoryfs.cramfs
#undo patch init.rc
echo "done."
}
check_variant
create_rootfs
#create_img