Bug 240878 - Documentation on how to build a custom Fedora kernel is incomplete/inaccurate
Summary: Documentation on how to build a custom Fedora kernel is incomplete/inaccurate
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 6
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Brian Brock
URL:
Whiteboard:
: 244570 (view as bug list)
Depends On:
Blocks: 427887
TreeView+ depends on / blocked
 
Reported: 2007-05-22 15:58 UTC by Akemi Yagi
Modified: 2008-08-02 23:40 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-01-08 16:01:17 UTC
Type: ---
Embargoed:


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

Description Akemi Yagi 2007-05-22 15:58:01 UTC
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 20:41:52 UTC
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 20:50:49 UTC
Changing the component to "kernel" as per the suggestion by Jeff Johnson.

Comment 3 J Gallagher 2007-06-12 20:50:25 UTC
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 14:04:46 UTC
(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 11:58:30 UTC
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 12:02:52 UTC
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 22:43:20 UTC
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 14:13:42 UTC
(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 23:16:12 UTC
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 Knuth 2007-06-18 22:22:45 UTC
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-19 01:26:31 UTC
*** Bug 244570 has been marked as a duplicate of this bug. ***

Comment 12 Christian Tosta 2007-06-19 20:59:40 UTC
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 21:04:29 UTC
ncurses is not necessary, you can use "make config" or edit the .config files by
hand.

Comment 14 Pete Zaitcev 2007-06-19 22:08:38 UTC
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-21 00:40:44 UTC
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 Knuth 2007-06-25 17:05:47 UTC
(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 Knuth 2007-06-25 17:17:44 UTC
(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 15:11:22 UTC
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 15:17:38 UTC
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 18:19:45 UTC
(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 19:26:34 UTC
(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 19:59:49 UTC
(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 20:33:27 UTC
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 20:42:21 UTC
(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 20:53:07 UTC
(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 21:08:50 UTC
(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 21:12:53 UTC
> 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-28 02:04:15 UTC
(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 Knuth 2007-06-28 12:34:55 UTC
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 20:52:39 UTC
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 19:19:04 UTC
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 Knuth 2007-06-29 19:34:04 UTC
(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 13:48:27 UTC
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 13:54:52 UTC
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 Knuth 2007-07-02 14:07:14 UTC
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 19:48:44 UTC
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 20:03:03 UTC
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-03 01:32:52 UTC
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-03 01:52:36 UTC
(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-03 03:46:46 UTC
(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 14:08:59 UTC
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 14:10:51 UTC
Created attachment 158446 [details]
Add --with/without debuginfo flag and some other flag cleanups

Comment 43 Akemi Yagi 2007-07-03 15:03:00 UTC
What are the chances that this is ported to RHEL4 and 5?  

Akemi

Comment 44 Jarod Wilson 2007-07-03 20:21:17 UTC
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 14:53:40 UTC
I files an RFE for RHEL5.  See Bug 247118.

Akemi

Comment 46 Jarod Wilson 2007-07-11 20:19:23 UTC
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 Knuth 2007-07-11 22:50:32 UTC
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 22:58:46 UTC
(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-12 01:21:52 UTC
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 Knuth 2007-07-12 20:32:26 UTC
(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 20:39:42 UTC
> 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-08 01:52:17 UTC
(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 Knuth 2008-01-08 15:46:55 UTC
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 16:01:17 UTC
Closing...


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