mercredi, mars 06, 2013

Xorg for FreeBSD on Raspberry Pi

Thanks to Ray, we have a working X11 drivers that works on Raspberry pi too.
Here is how to install it:
Download the latest Daisuke's Raspberry pi FreeBSD image (login/password: pi/ raspberry and root password: raspberry).
Unzip, dd it on your 8GB SD card, boot your rspie and configure your network (Internet access mandatory for downloading pkg).
Install USB mouse drivers:
cd /usr/src/sys/modules/usb/ums
make clean all install

Install pkg and declare the repository:
tar xf ./pkg.txz -s ",/.*/,,g" "*/pkg-static"
./pkg-static add ./pkg.txz

echo 'packagesite:${ABI}' > /usr/local/etc/pkg.conf
Install Xorg, scfb drivers and some X apps:
pkg inst xorg-minimal xf86-video-scfb xorg-apps 
Configure /etc/X11/xorg.conf:
Section "Files"
Section "Module"
    Load        "dbe"
    Disable    "dri"
    Disable    "dri2"
    Disable    "glx"
    SubSection  "extmod"
       Option  "omit xfree86-dga"

Section "ServerFlags"
    Option    "AIGLX"        "false"
    Option    "NoAccel"    "True"
    Option    "NoDRI"        "True"
    Option    "DRI"        "False"
    Option    "DRI2"        "False"

Section "InputDevice"
    Identifier  "Keyboard1"
    Driver      "kbd"

Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "mouse"
    Option      "Protocol"      "auto"
    Option      "Device"        "/dev/sysmouse"

Section "Monitor"
    Identifier  "Monitor"

Section "Device"
    Identifier  "Generic FB"
    Driver      "scfb"
    Option    "NoAccel"    "True"

Section "Screen"
    Identifier  "Screen"
    Device      "Generic FB"
    Monitor     "Monitor"
    DefaultDepth 16
    SubSection "Display"
       Depth           16

Section "ServerLayout"
    Identifier  "layout"
    Screen      0 "Screen" 0 0
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
Then a dummy ~/.xinitrc:
xterm &
xclock &
xcalc &
exec twm

And enjoy:

A first ugly screenshoot:

5 commentaires:

PaulFXH a dit…

Hi Olivier
Thanks for posting this.
I'm very interested to get a Desktop in FreeBSD on my Pi and I've tried quite a few options so far without success.
That's great that it seems to be working for you.
However, your procedure didn't work for me as when I try the 'pkg install' command, it first tries to update repo.txz.
However, this always seg faults.
Similarly, the command 'pkg update' always seg faults for me.
This post describes a similar problem and shows a solution in the link at the bottom.
However, I can't figure out how to get this to resolve my problem.

Any ideas how I can avoid the seg fault?

Olivier Cochard-Labbé a dit…

Hi PaulFXH,
are you using the Daisuke image: freebsd-pi-clang-20130302.img.gz ?

PaulFXH a dit…

Hi Olivier
Thank you for your reply.
Yes, I'm using that very image.
However, I've solved the problem by simply upgrading pkg from 1.0.9 to 1.0.9_2 using ports (I already had installed the ports).
It seems from this post that the segfaulting is only a problem in pkg-1.0.9 and not in later updates.
So, I've installed everything according to your post and it WORKS!!!
Next I want to install a DE.
Have you tried that?
I'm going to use LXDE.

Werner a dit…

One question I have: Judging from the entries in xorg.conf, does that mean there is no 2D or 3D acceleration for X in FreeBSD for Raspberyy devices?

Olivier Cochard-Labbé a dit…

I hope than since 2013 (article's year) the graphical support was improved since. Like this post: