-   Linux From Scratch (
-   -   Another LFS newb is stuck: Linux API headers won't install (

smoochie 05-19-2008 06:11 PM

Another LFS newb is stuck: Linux API headers won't install
Thank you to anyone who bothers to read this...I realize I'm not the only one with issues. I've successfully compiled GCC and now am at section 5.5 where I am told to install the linux API headers with the following commands:

make mrproper
make headers_check
make INSTALL_HDR_PATH=dest headers_install
cp -rv dest/include/* /tools/include

I executed these commands in the linux- directory, but headers_check leads to the following errors:

make[3]: *** No rule to make target `/mnt/lfs/linux-', needed by `/mnt/lfs/linux-'. Stop.
make[2]: *** [netfilter] Error 2
make[1]: *** [linux] Error 2
make: *** [headers_install] Error 2

I'd be grateful for any help here.

hoes 05-26-2008 04:59 PM

This is strange.
You put all the commands on different lines? (must ask)

Could you send some log?
Try running

make headers_check 2>&1 | tee logfile
That will create a file named logfile containing more info.
Maybe that'll help you and if not paste some of it in this thread.
Paste the lines beginning with the first strange entry or error.

smoochie 05-27-2008 11:57 PM

Yes, I put all commands on different lines. The error starts with headers_check. Here's the full text of the command:


smoochie@smoochies-desktop:/mnt/lfs/sources/linux-$ sudo make headers_check
CHK include/linux/version.h
UPD include/linux/version.h
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/unifdef
MKDIR include
MKDIR include/asm-generic
INSTALL include/asm-generic/errno-base.h
INSTALL include/asm-generic/errno.h
INSTALL include/asm-generic/fcntl.h
INSTALL include/asm-generic/ioctl.h
INSTALL include/asm-generic/ipc.h
INSTALL include/asm-generic/mman.h
INSTALL include/asm-generic/poll.h
INSTALL include/asm-generic/signal.h
INSTALL include/asm-generic/statfs.h
UNIFDEF include/asm-generic/resource.h
UNIFDEF include/asm-generic/siginfo.h
MKDIR include/asm
INSTALL include/asm/boot.h
INSTALL include/asm/debugreg.h
INSTALL include/asm/ldt.h
INSTALL include/asm/msr-index.h
INSTALL include/asm/ptrace-abi.h
INSTALL include/asm/ucontext.h
UNIFDEF include/asm/a.out.h
UNIFDEF include/asm/auxvec.h
UNIFDEF include/asm/byteorder.h
UNIFDEF include/asm/elf.h
UNIFDEF include/asm/errno.h
UNIFDEF include/asm/fcntl.h
UNIFDEF include/asm/ioctl.h
UNIFDEF include/asm/ioctls.h
UNIFDEF include/asm/ipcbuf.h
UNIFDEF include/asm/mman.h
UNIFDEF include/asm/msgbuf.h
UNIFDEF include/asm/msr.h
UNIFDEF include/asm/mtrr.h
UNIFDEF include/asm/page.h
UNIFDEF include/asm/param.h
UNIFDEF include/asm/poll.h
UNIFDEF include/asm/posix_types.h
UNIFDEF include/asm/ptrace.h
UNIFDEF include/asm/resource.h
UNIFDEF include/asm/sembuf.h
UNIFDEF include/asm/setup.h
UNIFDEF include/asm/shmbuf.h
UNIFDEF include/asm/shmparam.h
UNIFDEF include/asm/sigcontext.h
UNIFDEF include/asm/siginfo.h
UNIFDEF include/asm/signal.h
UNIFDEF include/asm/socket.h
UNIFDEF include/asm/sockios.h
UNIFDEF include/asm/stat.h
UNIFDEF include/asm/statfs.h
UNIFDEF include/asm/termbits.h
UNIFDEF include/asm/termios.h
UNIFDEF include/asm/types.h
UNIFDEF include/asm/unistd.h
UNIFDEF include/asm/user.h
UNIFDEF include/asm/vm86.h
MKDIR include/linux
MKDIR include/linux/byteorder
INSTALL include/linux/byteorder/big_endian.h
INSTALL include/linux/byteorder/little_endian.h
UNIFDEF include/linux/byteorder/generic.h
UNIFDEF include/linux/byteorder/swab.h
MKDIR include/linux/dvb
INSTALL include/linux/dvb/ca.h
INSTALL include/linux/dvb/frontend.h
INSTALL include/linux/dvb/net.h
INSTALL include/linux/dvb/osd.h
INSTALL include/linux/dvb/version.h
UNIFDEF include/linux/dvb/audio.h
UNIFDEF include/linux/dvb/dmx.h
UNIFDEF include/linux/dvb/video.h
MKDIR include/linux/hdlc
INSTALL include/linux/hdlc/ioctl.h
MKDIR include/linux/isdn
INSTALL include/linux/isdn/capicmd.h
MKDIR include/linux/netfilter
INSTALL include/linux/netfilter/nf_conntrack_sctp.h
INSTALL include/linux/netfilter/nf_conntrack_tuple_common.h
INSTALL include/linux/netfilter/nfnetlink_conntrack.h
INSTALL include/linux/netfilter/nfnetlink_log.h
INSTALL include/linux/netfilter/nfnetlink_queue.h
INSTALL include/linux/netfilter/xt_CLASSIFY.h
make[3]: *** No rule to make target `/mnt/lfs/sources/linux-', needed by `/mnt/lfs/sources/linux-'. Stop.
make[2]: *** [netfilter] Error 2
make[1]: *** [linux] Error 2
make: *** [headers_install] Error 2
I performed the command you recommended and here's what the logfile says:


CHK include/linux/version.h
make[1]: `scripts/unifdef' is up to date.
make[3]: *** No rule to make target `/mnt/lfs/sources/linux-', needed by `/mnt/lfs/sources/linux-'. Stop.
make[2]: *** [netfilter] Error 2
make[1]: *** [linux] Error 2
make: *** [headers_install] Error 2

hoes 05-28-2008 04:25 PM

Strange, I don't know.
I should look at the Makefile.

You execute the commands with sudo so it's not a permission problem.

Maybe I'll have a look at the Makefile.
If I do I will let you know.

hoes 05-28-2008 06:49 PM

Okay, I ran your commands too. But found no problem.
Could you maybe extract the file xt_CONNMARK.h from the archive and then try the make command again?
I guess that could do the trick because, I presume the file was accidentally deleted before.

dracayr 05-29-2008 03:41 AM

I have the same problem :(

EDIT: your solution worked :) Although I have no Idea why the xt_CONNMARK.h file wasn't working (it was present)


smoochie 05-31-2008 02:29 PM


Originally Posted by hoes (Post 3167513)
Could you maybe extract the file xt_CONNMARK.h from the archive and then try the make command again?

I'm kinda slow so could you explain where this file is located? What archive are you referring to?

dracayr 06-02-2008 09:39 AM

always consult google first :)
a quick google search reveals: the file is located at

Linux/include/linux/netfilter/xt_CONNMARK.h in the linux-headers archive

Oh, and of course it's the file you got the error with, and it's location is in the error message too.


gerald_M2B 06-02-2008 02:32 PM

dracayr> Oh, and of course it's the file you got the error with, and it's location is in the error message too.

No, its location is not in the error message, due to the insertion of "usr/" within the path.
make[3]: *** No rule to make target `/mnt/lfs/sources/linux-', needed by `/mnt/lfs/sources/linux-'. Stop.

What is the arch that is not working?
Since the error message has a different path than the actual sources, it suggests that the problem is in the kernel build process or the sanitizing of the C headers.


smoochie 06-05-2008 08:40 PM

Really weird, I started over and now I can't even prepare Binutils for compilation:


smoochie@smoochie-desktop:/mnt/lfs/sources/binutils-build$ sudo CC="gcc -B/usr/bin/" ../binutils-2.17/configure \
>    --prefix=/tools --disable-nls --disable-werror
loading cache ./config.cache
checking host system type... i686-pc-linux-gnulibc1
checking target system type... i686-pc-linux-gnulibc1
checking build system type... i686-pc-linux-gnulibc1
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc -B/usr/bin/
checking whether the C compiler (gcc -B/usr/bin/  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

Not sure why I keep hitting snags but at this rate I might be more successful writing my own OS from scratch :-/

hoes 06-06-2008 08:14 AM

can you compile dummy files with gcc?
try this:
Create two dummy files tot test the C and C++ compiler respectively

echo "main() {}" > dummy.c
echo "main() {}" >

No compile the files

gcc -v dummy.c
gcc -v

Post the results of the last two commands here.
And post also the content of PATH

echo $PATH
This way we can check whether the compiler works for C en C++ and whether your shell is able to found gcc.

smoochie 06-08-2008 06:26 PM

It looks like I solved the compiler problem, but the original headers_check problem is still there. Did you mean I should delete xt_connmark.h? I did so and it didn't solve it.

hoes 06-08-2008 07:34 PM

No, I meant you should try to extract it from the archive where you extracted the kernel from.
But it's strange that it is there in the first place because make thinks it not judging by the errormessage.

smoochie 06-08-2008 08:44 PM

It was already extracted with all the other files in the linux- package, so I'm not sure why that would make a difference. I'm using the LFS LiveCD using the packages included, and have read the directions in scrutinizing detail, but I still can't get past headers_check after 3 weeks of trying...

smoochie 06-10-2008 08:11 PM

Anyone have any ideas? I'm getting kinda desperate. If the directions don't work on their own custom distro, there must be something wrong with the directions. I hope I'm not the only person who can't get past headers_check :-(

All times are GMT -5. The time now is 03:34 AM.