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

目录

  • 1 创建容器
    • 1.1 Dockerfile
    • 1.2 镜像与容器操作
  • 2. 依赖下载
    • 2.1 环境包
    • 2.2 编译工具
    • 2.3 相关依赖
  • 3. 拷贝镜像到容器
  • 4. 环境构建

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 protected]

# 系统更新
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 镜像与容器操作

# 创建镜像
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

2. 依赖下载

2.1 环境包

下载链接:PROCESSOR-SDK-RTOS-J721E
【PSDK】基于DOCKER的开发环境配置_第1张图片

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

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

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

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

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

你可能感兴趣的:(PSDK,docker,TI,PSDK)