Ubuntu on Ventana

While Gateworks cannot fully support all Linux distros, it is relatively simple to overlay a Gateworks Ventana kernel onto any non-Gateworks third party Linux distro rootfs image. For a full list of Linux BSP's for Ventana see here

This page is dedicated details regarding running Ubuntu on an Gateworks Ventana Board.

See also:

the Gateworks Ventana third party linux page for more details on how to use other linux distro on Ventana.

For a full Board Support Package providing building a Linux distro from source, please see the OpenWrt, Yocto, or Android BSP from the Ventana BSP page

Ubuntu 18.04 LTS (Bionic Beaver) console image

* Note *: This is a mainline kernel that does not have Video Hardware Acceleration support for gstreamer and a few other Gateworks specific items. For more information, read Gateworks Mainline Linux Support.

Ubuntu 16.04 LTS (Xenial Xerus) console image

* Note *: This is a mainline kernel that does not have Video Hardware Acceleration support for gstreamer and a few other Gateworks specific items. For more information, read Gateworks Mainline Linux Support.

Ubuntu 14.04 LTS (Trusty Tahr) X11 LXDE image

A pre-built console image created using the debootstrap method for ​Ubuntu 14.04 (Trusty Tahr) and adding gstreamer-imx for IPU/VPU/GPU hw video acceleration as well as X11/LXDE with hardware acceleration can be downloaded:

​trusty-x11-ventana.tar.gz - tarball of rootfs you can use to image onto microSD / mSATA / USB using instructions from linux/blockdev (sha256sum:29166d5ebe6fc73c081b171f4f5ad15440b7d9a94c46c1d0111b47ea2fbd0c29)

Kernel Updates

Ubuntu releases are based on a specific major kernel version. However over time the Ubuntu team releases new major kernel version updates for specific distro versions. An apt-get install linux-image will not change the kernel major version and you have to specifically install a new major version to switch to it.

For example the latest kernel release available for Ubuntu 16.04 (Xenial) LTS at the time of this writing is 4.15 and can be installed with the following:

use apt-get search linux-image to determine what Ubuntu kernel versions are available

Root filesystem Sources

There are several sources of pre-built root filesystems that are compatible with Ventana. As Ventana uses an i.MX6 SoC, you need to use something that is compatible with an ARMv7 instruction set. Many pre-built distributions will reference 'armhf' which means 'ARM hard-float' which is appropriate for the i.MX6 as it has hardware floating-point.

Linaro - Linaro has several root filesystems including server, nano, developer, core, and ALIP. Each root filesystem will have different things installed for different purposes. Choose carefully which will work for you.

Linaro

The ​Linaro Developer Platform Team also creates Ubuntu flavored images.

Linaro is a non profit org that manages engineers who work on improving the state of ARM open source software.

ALIP - a small distribution created using upstream Ubuntu packages containing LXDE (Lubuntu) with lightdm, X11 and chromium as the default graphics applications but still with an emphasis on small size

Ubuntu Desktop - basically a stock Ubuntu Desktop environment with a few extra packages which should bring the same environment you would find with Unity, Firefox, etc.

These rootfs images can be found ​here within directories based on a year and a month. These directories are not to be confused with Ubuntu versions (also based on a year and a month). Note that not all the above rootfs images are available for every monthly build.

Build your own Ubuntu rootfs via debootstrap

The preferred way to create a Ubuntu root filesystem is to use the deboostrap utility on a Debian or Ubuntu host. This tool provides a 2-stage install where the second stage is within a chroot environment using qemu-arm.

Requirements:

Linux Ubuntu or Debian System with network connection and sudo permissions

Linux Kernel (ie Gateworks latest pre-built 3.14 kernel with full hardware support, Ubuntu pre-built kernel (missing full video in/out support but more up-to-date), or a vanilla mainline kernel (still missing full video in/out support but even more up-to-date), or a kernel of your own) - see below steps for more detail

we set and use target and distro env variables in step 2 and use those env variables in the remaining steps to make this tutorial more version-agnostic. Please be aware of this and do not deviate from the steps unless or until you completely understand what you are doing.

Note that this not required if you pass in 'rw' on the kernel cmdline. However while that is the default for the Ventana bootscripts for removeable storage it is not for NAND boot, therefore we will add a default fstab that will re-mount the kernel mounted rootfs as read-write

/dev/root in /etc/fstab will refer to the rootfs mounted by the kernel, thus the above entry simply re-mounts rootfs as read-write

The default Ubuntu kernel supports booting a microSD/SATA rootfs directly, but lacks nand/ubifs/ubi/usb-storage support. If you need that (and have a large enough flash to boot from that) you will need to use the Ubuntu initrd:

the depmod trick above is to run depmod with the exact kernel version (which will be the subdir in /lib/modules). An alternative is to run depmod after the first boot

Build your own kernel and install it as above with proper bootscript - see linux/kernel for more info (you can do this on a development host with a cross-toolchain or even even install development tools via the build-essential meta-package and build and install sources such as the kernel below (adds appx 180MB))

exit the chroot shell and remove files we no longer need

exit
sudo rm $target/usr/bin/qemu-arm-static

You may wish to move this file else place for later use should you wish to chroot again.

install to bootable media:

For a removable block storage device supported by your board such as a USB Mass Storage device, a microSD, an mSATA SSD the example below will create a single ext4 rootfs partition on a removable block storage device. Ensure you set DEVICE properly for your system. We use the 'udisks' application for mount/unmount so that the mount-point is obvious - if you know what your doing you could use standard mount/unmount as well:

trusty (14.04) LTS

Adding GStreamer IPU/VPU/GPU support via gstreamer-imx

You can easily add IMX6 IPU, VPU, and GPU support via GStreamer and Gstreamer-imx plugins. Many of the pieces needed (firmware and source-code) are from Freescale and not freely redistributable thus must be downloaded from their mirror and extracted from a shell script that forces you to read and agree to their End User License Agreement (EULA).

This support requires that you are using the Gateworks downstream vendor kernel as it has the necessary driver support that is not in the mainline Linux kernel. This procedure has not been proven on versions newer than Trusty.

There are several pre-requisites you will need to install and/or build using the instructions below:

imx-vpu-5.4.31.bin - Freescale lib_vpu (EULA required) - this is the low-level documented API that works with the (undocumented) VPU kernel driver API. You can think of this as a kernel driver in userspace

libfslcodec-4.0.3.bin - Freescale Codec Library (EULA required)

imx-gpu-viv-5.0.11.p4.5-hfp.bin - Freescale libg2d (EULA required) - this is the low-level documented API that works with the (undocumented) Vivante Galcore GPU kernel driver API. You can think of this as a kernel driver in userspace

libimxvpuapi - community based open-source high-level library over the low-level imx-vpu API

this is part of the Freescale Vivante GPU driver and apps (imx-gpu-viv) package which provides libgl/libgles1/libgles2/wayland-egl/libgal-x11/egl/libopenvg/libg2d

it comes in soft-float (sfp) and hard-float (hfp) - we want the hard-float as we are using an armhf rootfs

this is not required but needed for the gstreamer-imx g2d transform and sink plugins

build and install libimxvpuapi library:

This library provides a community based open-source API to the Freescale imx-vpu library (the low-level IMX6 VPU interface). It is a replacement for Freescale's closed-development libfslvapwrapper library.

note './waf install' installs artifacts to its prefix + /lib/gstreamer-1.0 but they need to be installed to /usr/lib/arm-linux-gnueabihf/gstreamer-1.0 which is why we created a symlink above before installing

note the uniaudio decoder codecs are from Freescale (found in the fsl-mm-codeclib package) and you do not need these unless you want to use FSL's audio codecs instead of the GStreamer ones

The Freescale IMX6 display drivers use kernel parameters to configure what display outputs to enable and in what format. What displays, resolutions, and formats affect how much contiguous memory is needed (CMA) as well. The Gateworks Yocto BSP has a bootscript that configures connected displays based on various rules and we will use this here. See http://trac.gateworks.com/wiki/Yocto/Video_Out#DisplaysDevices for more info

Now you will be able to use Gstreamer and Gstreamer-imx to tap the full potential of the IMX IPU/VPU/GPU hardware.

A common solution is to install a Desktop Environment such as the ​Lightweight X11 Desktop Environment (LXDE) that is used for Lubuntu. LXDE includes the Xorg X11 server, the lxdm Display Manager, the openbox Window Manager, and a slew of useful user applications including the Chromium browser:

you will need to add a non-root user with adduser for Chromium browser to work. You may choose to set up auto-login for that user by editing /etc/lxdm/default.conf and setting the autologin property in the base section at the beginning of the config file.

you will need to use a kernel with the vivante GPU driver built as a module or the Xorg server will crash

Hardware GPU Acceleration for X11

Note the below information has not been 100% proved out, proceed at your own risk

To add hardware GPU acceleration to X11 you need to add some libraries and drivers provided by Freescale from the imx-gpu-viv package. This requires signing Freescales End User License Agreement (EULA). This package provides the following:

libg2d - a documented low-level API to the GPU (used by things like libimxvpuapi for gstreamer-imx and the gpu-core drivers)