On Wed, 12 Nov 2003, Bruce Richardson wrote:

> 1.  Is the stock kernel for 5.6 E-smith compiled for i386 or a later
> architecture?

An appropriate kernel is installed depending on the hardware discovered at 
install time. You can learn which by running:

rpm -q --qf="%{ARCH}\n" kernel

> 2.  I'm going to compile the powerswitch module for E-smith.  Is it
> enough for me to
> 
>       * Install the kernel source and other devtools
>       * Copy /boot/config-2.4.18-5 to /usr/src/linux/.config
>       * run 'make menuconfig' and fill in the missing "Processor type
>         and features" settings.
>       * 'make dep'
>       * Finally, compile the module
> 
> Will this work?

Yes and no. You might be very lucky and end up with a module which works 
with your kernel but you are more likely to have done a lot of work to end 
up with a module which doesn't load.

The easiest way to end up with a module which will load and work is just
to run "make" in the powerswitch directory after you untar the source.  
RedHat have tweaked the kernel source so that you get compile options set
to build modules which exactly match your running kernel (google for
MODVERSIONS to find out exactly how this works). That'll work for you in
this case, but makes it much harder to build modules to match kernels or
architectures other than the build machine and its running kernel.

To build for other architectures you need to subvert the RedHat "do what I 
think you mean" fixes, e.g:

KVERSION=2.4.20
KRELEASE=18.7
SMP=0 # or 1
CPU=i686 # or i586, i386, athlon
gcc -DMODULE -D__KERNEL__ \
     -D__BOOT_KERNEL_H_ \
     -D__MODULE_KERNEL_$CPU \
     -D__BOOT_KERNEL_SMP=$SMP \
     -DEXPORT_SYMTAB -DMODVERSIONS \
     -include \
     /usr/src/linux-${KVERSION}-${KRELEASE}/include/linux/modversions.h \
     -Wall -Wstrict-prototypes -O6 -c \
     -Iinclude -I/usr/src/linux-${KVERSION}-${KRELEASE}/include \
     -c powerswitch.c

I've knocked up a spec file for building RPMs, but I notice that the
powerswitch source tarball does not come with any license. This means that
I cannot redistribute the source (and neither can you), nor build binaries
RPMs and distribute them. It would be breach of copyright if we did.

Please contact the author and ask him to rebundle the source code with a
free license (preferably GPL, which we are certain is compatible with the
linux kernel license). Let me know when he has done so and I will build
and publish my RPMs.

--
Charlie Brady                         [EMAIL PROTECTED]
Mitel Networks Corporation      http://www.mitel.com/
Phone: +1 (613) 592 5660 or 592 2122  Fax: +1 (613) 592 1175

A: Because we read from top to bottom, left to right.
Q: Why should i start my reply below the quoted text?


--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Searchable archive at http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to