Donnerstag, 13. Dezember 2012

openSUSE on CuBox (Day 9)

Kernel woes! After successfully getting an openSUSE 12.2 image done for the CuBox last week (or was it the week before last), Alex Graf and I figured that it was about time that we went about getting graphics working on openSUSE on the CuBox. In order to do so, extensive work needed to be done on the kernel. Instead of reinventing the wheel, we decided that, since the CuBox is in the Contrib: section of openSUSE anyway, we could just compile and use a non-standard (as in not upstream) variant. Not exactly elegant, because it basically means a kind of proprietary kernel fork that somebody needs to look after specifically for CuBox, but better than only rudimentary support for a headless CuBox.

So, on Tuesday Alex Graf and I found a Xilka kernel version 3.4.7 which had the source code and patches readily availabile online. Seeing as openSUSE 12.2 uses a 3.4 kernel (at least the default does), we decided to see if we could apply the patches that the Xilka developers had for the CuBox to the openSUSE kernel. It turns out that they all applied cleanly and the kernel actually compiled without choking.

Once the kernel RPM was compiled, I copied it over to the CuBox and installed it in place of the standard kernel that comes with the image I built last week. The command rpm -U <kernel>.rpm didn't work directly, as the image I built has a 3.6 kernel and this new one is 3.4. rpm -U --oldpackage <kernel>.rpm worked fine though. It spat some warnings, but everything seemed to work.

After rebooting, however, the first thing that happened once the kernel started kicking was a fat kernel backtrace. It looked like there was a problem with SATA. Alex's helpful advice was to go back to the series.conf (where the patches and the order in which they are to be applied is defined) and comment out these ones. After recompiling and reinstalling the rpm, I rebooted. This time it got past the place where it died with a backtrace but just fell into a kernel panic:

VFS: Cannot open root device "disk/by-id/mmc-SU04G_0x609dcec5-part2" or
unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available
partitions:
b300         3872256 mmcblk0  driver: mmcblk
  b301          153604 mmcblk0p1 00000000-0000-0000-0000-000000000000
  b302         3210990 mmcblk0p2 00000000-0000-0000-0000-000000000000
  b303          506045 mmcblk0p3 00000000-0000-0000-0000-000000000000
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(0,0)
 
Again, with Alex's help we traced this to the following missing lines in the config for the CuBox kernel:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
So, I added those lines and rebuilt the kernel yet again. This time, it worked. What this means is that we now  have a CuBox specific kernel on openSUSE so we can start taking advantage of some of the work that others have been doing - like graphics, for example.
I'm working on getting the kernel source tree into the build service now. 
Stay tuned! 
 
 

Keine Kommentare: