LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 02-12-2007, 07:52 PM   #1
Vitalie Ciubotaru
Member
 
Registered: Dec 2005
Location: Osaka, Japan
Distribution: Ubuntu Trinity
Posts: 153

Rep: Reputation: 30
Question *BSD from scratch?


My question is rather non-trivial, since none asked anything even slightly similar.

There is an interesting Linux project called Linux From Scratch (LFS) - building one's own Linux "distribution" entirely from source code. Besides educational purposes, it allows for maximal optimization possible for the given hardware. More than that their site has instructions for building linux from other OSes [including *BSD].
I wonder if anything like this is possible for BSD. I understand that BSD and Linux differ in that the former is divided into a "base system" and "add-ons" while the latter is a conglomerate of packages from different systems [well, that's basically all I know about BSD], but it is still an open source system, right? This means I can [potentially] compile it all from source code.
1. Are there any projects focussed on building [or cross-building] BSD from source? My google searches didn't yield anything. Maybe I don't know what to search...
2. Is there anybody who tried to do something like this? I mean not just compiling binaries on Linux to be run on BSD, but compiling an entire OS.
3. My questions may sound ridiculos due to lack of knowledge in a particular area. If they are, is there a good reference on the internal structure of BSD [something that distinguishes BSD from Linux - operating system, not the kernel], on cross-building between BSD and Linux, or ...?
Thanks in advance!

Vitalie CIUBOTARU
 
Old 02-12-2007, 07:59 PM   #2
vermaden
Member
 
Registered: Jan 2006
Location: pl_PL.lodz
Distribution: FreeBSD
Posts: 406

Rep: Reputation: 89
check this:
http://freebsd.org/doc/en_US.ISO8859...d-from-scratch
 
1 members found this post helpful.
Old 02-12-2007, 10:03 PM   #3
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
1)
Uhm, the BSD projects themselves are focused on being able to build the system from source. In fact, many BSD users (myself included) build it from source routinely. Since all of the base system is maintained by the project, this is undeniably simplified from the steps you need to do on Linux. As the system (take NetBSD for example) is much, much smaller, you don't gain much at all by trying to strip the base down. Still, it's possible and people do it with ease (for embedded platforms).

So, the very structure of the system makes the need for a project to do it unnecessary. BSD from scratch is the default starting point. And it's so easy that it can be managed with very few commands and patience.

2)
Like I said above... the projects exist in this state by default. Someone trying to do it again would only make it harder... since it can't get much easier (on NetBSD it's done with one command -- well repeated a couple times but still it's the same basic command you just control the steps).

3)
Read the documentation for the projects. Each project answers this question very well in their own documentation. But I've pretty much said it above. You just need the specific steps for each project. In particular, check out NetBSD as they have turned the question your asking into a fine art. You can build the entire system from source on any OS which provides standard POSIX utilities... this includes Linux, Solaris, Irix, or even in cygwin on Windows... all with the same ease as on a native NetBSD system. The entire build procedure is cleaned up and standardized. In fact, you can build a sparc distribution of NetBSD on an i386 Windows machine without any more thought than typing the command.

Edit: I have a feeling you'll end up disappointed with how easy this is. It's trivial to do it... so it's not like you "accomplished" a Herculean task when you do it. Most of your time will be spent watching code compile and wondering, "It can't possibly be this easy... could it?!"

Last edited by frob23; 02-12-2007 at 10:10 PM.
 
1 members found this post helpful.
Old 02-19-2007, 03:09 PM   #4
Vitalie Ciubotaru
Member
 
Registered: Dec 2005
Location: Osaka, Japan
Distribution: Ubuntu Trinity
Posts: 153

Original Poster
Rep: Reputation: 30
Thank you guys,

I followed your advices and there's indeed a lot of things I was wrong about. I even managed to cross-compile NetBSD. Now I'm trying to make it work - the kernel gets loaded (I'm using GRUB), it finds the partition (after I tell it), finds "/sbin/init" and stops since there's nothing "init" is supposed to load...
It looks like BSDs are differ from each other much more, than different Linux distros, right?
They even use different partition types and filesystems. BTW, which uses which - I put my NetBSD on ext2fs and it seems to be fine. I read something about UFS, FFS, UFS2(?) but didn't understand too much.
How does one create a native NetBSD filesystem from within Linux?
 
Old 02-21-2007, 08:25 PM   #5
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
I've replied to this on the other site (bsdforums) but I'll repeat it here. The problem is most likely that the kernel has no way of finding the root partition. If you understand the boot process you know that it has no way of knowing this information. You really should have a proper NetBSD partition. Luckily, you can build pretty much all the tools you need (including an installation kernel you can boot just like you're doing) and install from inside it. Just don't format the partition you have the sets on.
 
1 members found this post helpful.
  


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
LXer: Review: PC-BSD brings BSD to the desktop LXer Syndicated Linux News 0 02-14-2006 05:16 PM
LXer: PC-BSD : A user friendly BSD flavor geared for the desktop LXer Syndicated Linux News 0 02-04-2006 03:01 PM
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:53 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