Page 1 of 3

custom kernel

Posted: Sat Aug 29, 2009 12:32 am
by gearheadgeek
I am new to Ubuntu, and am struggling with problems I never had with Slackware:

My boss has a Ubuntu 8.04 distribution he uses with VIA boards and now is wants to use the fit-pc2. My job is to make that happen. The problem is, he is booting from usb key and using the squashfs support built into Ubuntu to actually run from RAM. This requires both squashfs and unionfs, which do not come with the patches from here. His distribution doesn't work because it is missing drm_psb, psb, and rt3090. So I grab the kernel sources and diff from here and patch the kernel with the diffs and unionfs and squashfs. I build the kernel using config from /proc/config.gz, but have troubles. I get the ralink driver but of course no psb or drm_psb. I can't use the ones from the fit-pc2 distribution with the new kernel because they are 2.6.24-34-fitpc2 and not 2.6.24. The source from here won't build what is distributed. I added -34-fitpc2 to EXTRA_VERSION in the makefile and fixed that, but still get a "-1 Invalid module format" error if I try to load psb,ko from the distribution with my new kernel from fitpc2 source. And I get the same error if I try to load the new squashfs.ko with the fitpc2 distribution kernel. All have versmagic=2.6.24-34-fitpc2. What am I missing?

Re: custom kernel

Posted: Sat Aug 29, 2009 9:35 am
by prj
Hi, I managed to compile the psb driver for 9.04 a while ago. You should be able to do the same for 8.04. It was a bit of a hassle but when I'm back at the office I can send you the sources and perhaps guide you through the build process.

I didn't manage to get 3D support for 9.04 but that was because I only had the binary blob for 8.04.

What you need to do is compile the LKMs (psb.ko and drm.ko), install the firmware (loaded by psb.ko), build a special version of libdrm, build the Xorg driver and install the 3d binary.

Cheers

Re: custom kernel

Posted: Sat Aug 29, 2009 6:56 pm
by gearheadgeek
Ah - that would be great!

TIA!

Re: custom kernel

Posted: Sat Aug 29, 2009 9:47 pm
by gearheadgeek
Well, I am a little smarter, but rather confused. The generic error message wasn't helpful, but dmesg mumbled something about " ... disagrees about version of symbol ..." which comes from kernel/module.c if (versions.crc == *crc) fails. So the crc is different when I compile the kernel. So I turn module versioning off and compile for the 469th time. Now I get a list of missing symbols:

Code: Select all

drm_psb: Unknown symbol _mutex_lock_interruptible
drm_psb: Unknown symbol _mutex_init
drm_psb: Unknown symbol rt_down_read
drm_psb: Unknown symbol _mutex_lock
drm_psb: Unknown symbol rt_up_write
drm_psb: Unknown symbol rt_write_unlock
drm_psb: Unknown symbol __rt_spin_lock_init
drm_psb: Unknown symbol rt_down_write
drm_psb: Unknown symbol del_timer_sync
drm_psb: Unknown symbol rt_spin_unlock
drm_psb: Unknown symbol rt_spin_lock
drm_psb: Unknown symbol rt_up_read
drm_psb: Unknown symbol __rt_rwlock_init
drm_psb: Unknown symbol _mutex_unlock
drm_psb: Unknown symbol rt_read_unlock
drm_psb: Unknown symbol rt_read_lock_irqsave
drm_psb: Unknown symbol rt_write_lock_irqsave
drm_psb: Unknown symbol _mutex_lock_interruptible
drm_psb: Unknown symbol _mutex_init
drm_psb: Unknown symbol rt_down_read
drm_psb: Unknown symbol _mutex_lock
drm_psb: Unknown symbol rt_up_write
drm_psb: Unknown symbol rt_write_unlock
drm_psb: Unknown symbol __rt_spin_lock_init
drm_psb: Unknown symbol rt_down_write
drm_psb: Unknown symbol del_timer_sync
drm_psb: Unknown symbol rt_spin_unlock
drm_psb: Unknown symbol rt_spin_lock
drm_psb: Unknown symbol rt_up_read
drm_psb: Unknown symbol __rt_rwlock_init
drm_psb: Unknown symbol _mutex_unlock
drm_psb: Unknown symbol rt_read_unlock
drm_psb: Unknown symbol rt_read_lock_irqsave
drm_psb: Unknown symbol rt_write_lock_irqsave
Now, this is seriously fishy. These symbols are not found in any code in the kernel tree. There is a __mutex_init in mutex.c, but no _mutex_init to be found. It would appear that fit-pc2 is not actually distributing source to their distribution kernel.

It almost looks like they are using rtlinux or rtai (xenomai)???? I had to do that to get any kind of reliable serial (RS-232 or RS-422) communication with linux, but why would you need that for video?

Re: custom kernel

Posted: Sat Aug 29, 2009 11:55 pm
by gearheadgeek
And the inverse, trying to load my unionfs and squashfs into the fit-pc2 distributed kernel, also has missing symbols, but ones that are in the kernel source tree:

Code: Select all

