Bug 28489 - kernel rpms are not rebuildable /boot/kernel.h is 0 length
Summary: kernel rpms are not rebuildable /boot/kernel.h is 0 length
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kernel
Version: 7.1
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-20 19:33 UTC by Phil Copeland
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-06-05 23:44:26 UTC
Embargoed:


Attachments (Terms of Use)

Description Phil Copeland 2001-02-20 19:33:20 UTC
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 15:06:54 UTC
We (Red Hat) should really try to resolve this before next release.

Comment 2 Karsten Hopp 2001-02-22 13:18:40 UTC
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 15:53:49 UTC
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 10:58:43 UTC
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.