forked from the-modem-distro/pinephone_modem_sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·83 lines (74 loc) · 2.54 KB
/
init.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
#!/bin/bash
BASE_PATH=`pwd`
YOCTOBRANCH="hardknott"
mkdir -p target
echo "Get the source for the bootloader"
if [ ! -d "quectel_lk" ]
then
echo "Cloning LK repository"
git clone https://github.com/Biktorgj/quectel_lk.git
else
echo "Pulling latest changes from LK"
cd quectel_lk && \
git pull && \
cd $BASE_PATH
fi
echo "Fetching Yocto"
if [ ! -d "yocto" ]
then
echo "Cloning Yocto repository from the Yocto Project"
git clone git://git.yoctoproject.org/poky yocto && \
cd yocto && \
git checkout tags/yocto-3.3.1 -b my-yocto-3.3.1
cd $BASE_PATH
else
echo "Yocto is already there"
fi
echo "Get meta-qcom fork from github"
if [ ! -d "yocto/meta-qcom" ]
then
echo "Cloning meta-qcom repository"
git clone -b $YOCTOBRANCH https://github.com/Biktorgj/meta-qcom.git yocto/meta-qcom
else
echo "Pulling latest changes from the kernel"
cd yocto/meta-qcom && \
git pull && \
cd $BASE_PATH
fi
echo "Fetching meta-python2 from OpenEmbedded"
if [ ! -d "yocto/meta-python2" ]
then
echo "Adding meta-python2"
git clone -b $YOCTOBRANCH git://git.openembedded.org/meta-python2 yocto/meta-python2
fi
echo "Fetching meta-openembedded (to provide support to meta-python2)"
if [ ! -d "yocto/meta-openembedded" ]
then
echo "Adding meta-oe"
git clone -b $YOCTOBRANCH https://github.com/openembedded/meta-openembedded.git yocto/meta-openembedded
fi
echo "Getting the ARM toolchain to be able to compile LK"
if [ ! -d "tools/gcc-arm-none-eabi-7-2017-q4-major/" ]
then
wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2" && \
mkdir -p tools ; \
tar xjvf gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 -C tools/ && \
rm gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
fi
echo "Setting up yocto initial configuration. Build path will be "$BASE_PATH/yocto/build
cd $BASE_PATH/yocto
if [ ! -d "build" ]
then
echo "Initializing poky and copying the configuration file"
source $BASE_PATH/yocto/oe-init-build-env $BASE_PATH/yocto/build && \
cp ../../tools/config/poky/rootfs.conf conf/ && \
bitbake-layers add-layer ../meta-qcom && \
bitbake-layers add-layer ../meta-openembedded/meta-oe && \
bitbake-layers add-layer ../meta-openembedded/meta-python && \
bitbake-layers add-layer ../meta-openembedded/meta-networking && \
bitbake-layers add-layer ../meta-python2
fi
cd $BASE_PATH
mkdir -p yocto/build/conf
cp tools/config/poky/rootfs.conf yocto/build/conf/
echo " Now run make without arguments to see what you can build"