Chromebook2

From Qt Wiki
Revision as of 10:28, 22 April 2015 by Agocs (talk | contribs) (Created page with "The ARM-based [http://www.samsung.com/us/computer/chrome-os-devices/XE503C32-K01US Samsung Chromebook2] (both the 11" and 13" variants) can also be used like a development boa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The ARM-based Samsung Chromebook2 (both the 11" and 13" variants) can also be used like a development board - by dual booting Linux from an SD card. The capabilities are similar to the ODROID-XU3: EGL, OpenGL ES, OpenCL with fbdev or X11.

Based on ARM's existing guide, we will go through the additional steps needed to set up WiFi networking, GL, a little development environment, and finally build qtbase from git on the device. For faster build times, cross compilation is recommended, we will take a look at this too.

The usual disclaimer applies: The steps below may void your warranty and data loss may occur. If in doubt, do not proceed.

1. To enable developer mode and create the base system on the memory card, follow ARM's excellent guide. Do not boot just yet.

Before running the script get the fbdev and x11 driver binaries and place them into the same directory.

2. External ethernet adapters are uncool, so we want WiFi. Once the SD card is ready, mount it on the host PC and download the firmware blob and place it to /lib/firmware/mrvl on the memory card. Then we need some tools. Download these from http://ports.ubuntu.com/pool/main and place them to /root on the memory card.

 libiw30_30~pre9-5ubuntu2_armhf.deb
 wireless-tools_30~pre9-5ubuntu2_armhf.deb
 libnl-3-200_3.2.3-2ubuntu2_armhf.deb
 libnl-genl-3-200_3.2.3-2ubuntu2_armhf.deb
 libpcsclite1_1.8.11-3ubuntu1_armhf.deb
 wpasupplicant_0.7.3-6ubuntu2.3_armhf.deb

3. Boot the Chromebook from the memory card (CTRL+U at the boot screen)

4. Login with 'root'. There is no password by default.

5. Do dpkg -i deb_file for the files we downloaded above (in that order).

6. Let's connect to a Wifi network ssid that uses WPA with key key:

 ifconfig mlan0 up
 (iwlist scan to verify it indeed worked)
 wpa_passphrase ssid key > wpa.conf
 wpa_supplicant -Dwext -imlan0 -c/root/wpa.conf -B
 dhclient mlan0

7. If everything went fine, we are connected to the network. Do e.g. apt-get update to verify.

8. Install X11 using the provided script:

 /root$ ./install-x11.sh

9. Now we can start X11 and openbox and get a wonderful xfce-terminal by doing startx. Switching console's is posible with Ctrl+Alt+Fx as usual. It's time to install some additional stuff:

 apt-get install openssh-server firefox emacs24
 apt-get build-deps qt4-x11
 apt-get install '.*xcb.*'

10. Now we can edit, build, ssh into the machine remotely, and have the dependencies needed for Qt 5. Now fix up the graphics drivers: After the above we will have Mesa installed which is not quite what we need. The Mali drivers are located in /root/mali/x11. Go to /usr/lib/arm-linux-gnueabihf and replace the symlinks to point to the Mali X11 drivers:

 rm libEGL.so libGLESv2.so
 ln -s /root/mali/x11/libmali.so libEGL.so
 ln -s /root/mali/x11/libmali.so libGLESv2.so
 ln -s /root/mali/x11/libmali.so libOpenCL.so

If fbdev is wanted later on, the symlinks will have to be changed. Before building Qt, it is also recommended to get fbdev_window.h from somewhere (Google helps, as usual) so that eglfs' Mali backend gets built:

 /usr/include/EGL$ wget https://raw.githubusercontent.com/Pivosgroup/buildroot-linux/master/package/amlogic/opengl/src/include/EGL/fbdev_window.h

11. Now get qtbase (5.5 branch) from Gerrit or code.qt.io:

 git clone git://code.qt.io/qt/qtbase.git -b 5.5

12. Configure and build it. Here we build a release version for development purposes. This takes a lot of time.

 ./configure -release -developer-build -opengl es2 -make libs -opensource -confirm-license
 make -j2

13. Try some GL examples from qtbase/examples/opengl: verify that contextinfo and qopenglwidget work as expected.

Cross-compilation based alternative to steps 11-13:

TODO