• Docker搭建RK3568开发环境


    推荐:Ubuntu 20.04 版本

    Docker加速

    # 编辑 Docker 配置文件
    $ sudo vim /etc/docker/daemon.json
    
    # 加入以下配置项
    {
        "registry-mirrors": [
            "https://dockerproxy.com",
            "https://hub-mirror.c.163.com",
            "https://mirror.baidubce.com",
            "https://ccr.ccs.tencentyun.com"
        ]
    }
    
    
    # 重启docker
    $ sudo service docker restart
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    Docker容器创建

    # 拉取Ubuntu镜像
    docker pull ubuntu:20.04
    
    # 关联源码目录并启动Docker,挂载使用绝对路径
    cd ~/Source/04-RK3568/02-Projects/SDK_RK3568_Linux_ATK
    sudo docker run -it  -v ${PWD}:${PWD} --name Ubuntu20_RK3568 ubuntu:20.04
    
    # 环境依赖
    apt-get update
    apt-get install -y curl python2.7 python-pyelftools git ssh make gcc libssl-dev liblz4-tool expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib unzip device-tree-compiler python3-pip libncurses-dev python3-pyelftools vim mtd-utils
    
    # Docker 补充
    apt install -y bc
    
    # 检出
    cd /home/gaoyang3513/Source/04-RK3568/02-Projects/SDK_RK3568_Linux_ATK
    .repo/repo/repo sync -l -j10
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    Python版本切换

    # 添加
    update-alternatives --install /usr/bin/python python /usr/bin/python2 100
    update-alternatives --install /usr/bin/python python /usr/bin/python3 150
    
    # 切换
    sudo update-alternatives --config python
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    Repo工具

    mkdir ~/bin
    export PATH=~/bin:$PATH
    
    # 下载
    curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o ~/bin/repo
    chmod a+x ~/bin/repo
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    Git

    git config --global user.name "gaoyang3513"
    git config --global user.email "gaoyang3513@163.com"
    
    git config --global core.editor vim
    
    • 1
    • 2
    • 3
    • 4

    开发

    编译

    ./build.sh lunch
    
    # 目标
    3. BoardConfig-rk3568-atk-evb1-ddr4-v10.mk
    
    • 1
    • 2
    • 3
    • 4

    在编译根文件系统的过程中会通过网络下载很多的第三方库文件;首先,下载过程会占用很多时间导致编译时间拉长;其次,如果用户的网络环境不稳定或者第三方库文件的下载源发生变更,很容易导致下载失败,进而导致根文件系统编译出错;所以,为了加快根文件系统的编译过程、也为了降低编译根文件系统时出现问题的概率, 我们可以预先把编译根文件系统所需的第三方库文件拷贝到 SDK 中。

    在容器外执行

    sudo tar -xzf ../../01-Resource/Alientek_RK3568/Disk_B/02-ATK-DLRK3568_SDK/linux_sdk/dl.tgz -C ./buildroot/
    
    • 1

    编译

    ./build.sh all
    
    • 1

    问题

    技巧

    # 新开
    sudo docker exec -it Ubuntu20_RK3568 /bin/bash
    
    • 1
    • 2
  • 相关阅读:
    stm32 LWIP开发-1-
    张量 Tensor
    监控工具普罗米修斯(Prometheus)的介绍与安装
    为什么我们不支持手工上传镜像
    多线程环境下如何安全的使用线性表, 队列, 哈希表
    List接口与实现类
    介绍一个Python排序函数natsort
    tomcat+idea--如何在idea上发布项目
    [黑马程序员C++笔记]P168-P173模板-函数模板
    元数据驱动下的业务创新,构建企业竞争新优势
  • 原文地址:https://blog.csdn.net/gaoyang3513/article/details/132750684