forked from bananapi-dev/BPi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHowToBuild_BPi_image.en.txt
106 lines (78 loc) · 3.97 KB
/
HowToBuild_BPi_image.en.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
=====How To Build Banana Pi Image=====
This document is for the developers who want to build their own BPi image.
Git pull requests with your contribution or correction are welcome.
=====Procedures=====
1. Setup the working space.
$ export WORKSPACE=`pwd`
2. Get the GitHub source code from sunxi-bsp source.
$ git clone https://github.com/bananapi-dev/sunxi-bsp
3. Change the directory to sunxi-bsp.
$ cd sunxi-bsp
4. Set the environment.
$ source bpi_env.sh
[bpi@psp sunxi-bsp]$ source bpi_env.sh
Submodule 'allwinner-tools' (https://github.com/linux-sunxi/allwinner-tools.git) registered for path 'allwinner-tools'
Submodule 'cedarx-libs' (https://github.com/linux-sunxi/cedarx-libs.git) registered for path 'cedarx-libs'
Submodule 'linux-sunxi' (https://github.com/bananapi-dev/linux-sunxi.git) registered for path 'linux-sunxi'
Submodule 'sunxi-boards' (https://github.com/bananapi-dev/sunxi-boards.git) registered for path 'sunxi-boards'
Submodule 'sunxi-tools' (https://github.com/linux-sunxi/sunxi-tools.git) registered for path 'sunxi-tools'
Submodule 'u-boot-sunxi' (https://github.com/bananapi-dev/u-boot-sunxi.git) registered for path 'u-boot-sunxi'
Initialized empty Git repository in /local/home/bpi/github.com/sunxi-bsp/sunxi-boards/.git/
remote: Reusing existing pack: 1028, done.
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 1037 (delta 4), reused 0 (delta 0)
Receiving objects: 100% (1037/1037), 268.50 KiB | 23 KiB/s, done.
Resolving deltas: 100% (624/624), done.
Submodule path 'sunxi-boards': checked out 'c36a1c2186b4e9e9afc6a06713a0e67aa552a370'
cubietruck configured. Now run `make`
[bpi@psp sunxi-bsp]$
5. Update and compile the source code of Banana Pi.
Need to configure cubietruck as a starting example because we can not find Bananapi project at the first time.
$ ./configure cubietruck
$ make update
Start to configure Bananapi and then compile!
$ sudo apt-get install -y libusb-1.0-0-dev
$ ./configure Bananapi
$ make update
$ make
6. Download the rootfs package you prefer (such as Ubuntu/Lubuntu/Respbian...etc.), extract to $WORKSPACE
List Ubuntu as an example here.
$ cd $WORKSPACE
$ wget https://releases.linaro.org/12.11/ubuntu/precise-images/ubuntu-desktop/linaro-precise-ubuntu-desktop-20121124-560.tar.gz
$ mkdir ROOTFS_DIR
$ sudo tar --strip-components=3 -pzxvf linaro-precise-ubuntu-desktop-20121124-560.tar.gz -C ROOTFS_DIR
7. Copy related files to the directory ROOTFS_DIR
$ sudo cp sunxi-bsp/build/Bananapi_hwpack/kernel/script.bin ROOTFS_DIR/boot
$ sudo cp sunxi-bsp/build/Bananapi_hwpack/kernel/uImage ROOTFS_DIR/boot
$ sudo gedit ROOTFS_DIR/boot/uEnv.txt
Add text as below
mmcboot=fatload mmc 0 0x43000000 script.bin || fatload mmc 0 0x43000000 evb.bin; \
fatload mmc 0 0x48000000 uImage; if fatload mmc 0 0x43100000 uInitrd; \
then bootm 0x48000000 0x43100000; else bootm 0x48000000; fi
uenvcmd=run mmcboot
bootargs=console=ttyS0,115200 console=tty0 \
disp.screen0_output_mode=EDID:1280x720p60 \
hdmi.audio=EDID:0 root=/dev/mmcblk0p1
$ sudo cp -r sunxi-bsp/build/Bananapi_hwpack/rootfs/* ROOTFS_DIR
$ sudo gedit ROOTFS_DIR/etc/network/interface
Add text as below
auto eth0
iface eth0 inet dhcp
$ sudo vi ROOTFS_DIR/etc/NetworkManager/NetworkManager.conf
Modify it as below
[ifupdown]
managed=true
8. Format the sdcard (assume the sdcard mount path is /dev/sdb), We recommend using 8G/Class 10 sdcard for better BPi experience
$ sudo umount /dev/sdb1
$ sudo dd if=/dev/zero of=/dev/sdb bs=1k count=1024
$ sudo dd if=sunxi-bsp/build/Bananapi_hwpack/bootloader/u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1024 seek=8
$ sudo fdisk /dev/sdb
Create a partition
$ sudo mkfs.ext4 /dev/sdb1
9. Copy ROOTFS_DIR into sdcard
$ mkdir mnt
$ sudo mount /dev/sdb1 mnt
$ sudo cp -a ROOTFS_DIR/* mnt
$ sudo sync
=====End=====