There are no compilers installed on the system yet, so let’s do something about it, right? I mean, what is a Linux machine without compilers?

[andre@rpi-server ~]$ yaourt -S base-devel

I once wrote about dropbox, and tried to get it working on my BeagleBoard. Now, dropbox is proprietary software. I hate proprietary software you know. Actually, why would I trust some binary blob running on my system. It might be doing god knows what. Not showing your source? What are you trying to hide? Anyhow, the problem is the fact dropbox is only available as binaries, compiled for either x86 or x86_64, and we are on a armv6h system. So, we got to emulate x86 (or x86_64). For this purpose I suggest qemu, which is able to run linux elf binaries compiled for other systems, provided the required libraries are available.

My last attempt on my BeagleBoard wasn’t really successful, but that might be due the fact I didn’t have a full base system for the emulated architecture. With the new ArchLinux installation method, basically creating a base system using the pacstrap program, I should be able to setup a working system.

Now, the next problem is, qemu is not in the ArchLinuxARM repository

[andre@rpi-server ~]$ yaourt -Ss qemu
extra/vde2 2.3.2-2
Virtual Distributed Ethernet for emulators like qemu
community/libvirt 1.0.0-3
API for controlling virtualization engines
(openvz,kvm,qemu,virtualbox,xen,etc)
The URL http://aur.archlinux.org/rpc.php?type=search&arg=qemu returned error : 301

Looking at the last line, it appears the request to search the AUR is failing. However, 301 is not an http error code, but a redirect. The aur repository should be accessed through https and not http. We can fix this by setting AURURL="https://aur.archlinux.org" in /etc/yaourtrc

[andre@rpi-server ~]$ yaourt -Ss qemu
extra/vde2 2.3.2-2
Virtual Distributed Ethernet for emulators like qemu
community/libvirt 1.0.0-3
API for controlling virtualization engines
(openvz,kvm,qemu,virtualbox,xen,etc)
aur/aqemu 0.8.2-2 (0)
QEMU GUI written in Qt4

Now, we got results from AUR as well… but still no qemu. Last time I just grabbed the source from the qemu site and compiled that, but this time, I am going to build a package and install it through pacman.

Well, if there is no binary package, perhaps we can go through ABS (Arch Build System) and build the package ourself. So let’s look up how it works, shall we?

[andre@rpi-server ~]$ man yaourt
man: can’t set the locale; make sure $LC_* and $LANG are correct

Hmmm? what’s that? can’t set the locale?

[andre@rpi-server ~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=”en_US.UTF-8″
LC_NUMERIC=”en_US.UTF-8″
LC_TIME=”en_US.UTF-8″
LC_COLLATE=C
LC_MONETARY=”en_US.UTF-8″
LC_MESSAGES=”en_US.UTF-8″
LC_PAPER=”en_US.UTF-8″
LC_NAME=”en_US.UTF-8″
LC_ADDRESS=”en_US.UTF-8″
LC_TELEPHONE=”en_US.UTF-8″
LC_MEASUREMENT=”en_US.UTF-8″
LC_IDENTIFICATION=”en_US.UTF-8″
LC_ALL=

No such file or directory? We’re missing something here! It seems, in the rootfs image for Raspberry Pi, the locate isn’t set up
correctly. In /etc/locate.conf the language was set to LANG=en_US.UTF-8, however, it was never generated, since /etc/locale.gen isn’t configured, all
possible langauges were still commened out. Removing the comments for en_US.UTF-8 UTF-8 and nl_NL.UTF-8 UTF-8 and running locale-gen

[root@rpi-server andre]# locale-gen
Generating locales…
en_US.UTF-8… done
nl_NL.UTF-8… done
Generation complete.

Problem solved! Right, were where we, yes, compiling from ABS. Seems adding a

[andre@rpi-server ~]$ yaourt -Sb qemu

Gives me a not found too, so using ABS directly isn’t going to work either. So, what we’re going to do is get the PKGBUILD from the regular ArchLinux repository and build that.

[andre@rpi-server ~]$ wget http://mirrors3.kernel.org/archlinux/sources/packages/qemu-1.2.0-1.src.tar.gz

[andre@rpi-server ~]$ tar -xvf ./qemu-1.2.0-1.src.tar.gz

Edit the BUILDPKG file and add armv6h to the arch= array, (alternatively call makepkg with the -A option to ignore the architecture) and start buildpkg

[andre@rpi-server qemu]$ makepkg
==> Making package: qemu 1.2.0-1 (Tue Nov 20 21:01:34 GMT 2012)
==> Checking runtime dependencies…
==> Missing Dependencies:
-> sdl
-> alsa-lib
-> nss
-> bluez
-> vde2
-> libpulse
-> seabios
-> libcap-ng
==> Checking buildtime dependencies…
==> Missing Dependencies:
-> texi2html
==> ERROR: Could not resolve all dependencies.

Okay, missing some dependencies. If we were running through yaourt, it would install the missing dependencies for me. But let’s just install what it tells me to install.

[andre@rpi-server qemu]$ yaourt -S texi2html sdl alsa-lib nss bluez vde2 libpulse seabios libcap-ng

error: target not found: seabios

We discover seabios is not in the ArchLinuxARM repository either. However this is a noarch package, so we can just take it from the regular ArchLinux repository.

[andre@rpi-server qemu]$ yaourt -U http://mirrors3.kernel.org/archlinux/extra/os/x86_64/seabios-1.7.0-1-any.pkg.tar.xz

Now, we’re ready to build. Since this may take a while… let’s run it in a screen. Since this was a new installation, screen was not yet installed

[andre@rpi-server qemu]$ yaourt -S screen

and here we go!

[andre@rpi-server qemu]$ makepkg
==> Making package: qemu 1.2.0-1 (Tue Nov 20 21:35:20 GMT 2012)
==> Checking runtime dependencies…
==> Checking buildtime dependencies…
==> Retrieving Sources…
-> Found qemu-1.2.0.tar.bz2
-> Found 65-kvm.rules
==> Validating source files with md5sums…
qemu-1.2.0.tar.bz2 … Passed
65-kvm.rules … Passed
==> Extracting Sources…
-> Extracting qemu-1.2.0.tar.bz2 with bsdtar
==> Removing existing pkg/ directory…
==> Starting build()…

Since this is going to take for a while, just detach the screen, and tomorrow we’ll see if it worked

Something I might want to look into is cross-compiling, and not just compiling, but also to build the package. makepkg doesn’t appear to have an option for target architecture. Well, only in it’s configuration file, but as it doesn’t appear to have support for cross compiling by itself, I doubt if it will work if I just change the main config file.

I have been searching the ArchLinux wiki for cross compiling packages, without any luck yet. Perhaps I will find something on the ArchLinuxARM wiki, but not today. PS. I might consider setting up a repo for hosting qemu packages, but I need to collect more info what’s involved in doing so.

« »