-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_up_build_environment.sh
executable file
·69 lines (53 loc) · 1.57 KB
/
set_up_build_environment.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
#!/usr/bin/env bash
#Set up build environment for Dragino v2. Only need to run once on first compile.
OPENWRT_PATH=openwrt
while getopts 'p:v:sh' OPTION
do
case $OPTION in
p) OPENWRT_PATH="$OPTARG"
;;
h|?) printf "Set Up build environment for MS14, HE \n\n"
printf "Usage: %s [-p <openwrt_source_path>]\n" $(basename $0) >&2
printf " -p: set up build path, default path = dragino\n"
printf "\n"
exit 1
;;
esac
done
shift $(($OPTIND - 1))
REPO_PATH=$(pwd)
echo "*** Backup original feeds files if they exist"
[ -f $OPENWRT_PATH/feeds.conf.default ] && mv $OPENWRT_PATH/feeds.conf.default $OPENWRT_PATH/feeds.conf.default.bak
echo "*** Copy feeds used in Dragino"
cp feeds.dragino $OPENWRT_PATH/feeds.conf.default
echo " "
echo "*** Update the feeds (See ./feeds-update.log)"
sleep 2
$OPENWRT_PATH/scripts/feeds update
sleep 2
echo " "
echo "*** Install OpenWrt extra packages"
sleep 2
$OPENWRT_PATH/scripts/feeds install -a
echo " "
echo ""
echo "Patch Dragino2 Platform"
rsync -avC platform/target/ $OPENWRT_PATH/target/
echo " "
echo "*** Install OpenWrt CC 15.05 patches"
cp cc_1505_patch/903-ar933x_uart_baud_max_step_fix.patch $OPENWRT_PATH/target/linux/ar71xx/patches-3.18/
echo " "
#Remove tmp directory
if [ -d $OPENWRT_PATH/tmp/ ]; then
echo "Remove tmp directory"
rm -rf $OPENWRT_PATH/tmp/
fi
echo "*** Change to build directory"
cd $OPENWRT_PATH
echo " "
echo "*** Run make defconfig to set up initial .config file (see ./defconfig.log)"
make defconfig > ./defconfig.log
# Backup the .config file
cp .config .config.orig
echo " "
echo "End of script"