bpi-tools 工具,谁能把这五个命令玩转

BPI-tools

[bpi-tools]: v1.0.3: bpi-tools bpi-get cmd support update tools & download images

bpi-tools can install to X86 ubuntu and Banana Pi:

on x86 pc:

for ubuntu 14.04 (x86):

dpkg --add-architecture armhf

or for ubuntu 12.04 (x86):

echo "foreign-architecture armhf" >> /etc/dpkg/dpkg.cfg.d/multiarch

dpkg -i bananapi-bpi-tools*.deb

if you don’t have pv cmd:
apt-get install pv (for bpi-copy use)

download bpi-tools & install:

on ubuntu / raspbian / debian :

download file: bananapi-bpi-tools_1.0.3_armhf.deb

github:

https://github.com/BPI-SINOVOIP/ … ols_1.0.3_armhf.deb

google drive:

https://drive.google.com/file/d/ … UU/view?usp=sharing

MD5: 0408a434003651001f0131e61cadc2fd

# sudo dpkg -i bananapi-bpi-tools_1.0.3_armhf.deb

on other system :

download file: bpi-tools.tgz

google drive:
https://drive.google.com/file/d/ … kE/view?usp=sharing

MD5: 82e35dba52bc3edb48e96c8a544ac216

# sudo tar xvf bpi-tools.tgz -C /

HOW TO USE:

root@bananapi:~# bpi-tools
bpi-tools v1.0.6
usage: bpi-tools
bpi-tools FILE
bpi-tools --all | --update | --download | --version

bpi files:
bpi-tools v1.0.6
bpi-bootsel v1.0.4
bpi-copy v1.0.10a
bpi-get v1.0.3
root@bananapi:~# bpi-tools --update
bpi-tools v1.0.6
usage: bpi-tools
bpi-tools FILE
bpi-tools --all | --update | --download | --version

BPIFILE=/root/.bpi-tools.lst
Wait for download index file …
OK!!\n

bpi files:
bpi-tools v1.0.6
bpi-bootsel v1.0.4
bpi-copy v1.0.10a
bpi-get v1.0.3
root@bananapi:~# bpi-tools --version

bpi files:
/usr/bin/bpi-tools v1.0.6
/usr/bin/bpi-bootsel v1.0.4
/usr/bin/bpi-copy v1.0.10a
/usr/bin/bpi-get v1.0.3
root@bananapi:~# bpi-tools --download

download bpi files:
bpi-tools
bpi-tools: OK
bpi-tools: v1.0.6
bpi-bootsel
bpi-bootsel: OK
bpi-bootsel: v1.0.4
bpi-copy
bpi-copy: OK
bpi-copy: v1.0.10a
bpi-get
bpi-get: OK
bpi-get: v1.0.3
root@bananapi:~# ls -l
total 20
-rwxr-xr-x 1 root root 1493 5月 6 10:06 bpi-bootsel
-rwxr-xr-x 1 root root 6170 5月 6 10:06 bpi-copy
-rwxr-xr-x 1 root root 1391 5月 6 10:06 bpi-get
-rwxr-xr-x 1 root root 2898 5月 6 10:06 bpi-tools
root@bananapi:~# bpi-get
bpi-get v1.0.3
usage: bpi-get
bpi-get FILE

BPIFILE=/root/.bpi-files.lst

Wait for download index file …

bpi files:
2016-05-05-u1510_gpu_vpu_camera_bt_bpi-m2p_beta.img.zip
2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
2016-04-27-debian-8-jessie-mate_gpu_mpv_1080p-bpi-m3_beta-sd-emmc.img.zip
2016-04-25-ubuntu-mate-16.04_Xenial_gpu_mpv_1080p_bt-bpi-m3_beta-sd-emmc.img.zip
u1510_gpu_vpu_camera_bpi-m2p-20160413_preview.img.zip
2016-04-11-Armbian_5.07_Bananapim2plus_Debian_jessie_3.4.111_desktop_preview.img.zip
2016-04-08-raspbian-jessie-bpi-m2.img.zip
2016-04-08-raspbian-jessie-bpi-m2p.img.zip
2016-04-08-raspbian-jessie-bpi-m3.img.zip

