Hitchhikers Guide to the PandaBoard

From Sabayon Wiki
Jump to: navigation, search

Where to start

The first Sabayon ARM port has been worked out on a BeagleBone, and its wiki entry is actually covering all the chroot setup. So, if you're interested in how to bootstrap an ARMv7 system, just have a look at Hitchhikers Guide to the BeagleBone (and ARMv7a). In this section instead, we just cover some useful information that can help you to get Sabayon running on the PandaBoard. At the moment, there are complete Sabayon ARMv7 images for the PandaBoard, compiled with -mfpu-abi=hardfp (so, as long as TI/Immagination doesn't release updated PowerVR libraries that work on hardfp, if you're looking for 3D, you'll be out of luck here).


Booting on the PandaBoard is different from booting from the BeagleBoard. Here we need u-boot.bin and not the mkimage'd u-boot.img. No big deal by the way.

  1. The MLO image (contains the x-loader code that starts u-boot -- like grub stage1 crap).
  2. The boot parameters file (uEnv.txt file)
  3. The u-boot binary file (u-boot.bin)

The kernel (uImage) and initramfs (uInitrd) will be loaded directly from the system partition (the second one), which is just ext3 (ext4 is not yet supported -- it's actually not supported by *all* the u-boot implementations).

MLO (Mmc LOader)

You could compile your own MLO, but why? Usually, PandaBoard people at least, provide their own MLO and there isn’t much need to cook your own off x-loader crap.

So, just grab it from molecules.git repo here and place inside the vfat partition (the boot partition).

If you are interested in building it, have a look at http://gitorious.org/x-load-omap3 . But anyway, the u-boot repo listed in the u-boot.bin chapter contains the buildsystem for MLO (it actually builds the MLO).


In this configuration, we want to load the kernel image (uImage) directly from the root filesystem. This way we can control the kernel version without touching the boot partition any further.

For the PandaBoard, the uEnv.txt file is quite simple and you can find it here.

Just copy it over to the vfat partition (the boot partition).


The same about MLO applies to u-boot.bin, but this is easier to get working. Also, have a look at the patch below if you need initramfs support working out of the box with Sabayon stuff.

If you go ahead reading this, take into account that you need a cross compiler that is able to chew ARM.

In our case, with the PandaBoard, it’s just a matter of using the official u-boot git repo at git://git.denx.de/u-boot.git and at least u-boot 2011.12:

git clone git://git.denx.de/u-boot.git
make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- omap4_panda_config
make -j8 ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- u-boot.bin

This will generate a final u-boot.bin file that you need to copy to the vfat partition (the boot partition).

You may need the following patch in order to boot Sabayon ARM images (expecting /boot/uImage and /boot/uInitrd for kernel and ramdisk files on the rootfs):

diff --git a/include/configs/omap4_common.h b/include/configs/omap4_common.h
index a989721..4583a5a 100644
--- a/include/configs/omap4_common.h
+++ b/include/configs/omap4_common.h
@@ -150,32 +150,51 @@
 	"loadaddr=0x82000000\0" \
+	"rdaddr=0x81000000\0" \
 	"console=ttyO2,115200n8\0" \
 	"usbtty=cdc_acm\0" \
 	"vram=16M\0" \
+	"optargs=\0" \
 	"mmcdev=0\0" \
 	"mmcroot=/dev/mmcblk0p2 rw\0" \
 	"mmcrootfstype=ext3 rootwait\0" \
 	"mmcargs=setenv bootargs console=${console} " \
+		"${optargs} " \
 		"vram=${vram} " \
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
 	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
 		"source ${loadaddr}\0" \
-	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+	"bootenv=uEnv.txt\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
+		"env import -t ${loadaddr} ${filesize}\0" \
+	"loaduimage=ext2load mmc ${mmcdev}:2 ${loadaddr} /boot/uImage\0" \
+	"loaduinitrd=ext2load mmc ${mmcdev}:2 ${rdaddr} /boot/uInitrd\0" \
 	"mmcboot=echo Booting from mmc${mmcdev} ...; " \
 		"run mmcargs; " \
 		"bootm ${loadaddr}\0" \
+	"mmcbootrd=echo Booting from mmc${mmcdev} (+initrd)...; " \
+		"run mmcargs; " \
+		"bootm ${loadaddr} ${rdaddr}\0" \
 	"if mmc rescan ${mmcdev}; then " \
+		"if run loadbootenv; then " \
+			"echo Loaded environment from ${bootenv};" \
+			"run importbootenv;" \
+		"fi;" \
 		"if run loadbootscript; then " \
 			"run bootscript; " \
 		"else " \
 			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"fi; " \
+				"if run loaduinitrd; then " \
+					"run mmcbootrd;" \
+				"else " \
+					"run mmcboot;" \
+				"fi;" \
+			"fi;" \
 		"fi; " \


We offer a "known to be good enough" kernel and its sources via our Portage overlay and Entropy repository. If you're looking for them, just get:

  1. sys-kernel/linux-panda (kernel binary, modules and initramfs)
  2. sys-kernel/panda-sources (source code from where sys-kernel/linux-panda has been compiled from)

Serial console

As explained in the Tips and tricks chapter, the first source of info when something goes wrong at boot is the serial console.

But, in order to make it work and allow login, you need to tweak /etc/inittab.

For the BeagleBone the following line should be edited (changing the current s0:... line):

s0:12345:respawn:/sbin/agetty 115200 ttyO2 vt100

And of course, add ttyO2 to /etc/securetty.

Fstab and other stuff

For the remaining tasks, you can just have a look at the BeagleBone guide mentioned at the beginning of this page.

The Graphics Stack (ouch)

The PandaBoard uses Imagination PowerVR chips. The company, through Texas Instruments, provides GLES libraries and a kernel driver, which is already available inside the kernel for this board (sys-kernel/linux-beagle). Unfortunately, as of today, our systems are compiled with the hardfp stack parameters convention ABI (the new and faster one), while the proprietary libraries are only shipped using the softfp ABI, which ABI is going die soon and even faster once Ubuntu will move over (and forse TI to move).

So, for now, and unless Sabayon is going to provide softfp environments, you can only use the framebuffer driver with no OpenGL acceleration (sorry!). Once you install xorg-server and xf86-video-omapfb you should be up and running, no need to write a xorg.conf file at all.

Currently, you can choose between Fluxbox, XFCE, LXDE and (hopefully soon) GNOME3 (but still in failsafe mode).