Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77386 - mol kernel module fails to load under gentoo-dev-sources-2.6.10
Summary: mol kernel module fails to load under gentoo-dev-sources-2.6.10
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: PPC Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-10 08:24 UTC by Santiago Gala
Modified: 2005-01-18 04:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
add #include <io.h> if kernel >= 2.6.10 (mol-0.9.70-2.6.10-io.h.patch,327 bytes, patch)
2005-01-16 13:50 UTC, Chris Abbey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Santiago Gala 2005-01-10 08:24:44 UTC
A small patch can solve it: http://mibus.cgcommunity.com/index.php?id=403

MOL - MacOnLinux - under Linux Kernel 2.6.10 no longer runs without change.

This is because the kernel module relies on the functions virt_to_phys() and phys_to_virt() which have both been removed from the kernel.

To fix it, you have to redefine the functions as macros. In src/kmod/Linux/alloc.h,

After the line:

#define _H_ALLOC

Add:

#define virt_to_phys(A) __pa(A)
#define phys_to_virt(A) __va(A)



Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-01-12 12:47:40 UTC
I think we should fix MOL, not the kernel. Could you provide a patch for MOL?
Comment 2 Santiago Gala 2005-01-12 13:06:34 UTC
Not really, I just applied what I found. I'm not a C programmer. A contitional define would work, except that virt_to_phys and phys_to_virt are functions and not macros, and I'm not sure a #ifndef virt_to_phys would catch it. a global search and replace in the module would work, provided that __pv and __vp are defined in any reasonable kernel release supported.

I'd leave the work to the upstream people (mol developer), and keep the kludge for now.
Comment 3 Chris Abbey 2005-01-16 13:50:02 UTC
Created attachment 48686 [details, diff]
add #include <io.h> if kernel >= 2.6.10

Pretty simple fix to MOL, much better than the kernel hack suggested above.
Comment 4 Lars Weiler (RETIRED) gentoo-dev 2005-01-16 17:23:15 UTC
That fix does not work for me.  It fails with:

+ Entering Linux
/var/tmp/portage/mol-0.9.70-r1/work/mol-0.9.70/src/kmod/Linux/../build/tmp-offsets.c:0: fatal error: can't open tmp-offsets.s for writing: Permission denied
compilation terminated.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[5]: *** [/var/tmp/portage/mol-0.9.70-r1/work/mol-0.9.70/src/kmod/Linux/../build/asm_offsets.h] Error 1
make[4]: *** [_module_/var/tmp/portage/mol-0.9.70-r1/work/mol-0.9.70/src/kmod/Linux/../build] Error 2
nm: '../build/mol.ko': No such file
nm: '../build/mol.ko': No such file
checker.pl failed
rm: cannot remove `../build/mol.ko': No such file or directory
make[3]: *** [all-local] Error 1                                                                                               make[2]: *** [sub-Linux-all] Error 2
make[1]: *** [sub-kmod-all] Error 2
make: *** [sub-src-all] Error 2

Either with our mol-0.9.70 tarball nor with a 0.9.71-rsync-snapshot.  And on both of my ppc machines.
Comment 5 Santiago Gala 2005-01-17 11:18:38 UTC
The attachment is working for me, it looks much cleaner as a patch.

On a separate note, sheep is not working due to kernel source reorg. I'm not using it, though
Comment 6 Chris Abbey 2005-01-17 12:43:46 UTC
Could that be bug 68224 that you ran into?
Comment 7 Lars Weiler (RETIRED) gentoo-dev 2005-01-17 14:35:06 UTC
Well, I should read my own error messages about userpriv and usersandbox...

Yep. It compiles and I'll attach the patch instantly to the MOL ebuild.  Furthermore I'll add a new rsync-MOL-snapshot (0.9.71_rc1).
Comment 8 Lars Weiler (RETIRED) gentoo-dev 2005-01-18 04:05:08 UTC
There was also another compilation error, when you have LDFLAGS set (as I have on one of my machines).

A patched version is in portage (though I didn't bumped the revision), which fixes the 2.6.10-problem and strips LDFLAGS.