Bug 28489 - kernel rpms are not rebuildable /boot/kernel.h is 0 length
kernel rpms are not rebuildable /boot/kernel.h is 0 length
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: kernel (Show other bugs)
7.1
All Linux
high Severity high
: ---
: ---
Assigned To: Arjan van de Ven
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-02-20 14:33 EST by Phil Copeland
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-05 19:44:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Phil Copeland 2001-02-20 14:33:20 EST
It's not possible to rebuild the kernel src rpms because /boot/kernel.h-XXX
is always zero length
consequently any atempt to build the kernel dies

ie
	/usr/src/linux-2.4.1/include/linux/version.h:2:2: #else without #if
	/usr/src/linux-2.4.1/include/linux/version.h:4:2: #endif without #if
	make: *** [init/main.o] Error 1

because linux/version.h looks like this
cat /usr/src/linux-2.4.1/include/linux/version.h
	#include <linux/rhconfig.h>
	#else
	#define UTS_RELEASE "2.4.1-0.1.10"
	#endif
	#define LINUX_VERSION_CODE 132097
	#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

and <linux/rhconfig.h> expects /boot/kernel.h to provide it with
definitions
even so linux/version.h SHOULD NOT have a broken apart #if / #else / #endif
spread over 3 files!


rpm -qlpvv --scripts 
/usr/src/redhat/RPMS/alpha/kernel-headers-2.4.1-0.1.10.alpha.rpm 

<blurb deleted>...

postinstall script (through /bin/sh):
cd /boot
rm -f kernel.h
ln -snf kernel.h-2.4.1 kernel.h
exit 0

# Old kernel-headers packages owned include symlinks; new
# ones just make them so that we can have multiple kernel-headers
# packages installed.
postuninstall script (through /bin/sh):
if [ $1 = 0 ]; then
    if [ -L /boot/kernel.h -a `ls -l /boot/kernel.h 2>/dev/null| awk '{
print $11 }'` = "kernel.h-2.4.1" ]; then
        rm -f /boot/kernel.h
    fi
fi
exit 0
-rw-r--r--    1 root    root                0 Feb 19 17:44
/boot/kernel.h-2.4.1
drwxr-xr-x    1 root    root             2048 Feb 19 17:44 /usr/include/asm

(Note that kernel.h is zero length when the rpm is built)
Comment 1 Glen Foster 2001-02-21 10:06:54 EST
We (Red Hat) should really try to resolve this before next release.
Comment 2 Karsten Hopp 2001-02-22 08:18:40 EST
you need to reboot once. rc.sysinit will then write the file /boot/kernel.h
for the running kernel.
Comment 3 Michael K. Johnson 2001-02-22 10:53:49 EST
If kernel.h is zero-size at post-install time we could perhaps
set it up with some default.  Normally this doesn't show because
people go through the install and then boot, though, so this should
not normally be an issue.  kernel.h is specifically supposed to be
for the running kernel, so there is a good argument not to add this
to post-install in any case.  On the other hand, if it is zero
length, it is clearly incorrect and gets in the way...
Comment 4 Phil Copeland 2001-02-23 05:58:43 EST
I can think of two off the cuff scenarios where this would be awkward

1. someone forcefully reinstalls the kernel-headers file /boot/kernel.h will be
zapped.
2. Where a system administrator is doing prep work for a change on a weekend and
upgrades the kernel with no intention of rebooting until their change window
which might be severl hours or days away. 

If there was just something in there to complete the #if else endif statements
that would be fine

a #if 0 would do the trick.

Thoughts?

Phil
=--=

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