curl -fsSL https://test.docker.com -o test-docker.sh
sudo sh test-docker.sh
本文以 BPI-M5 为例。请准备一台 Linux 计算机。
有一个一键安装脚本用于安装 Docker,安装命令如下:
curl -fsSL https://test.docker.com -o test-docker.sh
sudo sh test-docker.sh
安装后需要将当前用户添加到 Docker 用户组。
sudo groupadd docker
sudo usermod -aG docker $USER
首先获取 Docker 镜像。
docker pull sinovoip/bpi-build-linux-4.4:ubuntu16.04
创建文件并运行镜像。
mkdir /home/bpi/image
docker run -d -p 2222:22 -v /home/bpi/image:/root sinovoip/bpi-build-linux-4.4:ubuntu16.04
上面的“/home/bpi/image:/root”将宿主机的“/home/bpi/image”映射到容器的“/root”目录,并使用端口 2222。
运行后,可使用“docker container ls”查看已启动的容器。
然后通过 SSH 连接到 Docker 容器,密码为 root。
在 Docker 容器中创建文件夹后,也可在宿主机上看到该文件夹。
首先拉取源码
git clone https://github.com/BPI-SINOVOIP/BPI-M5-bsp
进入目录并拉取子模块
cd BPI-M5-bsp
git submodule update --init --recursive
开始编译
./build.sh bpi-m5 1
...
然后等待编译完成
使用以下命令安装 bpi 工具
curl -sL https://github.com/BPI-SINOVOIP/bpi-tools/raw/master/bpi-tools | sudo -E bash -
如果上述命令没有响应,也可使用下面的命令。
git clone https://github.com/BPI-SINOVOIP/bpi-tools
cd bpi-tools
sudo cp ./bpi* /bin/
输入 lsblk 命令查看 SD 卡设备路径(本例为 /dev/sdd)。
进入物理机的代码目录
cd ~/bpi/image/BPI-M5-bsp
sudo ./build.sh bpi-m5 6
This tool support following building mode(s):
--------------------------------------------------------------------------------
1. Build all, uboot and kernel and pack to download images.
2. Build uboot only.
3. Build kernel only.
4. kernel configure.
5. Pack the builds to target download image, this step must execute after u-boot,
kernel and rootfs build out
6. Update local build to SD with BPI Image flashed
7. Clean all build.
--------------------------------------------------------------------------------
Now building...
scripts/mk_install_sd.sh
--------------------------------------------------------------------------------
1. M5/M2Pro
--------------------------------------------------------------------------------
Please choose a target to install(1): 1
Please type the SD device(/dev/sdX): /dev/sdd
type will be intalled to /dev/sdd, [Y/n] y
Yes
...