Repository navigation
Expand file tree
/
Copy pathmk-friendlywrt.sh
More file actions
executable file
·84 lines (73 loc) · 1.77 KB
/
Copy pathmk-friendlywrt.sh
File metadata and controls
executable file
·84 lines (73 loc) · 1.77 KB
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
#!/bin/bash
set -eu
SCRIPTS_DIR=$(cd `dirname $0`; pwd)
if [ -h $0 ]
then
CMD=$(readlink $0)
SCRIPTS_DIR=$(dirname $CMD)
fi
cd $SCRIPTS_DIR
cd ../
TOP_DIR=$(pwd)
TARGET_FRIENDLYWRT_CONFIG=$1
FRIENDLYWRT_SRC_PATHNAME=$2
TARGET_PLAT=$3
cd ${TOP_DIR}/${FRIENDLYWRT_SRC_PATHNAME}
if [ ! -f .config ]; then
if [ -d ${TOP_DIR}/configs/${TARGET_FRIENDLYWRT_CONFIG} ]; then
CURRPATH=$PWD
readonly CURRPATH
touch ${CURRPATH}/.config
(cd ${TOP_DIR}/configs/${TARGET_FRIENDLYWRT_CONFIG} && {
for FILE in $(ls); do
if [ -f ${FILE} ]; then
echo "# apply ${FILE} to .config"
cat ${FILE} >> ${CURRPATH}/.config
fi
done
})
else
cp ${TOP_DIR}/configs/${TARGET_FRIENDLYWRT_CONFIG} .config
fi
sed -i -e '/^# CONFIG_PACKAGE_kmod-/d' .config
echo CONFIG_ALL_KMODS=y >> .config
# Fix compilation errors on the arm64 platform
if uname -mpi | grep aarch64 >/dev/null; then
if [ -e /usr/lib/go ]; then
if grep -q "CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT" .config; then
sed -i '/CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT/d' .config
fi
echo "CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT=\"/usr/lib/go\"" >> .config
fi
if [ ! -e /usr/include/asm ]; then
sudo ln -s /usr/include/aarch64-linux-gnu/asm /usr/include/asm
fi
fi
make defconfig
else
echo "using .config file"
fi
true ${DEBUG_DOT_CONFIG:=0}
if [ $DEBUG_DOT_CONFIG -eq 1 ]; then
echo "Abort because DEBUG_DOT_CONFIG=1"
exit 0
fi
if [ ! -d dl ]; then
# FORTEST
# cp -af /opt4/openwrt-full-dl ./dl
echo "dl directory doesn't exist. Will make download full package from openwrt site."
fi
make download -j$(nproc)
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
make -j$(nproc)
RET=$?
if [ $RET -eq 0 ]; then
exit 0
fi
make -j1 V=s
RET=$?
if [ $RET -eq 0 ]; then
exit 0
fi
exit 1