»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 08-07-2003, 04:53 PM   #1 (permalink)
Registered User
 
hav0c's Avatar
 
Join Date: Oct 2001
Location: TN, USA
Posts: 233
hav0c is on a distinguished road
Compile a linux kernel on FreeBSD?

Ok at home I have a Win2K box, a freeBSD box, and a computer being used as a router running Smoothwall. What I want to do is add some options to my smoothwall box, but to do that I need to compile a new kernel. Smoothwall does not have gcc installed on it, and installing it on a firewall would be sorta a bad idea. So what I want to know is can I compile a linux kernel on my FreeBSD box and then send it to the smoothwall box?

Thanks.

hav0c is offline   Reply With Quote
Old 08-07-2003, 04:56 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
no.. they're completely different

Thats like compiling IRIX on a Mac OSX essentially.

Yes they're both *nixes but the kernels are very different and GCC compiles for a specific kernel

I could be wrong, but gonna guess I'm right
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 08-07-2003, 05:18 PM   #3 (permalink)
Registered User
 
hav0c's Avatar
 
Join Date: Oct 2001
Location: TN, USA
Posts: 233
hav0c is on a distinguished road
Well I searched google.. didn't come up with much.. found this
http://www.linuxquestions.org/questi...threadid=28973

But if it is possible, how? I've compiled FreeBSD kernels many times but never the linux kernel. BTW IRIX and MacOSx run on differnet CPU architectures, but FreeBSD and Linux both run on the x86 architecture so it doesn't seem so impossible.
hav0c is offline   Reply With Quote
Old 08-07-2003, 11:58 PM   #4 (permalink)
Registered User
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Champaign, IL
Posts: 3,253
jkrohn is on a distinguished road
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
Two things.

What is proposed in that thread is different than what you want to do.

The linux kernel will compile on FreeBSD. It will compile with no problems probably. Now when you try to transfer it over (You realize all the copies you have to make right?) it is VERY likely not going to work.

Just take a look at normal binary kernel files for linux.
1) There is no cross distro binary. You can find kernel binary packages for each specific distro, but no crosses. This is for systems running the same kernel! Let alone compiling it on on a FreeBSD system and running it on a linux system. Try this with any semi-complicated program and it is not going to work, let alone something as complicated as the kernel.

I have never tried it, and have never heard of anyone trying it. Everything I know tells me that you will not be able to get it to successfully work once you move it over.

Perhaps you should dig around smoothwall for how they suggest upgrading the kernel? They have to have some method right?

Jkrohn
__________________
Jkrohn
jkrohn is offline   Reply With Quote
Old 08-08-2003, 05:07 AM   #5 (permalink)
Registered User
 
strangerstill's Avatar
 
Join Date: Oct 2001
Posts: 1,565
strangerstill is on a distinguished road
The biggest problem is that FreeBSD and Linux use different executable formats - Linux uses ELF and FreeBSD uses (something else)

It might be possible to get gcc on a FreeBSD box to compile ELF binaries (not sure), and at least the architectures are the same (btw compiling e.g. PowerPC binaries on an x86 system is not that difficult, it's called cross-compiling and is something that gcc is quite good at)

There are problems though. For one, the Linux kernel expects the GNU toolchain (make, sed, etc). Also you will have trouble with glibc headers etc.

Solutions - simplest: can you install gcc on the router and then remove it once the new kernel is done? Else, how about booting from a Knoppix CD or a Gentoo LiveCD (assuming that those contain all required headers, I'm not sure)
strangerstill is offline   Reply With Quote
Old 08-08-2003, 05:09 AM   #6 (permalink)
Registered User
 
strangerstill's Avatar
 
Join Date: Oct 2001
Posts: 1,565
strangerstill is on a distinguished road
Ah, I found this: http://lists.debian.org/debian-hurd/.../msg00062.html

It talks about compiling the Hurd rather than the Linux kernel, but much should be similar (yeah, right)
strangerstill is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 09:30 PM.