• 【PSDK】基于DOCKER的开发环境配置


    1 创建容器

    1.1 Dockerfile

    ########################################################################################################################
    # docker build -f Dockerfile_u18_tsinghua_u18 -t u18:tsinghua_u18 .
    # docker run -id --privileged=true --name u18_tsinghua u18:tsinghua_u18
    # docker exec -it u18_tsinghua /bin/bash 
    # docker stop u18_tsinghua
    # docker rm   u18_tsinghua
    # docker rmi  u18:tsinghua_u18
    ########################################################################################################################
    # 基础镜像
    FROM ubuntu:18.04
    
    # 构建参数
    ARG user=u18
    
    # 元数据
    LABEL Author=Steven.Zhou Email=zhy29563@126.com
    
    # 系统更新
    RUN apt-get -y update                                                                                    &&\
        apt-get install -y ca-certificates                                                                   &&\
        cp /etc/apt/sources.list /etc/apt/sources.list.bak                                                   &&\
        sed -i "s@http://.*archive.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list  &&\
        sed -i "s@http://.*security.ubuntu.com@https://mirrors.tuna.tsinghua.edu.cn@g" /etc/apt/sources.list &&\
        apt-get -y update                                                                                    &&\
        apt-get -y upgrade                                                                                   &&\
        apt-get install -y sudo openssh-server net-tools wget axel curl zip unzip build-essential            &&\
        apt-get -y autoremove
    
    # 添加用户:赋予sudo权限,指定密码
    RUN useradd -m --shell /bin/bash ${user} && adduser ${user} sudo && echo "${user}:${user}" | chpasswd
    
    # 指定容器起来的工作目录
    WORKDIR /home/${user}
    
    # 指定容器起来的登录用户
    USER ${user}
    
    • 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

    1.2 镜像与容器操作

    # 创建镜像
    docker build -f Dockerfile_u18_tsinghua_u18 -t u18:tsinghua_u18 .
    # 创建容器
    docker run -id --privileged=true --name u18_tsinghua u18:tsinghua_u18
    # 进入容器
    docker exec -it u18_tsinghua /bin/bash 
    # 停止容器
    docker stop u18_tsinghua
    # 删除容器
    docker rm   u18_tsinghua
    # 删除镜像
    docker rmi  u18:tsinghua_u18
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    2. 依赖下载

    2.1 环境包

    下载链接PROCESSOR-SDK-RTOS-J721E
    下载版本与文件

    cd DOWNLOAF_PATH
    
    wget https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-bA0wfI4X2g/07.03.00.07/ti-processor-sdk-rtos-j721e-evm-07_03_00_07.tar.gz
    wget https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-bA0wfI4X2g/07.03.00.07/ti-processor-sdk-rtos-j721e-evm-07_03_00_07-prebuilt.tar.gz
    wget https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-bA0wfI4X2g/07.03.00.07/psdk_rtos_j721e_7.3_es11_src_patch.tar.gz
    
    • 1
    • 2
    • 3
    • 4
    • 5

    2.2 编译工具

    cd DOWNLOAF_PATH
    
    wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz         --no-check-certificate
    wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz   --no-check-certificate
    wget https://developer.arm.com/-/media/Files/downloads/gnu-a/9.2-2019.12/binrel/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz --no-check-certificate
    
    • 1
    • 2
    • 3
    • 4
    • 5

    2.3 相关依赖

    cd DOWNLOAF_PATH
    
    git clone git://git.ti.com/atf/arm-trusted-firmware.git
    cd arm-trusted-firmware && git checkout -b dev ti2020.00
    cd .. && tar -zcvf arm-trusted-firmware.tar.gz arm-trusted-firmware/
    
    git clone git://git.ti.com/optee/ti-optee-os.git
    cd ti-optee-os && git checkout -b dev ti2020.00
    cd .. && tar -zcvf ti-optee-os.tar.gz ti-optee-os/
    
    wget https://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/snapshot/opkg-utils-master.tar.gz --no-check-certificate
    wget https://github.com/g-truc/glm/releases/download/0.9.8.0/glm-0.9.8.0.zip                 --no-check-certificate
    wget https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.zip/download          --no-check-certificate -O `pwd`/glew-2.0.0.zip
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    3. 拷贝镜像到容器

    cd DOWNLOAF_PATH
    
    docker exec -t u18_tsinghua mkdir /home/u18/psdk_src                                                    &&\
    docker cp ti-processor-sdk-rtos-j721e-evm-07_03_00_07.tar.gz            u18_tsinghua:/home/u18/psdk_src &&\
    docker cp ti-processor-sdk-rtos-j721e-evm-07_03_00_07-prebuilt.tar.gz   u18_tsinghua:/home/u18/psdk_src &&\
    docker cp psdk_rtos_j721e_7.3_es11_src_patch.tar.gz                     u18_tsinghua:/home/u18/psdk_src &&\
    docker cp gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz            u18_tsinghua:/home/u18/psdk_src &&\
    docker cp gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz      u18_tsinghua:/home/u18/psdk_src &&\
    docker cp gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz    u18_tsinghua:/home/u18/psdk_src &&\
    docker cp arm-trusted-firmware.tar.gz                                   u18_tsinghua:/home/u18/psdk_src &&\
    docker cp opkg-utils-master.tar.gz                                      u18_tsinghua:/home/u18/psdk_src &&\
    docker cp ti-optee-os.tar.gz                                            u18_tsinghua:/home/u18/psdk_src &&\
    docker cp glm-0.9.8.0.zip                                               u18_tsinghua:/home/u18/psdk_src &&\
    docker cp glew-2.0.0.zip                                                u18_tsinghua:/home/u18/psdk_src
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    4. 环境构建

    cd /home/u18/psdk_src
    
    # 主环境
    tar -xvf /home/u18/psdk_src/ti-processor-sdk-rtos-j721e-evm-07_03_00_07.tar.gz &&\
    mv       /home/u18/psdk_src/ti-processor-sdk-rtos-j721e-evm-07_03_00_07        /home/u18/psdk
    
    # 文件系统
    tar -xvf /home/u18/psdk_src/ti-processor-sdk-rtos-j721e-evm-07_03_00_07-prebuilt.tar.gz                                           &&\
    cp       /home/u18/psdk_src/ti-processor-sdk-rtos-j721e-evm-07_03_00_07-prebuilt/boot-j7-evm.tar.gz                /home/u18/psdk &&\
    cp       /home/u18/psdk_src/ti-processor-sdk-rtos-j721e-evm-07_03_00_07-prebuilt/tisdk-default-image-j7-evm.tar.xz /home/u18/psdk
    
    # 补丁包
    tar -xvf /home/u18/psdk_src/psdk_rtos_j721e_7.3_es11_src_patch.tar.gz &&\
    tar -xvf /home/u18/psdk_src/psdk_rtos_j721e_7.3_es11_src.tar.gz -C /home/u18/psdk/pdk_jacinto_07_03_00_29/packages/ti
    
    # 编译器
    tar -xvf /home/u18/psdk_src/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz         -C /home/u18/psdk &&\
    tar -xvf /home/u18/psdk_src/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz   -C /home/u18/psdk &&\
    tar -xvf /home/u18/psdk_src/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz -C /home/u18/psdk
    
    # 依赖
    tar -xvf /home/u18/psdk_src/arm-trusted-firmware.tar.gz  -C /home/u18/psdk &&\
    tar -xvf /home/u18/psdk_src/ti-optee-os.tar.gz           -C /home/u18/psdk &&\
    tar -xvf /home/u18/psdk_src/opkg-utils-master.tar.gz     -C /home/u18/psdk &&\
    unzip    /home/u18/psdk_src/glm-0.9.8.0.zip              -d /home/u18/psdk &&\
    unzip    /home/u18/psdk_src/glew-2.0.0.zip               -d /home/u18/psdk && cd /home/u18/psdk/glew-2.0.0 && make && sudo make install
    
    # X11 与 GL
    sudo apt-get install -y libx11-dev mesa-common-dev libglu1-mesa-dev
    
    # i386架构
    sudo dpkg --add-architecture i386
    sudo apt-get -y update
    
    # 构建SDK
    cd /home/u18/psdk
    ./psdk_rtos/scripts/setup_psdk_rtos.sh
    
    # 编译视觉程序
    cd vision_apps
    make -j16
    
    # 删除安装包
    rm -rf /home/u18/psdk_src
    
    • 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
  • 相关阅读:
    AP360X 3D小夜灯 拍拍灯 智能充电 LED照明 手电筒驱动IC LED指示灯
    C语言-入门-extern和头文件(十六)
    KeyTool生成证书链及使用
    c++---I/o操作
    SAP 异常现象之同一个IDoc可以被POST两次触发2张不同的物料凭证
    [重庆思庄每日技术分享]-SQLLOADER express加载数据报 KUP-04040
    ubuntu命令
    Vue+ECharts实现可视化地图
    从 几 个应用入手 了解为什么灵魂绑定代币将为 DeFi 带来大规模采用
    P8198 [传智杯 #4 决赛] 背单词的小智 —二分答案
  • 原文地址:https://blog.csdn.net/zhy29563/article/details/132870245