[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build OpenBSD on Linux
Joe Cao <caoco2002@yahoo.com> writes:
> Date: Wed, 11 Feb 2004 22:09:03 -0800 (PST)
> From: Joe Cao <caoco2002@yahoo.com>
> Subject: build OpenBSD on Linux
> To: misc@openbsd.org
>
> Hello,
>
> Can I build OpenBSD on a Linux platform? How to setup the environment?
>
> Thanks!
>
> Joe
> Yahoo! Finance: Get your refund fast by filing online
>
>
I'm going to disagree with the majority and say "yes" (but you probably
won't want to.)
Francisco's (and BSW's) approach (vmware/bochs) is doable, but I think
cheating. Sure you can do that, but it's going to be really slow,
because all you've really done is create very slow openbsd hardware.
You're better off getting real hardware if possible.
The "right" way to do this is to build it using a combination of native
linux tools and the openbsd source itself. For inspiration, you might
look at linux-from-scratch, gentoo, etc. It is going to be a much
harder process, because the openbsd build system assumes it's running
on openbsd and there will be various important bits that will break.
It won't be impossible because openbsd is written to be more or less
standards compliant, linux is more or less standards compliant, and
therefore, 98% of the code will just work. It's the remaining 2%
that's going to be a pain.
Probably the hardest parts will be the beginning and the end. At the
beginning, you'll need to build an openbsd tool chain using linux.
That means pieces like the compiler, linker, assembler, etc. OpenBSD
does use Gnu source for much of this, but there are changes both
trivial and subtle, and you can't just swap one for the other. At the
end, you'll be doing things like building filesystems, boot blocks, and
generally handling install issues. There are several approaches here
(ext2fs obsd boot floppy, standalone ufs mkfs, fix linux ufs support,
etc.) and they'll all be hard work. You'll probably find it handy
to install openbsd on a 2nd system simply in order to test bits
of your build process as you get them.
The first question to ask is "why"? If you are just doing this as a
bootstrap effort, stop now. Install openbsd and go from there. It
works, works well, and does not require the expenditure of any brain
cells or alcohol.
If you are doing this from a purist "standards" / "security" angle,
then you have much hard work in front of you, and you may not wind up
with useable results, but it should be rewarding and interesting.
You'll certainly get a "from-the-ground-up" appreciation of just where
linux & openbsd differ, and you'll get a very comprehensive education
as to what's in openbsd and how it all fits together. From the
security stand-point, the interesting background is there's an early
Unix paper which discusses planting a trojan horse in the C compiler
that places code in the compiler and /bin/login that's not visible
simply by auditting the code. If you can compile openbsd purely from
auditted source and independently derived binaries, then you can make
the assertion that openbsd doesn't have such a trojan horse. So, from
the standards angle, you'll get a document that says "here's where
openbsd and linux" differ. That's probably the most valuable thing you
can make for others. From the education angle, you'll learn. No
direct value to others, but could be of great value to you. From the
security point, well, it's all theoretical, so won't be of interest to
OpenBSD per se. But it might make a great academic paper.
-Marcus Watts