-
Notifications
You must be signed in to change notification settings - Fork 0
/
release_obs.sh
executable file
·93 lines (76 loc) · 2.38 KB
/
release_obs.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#
JOBS=`grep -c processor /proc/cpuinfo`
let JOBS=${JOBS}*2
JOBS="-j${JOBS}"
BOOT_PATH="arch/arm/boot"
ZIMAGE="zImage"
DZIMAGE="dzImage"
INPUT_STR=${1}
CONFIG_STR=${INPUT_STR%_smk_dis*}
#CONFIG_STR=${INPUT_STR%_tima_en*}
OPTION_STR=${INPUT_STR#*${CONFIG_STR}}
echo "defconfig : ${CONFIG_STR}_defconfig , option : ${OPTION_STR}"
if [ "${OPTION_STR}" = "_smk_dis" ]; then
echo "Now change smack-disable for ${CONFIG_STR}_defconfig"
sed -i 's/CONFIG_SECURITY_SMACK=y/\# CONFIG_SECURITY_SMACK is not set/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change smack-disable step 1"
exit 1
fi
sed -i 's/\# CONFIG_DEFAULT_SECURITY_DAC is not set/CONFIG_DEFAULT_SECURITY_DAC=y/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change smack-disable step 2"
exit 1
fi
sed -i 's/CONFIG_DEFAULT_SECURITY_SMACK=y/\# CONFIG_DEFAULT_SECURITY_SMACK is not set/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change smack-disable step 3"
exit 1
fi
sed -i 's/CONFIG_DEFAULT_SECURITY="smack"/CONFIG_DEFAULT_SECURITY=""/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change smack-disable step 4"
exit 1
fi
fi
if [ "${OPTION_STR}" = "_tima_en" ]; then
echo "Now change tima enable for ${CONFIG_STR}_defconfig"
sed -i 's/\# CONFIG_TIMA is not set/CONFIG_TIMA=y/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change tima enable step 1"
exit 1
fi
sed -i 's/\# CONFIG_TIMA_LOG is not set/CONFIG_TIMA_LOG=y/g' arch/arm/configs/${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to change tima enable step 2"
exit 1
fi
fi
make ARCH=arm ${CONFIG_STR}_defconfig
if [ "$?" != "0" ]; then
echo "Failed to make defconfig"
exit 1
fi
make $JOBS zImage ARCH=arm
if [ "$?" != "0" ]; then
echo "Failed to make zImage"
exit 1
fi
DTC_PATH="scripts/dtc/"
rm $BOOT_PATH/dts/*.dtb -f
make ARCH=arm dtbs
if [ "$?" != "0" ]; then
echo "Failed to make dtbs"
exit 1
fi
./scripts/sprd_dtbtool.sh -p ${DTC_PATH} -v ${BOOT_PATH}/dts/
if [ "$?" != "0" ]; then
echo "Failed to make merged-dtb"
exit 1
fi
./scripts/sprd_mkdzimage.sh -o ${BOOT_PATH}/${DZIMAGE} -k ${BOOT_PATH}/zImage -d ${BOOT_PATH}/merged-dtb
if [ "$?" != "0" ]; then
echo "Failed to make mkdzImage"
exit 1
fi