Skip to content

How to build the images

gz-c edited this page Jun 4, 2018 · 2 revisions

Compiling of Original Image

Download the source code from github

Compiling environment: Ubuntu 14.04.5 LTS

Compiling with root user is not recommended.

In source root directory of OrangpiH5 please input

./build.sh

An interface will appear:

Select 1 OrangePi Prima (internal version)

Enter your root password

Select build option. Note! Your first compiling must be done in line with the following order, otherwise an error would be reported:

2->4->2->3->5->1->0

When Operation 0 is finished, the final image file is out/OrangePiH5_Prima.img

Installation and Design of Image

Mount the image file, out/OrangePiH5_Prima.img, to a temporary working directory:

mkdir temp
mount -o loop,offset=73400320 OrangePiH5_Prima.img temp
  1. Setup manager image

Input the following command:

vim temp/etc/bootsamos.sh

The following script can be seen:

cd /usr/local/skywire/go/bin
#nohup ./manager -web-dir /usr/local/skywire/go/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &
sleep 3
nohup ./node -connect-manager -manager-address 192.168.0.2:5998 -manager-web 192.168.0.2:8000 -discovery-address discovery.samos.io:5999-021192b6e41286d6799cb7ebf8c65ccc24c5d0bf0c9d98d6c48b6$
cd /

If the image is a manager, you should delete the # so that the manager will start automatically.

If the image is a node, you can skip this step.

  1. Set up an image IP

Input the following command

vim temp/etc/network/interfaces.d/eth0 

The following configuration can be seen:

auto eth0
  iface eth0 inet static
#    address 192.168.0.2   (manager)
#   hwaddress ether 00:21:3c:32:f4:42 (manager)
#    address 192.168.0.3 (node1)
#    hwaddress ether 00:21:3c:32:f4:43 (node1)
#    address 192.168.0.4 (node2)
#    hwaddress ether 00:21:3c:32:f4:44 (node2)
#    address 192.168.0.5 (node3)
#    hwaddress ether 00:21:3c:32:f4:45 (node3)
#    address 192.168.0.6 (node4)
#    hwaddress ether 00:21:3c:32:f4:46 (node4)
#    address 192.168.0.7 (node5)
#    hwaddress ether 00:21:3c:32:f4:47 (node5)
#    address 192.168.0.8 (node6)
#    hwaddress ether 00:21:3c:32:f4:48 (node6)
#    address 192.168.0.9 (node7)
#    hwaddress ether 00:21:3c:32:f4:49 (node7)
    netmask 255.255.255.0
    gateway 192.168.0.1
dns-nameservers 192.168.0.1 8.8.8.8

Delete the # according to the target node to be compiled. For instance, if manager is the one to be compiled, then both of the # of the following configuration should be deleted:

#   address 192.168.0.2 (manager)
#   hwaddress ether 00:21:3c:32:f4:42 (manager)
  1. Generate the target image

Input the following command and save the amended image

sync
umount temp

The target image is finished.

4.Compress and release the target image

Input the following command:

tar -zcvf the_target_directory/the_target_file_name.tar.gz OrangePiH5_Prima.img

The following are the samples of all compression commands for manager or node.

tar -zcvf dist-manager/manager.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-1-03.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-2-04.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-3-05.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-4-06.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-5-07.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-6-08.tar.gz OrangePiH5_Prima.img
tar -zcvf dist-manager/node-7-09.tar.gz OrangePiH5_Prima.img

This is the point where all of the target images have been generated.

Installation

  1. Windows

Download the released tar.gz file from the official website (downloads.skycoin.net). Unzip the file and have the image file OrangePiH5_Prima.img

Install Win32DiskImager and run it:

Select OrangePiH5_Prima.img and choose the target TF card for Device. Others must be configured as shown in the above picture. 
Then click the button Write in and wait for the progress bar to finish. Insert the TF card into the target miner.

Visit this website: http:https://192.168.0.2:8000 The default password is 1234.

  1. Linux

Input the following command and select your own target directory:

dd if=OrangePiH5_Prima.img of=/dev/target directory

Note:

  1. The first loading of miner should be a bit slow. Please wait for 3 minutes as recommended.
  2. The capacity of the TF card needs to be larger than that of the image. When the initialization is completed, the system capacity is automatically expanded to the target TF card capacity.
No configuration by users themselves needed.
  3. According to the user's needs, node can adjust the number of installations, but at least one manager is needed.

QA

  1. Possible errors during the process of compiling
output/pack/out/u-boot.fex cant be open
create package failed
ERROR: dragonsecboot boot_package.cfg failed

Cause and Solution: failed to follow the suggested compiling order; it is uboot that should be compiled first.

  1. Possible errors during the process of compiling
make[3]: *** no rules to create the goal of“drivers/input/misc/input_demo.o”
“drivers/input/misc/input_demo.c”。 cease。
make[2]: *** [drivers/input/misc] error 2
make[1]: *** [drivers/input]  error 2
make: *** [drivers] error 2

Solution:

Edit kernel/drivers/input/misc/Makefile, find obj-m += input_demo.o and delete it.

  1. Possible errors during the process of compiling
kernel/modules.builtin not found

Solution: failed to follow the suggested compiling order; it is kernel that should be compiled first.

  1. Possible errors during the process of compiling
I: Running command: chroot rootfs /debootstrap/debootstrap --second-stage
chroot: Unable to run command"/debootstrap/debootstrap": Exec format error

Solution: install the following plugins

apt-get install fakeroot
apt-get install debootstrap
apt-get install schroot
apt-get install binfmt-support qemu qemu-user-static
Clone this wiki locally