LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   install new kernel headers (https://www.linuxquestions.org/questions/slackware-14/install-new-kernel-headers-542788/)

cyb0rg777 04-02-2007 06:31 PM

install new kernel headers
 
I just built a 2.6.19 kernel for slackware 11.
I needed a hal patch .
So now I am missing some header files .
I am pretty sure they are kernel headers .
So my question is this .

How can I install kernel headers from new kernel source?

jong357 04-02-2007 11:07 PM

Leave the version at "2.6.19.7" and go download the 2.6.19.7 kernel source and recompile your kernel. Why not use the latest version instead of 2.6.19? Besides, there were significant changes to the headers from 2.6.19 to 2.6.19.1... You'll at least want to use the headers from the 2.6.19.1 kernel..

run the below script, do a removepkg on your existing headers and then install the new package in /tmp.

Code:

#!/bin/sh

CWD=`pwd`
TMP=/tmp
PKGNAME=kernel-headers
PKG=$TMP/package-$PKGNAME
VERSION=2.6.19.7
PKGVER=${VERSION}
ARCH=i386
BUILD=1

rm -rf $PKG
mkdir -p $PKG/install

cd $TMP
echo
echo "linux-$VERSION source is now extracting..."
rm -rf linux-$VERSION
tar xjf $CWD/linux-$VERSION.tar.bz2
cd linux-$VERSION
chown -R root.root .
make mrproper
sed -i.bak '/scsi/d' include/Kbuild
make headers_check || :
make headers_install INSTALL_HDR_PATH=$PKG/usr

# Make the package description:
cat << EOF > $PKG/install/slack-desc
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.

              |-----handy-ruler------------------------------------------------|
kernel-headers: kernel-headers (include files)
kernel-headers:
kernel-headers: These are the include files from the Linux kernel.
kernel-headers:
kernel-headers: You'll need these to compile most system software for Linux.
kernel-headers:
kernel-headers:
kernel-headers:
kernel-headers:
kernel-headers:
kernel-headers:
EOF

# Build the package:
cd $PKG
makepkg -l y -c n $TMP/$PKGNAME-$PKGVER-$ARCH-$BUILD.tgz


cyb0rg777 04-03-2007 09:13 PM

I must have done something wrong. The script doesn't seem to do anything but create an empty package.Then when I remove my old kernel headers I have no headers.
The "make headers_check" and "make headers_install" should do it by theirself ,right?

jong357 04-03-2007 10:07 PM

not quite, but make sure you have your old headers gone before doing so.
Code:

make headers_check
make INSTALL_HDR_PATH=/usr headers_install

Also, if you don't issue the sed command, it's possible you'll nuke some glibc files...
Quote:

[root@jaguar ~/Desktop/Xorg] grep -R usr/include/scsi /var/log/packages/
/var/log/packages/glibc-2.4-i686-1:usr/include/scsi/
/var/log/packages/glibc-2.4-i686-1:usr/include/scsi/sg.h
/var/log/packages/glibc-2.4-i686-1:usr/include/scsi/scsi.h
/var/log/packages/glibc-2.4-i686-1:usr/include/scsi/scsi_ioctl.h
That's something you'll want to confirm on your box. (install headers to package, grep like above then compare for conflicts)

You need the kernel tar.bz2 in the same directory as the script. That's probably why you had an empty slackware package. You aught to get into the habit of exclusively using packages.. Just my :twocents: And you really aught to use 2.6.19.1 too... :)

Good luck with hal.

cyb0rg777 04-04-2007 11:21 AM

Worked perfect.
Thank you.


All times are GMT -5. The time now is 12:22 AM.