LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-02-2007, 06:31 PM   #1
cyb0rg777
Member
 
Registered: Dec 2004
Location: ~
Distribution: Debian
Posts: 143
Blog Entries: 8

Rep: Reputation: 15
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?
 
Old 04-02-2007, 11:07 PM   #2
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
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
 
Old 04-03-2007, 09:13 PM   #3
cyb0rg777
Member
 
Registered: Dec 2004
Location: ~
Distribution: Debian
Posts: 143

Original Poster
Blog Entries: 8

Rep: Reputation: 15
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?
 
Old 04-03-2007, 10:07 PM   #4
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
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 And you really aught to use 2.6.19.1 too...

Good luck with hal.

Last edited by jong357; 04-03-2007 at 10:23 PM.
 
Old 04-04-2007, 11:21 AM   #5
cyb0rg777
Member
 
Registered: Dec 2004
Location: ~
Distribution: Debian
Posts: 143

Original Poster
Blog Entries: 8

Rep: Reputation: 15
Worked perfect.
Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Install Kernel Headers derrekito Slackware 10 06-28-2006 05:47 AM
trying to find/install kernel-source or kernel-headers timsch75 Slackware 3 10-22-2005 09:17 AM
install script can not find kernel-headers abtimoteo Linux - Laptop and Netbook 1 05-01-2005 03:29 AM
How to install kernel headers for redhat 9.0? Tommi Linux - General 5 07-02-2003 07:15 AM
How do I install kernel headers jsurgeson Linux - Newbie 4 03-27-2002 05:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration