Sunday 25 September 2016

Chromium OS for Intel Compute Sticks


Google's Chromium projects include Chromium and Chromium OS which are the open-source projects behind the Google Chrome browser and Google Chrome OS.  Chromium OS aims to provide a fast, simple and more secure computing experience for 'web-centric' orientated users.

I've previously tried Chromium OS on earlier Intel Compute Sticks as Google provides both the source-code and documentation to build and install Chromium OS on your own device. However I thought I'd revisit the project and incorporate the latest patches and fixes together with the most recent kernel.

The build results in an image that can be written to a USB and then booted on any of Intel's Compute Sticks giving you a pseudo Chromiumbit:

STCK1A8LFC
STCK1A32WFC
STK1AW32SC
STK2m3W64CC
Performance is dependent on your USB and with a Sandisk Ultra Fit USB3.0 for example it is pretty good:

STCK1A8LFC
STCK1A32WFC
STK1AW32SC
STK2m3W64CC
and runs YouTube at 1080p even on the basic model STCK1A8LFC:

STCK1A8LFC
Furthermore Crouton can be installed to provide a full Ubuntu OS:

STCK1A8LFC
STCK1A32WFC
STK1AW32SC
STK2m3W64CC
Interestingly whilst wifi works on each device audio is only available on the Core m devices even though the Intel HDMI driver is loaded:

STCK1A8LFC and STCK1A32WFC
STK1AW32SC
STK2m3W64CC
So it is back to using a USB audio adapter if sound is a mandatory requirement. If anyone can work out how to configure Chromium to use the Intel HDMI driver please comment below.

To try my latest Intel Compute Stick Chromium OS image you will first need to download it from here and after uncompressing it ('7z x linuxium-ics-chromiumos_image.bin.7z') write it to a USB ('dd if=linuxium-ics-chromiumos_image.bin of=/dev/sdX bs=4M' where 'X' is the appropriate drive letter).

Installation to your device's eMMC storage is also possible noting that it will overwrite the entire internal storage and a resize of the first partition is necessary to fully utilize all available storage space. See the following picture for all the necessary commands:


Acknowledgements: Google (Chromium), Pierre-Louis Bossart (HDMI audio), Daniel Bilik (C-state) and Bastien Nocera (WiFi).

Thursday 15 September 2016

Yocto for Intel Compute Sticks



Most 'end-users' of 'consumer' products like the Intel Compute Stick who want to either use or at least try a Linux OS will often pick Ubuntu. However given the limited hardware configurations of affordable mini PCs, performance may not be optimal with resource hungry distributions. In the world of embedded systems rather than use a 'proprietary' Linux distribution typically the operating systems are developed from Linux build systems like Yocto, OpenEmbedded, Buildroot and OpenWrt etc.

Unfortunately trying a Yocto Linux build on an Intel Compute Stick is not necessarily that straight forward. It is probably too daunting for most owners to build an initial image just to see what Yocto is all about and most images available for download don't include key drivers or simple installation instructions.

So I've created a Yocto ISO with documentation specifically for Intel Compute Sticks to provide a very basic Linux operating system with wifi and audio support together with the capability to install some additional packages including the Chromium browser.

The ISO can be used either as a LiveUSB or to install Yocto. As the standard installation is to overwrite the entire storage device (i.e. no support for dual booting) I also provide a script to install to pre-existing partitions. The rationale being that you can temporarily replace a current Linux installation (for example Ubuntu) with Yocto and then replace it with the previous Linux installation without affecting any other installed operating systems like Windows etc. As booting the ISO directly on Baytrail models is extremely slow (once booted it works fine) I also provided a script to directly install to the device rather than try to use the LiveUSB approach. Finally I provide some templates to build a repository to allow updates (package installation) from another PC acting as a web server. I also provide the packages which can be installed from the web server or directly if preferred.

Let's get started.

First download my Yocto ISO 'core-image-sato-ics.iso'.

