LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices

Reply
 
Search this Thread
Old 01-04-2008, 03:33 PM   #1
crik91
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Rep: Reputation: 0
Installation of Linux API Headers...


I'm sorry...I don't speak english very well...
I have a problem in page 5.5 of Linux From Scratch 6.3...

In what directory I do this command?
Please!Help me!
Thanks a lot...
 
Old 01-04-2008, 03:46 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,712
Blog Entries: 1

Rep: Reputation: 221Reputation: 221Reputation: 221
Unpack linux-2.6.23.12.tar.bz2, change into the top of the source tree (cd linux-2.6.23.12), and execute the commands from there.
 
Old 01-04-2008, 03:53 PM   #3
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Basically,

- Download the Linux kernel archive (in .tar.gz or .tar.bz2 format) into /usr/src.
- Unpack it (either by "tar -zxf linux*.tar.gz" or "tar -xjf linux*.tar.bz2").
- Symbolically link ("symlink") the directory to /usr/src/linux ("ln -s /usr/src/linux* /usr/src/linux").
- Go into the new directory ("cd /usr/src/linux").

Then, once your in this directory, you can run those commands: make mrproper, make headers_check, make INSTALL_HDR_PATH=dest headers_install, cp -rv dest/include/* /tools/include.
 
Old 01-04-2008, 04:02 PM   #4
crik91
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Code:
lfs@kubuntu:/mnt/lfs/sources$ sudo mv linux-2.6.22.5.tar.bz2 /usr/src/
[sudo] password for lfs:
lfs is not in the sudoers file.  This incident will be reported.
lfs@kubuntu:/mnt/lfs/sources$
Please, help me!
 
Old 01-04-2008, 04:33 PM   #5
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,712
Blog Entries: 1

Rep: Reputation: 221Reputation: 221Reputation: 221
Do not, do not, do not put the Linux kernel source in your /usr/src. That is on your host system! If you execute the commands in the LFS book from /usr/src/linux, you will overwrite your host system's kernel headers.

Ensure that you are in $LFS/sources and then
Code:
tar xf linux-2.6.22.5.tar.bz2
cd linux-2.6.22.5
make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include
Do not create the /usr/src/linux symlink ever on your LFS system. That hasn't been done for years, it is strongly discouraged by the kernel developers, and can cause system breakage.
 
Old 01-04-2008, 04:51 PM   #6
crik91
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Original Poster
Rep: Reputation: 0
I have a big problem:
Code:
lfs@kubuntu:/mnt/lfs/sources$ tar xf linux-2.6.22.5.tar.bz2
lfs@kubuntu:/mnt/lfs/sources$ cd linux-2.6.22.5
lfs@kubuntu:/mnt/lfs/sources/linux-2.6.22.5$ make mrproper
lfs@kubuntu:/mnt/lfs/sources/linux-2.6.22.5$ make headers_check
  CHK     include/linux/version.h
  UPD     include/linux/version.h
  HOSTCC  scripts/basic/fixdep
/tools/bin/ld: unrecognized option '--hash-style=both'
/tools/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
lfs@kubuntu:/mnt/lfs/sources/linux-2.6.22.5$
 
Old 01-05-2008, 06:12 AM   #7
crik91
LQ Newbie
 
Registered: Jan 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Help me please!What should I do?
 
Old 01-05-2008, 03:11 PM   #8
proc
Member
 
Registered: Jul 2007
Location: /dev/urandom
Posts: 70

Rep: Reputation: 15
This should give you some hints...

Code:
#!/bin/sh
# Build variables.
PROG=kernel-headers
VERSION=2.6.23.12
ARCH=i686
PORTARCH=i386
BUILD=1

# Setup the package path and build directory.
CWD=`pwd`
TMP=/tmp
if [ ! -d $TMP ] ; then
   mkdir -pv $TMP    # Just in case /tmp doesn't exist for some reason. 
fi
PKG=$TMP/pkg-$PROG
rm -rf $PKG          # Make sure that this doesn't exist first.
mkdir -pv $PKG

# Extract and copy over the kernel headers. 
cd $TMP
rm -rf linux-2.6.23.12
tar -xvjf $CWD/linux-2.6.23.12.tar.bz2
cd linux-2.6.23.12
mkdir -pv $PKG/usr/include
cd include
cp -fa asm-generic asm-$PORTARCH linux $PKG/usr/include

# Ensure everything in the package belongs to root and has sane 
# permissions.
chown -Rv root:root $PKG/usr/include/{asm-*,linux} 
find $PKG/usr/include/{asm-*,linux} -type d -exec chmod -v 755 {} \; 
find $PKG/usr/include/{asm-*,linux} -type f -exec chmod -v 644 {} \;

# Copy over the description and make the package.
cd $PKG
mkdir -pv $PKG/install
cp $CWD/desc $PKG/install
makepkg -l y -c n $TMP/$PROG-$VERSION-$ARCH-$BUILD.tgz

Last edited by proc; 01-05-2008 at 03:15 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
make headers_check errors [LFS V6.3, Sect 6.7 Linux-2.6.22.5 API Headers] michealoc Linux From Scratch 1 10-11-2007 09:03 AM
Installation of Linux API Headers martinwprior Linux From Scratch 3 09-28-2007 01:19 AM
"make headers_check" gives errors during "5.5.1 Installation of Linux API headers " void_man() Linux From Scratch 3 09-26-2007 09:16 PM
Installation of Linux-Libc-Headers problems Damon Spector Linux From Scratch 12 10-29-2005 10:09 AM
Installation of Kernel-headers X-GhoSt Red Hat 12 05-10-2004 11:54 AM


All times are GMT -5. The time now is 11:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration