forked from friendlyarm/friendlywrt_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmk-friendlywrt.sh
executable file
·48 lines (40 loc) · 1.03 KB
/
mk-friendlywrt.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
#!/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
echo "============Start building friendlywrt============"
echo "TARGET_FRIENDLYWRT_CONFIG = $TARGET_FRIENDLYWRT_CONFIG"
echo "FRIENDLYWRT_SRC_PATHNAME = $FRIENDLYWRT_SRC_PATHNAME"
echo "=========================================="
cd ${TOP_DIR}/${FRIENDLYWRT_SRC_PATHNAME}
./scripts/feeds update -a
./scripts/feeds install -a
if [ ! -f .config ]; then
cp ${TOP_DIR}/configs/${TARGET_FRIENDLYWRT_CONFIG} .config
make defconfig
else
echo "using .config file"
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)
USING_DATE=$(date +%Y%m%d)
echo "${USING_DATE}" > ./package/base-files/files/etc/rom-version
make -j$(nproc) V=s
RET=$?
if [ $RET -eq 0 ]; then
exit 0
fi
exit 1