LingYun Studio embeded system framwork software, such as thirdparty build shell and lingyun library
guowenxue
2024-08-19 80686e6bc4cb17e9d856647084725203fa63ebe6
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
#!/bin/bash
 
set -e
 
ROOTFS_PATH=`pwd`/../../linux-bsp/rootfs/
 
LYFTP_SRC=http://master.weike-iot.com:2211/src/
 
CROSSTOOL=/opt/gcc-aarch32-10.3-2021.07/bin/arm-none-linux-gnueabihf-
 
 
 
JOBS=`cat /proc/cpuinfo  |  grep processor | wc -l`
 
function msg_banner()
{
    echo ""
    echo "+-----------------------------------------------------------------------"
    echo "|  $1 "
    echo "+-----------------------------------------------------------------------"
    echo ""
}
 
function check_result()
{
    if [ $? != 0 ] ; then
       echo ""
       echo "+-----------------------------------------------------------------------"
       echo "|  $1 "
       echo "+-----------------------------------------------------------------------"
       echo ""
       exit ;
    fi
}
 
 
function compile_busybox()
{
    SRC_NAME=busybox-1.31.0
    PACK_SUFIX=tar.bz2
 
    if [ -f $SRC_NAME/busybox ] ; then 
        msg_banner "$SRC_NAME already compile and installed" 
        return 0; 
    fi 
 
    msg_banner "start download and compile $SRC_NAME " 
 
    if [ ! -d $SRC_NAME ] ; then
        if [ ! -f $SRC_NAME.${PACK_SUFIX} ] ; then
           wget ${LYFTP_SRC}/${SRC_NAME}.${PACK_SUFIX}
           check_result "ERROR: download ${SRC_NAME} failure"
        fi
 
        tar -xjf $SRC_NAME.${PACK_SUFIX}
    fi
 
    cp config/${SRC_NAME}.config $SRC_NAME/.config
 
    cd $SRC_NAME
 
    sed -i "s|^CONFIG_CROSS_COMPILER_PREFIX.*|CONFIG_CROSS_COMPILER_PREFIX=\"${CROSSTOOL}\"|g" .config 
    sed -i "s|^CONFIG_PREFIX.*|CONFIG_PREFIX=\"$ROOTFS_PATH\"|g" .config
 
    make 
    #make uninstall && sudo make install
}
 
 
compile_busybox