root@bananapi:~# bpi-get 2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
INFO: Try to get 2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip …
BPIFILE=/root/.bpi-files.lst
IMGFILE=2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
MD5TMP=/tmp/.md5.tmp.8322
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 280 0 280 0 0 430 0 --:–:-- --:–:-- --:–:-- 430
0 0 0 671M 0 0 3317k 0 --:–:-- 0:03:27 --:–:-- 3533k
2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip: OK
root@bananapi:~# bpi-copy .
SRC=.
DST=
COPYMODE=usage
default
bpi-copy v1.0.10a
usage: bpi-copy
bpi-copy IMGFILE
bpi-copy IMGDIR
bpi-copy IMGFILE DEVICE
bpi-copy DEVICE IMGFILE

bpi images: (.img.zip)
./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
bpi images: (
.img)
bpi images: (.img.gz)
/usr/lib/u-boot/bananapi/bpi-m2/BPI_M2_720P.img.gz
/usr/lib/u-boot/bananapi/bpi-m2p/BPI_M2P_720P.img.gz
/usr/lib/u-boot/bananapi/bpi-m3/BPI_M3_720P.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m1.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m1p.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m2.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m2p.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m3.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-r1.img.gz
xz images: (
.xz)
zip images: (.zip)
./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
raw images: (
.raw)

Disks: (lsblk | grep disk)
sda 8:0 0 931.5G 0 disk
sdb 8:16 0 2.7T 0 disk
sdc 8:32 1 14.9G 0 disk

Disks: (fdisk -l | grep Disk | grep bytes)
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 3000.6 GB, 3000558944256 bytes
Disk /dev/sdc: 15.9 GB, 15931539456 bytes
root@bananapi:~# bpi-copy ./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip /dev/sdc
SRC=./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip
DST=/dev/sdc
COPYMODE=imagetodisk
imagetodisk
bpi-copy v1.0.10a
usage: bpi-copy
bpi-copy IMGFILE
bpi-copy IMGDIR
bpi-copy IMGFILE DEVICE
bpi-copy DEVICE IMGFILE

Warning: Try to write ./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip to BOOTDISK /dev/sdc

五 5月 6 10:21:13 CST 2016
*** start COPY (blue led on ) …
umount device: /dev/sdc
umount /dev/sdc2
umount /dev/sdc1

IMGFILE=./2016-05-05-debian-8-jessie-lite-bpi-m2p_beta-sd-emmc.img.zip

zip
1.91GB 0:01:59 [16.3MB/s] <=> ]
0+20666 records in
0+20666 records out
*** end COPY (blue led off) …
五 5月 6 10:23:40 CST 2016

RUNTIME 2:27
OK!! You can remove the BOOTDISK /dev/sdc now!!
root@bananapi:~#

if you want to use bpi-m2p image for bpi-m3, you can re-insert SD card:

root@bananapi:~# bpi-bootsel
bpi-bootsel v1.0.4
usage: bpi-bootsel
bpi-bootsel IMGFILE
bpi-bootsel IMGFILE DEVICE

bpi images:
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m1.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m2.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m1p.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m2p.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-r1.img.gz
/usr/lib/u-boot/bananapi/u-boot-2016.05-rc1/u-boot-2016.05-rc1-bpi-m3.img.gz
/usr/lib/u-boot/bananapi/bpi-m2/BPI_M2_720P.img.gz
/usr/lib/u-boot/bananapi/bpi-m2p/BPI_M2P_720P.img.gz
/usr/lib/u-boot/bananapi/bpi-m3/BPI_M3_720P.img.gz

Disks: (lsblk | grep disk)
sda 8:0 0 931.5G 0 disk
sdb 8:16 0 2.7T 0 disk
sdc 8:32 1 14.9G 0 disk

Disks: (fdisk -l | grep Disk | grep bytes)
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
Disk /dev/sdb: 3000.6 GB, 3000558944256 bytes
Disk /dev/sdc: 15.9 GB, 15931539456 bytes
root@bananapi:~# bpi-bootsel /usr/lib/u-boot/bananapi/bpi-m3/BPI_M3_720P.img.gz /dev/sdc
Warning: Try to write /usr/lib/u-boot/bananapi/bpi-m3/BPI_M3_720P.img.gz to BOOTDISK /dev/sdc
umount device: /dev/sdc
umount /dev/sdc2
umount /dev/sdc1
OK!! You can remove the BOOTDISK /dev/sdc now!!
root@bananapi:~#

gitbook 链接:
https://bananapi.gitbooks.io/bpi-m3/content/en/bpitools.html