Ubuntu for Rhomb.io

Introduction

In this Wiki article you will learn all about generating Ubuntu Operating System for Rhomb.io boards. You can use a SD card or an emmc Rhomb.io module to flash the sofware and boot the board.

Prerequisites

For ubuntu installation use SD card having atleast 16GB capacity. To use ubuntu pakcage machine should have atleast 15GB free space available.

Follow this steps to install toolchain: https://wiki.rhomb.io/index.php?title=Setting_up_compiling_Envoriment

Procedure to build

How to build everything

Login to linux and open terminal. Clone the Ubuntu repository to your local machine

git clone https://github.com/Rhomb-io/ubuntu-rhomb.git 

Change working directory to Build-Root repository directory

cd ubuntu-rhomb/

Run below command

sudo ./build.sh all

Note: This command will take little long for the first time run as it downloads all the packages and then compile. It will generated zImage (dtb appended ) and ubuntu.tgz (filesystem) in "<ubuntu_rhomb>/output/images/".

How to rebuild kernel

If you make some changes on the kernel sourcecode, you can rebuild the kernel instead of doing the entire process.

You can use this command, instead of sudo ./build.sh all.

sudo ./build.sh linux

Note: This command rebuild linux kernel with latest changes and install kernel image (zImage with dtb appended) in "<ubuntu_rhomb>/output/images/".

How to rebuild u-boot

To rebuild u-boot

sudo ./build.sh uboot

Note: This command rebuild uboot with latest changes and install uboot image in "<ubuntu_rhomb>/output/images/".

How to rebuild root filesystem

To rebuild Ubuntu filesystem

sudo ./build.sh ubuntu

Note: This command rebuild rootfs with latest changes in "<buidroot_rhomb>/output/images/".

Procedure to flash

How to flash SD

Insert a SD card to you computer.

Check the name that Linux puts to the SD card. You can use the next command before, and after SD insertion to compare the output and know what is the name of SD card.

lsblk

Buildrootpartiton.png

After you know the correct device name for SD card, run this command

sudo ./prepare_sd.sh sdb

Note: If necessary, change the name of "sdb" by the name that linux grants to your SD card (see lsblk output at previous step).

The process starts to copy all the needed files to SD card. When the process finishes, you can see this text:

SD card prepared
Insert sd card into board
Set DIP switch to SD card boot mode
Good luck!

How to flash emmc

First of all, you need to follow the previous steps at "Procedure to build and flash SD card".

Insert the generated SD card in the board card reader.

Insert an emmc Rhomb.io module at the board module socket.

Set the DIP Switch in Gaia to boot from SD Card.

Sddipok.jpg

Connect the Gaia board to PC via the Quad USB to UART board.

2016-09-28 09 48 47-Primeros pasos con Rhomb Rev 0.35 - Word.png

Open Putty, select serial connection and set the proper COM port and 115200 baudrate. Press open.

Note: To know the name of the proper COM port see the Windows device manager (at COM ports section) after and before of connecting the Quad USB-UART board.

Puttyconnect.jpg

Once the boot process finishes, you can see this text:

Welcome to Ubuntu
Ubuntu login:

Login as user "rhomb" and password "rhomb". After that, issue this commands:

cd /opt/
sudo tar -xf images.tgz
cd images
sudo ./emmc_fusing.sh mmcblk1

This script will ask user if "/dev/mmcblk1p1" already formatted with ext4 filesystem as below

/dev/mmcblk1p1 contains a ext4 file system
last mounted on / on Thu Jan  1 00:00:02 1970
Proceed anyway? (y,N)
       

Enter 'y' if it asked first time. For next time onwards user can enter 'N'. The process will start. When the process finishes OK, you can see this message:

eMMC flashed
Power off the board
Set emmc boot mode boot board
Good luck!

Now, turn off the board. Remove the SD card if you like. Set the DIP Switch to EMMC bootmode, and boot the board. Now the board is booting from the EMMC.

Now, you can operate your system using the Ubuntu command line.

Troubleshoting at SD or emmc generation

If you have problems generating the SD card, for example, this messages appearing during flashing process:

tar: lib/firmware/matrox: Cannot mkdir: No space left on device
tar: lib/firmware/matrox/g400_warp.fw: Cannot open: No such file or directory

You will need to remove any previous partition existing at the sdcard. You can use for example gparted.

Procedure to boot

Boot from SD or emmc with HDMI display and GUI

  1. Insert the desired boot media. SD card or emmc module.
  2. Set the DIP Switch to SD or emmc boot mode (see DIP switch position at the next section images).
  3. Connect HDMI cable to the board and to the monitor.
  4. Connect a mouse, keyboard, LAN cable etc.. to the board
  5. Connect 5V-2A power source to the board at PWR IN and USB PWR connectors.
  6. Power on the board.

NOTE: In case of booting from eMMC we have seen that sometimes it failed to display GUI on HDMI screen. In that case boot via UART, login into board and apply below commands. This is one time command you won't face issue after that.

  1. sudo dpkg-reconfigure lightdm
  2. sudo /etc/init.d/lightdm restart

Boot from SD - UART Debug

Unplug HDMI cable (if you have any).

Now, you have an SD card with u-boot, minimal filesystem, rhomb.io kernel based on 4.8 Linux kernel.

Insert the SD card in the PCB card reader.

Set the DIP Switch in Gaia to boot from SD Card.

Sddipok.jpg

Connect the board to PC via the Quad USB to UART board.

See image

Open Putty, select serial connection and set the proper COM port and 115200 baudrate. Press open.

Note: To know the name of the proper COM port see the Windows device manager (at COM ports section) after and before of connecting the Quad USB-UART board.

See image

Apply 5V-2A power supply to Gaia and press the power on button for any seconds. Wait for the boot process finishes.

Now, you can operate your system using the Ubuntu command line.

Boot from eMMC - UART Debug

Unplug HDMI cable (if you have any).

Insert an EMMC Rhomb.io module in the module socket of the PCB.

Set the DIP Switch in Gaia to boot from EMMC.

Emmcboot 213.jpg

Connect the board to PC via the Quad USB to UART board.

2016-09-28 09 48 47-Primeros pasos con Rhomb Rev 0.35 - Word.png

Open Putty, select serial connection and set the proper COM port and 115200 baudrate. Press open.

Note: To know the name of the proper COM port see the Windows device manager (at COM ports section) after and before of connecting the Quad USB-UART board.

Puttyconnect.jpg

Apply 5V-2A power supply to Gaia and press the power on button for any seconds. Wait for the boot process finishes.

Now, you can operate your system using the Ubuntu command line.