unionfs: Unknown symbol __init_rwsem
unionfs: Unknown symbol down_write
unionfs: Unknown symbol up_write
unionfs: Unknown symbol mutex_lock
unionfs: Unknown symbol __mutex_init
unionfs: Unknown symbol release_open_intent
unionfs: Unknown symbol kmap_atomic
unionfs: Unknown symbol kunmap_atomic
unionfs: Unknown symbol down_read
unionfs: Unknown symbol mutex_unlock
unionfs: Unknown symbol up_read
squashfs: Unknown symbol mutex_lock
squashfs: Unknown symbol __mutex_init
squashfs: Unknown symbol kmap_atomic
squashfs: Unknown symbol kunmap_atomic
squashfs: Unknown symbol mutex_unlock
Now it is __mutex_init that is undefined and up_read/down_read look like what got changed to rt_up_read/rt_down_read. The weirdness continues.....

Re: custom kernel

Posted: Sun Aug 30, 2009 10:05 am
by prj
Obviously the symbols mismatch, so the kernel source you're using to compile the binaries doesn't match the kernel you're running. My guess is that the FITPC2 kernel sources doesn't match the compiled kernel they are shipping.

My suggestion is that you stick with a vanilla kernel and try to compile the drivers on top of that. The only binary you cannot recompile is the 3D support for the PSB driver. From what I've seen the 3D binary only depends on the Xorg version so you shouldn't have a problem with this.

The sources seems to be available here:

* Firmware
http://ppa.launchpad.net/ubuntu-mobile/ ... rig.tar.gz

* Kernel modules
http://ppa.launchpad.net/ubuntu-mobile/ ... rig.tar.gz

* PSB 3D Binary
http://ppa.launchpad.net/ubuntu-mobile/ ... rig.tar.gz

* PSB Xorg driver
http://ppa.launchpad.net/ubuntu-mobile/ ... rig.tar.gz

* Poulsbo libdrm
http://ppa.launchpad.net/ubuntu-mobile/ ... rig.tar.gz

This is the order for install (I'm kinda guessing here since I don't really remember):
1. Kernel modules drm.ko, psb.ko (Read the makefile for instructions)
2. Poulsbo libdrm (should work if you install with prefix=/usr/local/)
3. PSB Xorg driver (Don't really remember this step, but I had to move files around a bit for the driver to find all the necessary parts)
4. Put firmware in /lib/firmware
5. Put 3D binary along with the other xorg drivers (/usr/lib/xorg/modules/drivers)

That's a good start. Let me know on the progress.

Cheers

Re: custom kernel

Posted: Sun Aug 30, 2009 12:29 pm
by Denis
Hi guys,
I am a little confused by your talk.

First - there are clean instructions how to install Ubuntu 8.04 and 9.04 on our wiki http://www.fit-pc2.com/wiki/index.php?t ... on_fit-PC2. Installation on plugged disk-on-key should not be a problem.

Second - all sources and binaries used in fit-PC2 compatible to each other and available at http://fit-pc2.com/download/ubuntu/dists, we created this repository to avoid users find and install software from different sources. Drm and psb modules merged directly in kernel sources, other X files available as packages.

Why do you need to recompile kernels? Please correct me if I do not understand something.

Re: custom kernel

Posted: Sun Aug 30, 2009 3:28 pm
by prj
Yes, ignore my previous post :) I'm not up to date with how everything is distributed. Seems like the links in Denis post contains everything you need.

Re: custom kernel

Posted: Sun Aug 30, 2009 6:35 pm
by gearheadgeek
Denis wrote:Hi guys,
I am a little confused by your talk.

Why do you need to recompile kernels? Please correct me if I do not understand something.
You didn't read my first post. I need squashfs and unionfs, which you don't use or distribute.

I can't use the existing kernel from our product because it does not have drm_psb or psb.

I can't simply add squashfs and unionfs to the kernel source and diffs that you distribute and compile because there is no drm_psb or psb source.

I can't simply use your drm_psb anb psb modules with a kernel I compile from your source and diffs because they are incompatible. That is, the source and diffs from your web site do not compile to the binaries you distribute and so pieces that you distribute are not compatible with a kernel compiled from them. I listed above the missing symbols reported by an attempt to load one of your distributed modules into a kernel compiled from your kernel source and diffs. They are not compatible.

I can't compile squashfs and unionfs and add them to your kernel and modules, again because they are incompatible.
Second - all sources and binaries used in fit-PC2 compatible to each other and available at http://fit-pc2.com/download/ubuntu/dists, we created this repository to avoid users find and install software from different sources. Drm and psb modules merged directly in kernel sources, other X files available as packages.
I took the kernel source and diffs from there for my compile. There is definately not drm_psg or psb source there.

Carl

Re: custom kernel

Posted: Sun Aug 30, 2009 6:58 pm
by gearheadgeek
Geez! "You cannot make another post so soon after your last."
Isn't that special....
prj wrote: My guess is that the FITPC2 kernel sources doesn't match the compiled kernel they are shipping.
Bingo!
My suggestion is that you stick with a vanilla kernel and try to compile the drivers on top of that. The only binary you cannot recompile is the 3D support for the PSB driver. From what I've seen the 3D binary only depends on the Xorg version so you shouldn't have a problem with this.
Thanks a bunch. If Denis can't help, this will be the only possible route. But the distribution kernel is by (denis@sotona) so he is likely the one to help.

Carl