Docker安装
sudo apt install docker.io
Docker运行权限
#添加docker group
sudo groupadd docker# 将当前用户添加到docker组
sudo gpasswd -a ${USER} docker# 重启docker服务:
sudo service docker restart# 查看用户组及成员:
cat /etc/group | grep docker
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
Docker容器创建
# 拉取Ubuntu镜像
# Ubuntu 20.04 LTS
docker pull ubuntu:20.04# 进入关联源码目录挂载使用绝对路径,启动Docker
cd ~
docker run -it -v ${PWD}:${PWD} --name Ubuntu20_CV180x_MilkvDuo ubuntu:20.04# 添加用户
adduser gaoyang3513# 环境依赖
apt-get update# 安装 SDK 构建所需要的软件包
sudo apt install dialog python3-dev make git bc gcc flex bison ninja-build libssl-dev \rsync pkg-config device-tree-compiler squashfs-tools parted dosfstools cpio unzip wget# Docker 补充
apt install -y bc time rsync curl vim cmake sudo# 为用户username添加sudo权限
sudo usermod -a -G sudo gaoyang3513# 管理sudo
echo "%sudo ALL=(ALL:ALL) ALL" >> /etc/sudoers
echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
Python版本切换
# 添加,优先python3
update-alternatives --install /usr/bin/python python /usr/bin/python2 100
update-alternatives --install /usr/bin/python python /usr/bin/python3 150# 切换
update-alternatives --config python
Git
git config --global user.name "gaoyang3513"
git config --global user.email "gaoyang3513@163.com"git config --global core.editor vim
拉取代码
git clone https://github.com/milkv-duo/duo-buildroot-sdk.git SDK_CIV1800_MilkV-Duo
# 加速
git clone https://hub.nuaa.cf/milkv-duo/duo-buildroot-sdk.git SDK_CIV1800_MilkV-Duo
编译
cd duo-buildroot-sdk/
./build_milkv.sh
- 编译成功后可以在
out
目录下看到生成的SD卡烧录镜像milkv-duo-XXX.img
分步编译
export MILKV_BOARD=milkv-duo
source milkv/boardconfig-milkv-duo.shsource build/milkvsetup.sh
defconfig cv1800b_milkv_duo_sd
clean_all
build_all
pack_sd_image
生成的固件位置: install/soc_cv1800b_milkv_duo_sd/milkv-duo.img