Lan Barnes wrote:
..
OK, I made a copy of the k-devel source rpm on my server, installed it,
and tried a vanilla compile there. Same problem. That box was installed
with "everything."
C'mon, I know there are kernel hackers out there. Wad'm I doing wrong?
Here's the recipe, that I use:
=============================
lftpget -c
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/SRPMS/kernel-2.6.15-1.1831_FC4.src.rpm
rpm -ivh kernel-2.6.15-1.1831_FC4.src.rpm
cd /usr/src/redhat/SPECS
cp kernel-2.6.spec kernel-261511831-j1.spec
edit kernel-261511831-j1.spec
append j1 to the '%define release..' line
(or, you may wish to experiment further mods to this line,
such as replacing '%{rhbsys}' with say 'j2'.
The resulting names for the kernel and module directory
will carry a suffix like '..FC4jsackj1smp' or '..FC2j2'
for the 2 example cases)
rpmbuild -bp kernel-261511831-j1.spec
(this applies patches provided by the distribution,
and then does everything through a '.configure' step
that you might do manually)
cd /usr/src/redhat/BUILD/kernel-2.6.15/linux-2.6.15
-->make changes to sources and/or .config
cd /usr/src/redhat/SPECS
rpmbuild --short-circuit -bc /usr/src/redhat/SPECS/kernel-261511831-j1.spec
IMPORTANT NOTES:
---------------
IN.1) the --short-circuit is *critical* to avoid having rpm redo the
prep steps and throw away your code/config changes
IN2) the --short-circuit is ONLY honored for a -bc or -bi step following
the prep and your mods. You could possibly do -bp, -bc, and then -bi.
Also Note:
---------
AN.0) you can (and probably should) do all the above as root, to avoid
needing to prepare various directories to be writable by <user>, and to
avoid having to chown root.root on all the results. If you did, then the
name root will appear where jsack did in my notes, above.
AN.1) the -bi doesn't really install anything, except into a workspace
under /var/tmp/kernel-2.6.15-1.1831_FC4.jsackj1-root (or ..FC4j2-root).
You have to copy things to /boot and /lib/modules, which is what I like
anyway, because then I can see exactly what's going on.
AN.2) I often make a tarball of the results via
cd /var/tmp/kernel-2.6.15-1.1831_FC4j2
tar -czvpf 261511831-j2.tgz boot lib
(I ignore the usr debugging stuff. You may wish to prune other things
before up-ge-tarballing)
Anyway, then the tarball can be ported to other targets, and also serves
as well as an rpm for documenting/archiving what you installed.
AN.3) Perhaps someone else will suggest how to make bonafide rpms.
AN.4) You could do everything after the prep (the -bp) manually via
make, make modules, make modules_install, etc -- but I like the way rpm
collects everything in /var/tmp.
You may have wanted to read this first:
--------------------------------------
Ymhwtrtf.1) The rpm will build up to 3 kernels, standard (up), smp and
xen, taking *three* passes through all the compile steps. To override
the defaults, edit the lines at the top of the rpm spec to look like
---------------------
%define buildup 1
%define buildsmp 1
%define includexen 0
%define builddoc 0
---------------------
by changing anything with a 1 that you don't want to a 0. (When I
remember it, ..) I change my 'buildsmp 1' to a 'buildsmp 0', because I
only want the standard uniprocessor results.
..jim
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list