LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cp linux-libc-headers to ??? (https://www.linuxquestions.org/questions/linux-newbie-8/cp-linux-libc-headers-to-278293/)

joirnange 01-15-2005 10:52 PM

cp linux-libc-headers to ???
 
i just download the linux-libc-headers from http://ep09.pld-linux.org/~mmazur/linux-libc-headers/

what should i do next??
i got 2 version of steps:

**************************************************************************************************
version 1:

cp -R include/asm-i386 /tools/include/asm
cp -R include/linux /tools/include

&&&&&&&&&&&&&&&&&&&&&&&&&&&&

version 2:

cp -R include/asm-i386 /usr/include/asm
cp -R include/linux /usr/include

chown -R root:root /usr/include/{asm,linux}

find /usr/include/{asm,linux} -type d -exec chmod 755 {} \;
find /usr/include/{asm,linux} -type f -exec chmod 644 {} \;
*************************************************************************************************

i tried version 1:
[root@jin linux-libc-headers-2.6.5.1]# cp -R include/asm-i386 /tools/include/asm
cp: cannot create directory `/tools/include/asm': No such file or directory

where is the tools directory??
should i use the version 2 step???
whats the difference between these 2 steps??

I am newbie..so alot of thing dono..hope some1 can guide...thanks.

__J 01-15-2005 11:13 PM

are you using a Linux From Scratch guide? For your distro theres probably a package named libc-devel or something similar you need to install.

joirnange 01-15-2005 11:45 PM

can i use the step from version 2???

cp -R include/asm-i386 /usr/include/asm
cp -R include/linux /usr/include

chown -R root:root /usr/include/{asm,linux}

find /usr/include/{asm,linux} -type d -exec chmod 755 {} \;
find /usr/include/{asm,linux} -type f -exec chmod 644 {} \;

i afraid i do something wrong......
i m using fedora core 2.

__J 01-16-2005 12:09 AM

what do you mean by version 2????

if you already have these includes (from a different version) and overwright them it could cause problems down the road. Generally, you always stick the the headers the glibc that came with the system was built against.

Why are you trying to install these anyway?

joirnange 01-16-2005 12:53 AM

i want to replace the include because i face this problem :

[root@jin iptables-1.2.9]# make KERNEL_DIR=/usr/src/linux-2.6.5-1.358/
In file included from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4.h:8,
from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4/ip_tables.h:25,
from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from extensions/libipt_layer7.c:26:
/usr/src/linux-2.6.5-1.358/include/linux/config.h:6:2: #error including kernel header in userspace; use the glibc headers instead!
Extensions found: IPv4:layer7 IPv4:recent IPv6:ah IPv6:esp IPv6:frag IPv6:ipv6header IPv6:hbh IPv6:dst IPv6:rt
cc -O2 -Wall -Wunused -I/usr/src/linux-2.6.5-1.358//include -Iinclude/ -DIPTABLES_VERSION=\"1.2.9\" -fPIC -o extensions/libipt_layer7_sh.o -c extensions/libipt_layer7.c
In file included from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4.h:8,
from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4/ip_tables.h:25,
from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from extensions/libipt_layer7.c:26:
/usr/src/linux-2.6.5-1.358/include/linux/config.h:6:2: #error including kernel header in userspace; use the glibc headers instead!
make: *** [extensions/libipt_layer7_sh.o] Error 1


After i search from Googles, i got a solution, there is :

You need the cleaned up 2.6 kernel headers maintained by
Mariusz Mazur <mmazur_at_kernel.pl> which you can download from:
http://ep09.pld-linux.org/~mmazur/linux-libc-headers/


Then i download the header and now intend to replace the into include.

So..CAN I do this after i download the header file? :

cp -R include/asm-i386 /usr/include/asm
cp -R include/linux /usr/include

chown -R root:root /usr/include/{asm,linux}

find /usr/include/{asm,linux} -type d -exec chmod 755 {} \;
find /usr/include/{asm,linux} -type f -exec chmod 644 {} \;

__J 01-16-2005 01:35 AM

you *could* but if you look at the last cc command, it is specifically telling it to link to /usr/src/linux-2.6.....
so you would have to force the compiler to link with the includes to /usr/include. again, If you replace the includes in /usr/include with those I don't know what it will break down the line if you try to compile anything else. Was iptables configure into your kernel?

joirnange 01-16-2005 02:02 AM

how to force the compiler to link with the includes to /usr/include.??(what should do)

what do u mean by : Was iptables configure into your kernel?(what command to type)

I am so sorry if i asking too many newbie question or easy question...caz i really new in linux.

Do u mind to take a look at this site??
http://www.linuxquestions.org/questi...hreadid=277739

Actually i am doing this project...
http://l7-filter.sourceforge.net/L7-HOWTO-Netfilter

but i faced the error when i try to patch the iptables.

THANKS

__J 01-16-2005 02:16 AM

ok, on the link you wanted me to look at Capt_Caveman's second link you should take a look at. The glibc headers should stay no matter what kernel you are running. ( There are a lot of "workarounds" in linux that you read (for example someone says they got it working this or that way) but some of them will break your system.

did you patch and compile the kernel already?
and what errors are you having patching iptables (what command are you using to patch)?

Don't worry about asking questions after all thats what this place is for.

joirnange 01-16-2005 02:33 AM

yes. i just download the rpm
then fire these commnad for compiling the kernel....i dono correct or not....

rpm -i kernel*.src.rpm
cd /usr/src/redhat/SPECS
rpmbuild -ba kernel*.spec

i think in compliing the kernel here....i miss something???

The error i face when i compile the iptable is :

[root@jin iptables-1.2.9]# patch -p1 < iptables-layer7-0.9.0.patch
patching file extensions/.layer7-test
patching file extensions/libipt_layer7.c
patching file extensions/libipt_layer7.man

[root@jin iptables-1.2.9]# chmod +x extensions/.layer7-test

[root@jin iptables-1.2.9]# make KERNEL_DIR=/usr/src/linux-2.6.5-1.358
In file included from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4.h:8,
from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4/ip_tables.h:25,
from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from extensions/libipt_layer7.c:26:
/usr/src/linux-2.6.5-1.358/include/linux/config.h:6:2: #error including kernel header in userspace; use the glibc headers instead!
Extensions found: IPv4:layer7 IPv4:recent IPv6:ah IPv6:esp IPv6:frag IPv6:ipv6header IPv6:hbh IPv6:dst IPv6:rt
cc -O2 -Wall -Wunused -I/usr/src/linux-2.6.5-1.358/include -Iinclude/ -DIPTABLES_VERSION=\"1.2.9\" -fPIC -o extensions/libipt_layer7_sh.o -c extensions/libipt_layer7.c
In file included from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4.h:8,
from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4/ip_tables.h:25,
from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from extensions/libipt_layer7.c:26:
/usr/src/linux-2.6.5-1.358/include/linux/config.h:6:2: #error including kernel h eader in userspace; use the glibc headers instead!
make: *** [extensions/libipt_layer7_sh.o] Error 1


[root@jin iptables-1.2.9]# make install KERNEL_DIR=/usr/src/linux-2.6.5-1.358
cc -O2 -Wall -Wunused -I/usr/src/linux-2.6.5-1.358/include -Iinclude/ -DIPTABLES _VERSION=\"1.2.9\" -fPIC -o extensions/libipt_layer7_sh.o -c extensions/libipt _layer7.c
In file included from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4.h: 8,
from /usr/src/linux-2.6.5-1.358/include/linux/netfilter_ipv4/ip _tables.h:25,
from include/libiptc/libiptc.h:6,
from include/iptables.h:5,
from extensions/libipt_layer7.c:26:
/usr/src/linux-2.6.5-1.358/include/linux/config.h:6:2: #error including kernel h eader in userspace; use the glibc headers instead!
make: *** [extensions/libipt_layer7_sh.o] Error 1


if i did something wrong...can u guide me from the beggining again??
for doing this project....( i have to pass it up next week).....:cry:

__J 01-16-2005 02:42 AM

the directions you are following are for 2.6.9 or later ( your running 2.6.5). So your either going to have to compile a new kernel (2.6.10 is the latest, available from www.kernel.org) or adjust slightly as the directions suggest ( I have no idea what to adjust but lets try it out). Without the patched kernel it will probably not work so first step is to go get the kernel source from www.kernel.org and the patch from the guide. make a directory in your home folder like /home/joirnange/kernels and download the kernel there. unzip it and cd into that folder. then we patch but first get the kernel and unpack it.

joirnange 01-16-2005 03:08 AM

I have to bring my Pc to my friend house to download the patch and kernel..caz my connection is very slow now....
so i will come to this forum again after 1 hour. will u (___J)still in this forum after an hour?
Do u mind to give me ur email address ? i afraid to loose u.......caz i got no friend to help me anymore....Thanks

__J 01-16-2005 03:11 AM

yeah I'll be around.
by the way I just patched a 2.6.10 and compiled iptables according to the guide and it compiled and installed fine (though I'm running slackware 10.0) but hopefully we can get this working.


All times are GMT -5. The time now is 08:12 PM.