Saturday, July 6, 2013

Weston-rpi Raspberry Pi ArchLinux

Dado que es probable que tenga que repetir este proceso alguna vez, y que no soy usuario de Arch, escribí y compartí los pasos necesarios por si alguien se encuentra en la misma situación.

Since it's probable and will have to repeat the same process again sometime, and the fact that i'm not an Arch user, i did write down and share the steps in case anyone else could be in the same situation.





1 - Desde el principio / From the top


Esta parte es un poco obvia y si tu sistema arch ya está funcionando, actualizado y listo, te la puedes saltar.
This section is a little trivial, you can skip it if your Arch system is up, updated, and ready.

Obteniendo La imagen de ArchLinux para el Raspberry-Pi:
Obtaining the Raspberry-Pi ArchLinux Image:


Puedes descargar la última imagen para el raspberry desde el sitio de Archlinux para ARM.
You can download the latest raspberry-pi ready image from the Archlinux for ARM site.


Los pasos a seguir para escribir la imagen en tu SD están descritos ahí mismo.
The steps to write the image in your SD card are described there.

Una vez corriendo el sistema nos logueamos y procederemos a crear un usuario normal.
Once the system boots up, we log in and procede to create a normal user.

User: root
Password: root

~# adduser pi
~# passwd pi
Enter UNIX password: raspberry
....

Otra cosa importante es tener el sistema actualizado, para esto hacemos:
Another important thing is to keep your system up to date, we need to type:

~# pacman -Syu

Instando dependencias y otros.
Setting up dependencies and stuff.


Primero debemos instalar las herramientas de desarrollo basicas:
First we must install the minimal development tools:

~# pacman -S base-devel

...ahora podemos empezar.
...now we are ready to start.



2 - Compilando el paquete weston-rpi desde el código fuente.
Building the weston-rpi package from source.


Este código esta alojado en la sección AUR de ArchLinux, y posee las modificaciones necesarias para usar el backend de video que nos provee el raspberry (VideoCore) en vez de usar DRM u otro de los existentes.

This code is hosted in the AUR secction of the ArchLinux repos. It has been modified to add the needed parts to make weston fallback to the Raspberry's video Backend instead of the others default <?> backends like DRM.


Descargando el código fuente.
Downloading the source code.


Como dije, el código esta en los repositorios AUR, si vemos el recuadro del lado izquierdo "Package actions" tenemos el link para el archivo PKGBUILD y el Codigo Fuente, descargaremos ambos.

As i said, the code is hosted on the AUR repos, if we look at the box in the left side titled "Package actions", it provides the link for the PKGBUILD file and the Source code, we'll download both.

https://aur.archlinux.org/packages/weston-rbp/

Los siguientes pasos los realizé como usuario normal (no root).
i did the next steps as a normal user (no root).

~$ mkdir weston
~$ cd weston

~$ wget https://aur.archlinux.org/packages/we/weston-rbp/PKGBUILD
~$ wget https://aur.archlinux.org/packages/we/weston-rbp/weston-rbp.tar.gz


Archivos .pc / .pc Files


Hay librerias del raspberry que no tienen los archivos pkg-config apropiados, asi que los descargaremos también, hay que asegurarse de desacargarlos en sus versiones para el raspberry.

There are some raspberry libs without the appropiate pkg-config files, so we'll download them too. just make shure you are downloading the raspberry version of them.

http://cgit.collabora.com/git/user/pq/android-pc-files.git/tree/pkgconfig?h=raspberrypi

Estos 3 archivos los descargué dentro del directorio ~/weston que creamos en el paso anterior, junto con todo lo demás.
I put these 3 files in the ~/weston directory wich we created in the previous step, just like the other files.


Compilando / Building

En nuestro directorio ~/weston llamamos al comando makepkg
In our ~/weston directory we call makepkg

~$ makepkg -s

(... a lot of text from ./configure and make / un montón de mensajes del ./configure y make)

==> Entering fakeroot environment...
==> Starting package()...

(... a lot of make messages / mucho texto de la salida de make)

==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "weston-rbp"...
  -> Generating .PKGINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: weston-rbp 1.1.1-1 (Sat Jul  6 07:42:53 BST 2013)

Si todo salió bien, nuestro paquete estará en el directorio, y listo para ser instalado con pacman, mas información sobre makepkg aquí.
If everything were fine, our package should be on the directory and ready to be installed with pacman. more infor about makepkg here.

https://wiki.archlinux.org/index.php/Creating_Packages



3 - Instalando weston / Installing weston

Como todo resultó bien tenemos un paquete en nuestro directorio, el mio es  "weston-rbp-1.1.1-1-armv6h.pkg.tar.xz". lo instalaremos con pacman. ahora si debemos logearnos como root.

As everything went fine, we got an installable package in our directory, mine says  "weston-rbp-1.1.1-1-armv6h.pkg.tar.xz". we will install this with pacman. now we need to be root.

~$ su
*******
~# pacman -U  weston-rbp-1.1.1-1-armv6h.pkg.tar.xz

loading packages...
resolving dependencies...
looking for inter-conflicts...


Packages (1): weston-rbp-1.1.1-1

Total Installed Size:   1.41 MiB
:: Proceed with installation? [Y/n] (we accept / aceptamos)

(... we see some progress bars here / vemos unas barras de progreso aquí)

(1/1) installing weston-rbp
~#

Ahora si corremos weston deberíamos ver como este elije en backend de video Raspberry Pi.
Now if we run weston, we should see a message saying it choose the Raspberry Pi video backend.

~$ weston
(...)
[08:16:37.156] Loading module '/usr/lib/weston/rpi-backend.so'
[08:16:37.165] initializing Raspberry Pi backend
(...)

Y obviamente esteo debería iniciar weston, lo probaré mañana ya que ahora lo estoy corriendo desde ssh.
And this obviously should start weston, i will check tomorrow since i'm conected from ssh now.


No comments :

Post a Comment