Bug 240878 - Documentation on how to build a custom Fedora kernel is incomplete/inaccurate
Documentation on how to build a custom Fedora kernel is incomplete/inaccurate
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
: 244570 (view as bug list)
Depends On:
Blocks: 427887
  Show dependency treegraph
 
Reported: 2007-05-22 11:58 EDT by Akemi Yagi
Modified: 2008-08-02 19:40 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-08 11:01:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Add --with/without debuginfo flag and some other flag cleanups (8.39 KB, patch)
2007-07-03 10:10 EDT, Jarod Wilson
no flags Details | Diff

  None (edit)
Description Akemi Yagi 2007-05-22 11:58:01 EDT
Description of problem:

When rebuilding a kernel by running the rpmbuild -bp command, it creates a
.config file in the BUILD directory.  However, this .config file is missing the
first line (# i386 for example).  If we customize kernel options using this file
, then the first line remains missing.  (Even if we use the .config file
containing the correct first line, make menuconfig deletes it).  The build step
looks for the first line to get $ARCH.  Because now this line is not present in
.config, $ARCH becomes empty and the build process fails.




Version-Release number of selected component (if applicable):


How reproducible: Always


Steps to Reproduce:
1. Install kernel source (src.rpm)
2. Run rpmbuild -bp --target `uname -m` kernel-2.6.spec
3.
  
Actual results:
The .config file created in the BUILD directory lacks the first line (# $ARCH).

Expected results:
The .config file created in the BUILD directory should retain the first line.

Additional info:
This problem apparently exists in FC5 and FC6 (and RHEL5).  It was seen as early
as in 2005.  For example, see this Fedora mailing list which summarizes the
issue (and a workaround) in details:

http://www.redhat.com/archives/fedora-list/2005-May/msg00401.html
Comment 1 Jeff Johnson 2007-05-22 16:41:52 EDT
This is a kernel packaging problem, not an rpmbuild problem.

You're much more likley to get results if you cvhange the component to "kernel".
Comment 2 Akemi Yagi 2007-05-22 16:50:49 EDT
Changing the component to "kernel" as per the suggestion by Jeff Johnson.
Comment 3 J Gallagher 2007-06-12 16:50:25 EDT
Ahem,

this is a major PITA, can someone make a useful reply please?

In fact, to make the process work I think you need to copy a properly formatted
.config file to the build directory, run a 'make oldconfig' and then (if you
require customizations) 'make menuconfig', and THEN add the "#i386" to the first
line and then I think you still need to copy the config to the appropriate
target in ~/rpmbuild/SOURCES/ (if you want to use 'rpmbuild -bb' to build the
kernel rpm itself)

On top of all of this, if you do not disable Kernel debugging from the Kernel
hacking section (which will be enabled if you copied your existing config from
/boot) you end up with nearly half a gig of modules

On top of this, editing the spec file to prevent PAE, kdump and debug builds is
not exactly as clear as it could be, failure to edit correctly causes the build
process to be quadrupled and require many gigs of harddisk spacc (Configured
properly on my AMD 3500+ the rpmbuild takes 1 Gig of space and 30 mins)

Currently, the "official" kernel building guidelines in Fedora are very
unsatisfactory and conatain errors and crucial omissions, it is far easier to
install a vanilla tarball and run make, make modules_install, make install.

So how about tidying it all up?
Comment 4 Chuck Ebbert 2007-06-13 10:04:46 EDT
(In reply to comment #3)
> Currently, the "official" kernel building guidelines in Fedora are very
> unsatisfactory and conatain errors and crucial omissions, it is far easier to
> install a vanilla tarball and run make, make modules_install, make install.
> 
> So how about tidying it all up?

What changes would you suggest?

http://fedoraproject.org/wiki/Docs/CustomKernel
Comment 5 Akemi Yagi 2007-06-14 07:58:30 EDT
As reported above, it is necessary to tweak things to successfully build a
custom kernel. One such example is having to add manually the #i386 (or #x86_64)
line to .config.  The CustomKernel on the CentOS wiki page is addressing these
points.  Please take a look at:

http://wiki.centos.org/HowTos/Custom_Kernel

and see the comments for CentOS 5.

Akemi
Comment 6 Johnny Hughes 2007-06-14 08:02:52 EDT
The issue is that when you save changes from "make menuconfig", "make xconfig"
(which is how you would get your customized kernel) it will erase the # $ARCH
line at the top of the config file.

This means that people have to remember to add that line back in to the .config
file (that would be in Step 3, substep 5 in the current Fedora wiki ... before
copying the .config file back to the SOURCES).

The actual make process from the kernel is what removes the "# $ARCH" from the
top of the file ... so changing that process might not be the best thing.

Maybe the answer is logic in the preprocessing to add '# "uname -i"' to the top
of the kernel-<version>-<arch>.config file in SOURCES if it does not exist. 
(Which is required to be there for building the Kernel in RPM form, but not
produced from "make oldconfig", "make menuconfig" or "make xconfig".
Comment 7 J Gallagher 2007-06-14 18:43:20 EDT
That header line and having to copy the .config back to SOURCES/ are the main
problem with using rpmbuild for the kernel,.
ALso, the "official" instructions specify the build directory as
~/rpmbuild/redhat/BUILD/ when it is actually ~/rpmbuild/BUILD/

The spec file editing is talso a real hassle, need it be so convoluted? The
default for 90% builds requires a kernel and kernel-devel rpm, wouldn't it be
better to require those requiring debug, PAE and kdump kernels to edit the spec
file rather than the majority or people?
Comment 8 Chuck Ebbert 2007-06-15 10:13:42 EDT
(In reply to comment #7)
> The spec file editing is talso a real hassle, need it be so convoluted? The
> default for 90% builds requires a kernel and kernel-devel rpm, wouldn't it be
> better to require those requiring debug, PAE and kdump kernels to edit the spec
> file rather than the majority or people?

Those directions are out-of-date. If you look at the spec file you'll see that
you can specify --with= / --without= on the rpmbuild command line to pick what
kind of kernels get built. This works for Fedora 6, 7 and rawhide.
Comment 9 J Gallagher 2007-06-15 19:16:12 EDT
Ok, can the header line ("# i386" or "# x86_64" etc) missing problem be fixed?
At the very least, some Fedora instructions should be available to tell people
to make the amendment.

As of now there are no "official" instructions available which, when followed,
enable  a correct custom kernel build using rpmbuild. They are available in the
various forums and as noted above Centos have made a better effort.

This guide still uses ~/rpmbuild/redhat/ as the base dir, it is just ~/rpmbuild/
http://fedoraproject.org/wiki/Docs/CustomKernel
Comment 10 Sam Folk-Williams 2007-06-18 18:22:45 EDT
Hi,

I have made the requested changed (Added the bit about the header line in the
config and fixed the references to ~/rpmbuild/redhat.

Any other questions, go ahead and update this BZ.

Thanks for bringing this to my attention.

Sam
Comment 11 Chuck Ebbert 2007-06-18 21:26:31 EDT
*** Bug 244570 has been marked as a duplicate of this bug. ***
Comment 12 Christian Tosta 2007-06-19 16:59:40 EDT
Please modify the http://fedoraproject.org/wiki/Docs/CustomKernel to match the
dependency of ncurses-devel to build kernels.
Comment 13 Chuck Ebbert 2007-06-19 17:04:29 EDT
ncurses is not necessary, you can use "make config" or edit the .config files by
hand.
Comment 14 Pete Zaitcev 2007-06-19 18:08:38 EDT
What is wrong with people?! All configs are in configs/ directory. This is
where you have to get your configs and not use the garbage left in .config
after rpmbuild -bp. In fact, it's a pain for me that rpm leaves anything
in .config, because it has to be explicitly removed before cp -al or else
several hardlinked trees cloned from the same prep tree may conflict.
Comment 15 J Gallagher 2007-06-20 20:40:44 EDT
Sam

thanks for the amendments, it helps :) , although the "bug" (mentioned in the
thread title) is still an annoyance.

in F7 i still had to add a '%define _enable_debug_packages 0' to the i686
conditional define later in the script to get it to work without errors, maybe
my build technique is wrong.

Zaiticev
what would be more helpful is if you would install a fresh F7 or FC6 install,
download the matching kernel*.src.rpm and explain exactly the steps you took to
build without requiring several gigabytes of harddisk space or more than ~30mins
for a simple kernel and kernel-devel build.

Cheers.
Comment 16 Sam Folk-Williams 2007-06-25 13:05:47 EDT
(In reply to comment #15)

> in F7 i still had to add a '%define _enable_debug_packages 0' to the i686
> conditional define later in the script to get it to work without errors, maybe
> my build technique is wrong.
> 

Can anyone else confirm if this is necessary? 
Comment 17 Sam Folk-Williams 2007-06-25 13:17:44 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > The spec file editing is talso a real hassle, need it be so convoluted? The
> > default for 90% builds requires a kernel and kernel-devel rpm, wouldn't it be
> > better to require those requiring debug, PAE and kdump kernels to edit the spec
> > file rather than the majority or people?
> 
> Those directions are out-of-date. If you look at the spec file you'll see that
> you can specify --with= / --without= on the rpmbuild command line to pick what
> kind of kernels get built. This works for Fedora 6, 7 and rawhide.

Which instructions exactly are out of date? On the wiki we currently have 2
things wrt the spec file - change the release name and add your patch. Is this
the part that is convoluted/out of date?
Comment 18 J Gallagher 2007-06-26 11:11:22 EDT
Sam

I edited three sections (not including the revicion line) to get a simple kernel
and kernel-devel i686 build (no pae, kdump or debug builds), it took ~30mins on
an AMD64 3500 with 1Gb ram and used about 1GB of disk space in the ~/rpmbuild
directory (usage in /var/tmp was negligible)
Without the '%define _enable_debug_packages 0' line in the third section below
the rpmbuild failed with an error about an unfound file in /var/tmp (sorry I
don't have the exact error)

What would be cool is if someone could explain an easier method to get a simple
build (using rpmbuild to get a kernel and kernel-devel rpm), that is, without
requiring all these edits to the spec file, and TEST it in a fresh fc7 install.
I am probably doing something incorrectly with the spec file, but this method
works for me.

Your updated wiki instructions are fine apart from explaining how to edit the
spec file.

Cheers

James

------------------------------------------------------------------------------

# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them
#
# standard kernel
%define with_up      %{?_without_up:      0} %{?!_without_up:      1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
# kernel-PAE (only valid for i686)
%define with_pae     0
# kernel-xen
%define with_xen     0
# kernel-kdump
%define with_kdump   0
# kernel-debug
%define with_debug   0
# kernel-doc
%define with_doc     0
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}

---------------------------------------------------------------------------


# Set debugbuildsenabled to 1 for production (build separate debug kernels)
#  and 0 for rawhide (all kernels are debug kernels).
# See also 'make debug' and 'make release'.
%define debugbuildsenabled 0


----------------------------------------------------------------------------



%ifarch i686
# we build always xen i686 HV with pae
%define xen_flags verbose=y crash_debug=y pae=n
%define _enable_debug_packages 0
%endif


-------------------------------------------------------------------------------



Comment 19 J Gallagher 2007-06-26 11:17:38 EDT
Sam

I edited three sections (not including the revision line) to get a simple kernel
and kernel-devel i686 build (no pae, kdump or debug builds), it took ~30mins on
an AMD64 3500 with 1Gb ram and used about 1GB of disk space in the ~/rpmbuild
directory (usage in /var/tmp was negligible)
Without the '%define _enable_debug_packages 0' line in the third section below
the rpmbuild failed with an error about an unfound file in /var/tmp (sorry I
don't have the exact error)

What would be cool is if someone could explain an easier method to get a simple
build (using rpmbuild to get a kernel and kernel-devel rpm), that is, without
requiring all these edits to the spec file, and TEST it in a fresh fc7 install.
I am probably doing something incorrectly with the spec file, but this method
works for me.

Your updated wiki instructions are fine apart from explaining how to edit the
spec file.

Cheers

John

------------------------------------------------------------------------------

# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them
#
# standard kernel
%define with_up      %{?_without_up:      0} %{?!_without_up:      1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
# kernel-PAE (only valid for i686)
%define with_pae     0
# kernel-xen
%define with_xen     0
# kernel-kdump
%define with_kdump   0
# kernel-debug
%define with_debug   0
# kernel-doc
%define with_doc     0
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}

---------------------------------------------------------------------------


# Set debugbuildsenabled to 1 for production (build separate debug kernels)
#  and 0 for rawhide (all kernels are debug kernels).
# See also 'make debug' and 'make release'.
%define debugbuildsenabled 0


----------------------------------------------------------------------------



%ifarch i686
# we build always xen i686 HV with pae
%define xen_flags verbose=y crash_debug=y pae=n
%define _enable_debug_packages 0
%endif


-------------------------------------------------------------------------------



Comment 20 Chuck Ebbert 2007-06-26 14:19:45 EDT
(In reply to comment #17)
> Which instructions exactly are out of date? On the wiki we currently have 2
> things wrt the spec file - change the release name and add your patch. Is this
> the part that is convoluted/out of date?

In Step 5 you can specify
  rpmbuild -bp --with=<option>
or
  rpmbuild -bp --without=<option>
e.g. "rpmbuild -bp --with=smp ..." gets you an smp kernel and nothing else.

Comment 21 Chuck Ebbert 2007-06-26 15:26:34 EDT
(In reply to comment #20)
>> e.g. "rpmbuild -bp --with=smp ..." gets you an smp kernel and nothing else.

oops, thats --with=smponly

Comment 22 Akemi Yagi 2007-06-26 15:59:49 EDT
(In reply to comment #20)

> In Step 5 you can specify
>   rpmbuild -bp --with=<option>
> or
>   rpmbuild -bp --without=<option>

This is Step 5, so is it supposed to be 'rpmbuild -ba' (not -bp) ?

Comment 23 J Gallagher 2007-06-26 16:33:27 EDT
Chuck,

1. How do you edit your replies here, I'm unable to?

2. That suggestion don't work for me, I just want a simple kernel and
kernel-devel rpm but I can't figure out how to do it without the "concoluted"
editig of the spec file I've explained.

If someone, ANYONE!, could do a fresh F7 install and then explain their steps to
get a simple kernel build using rpmbuild like mine which doesn't require more
than a ~gigabyte of hardrive space and completes in ~30mins on a modern cpu that
would be very useful.
Comment 24 Chuck Ebbert 2007-06-26 16:42:21 EDT
(In reply to comment #22)
> 
> This is Step 5, so is it supposed to be 'rpmbuild -ba' (not -bp) ?

That should probably be -bb, unless you really want a source package built.
Comment 25 Chuck Ebbert 2007-06-26 16:53:07 EDT
(In reply to comment #23)
> 1. How do you edit your replies here, I'm unable to?

Just click on "reply" and edit the txt box.
 
> 2. That suggestion don't work for me, I just want a simple kernel and
> kernel-devel rpm but I can't figure out how to do it without the "concoluted"
> editig of the spec file I've explained.
> 
> If someone, ANYONE!, could do a fresh F7 install and then explain their steps to
> get a simple kernel build using rpmbuild like mine which doesn't require more
> than a ~gigabyte of hardrive space and completes in ~30mins on a modern cpu that
> would be very useful.

Just follow the directions, but in step 5 do:

  rpmbuild -bb --with=smponly <target>

Unfortunately I think the debug-info packages will always be built unless you
edit the spec, we can work on the spec file a bit more to add options for that.
And its never going to be really fast...
Comment 26 J Gallagher 2007-06-26 17:08:50 EDT
(In reply to comment #18)
> Sam
> 
> I edited three sections (not including the revision line) to get a simple kernel
> and kernel-devel i686 build (no pae, kdump or debug builds), it took ~30mins on
> an AMD64 3500 with 1Gb ram and used about 1GB of disk space in the ~/rpmbuild
> directory (usage in /var/tmp was negligible)
> Without the '%define _enable_debug_packages 0' line in the third section below
> the rpmbuild failed with an error about an unfound file in /var/tmp (sorry I
> don't have the exact error)
> 
> What would be cool is if someone could explain an easier method to get a simple
> build (using rpmbuild to get a kernel and kernel-devel rpm), that is, without
> requiring all these edits to the spec file, and TEST it in a fresh fc7 install.
> I am probably doing something incorrectly with the spec file, but this method
> works for me.
> 
> Your updated wiki instructions are fine apart from explaining how to edit the
> spec file.
> 
> Cheers
> 
> John
> 
> ------------------------------------------------------------------------------
> 
> # The following build options are enabled by default.
> # Use either --without <opt> in your rpmbuild command or force values
> # to 0 in here to disable them
> #
> # standard kernel
> %define with_up      %{?_without_up:      0} %{?!_without_up:      1}
> # kernel-smp (only valid for ppc 32-bit, sparc64)
> %define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
> # kernel-PAE (only valid for i686)
> %define with_pae     0
> # kernel-xen
> %define with_xen     0
> # kernel-kdump
> %define with_kdump   0
> # kernel-debug
> %define with_debug   0
> # kernel-doc
> %define with_doc     0
> # kernel-headers
> %define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
> 
> ---------------------------------------------------------------------------
> 
> 
> # Set debugbuildsenabled to 1 for production (build separate debug kernels)
> #  and 0 for rawhide (all kernels are debug kernels).
> # See also 'make debug' and 'make release'.
> %define debugbuildsenabled 0
> 
> 
> ----------------------------------------------------------------------------
> 
> 
> 
> %ifarch i686
> # we build always xen i686 HV with pae
> %define xen_flags verbose=y crash_debug=y pae=n
> %define _enable_debug_packages 0
> %endif
> 
> 
> -------------------------------------------------------------------------------
> 
> 
> 
> 

Comment 27 J Gallagher 2007-06-26 17:12:53 EDT
> 1. How do you edit your replies here, I'm unable to?

Just click on "reply" and edit the txt box.

That just creates a new (edited) messge, I want to edit after posting since ny
spelilng is so bad)

The kernel build process using rpmbuild is very unsatisfactory, I will recommend
using the old-fashioned make, make modules_install, make install until it is
improved.
Comment 28 Akemi Yagi 2007-06-27 22:04:15 EDT
(In reply to comment #24)
> (In reply to comment #22)
> > 
> > This is Step 5, so is it supposed to be 'rpmbuild -ba' (not -bp) ?
> 
> That should probably be -bb, unless you really want a source package built.

One comment about the "Building Only Kernel Modules" section.  The file
/usr/share/doc/<kernel_version>/Documentation/kbuild/modules.txt has a note on
module versioning: 

"modules_prepare will not build Module.symvers even if CONFIG_MODULEVERSIONING
is set. Therefore a full kernel build needs to be executed to make module
versioning work."

Should this be added to the wiki?  Or at least mention module versioning?

Akemi
Comment 29 Sam Folk-Williams 2007-06-28 08:34:55 EDT
Can one of the engineers confirm if the following are all the valid options for
use with --with and --without? For example, in the spec file you have with_smp
but on the command line that should read --with=smponly. Any other gotchas there?

# standard kernel
%define with_up      %{?_without_up:      0} %{?!_without_up:      1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
# kernel-PAE (only valid for i686)
%define with_pae     0
# kernel-xen
%define with_xen     0
# kernel-kdump
%define with_kdump   0
# kernel-debug
%define with_debug   0
# kernel-doc
%define with_doc     0
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
Comment 30 Chuck Ebbert 2007-06-28 16:52:39 EDT
It's those options that start with underlines that get defined on the command
line, e.g.
  rpmbuild --with smponly ...
defines the macro
  _with_smponly

(See /usr/share/doc/rpm-<version>/conditionalbuilds)

For all the predefined macros see /usr/lib/rpm/macros and
/usr/lib/rpm/redhat/macros.

I looks like the debuginfo packages can be disabled with
   rpmbuild --define '_enable_debug_packages 0' ...
but I haven't tried that yet.
Comment 31 Jarod Wilson 2007-06-29 15:19:04 EDT
Adding myself to the cc list on this one, since I wrote all this with/without
stuff and would like to help clarify/fix/whatever anything I can...
Comment 32 Sam Folk-Williams 2007-06-29 15:34:04 EDT
(In reply to comment #31)
> Adding myself to the cc list on this one, since I wrote all this with/without
> stuff and would like to help clarify/fix/whatever anything I can...

Thanks Jarod - just check out section 5 here:

http://fedoraproject.org/wiki/Docs/CustomKernel#head-3e526c191c74371ce9406b8e0e235594c12157e9

Does that look accurate? Can you enable/disable the debuginfo build on the
command line too?

Thanks,
Sam
Comment 33 Jarod Wilson 2007-07-02 09:48:27 EDT
Just looking over the doc now, seeing more than just section 5 needing some
changes. :)

In section 4, it recommends inserting some custom text before %{?dist} on the
release line. But if you read up just a few lines in the spec:

----8<----
# Polite request for people who spin their own kernel rpms:
# please modify the "buildid" define in a way that identifies
# that the kernel isn't the stock distribution kernel, for example,
# by setting the define to ".local" or ".bz123456"
#
#% define buildid .local
----8<----

In other words, just tell people to set something such as:

%define buildid .sfw


Okay, now on to section 5...

The "To build just a specific kernel flavor" recipe isn't quite correct. By
default, pretty much everything defaults to "--with" (aka, enabled), so saying
'--with=xen' isn't going to be just the xen kernel, its going to build xen, smp,
up, etc. (all valid variants for that arch). Only the --without flags or the
--with xenonly|smponly|baseonly options actually *disable* other options.

And no, the _enable_debug_packages option does not disable building debuginfo
packages, it controls whether or not to build separate kernel and kernel-debug
packages. The debuginfo package is the stripped debug info from the kernel
package. The kernel-debug package is a kernel built with a bunch of debug
options included.

There may be some minor clean-up needed in the spec file to make everything play
nice when flipping the _enable_debug_packages bit and using other flags, I seem
to recall running into an issue w/the RHEL5 version of the same. I'll
double-check the actual output of everything best as I can, but the above is at
least the way everything is *intended* to work... :)
Comment 34 Jarod Wilson 2007-07-02 09:54:52 EDT
D'oh. My apologies, I'm crossing up _enable_debug_package with
debugbuildsenabled. I believe setting _enable_debug_packages to 0 may well be
intended to disable building debuginfo packages, but I've not actually used it
myself. I'll give that some attention too.
Comment 35 Sam Folk-Williams 2007-07-02 10:07:14 EDT
Thanks Jarod. For that unique name i wonder if that was added recently - a few
months ago those instructions came from Dave J. Anyhoo, thanks for the
clarification on the --with and --without. If you need to specify multiple
--withouts, would that be "--without smp xen pae," or "--without smp --without
up" etc.

I am now noticing this in the spec file:

%define with_debug   %{?_without_debug:   0} %{!?_without_debug:   1}

Can we just do "--without_debug"?

Thanks,
Sam
Comment 36 Jarod Wilson 2007-07-02 15:48:44 EDT
Yeah, the buildid bit is at least somewhat recent.

Not absolutely certain, but I don't think sure if you can throw multiple params
to --with/without, but multiple --without's definitely works.

You can do a '--without debug' or --without=debug' to turn off the kernel-debug
build, but it won't disable creation of debuginfo packages. Got side-tracked
with some other spec changes, so I haven't yet looked into how well trying to
disable debuginfo packages works right now...
Comment 37 Chuck Ebbert 2007-07-02 16:03:03 EDT
If you look at /usr/lib/rpm/redhat/macros, you can see 

%_enable_debug_packages 1

So I think just defining it to 0 on the command line will override that.
Of course it would be better if we had some easier way to do it.
Comment 38 Jarod Wilson 2007-07-02 21:32:52 EDT
Okay, along with the other changes in my local devel kernel spec, I've added a --with/without debuginfo 
option that I've tested out, and it does the right thing -- 'rpmbuild -bb --with baseonly --without 
debuginfo' spit out only kernel, kernel-devel and kernel-headers (x86_64 build). Would be more than 
happy to port that into the F7 and FC6 specs too.
Comment 39 Akemi Yagi 2007-07-02 21:52:36 EDT
(In reply to comment #38)
> Okay, along with the other changes in my local devel kernel spec, I've added a
--with/without debuginfo 
> option that I've tested out, and it does the right thing -- 'rpmbuild -bb
--with baseonly --without 
> debuginfo' spit out only kernel, kernel-devel and kernel-headers (x86_64
build). Would be more than 
> happy to port that into the F7 and FC6 specs too.

Any chance you can share it here?

Akemi

Comment 40 Jarod Wilson 2007-07-02 23:46:46 EDT
(In reply to comment #39)
> (In reply to comment #38)
> > Okay, along with the other changes in my local devel kernel spec, I've added a
> > --with/without debuginfo option
> [...]
> Any chance you can share it here?

I should be able to get together a port for the F7 and FC6 specs tomorrow morning. I don't have it in an 
easily-digestable form right now, as its intertwined with several other major changes we're discussing for 
the rawhide kernel spec file.
Comment 41 Jarod Wilson 2007-07-03 10:08:59 EDT
Not sure how that 'e' got chopped off the summary last update... But anyhow, I'm
attaching the spec diff for F7 to add --with/without debuginfo (and clean up a
few other flags a little bit -- redundancy reduction, mostly).
Comment 42 Jarod Wilson 2007-07-03 10:10:51 EDT
Created attachment 158446 [details]
Add --with/without debuginfo flag and some other flag cleanups
Comment 43 Akemi Yagi 2007-07-03 11:03:00 EDT
What are the chances that this is ported to RHEL4 and 5?  

Akemi
Comment 44 Jarod Wilson 2007-07-03 16:21:17 EDT
RHEL5, quite likely. I do have a few other things queued up for the RHEL5 kernel
spec that this could go along with. Not sure about RHEL4. Might be a good idea
to file RFE bugs against both the RHEL4 and 5 kernels to keep track, or it could
easily slip through the cracks.
Comment 45 Akemi Yagi 2007-07-05 10:53:40 EDT
I files an RFE for RHEL5.  See Bug 247118.

Akemi
Comment 46 Jarod Wilson 2007-07-11 16:19:23 EDT
For the record, all these bits are now in the rawhide, F7 and FC6 kernel specs,
and I'm cc'd on the RHEL5 RFE so the maintainer can bug me about porting 'em,
probably post-5.1 timeframe.
Comment 47 Sam Folk-Williams 2007-07-11 18:50:32 EDT
Thanks Jarod - i just pulled down the latest src rpm on F7 and ran:

rpmbuild -ba --with baseonly --without debug --target=i686 kernel-2.6.spec 

It built the following:
[sfw@localhost SPECS]$ ls ../RPMS/i686/
kernel-2.6.21-1.3228.blah.fc7.i686.rpm           
kernel-debuginfo-common-2.6.21-1.3228.blah.fc7.i686.rpm
kernel-debuginfo-2.6.21-1.3228.blah.fc7.i686.rpm 
kernel-devel-2.6.21-1.3228.blah.fc7.i686.rpm


Is --withou debug supposed to prevent the building of kernel-debuginfo*?

-Sam
Comment 48 Chuck Ebbert 2007-07-11 18:58:46 EDT
(In reply to comment #47)
> Is --withou debug supposed to prevent the building of kernel-debuginfo*?
> 

that would be --without debuginfo

Comment 49 Jarod Wilson 2007-07-11 21:21:52 EDT
Yeah, what Chuck said. --without debug disables building kernel-debug, which is an extra-debugging-
enabled kernel build, while --without debuginfo disables creating the debuginfo packages for any kernels 
being built.
Comment 50 Sam Folk-Williams 2007-07-12 16:32:26 EDT
(In reply to comment #49)
> Yeah, what Chuck said. --without debug disables building kernel-debug, which
is an extra-debugging-
> enabled kernel build, while --without debuginfo disables creating the
debuginfo packages for any kernels 
> being built.

That makes sense, but in the spec file in the 2.6.21-1.3228 the debuginfo option
isn't there, and it gets ignored. This seems to be the latest F7 updates - is it
in a later version?

# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them.
#
# standard kernel
%define with_up      %{?_without_up:      0} %{?!_without_up:      1}
# kernel-smp (only valid for ppc 32-bit, sparc64)
%define with_smp     %{?_without_smp:     0} %{?!_without_smp:     1}
# kernel-PAE (only valid for i686)
%define with_pae     %{?_without_pae:     0} %{?!_without_pae:     1}
# kernel-xen
%define with_xen     %{?_without_xen:     0} %{?!_without_xen:     1}
# kernel-kdump
%define with_kdump   %{?_without_kdump:   0} %{?!_without_kdump:   1}
# kernel-debug
%define with_debug   %{?_without_debug:   0} %{!?_without_debug:   1}
# kernel-doc
%define with_doc     %{?_without_doc:     0} %{?!_without_doc:     1}
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}

Comment 51 Jarod Wilson 2007-07-12 16:39:42 EDT
> That makes sense, but in the spec file in the 2.6.21-1.3228 the debuginfo option
> isn't there, and it gets ignored. This seems to be the latest F7 updates - is it
> in a later version?

Ah, yes, we haven't yet released a kernel that carries that spec change. Whoops.
Coming Soon. :)

Just another pair of heads ups, btw... For rawhide, the spec has been renamed to
kernel.spec, and the kernel-*.config files are no longer included in the srpm --
they're generated on the fly from the config-* files, which are now included in
the srpm.
Comment 52 Jon Stanley 2008-01-07 20:52:17 EST
(This is a mass-update to all current FC6 kernel bugs in NEW state)

Hello,

I'm reviewing this bug list as part of the kernel bug triage project, an attempt
to isolate current bugs in the Fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

I am CC'ing myself to this bug, however this version of Fedora is no longer
maintained.

Please attempt to reproduce this bug with a current version of Fedora (presently
Fedora 8). If the bug no longer exists, please close the bug or I'll do so in a
few days if there is no further information lodged.

Thanks for using Fedora!
Comment 53 Sam Folk-Williams 2008-01-08 10:46:55 EST
This is resolved, the kernel docs have been updated for F8.

If anyone has addition questions on the docs, please open a new BZ.

-Sam
Comment 54 Jarod Wilson 2008-01-08 11:01:17 EST
Closing...

Note You need to log in before you can comment on or make changes to this bug.