building packages for FC2 for external kernel modules
by Thomas Vander Stichele
Hi all,
I'd like to spark some discussion on how to properly package kernel
modules for FC2. I have personally packaged a few kernel module
packages for FC1 for fedora.us (see
http://thomas.apestaart.org/download/pkg/fedora-1-i386-fedora-stable/),
and Ville Skytta has packaged some others using a different technique.
I have spent some time this week getting more familiar with the linux
2.6 buildsystem, and have come up with a similar system to what I had
for 2.4. I'd like to explain the various parts of the problem and
solution and get some feedback so I can fix the procedure and propose it
to fedora.us
First of all, a few things are different with 2.6 and FC2:
- you cannot use kernel-source anymore to build for all archs (i586,
i686 - athlon is dropped) and types (regular and -smp) This is because
you need a bunch of different headers and built files
- these built files are packaged in the kernel rpm and install in
/lib/modules/`uname -r`/build which is now no longer a symlink to
/usr/src/linux-(rel) but a real directory. This effectively prevents
you from building kernel modules for more than one arch at the same time
on your system, since there's no way to install the same kernel rpm for
different archs.
- afaict the FC2 kernel no longer uses symbol versioning (MODVERSIONS
not defined, and Module.symvers only contains "0" versions. I have no
idea why this change has been made.
- 2.6 has a new kbuild system that makes it possible to build
out-of-source kernel modules more reliably/easily
So, how does the current procedure work ?
- I wrote a script (http://thomas.apestaart.org/download/tmp/kmd.py)
which takes a set of kernel rpms for the same-version release, but
different arch/types, extracts them, then creates a symlink/copy forest
that produces a tree of dirs with the same contents as each of the four
rpms
(http://thomas.apestaart.org/download/pkg/fedora-2-i386-fedora-stable/kern...)
The reason for doing this is so that modules for each arch/target combo
can again be built on one kernel, and the resulting rpm is smaller than
four copies of the other rpms.
Currently, this rpm puts files in
/usr/share/kernel-module-devel-2.6.5-1.358 :
common kernel-smp-2.6.5-1.358.i586.rpm
kernel-2.6.5-1.358.i586.rpm kernel-smp-2.6.5-1.358.i686.rpm
kernel-2.6.5-1.358.i686.rpm
common is a symlink to /lib/modules/`uname -r` (which can be regular or
smp, and is symlinked at %post time by the rpm).
the four other directories are named exactly like the rpm they were part
of, and contains a tree of files that are different to the others, and
symlinks to the common directory.
- In the autostars project, we have come up with a set of scripts and a
sample project to package kernel modules and build them reliably and
reproducably against any kernel build tree
(http://cvs.sourceforge.net/viewcvs.py/autostars/autostars/linux/)
This has been updated with a full set of procedures to build for 2.6 as
well. Given only the argument
--with-linuxdir=/usr/share/kernel-module-devel-(ver-rel)/(rpm dir), it
can build the correct kernel module. (This same project can still be
used to build 2.4 modules correctly as well, including redhat's special
defines for boot,enterprise,smp,bigmem from /boot/kernel.h)
For 2.6, it includes a libtool-like script that takes care of installing
modules and taking into account symbol versions.
- like before, I have created patches to hostap and ipw2100 drivers to
autotoolize them using this setup. This only takes ten minutes if
you're used to autotools, and ten more if you want it to work out of the
box for both 2.4 and 2.6 (assuming the source allows this).
- Since ipw2100 needs symbol versions and include files from hostap,
I've made the hostap rpm install these files as part of a
kernel-module-devel-hostap-(ver-rel) rpm, in the same tree as the
original kernel-module-devel rpm. all hostap*.symvers files end up in
e.g.
/usr/share/kernel-module-devel-2.6.5-1.358/kernel-2.6.5-1.358.i686.rpm
(which is where Modules.symvers lives).
The .h files I have for now put in
/usr/share/kernel-module-devel-2.6.5-1.358/kernel-2.6.5-1.358.i686.rpm/include/modules/hostap
- the spec files for ipw2100 and hostap need some small tweaks to build
both on pre-fc2 (with 2.4) and post-fc2. It mainly consists of the
first buildrequire'ing kernel-source and kernel, and the second
buildrequiring kernel-module-devel-(ver-rel). For hostap, depending on
2.4 or 2.6, different symbol versioning files are installed
(builddir/include/linux/modules/*.ver versus builddir/*.symvers)
Currently the configure invocation is slightly different too, but this
could be fixed.
The resulting rpms are up at
http://thomas.apestaart.org/download/pkg/fedora-2-i386-fedora-stable/kern...
and
http://thomas.apestaart.org/download/pkg/fedora-2-i386-fedora-stable/kern...
and are of course built with mach.
I'd appreciate it if some other people (particularly on smp, though I
don't even know if there are people with an ipw2100 AND dual cpu's) try
them out and let me know if it works.
I'll work on some other kernel module projects as well (I've done the
qc-usb module too, but the resulting module doesn't seem to work
correctly. The original upstream build against my /lib/modules tree
doesn't work either, so I'm sure it's not my changes that break it :))
Here is a list of things I still need to decide or fix and would like to
have input on:
- the devel rpm containst the kernel's version and release as part of
the name, in accordance with fedora.us's policy for actual kernel
modules. It's not possible to have a "-" in the version number, so I
can't put kernel ver/rel in that, and I don't want to stick it in the
release tag since then it's impossible to buildrequire: it properly
since on fedora.us the resulting rpm gets a 0.fdr.2 appended to the
release tag. Is this ok ?
- the devel rpm currently stores its files in
/usr/share/kernel-module-devel-(ver-rel)
Would it be more appropriate to put stuff in
/usr/lib/kernel-module-devel-(ver-rel) instead ?
- the devel rpm is currently set with arch i386. I've considered making
it noarch, since it contains files for more than one arch. But I assume
it's not possible anyway to easily build for x86, ppc and ia64 on the
same machine (though the -devel rpm could still be created for all of
them since it just unpacks rpms and compares files). Which of the two
would be preferable in this case ?
- the hostap rpm does the following:
- when built with --target i386, it does the build for the four
arch/type combos and packages only the devel files (symbol versions +
headers), installing them in the same dir as the kernel-module-devel
rpm.
- when built with --target i586 or i686, it does only one build for
the given 'kernel' uname -r define, and removes the devel files.
This would be an argument in favour of having the -devel packages be
i386; I don't think it's possible to build a -devel rpm for ppc, x86 and
ia64 at the same time if you have to actually build the files.
- currently, .symvers files are installed in the root of the builddir,
and include files are installed in builddir/include/modules/(basename of
module). For the .symvers, I think this is an ok location. For the
headers, I'm not sure yet. Of course, this needs to be a location we
need to agree on so interdependent modules can be built correctly.
For building ipw2100, an extra include directive is given in the
Makefile.am patch that points to builddir/include/modules/hostap
Any suggestions on standardizing this or is this ok ? What would
projects like these be expected to install them to normally ?
- the module spec files could be made to work with fc2 and pre-fc2. I
normally use a check to scan /etc/fedora-release and build a conditional
based on that. Maybe it should check for the kernel version instead ?
If so, can that be done reliably without invoking rpm as part of the
check ? Is it worth it to try and integrate, or would it make more sense
to just do 2.4 and 2.6 spec files separately ?
- I cannot test the smp versions because my machine cannot boot the smp
kernel. For all 2.4 kernels this worked fine. Has it become impossible
to run smp kernels on up machines ? Does anyone know more about this ?
- Anyone know why FC2 module versioning is turned off ? AFAIK the build
setup we've come up with would take symbol versioning into account
correctly if it were turned on.
- any other suggestions/questions/objections ?
Thanks,
Thomas
Dave/Dina : future TV today ! - http://www.davedina.org/
<-*- thomas (dot) apestaart (dot) org -*->
yes i am
a long way
from home
<-*- thomas (at) apestaart (dot) org -*->
URGent, best radio on the net - 24/7 ! - http://urgent.fm/
19 years, 11 months
Why is hotplug disabled when loading network modules
by Jean-Rene Cormier
Hi, I have a laptop with an Intel Pro Wireless 2100 card and I'm using
the ipw2100 driver which loads the firmware through hotplug and was
wondering why the firmware wasn't getting loaded at boot time. Someone
on the IPW2100-devel list mentioned that hotplug was getting disabled in
the is_available function in
/etc/sysconfig/network-scripts/network-functions and looking at that
file I can see that I have these lines which do disable it:
HOTPLUG=`cat /proc/sys/kernel/hotplug`
echo "/bin/true" > /proc/sys/kernel/hotplug
modprobe $1 > /dev/null 2>&1 || {
echo "$HOTPLUG" > /proc/sys/kernel/hotplug
return 1
}
echo "$HOTPLUG" > /proc/sys/kernel/hotplug
Why is hotplug disabled when loading the module? And what should be the
"proper way" of loading the firmware?
Jean-Rene Cormier
19 years, 11 months
Need grub interface -- define specifics
by Bryan Smith
ndbecker2(a)verizon.net wrote:
> I found it was very difficult to find information on how to repair this.
> The grub info itself has lots of detail, but is remarkably short on basic
> howto.
> Anyway, what Fedora can really use is a way to rerun grub-install, possibly
> with changed parameters.
> I am a highly experienced user, but I have to do grub-install just
> infrequently enough that it's always a major PIA to dig up the info on how
> to do it.
>From my understanding, this is caused by differences in BIOS disk number
to Linux disk device mappings. It's difficult to compensate for this issue
automatically, regardless of LILO or GRUB.
Maybe there is a way to automatically extract the BIOS disk number and then
re-create the mapping file. But when do you do it? Sometimes people just
swap disks once, but should it be run automatically then?
Detail what it _should_ do _exactly_ and then I can better tell you if it is
feasible or not.
-- Bryan
P.S. The only alternative is to do what Windows does. Have a "dumb" MBR
boot the "active" primary partition on BIOS disk 80h, and _hope_ there is a
driver for it in the root C:\. Heck, XP doesn't even let you change ATA
drivers. I had to hack the registry manually once to do this when I changed
a mainboard (after a SiS chipset mainboard blew and a ViA chipset mainboard
was put in -- not good when you're 1,100 miles from home with 1 computer ;-).
--
Bryan J. Smith, E.I. -- b.j.smith(a)ieee.org
19 years, 11 months
Need grub interface
by Neal Becker
anaconda does a great job setting up grub. Just one problem. AFAICT, there
is no convenient way to redo this process.
I just added a drive to my machine, and I needed to redo grub. All drive
numbers changed.
I found it was very difficult to find information on how to repair this.
The grub info itself has lots of detail, but is remarkably short on basic
howto.
Anyway, what Fedora can really use is a way to rerun grub-install, possibly
with changed parameters.
I am a highly experienced user, but I have to do grub-install just
infrequently enough that it's always a major PIA to dig up the info on how
to do it.
19 years, 11 months
problem with Linux 2.6.6-1.403 and scsi
by Rui Miguel Silva Seabra
I think it doesn't bite me (unless usb-storage for some reason needs
it), but I think there might be some problem...
This happened with 2.6.6-1.397 too!
Rui
[root@roque root]# apt-get install kernel#2.6.6-1.403
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
kernel#2.6.6-1.403
0 upgraded, 1 newly installed, 0 removed and 2 not upgraded.
Need to get 14.0MB of archives.
After unpacking 35.1MB of additional disk space will be used.
Get:1 ftp://ftp.pt.freshrpms.net
pub/freshrpms/ayo/fedora/linux/development/i386/core kernel#2.6.6-1.403
2.6.6-1.403 [14.0MB]
Fetched 14.0MB in 2m44s (85.3kB/s)
Committing changes...
Preparing... ###########################################
[100%]
1:kernel ###########################################
[100%]
WARNING: /lib/modules/2.6.6-1.403/kernel/drivers/scsi/pcmcia/fdomain_cs.ko needs unknown symbol kernel_scsi_ioctl
WARNING: /lib/modules/2.6.6-1.403/kernel/drivers/scsi/fdomain.ko needs
unknown symbol kernel_scsi_ioctl
Done.
19 years, 11 months
Self-Introduction: Alex Perez
by Alex Perez
[If you get this twice, my sincere apologies.]
Hi there, my name is Alexander Joseph Perez, and I'm a co-maintainer of
the GNUstep.org website and have been using GNUstep.org for several
years. I'm from Santa Rosa, California, in the USA, am a full time
anthropology student at Santa Rosa Junior College and work part time as
a lowly help desk technician for the City of Santa Rosa, California.
I'm writing this e-mail because I've recently noticed that the most
recent release of Fedora Core (2) does not contain any GNUstep packages,
and as I've just installed it after getting sick and tired of Debian,
I'd like to change that. I am intimately famaliar with the build
process, and have a significant amount of personal contact online with
the GNUstep core development team on a daily basis. I'd be willing to do
QA on my packages as long as the requirements were reasonable. In short,
I'd like to expose GNUstep to a wider audience now that it is ready for
such exposure. GNUstep has been a long-lived project, and "we're not
dead yet" seems to have become our mantra. GNUstep is not dead. In fact
it's alive and well, and with the inclusion of GNUstep packages into
Fedora Core, one of the more popular distributions of Linux, we will
gain the potential to expose many more people to GNUstep and its offerings.
As I said previously, I'm a current GNUstep.org website maintainer, and
am working on unifying the disparate GNUstep-related documentation
sources which are/have been strewn across the expanse of the Internet
until recently (much of it still is). I love the simplicity and true
Object-Oriented nature of the Objective-C programming language, which
GNUstep is based on. My associate, Andrew Pinski, is the GCC libobjc
(GCC Objective-C runtime) maintainer and works periodically for apple as
his college career permits. I recently worked with him to make sure that
some of the patches to the Objective-C runtime were integrated into
libobjc head.
If anyone here has any questions, please feel free to contact me at
aperezATstudentDOTsantarosaDOTedu as I'd be glad to answer or clarify
any points I've made here. I am not subscribed to the fedora-devel
mailing list and do not wish to be unless I am "accepted" and allowed to
create and provide GNUstep packages to Fedora.
My GPG fingerprint is 2F36 2A89 14B4 B58F 176B 1B26 5E4D 5FCA 9190 2041
and this has been uploaded to pgp.mit.edu
Cheers,
Alex Perez
--
pub 1024D/91902041 2004-05-31 Alex Perez (MrBIOS)
<aperez(a)student.santarosa.edu>
Key fingerprint = 2F36 2A89 14B4 B58F 176B 1B26 5E4D 5FCA 9190 2041
sub 2048g/380DB427 2004-05-31
19 years, 11 months
Re: Missing ethereal after installation of FC2
by "Nils O. Selåsdal"
On Sun, 2004-05-30 at 18:00, Charles R. Anderson wrote:
> On Sun, May 30, 2004 at 05:41:22PM +0200, Casper Pedersen wrote:
> > I have found a bug in ethereal-0.10.3.2 which is installed with FC2.
> > I've filed bug 124721, and here is the fix for it
> > + %{_bindir}/ethereal
> > + %{_sbindir}/ethereal
>
> Those two files are not supposed to be in the ethereal package, since
> they are in the ethereal-gnome package.
The bug is perhaps that ethereal-gnome should be installed as well.
I also got a little puzzled by ethereal beeing installed by default,
but not ethereal-gnome.
19 years, 11 months