To use as a LiveUSB write the ISO to a USB using the 'dd' command. You can also use the LiveUSB to install from the GRUB boot menu or you can install using one of my installation scripts. For the later option download either 'make-install-mmcblk0.sh' or 'make-install-partition.sh' and copy this to a USB along with the Yocto ISO 'core-image-sato-ics.iso'. On a different USB download and write one of my latest Ubuntu ISOs for the Intel Compute Stick using the 'dd' command and boot your Intel Compute Stick using the Ubuntu LiveUSB. Once booted insert the other USB with the Yocto ISO and install script and change directory to where these files are. If you are installing to existing partitions use the 'lsblk' command or similar to confirm which partitions should be used in the installation. Alternatively you can make new partitions specifically for the Yocto installation. The script assumes that three partitions are available: one each for boot, the root file system and swap. Edit the script to ensure the correct partitions will be used (or modify the script as required). Then run the installation script as root/sudo and reboot your Intel Compute Stick to run Yocto.

Next create a web server on another Linux PC. It is really simple and easy to do. Chose a name for your Yocto repository web server (e.g. 'archive.linuxium.com.au'). Download my documentation/script to create the web server 'make-repository-server.sh' and replace all the occurances of the string '<repo.website.name>' with the name you chose. Now download the compressed Yocto repository 'yocto.7z'. If you are happy to 'rcp' this file to your Yocto repository web server you need to edit 'make-repository-server.sh' and update '<user@ip-address>' as appropriate or you can just delete these lines if you want to manually copy the file over after the next step. Now you can either manually run the commands in the file 'make-repository-server.sh' or run the file as a script and in both cases do so as root/sudo.


The next step is to set up wifi on Yocto. This is probably the hardest step as it involves configuring wifi from the command line and it will depend on your individual environment. If initially you don't feel confident enough to attempt this or in the worst case can't get it working then using a USB ethernet dongle is a quick and simple work around. Whilst there is a lot of information on the web on configuring wifi to help I've included some example files and a script to show how to set up a WPA2 wifi connection with a static address on a hidden network because this is probably the hardest to configure. Download onto a USB the following '_etc_network_interfaces'; '_etc_wpa_supplicant.conf' and 'start_wifi.sh' files. Edit  '_etc_network_interfaces' and for a static address update the IP address details or for a dynamic address change 'static' to 'dhcp' and delete the remaining lines. Copy the file to '/etc/network/interfaces' as root/sudo on your Intel Compute Stick running Yocto. Next run the command 'wpa_passphrase' to get your wifi network pre-shared key (psk). Update the file '_etc_wpa_supplicant.conf' with your wifi name and your psk and change the rest of the parameters according to your wifi network requirements (hint: google 'set up wpa_supplicant' with 'wep' or 'wpa' if you get stuck). Once finished copy the file to '/etc/wpa_supplicant.conf' as root/sudo. Finally run the script 'start_wifi.sh' on your Intel Compute Stick running Yocto. Hopefully this will start your wifi connection.

Once wifi is working (or ethernet if you cheated!) you can now set up access to your Yocto repository web server. As root/sudo edit the file '/etc/hosts' and add a line at the top with the IP address of your Yocto repository web server and its name (e.g. 'archive.linuxium.com.au') similar to how 'localhost' is defined. Now download the  file '_etc_apt_sources.list' and replace all the occurances of the string '<repo.website.name>' with the name of your Yocto repository web server. Then copy the file to '/etc/apt/sources.list' as root/sudo.


Having set up wifi (or ethernet) and your Yocto repository web server you can now update your packages and install new ones. I've built Yocto to use the Debian package manager so it is familiar for existing Ubuntu users. First update your sources as root/sudo with the usual 'apt-get update'. If you want to install Chromium simply enter 'apt-get install chromium'. You can also use 'apt-cache search' to see what other packages are available.

The performance of Chromium is very good on the basic 'Ubuntu' Intel Compute Stick (STCK1A8LFC) and allows you to watch 1080p YouTube.


Hopefully my ISO appeals as a primer for Yocto and similar building tools and encourages some to experiment further.

Acknowledgements: Yocto Project, OpenEmbedded, Emutex, O.S. Systems, Pierre-Louis Bossart and Bastien Nocera.