How to compile BPI-M2+ BSP and boot image


(bpi team) #1

How to compile BPI-M2+ BSP and boot image

1, download Linux image Ubuntu-12.04 64bit system:

download link: http://mirrors.163.com/ubuntu-releases/12.04/ubuntu-12.04.5-desktop-amd64.iso

just use this version , do not need upgrade to newest version.

2,install Linux system on virtual machine:

note : you need Modify the network card to bridge mode (copy network status) when you install linux system.

3,install tooling on linux system:

sudoapt-get update && apt-get install -y \
apt-utils\
openssh-server\
build-essential\
gcc-arm-linux-gnueabihf\
g++-arm-linux-gnueabihf\
gcc-arm-linux-gnueabi\
g++-arm-linux-gnueabi\
unzip\
sudo\
Git\
mercurial\
vim\
bc\
u-boot-tools\
device-tree-compiler\
ia32-libs\
pkg-config\
libusb-1.0-0-dev\
Python-software-properties\
software-properties-common\
libncurses5-dev\
busybox

4,download BPI-M2+ BSP code:

install git tooling

sudoapt-get install git-core

download source code for BPI-M2+

sudo git clone https://github.com/BPI-SINOVOIP/BPI-M2P-bsp.git
sudo git clone https://github.com/BPI-SINOVOIP/bpi-tools.git

5,compile BPI-M2+ bsp code:

sudo  ./build.sh

please choose option 1,compile all source code.

Compile process takes longer, please wait for complete

6,Made SD card:

6.1, use GParted tooling to format SD card

 install :sudoapt-get install -y gparted

In the graphical interface operation, formatted into :100M reserve + 50M(Fat32 format) + 500M(Ext4 format)

Note: the formatting Fat32 and corruption partition size can be adjusted, can adjust the Fat32 is 200 m, corruption all USES the remaining space

6,2,mount SD card,Fat32 Partition mounted as usb1,Ext4 Partition mounted asusb2.

sudomount /dev/sdb1 /mnt/usb1
sudomount /dev/sdb2 /mnt/usb2

6,3,made busybox root file system:

download link:

https://github.com/BPI-SINOVOIP/BPI-files/blob/master/rootfs/busybox-1.24.2_bash-root.tgz

Extract the downloaded file to Ext4 partition

sudomount /dev/sdb2 /mnt/usb2
sudotar xvf busybox-1.24.2_bash-root.tgz -C /mnt/usb2

6,4,unzip SD card .tgz file to different partitions

cd BPI_M2P_bsp/SD
sudo tar xvf ./BPI-BOOT-bpi-m2p.tgz  -C /mnt/usb1
sudo tar xvf ./BOOTLOADER-bpi-m2p.tgz  -C /mnt/usb2
sudo tar xvf ./3.4.39-BPI-M2P-Kernel.tgz  -C /mnt/usb2

6,5, Use bpi-boot tool production start (The first 100M)

sudo ../../bpi-tools/bpi-bootsel./100MB/BPI_M2P_720P.img.gz/dev/sdb

6,6 Production process takes long time, please wait until it finish.

7, when finish :

BPI-M2+ board insert SD card and power on.

8,Cloning system, operating under BPI-M2+ board :

Insert SD card through the card reader into the usb port of BPI-M2+ board, called equipment: /dev/sda

Note: dd 700M here, already contains the system part of a total of 650M, 100M partition (tenure) + (Fat32) 50M+ 500M (Ext4) = 650M

8.1 Direct cloning system:

dd if=/dev/mmcblk0 of=/dev/sda bs=10M count=70

8.1 Cloning to image file:

mount /dev/sda0 /mnt/sd
dd if=/dev/mmcblk0of=/mnt/sd/m2p_os.img bs=10M count=70

8.2 Cloning to eMMC flash:

dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=10M count=70

9,use img file made boot SD card:

9.1,windows system use SDFormatter format SD card 9.2,windows system use Win32DiskImager burm image file to SD card