[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new FAQ version!




There will be an HTML version of this soon.

-Jon

OpenBSD New User FAQ Version .2 by Jonathan Katz: jkatz@openbsd.org

These are a few of the questions that seem to be asked every so-often on
the mailing list. This is very early in the making for such a document, so
if it doesn't contain what you are looking for, please ask and feel free
to contribute. This document DOES NOT cover the installation process.

Please note this was entirely written in vi and occasionally spell
checked using ispell. People on the misc@openbsd.org mailing list as
well as the newsgroups have volunteered to convert this document into
SGML and HTML.

Sections:

1) Non-standard hardware, my GENERIC or INSTALL kernel won't boot OR 
	"I can't get my hardware to work."
2) Virtual Consoles
3) How to compile a kernel
4) Getting source code
5) Rebuilding my system
6) Ethernet quirks
7) Problems loading X11 (XFree86)
8) Finding other software (ports).
9) Where do I get my OpenBSD 2.1 CD?
10) disklabel and fdisk
11) Miscellany (HELP!)

-------------------------------------------------------

1) My foobar 1230 SCSI adapter (or other peripheral) has a non-standard
irq and doesn't work with the GENERIC or INSTALL kernels! 

Yes it does. With a little tinkering and patience, anything can be
accomplished.  At the OpenBSD boot prompt type "-c". IT should look
something like this: 

[OpenBSD boot Rev. 1.0a]
boot>> -c

You will eventually get a 'UKC>' prompt. Here you can type "list" and list
all the devices that are compiled into this kernel. Once you find the name
of the device you'd like to change, type "change devicename". UKC will guide
you through the different attributes of the device that can be configured.
Once you are finished adding the necessary configurations, you'll be back at
the UKC> prompt. At the prompt type "quit" and your machine will continue to
boot, with the updated info.

In addition, other device drivers (sound cards, etc) that are compiled
into the kernel may conflict with other drivers. If your kernel locks up
during the boot process take note of the device that it failed on. Try
disabling that device, or the one FOLLOWING it when you do your "list"
at the "UKC>" prompt. 

2) How do I get virtual consoles?

To start, virtual consoles are only supported on the i386 port. The
default GENERIC kernel (the one you normally get after doing an install)
has support for virtual consoles compiled in. If you are using an
older GENERIC kernel, or a different kernel, support for "vt0" (the
kernel device that controls virtual consoles) may not be included. If
you are using the 2.1 release GENERIC kernel, you will have virtual
consoles enabled.

On the 2.1 CD and FTP sites, the GENERIC kernel does not use virtual
consoles. You must recompile the kernel commenting out the line that 
says "pc0" and uncommenting the line that says "vt0." For more information
on compiling a new kernel, read on.

2.1) Now that I know I have virtual consoles, how do I use them?

Unlike Linux, you need to hit cntrl+alt+fn to swap from console to
console. By default (with the files in /dev from your install, and a newly
compiled kernel with vt0 support)  you have four (F1 through F4) virtual
consoles. If you make more ttyC devices in /dev (cd /dev; MAKEDEV ttyC4;
MAKEDEV ttyC5;  MAKEDEV ttyC6; MAKEDEV ttyC7;) and edit /etc/ttys so that
all the tty's are on, you will have a standard 8 virtual consoles. 

3) How do I compile a kernel?

Kernels can be compiled in under 9 steps (WOW!) 
1) get the source code VIA FTP, CTM, or CVS (skip to CVS section if need be)
2) cd /usr/src/sys/arch/(your_machine_type)/conf
    NOTE: (your_machine_type) will vary with what kind of
	processor you use. On my VAX 3400, it would be:
		/usr/src/sys/arch/vax/conf
	On my P5/100 it would be:
		/usr/src/sys/arch/i386/conf
	On my Sparc IPC it would be:
		/usr/src/sys/arch/sparc/conf
3) edit a config file to your liking and save it as a new name. 
	(vi GENERIC; :w NEW_KERNEL_NAME :q)
	Things to keep in mind:
		Make your kernel name snazzy (you don't HAVE to do that).
		Most people keep their kernel names in caps (general
			convention).
4) type "config NEW_KERNEL_NAME"
	If all goes according to plan it will tell you to 
	"don't forget to make depend!" If config chokes on 
	your file, look at what it says and play with your 
	configuration until you get it right.
5) cd /usr/src/sys/arch/(your_machine_type)/compile/NEW_KERNEL_NAME
	NOTE: config makes that DIRECTORY "NEW_KERNEL_NAME" all by
	itself.
6) make depend ; make
7) su (if not root already); cp /bsd /bsd.old; cp bsd /bsd 8) shutdown/reboot your system.  9) Enjoy your custom kernel :-)

4) How do I get source code?

OpenBSD source code is obtained VIA CVS, FTP or CTM. If you've ftp'd the
distribution of OpenBSD, it should be pretty simple for you to figure out
how to FTP the source. CTM is covered in its own document on the WWW
server. As for CVS, here is your crash course.  I've found that getting
code VIA CVS is fast, easy, and means you get newer/better/bugfixed code. 

NOTE: For example purposes I'm using anoncvs.openbsd.org which is a few
miles of fiber away from me in the United States. You may want to pick a
nearer cvs site for you to use (especially if you are downloading the
tree, as downloading OpenBSD's powerful crypto from the States to sites in
Europe breaks various laws). See the OpenBSD WWW sites for a cvs mirror
close to home. If these instructions are not working for you, please skip
to the section that talks about the "pserver" that has been set-up in
order to alleviate the headache of a proxy/firewall that may be causing you
some grief.

INITIAL USE:
cd /usr
setenv CVSROOT anoncvs@anoncvs.openbsd.org:/cvs
cvs -z 9 -q get -PA src

UPDATE USE:
cd /usr/src
setenv CVSROOT anoncvs@anoncvs.openbsd.org:/cvs
cvs -z 9 -q up -PAd 

"pserver" WORK-AROUND:
cd /usr
setenv CVSROOT :pserver:anoncvs@anoncvs5.usa.openbsd.org:/cvs
cvs login
<type any password, it will return ok...work>
cvs -z9 -q get src ..

[From: Todd Miller... millert@openbsd.org]

A quick explanation of the flags:
"-z 9"  turns on compression-- the same as "gzip -9"
"-q"	makes it quiet, as CVS can generate a lot of output
"-d"	will create and update new directories if your tree does not have
		them
"-P"	prunes out old directories
"-A" 	resets sticky tags

5) How do I rebuild my system?

Depending on what version system you have and what version source you
have, it can be as easy as four steps, and as lengthy as 22. If
you have a 2.1 CD (or downloaded 2.1) and are using "-current"
sources, you should be able to recompile in 4 steps. In order to get 2.1
(and later) versions to compile on a 2.0 based system, things get a little
tricky.

5.1) "The Four Steps" (as opposed to the Four Questions)

If you want to be risky, you can just try doing a "make -k build" in
/usr/src-- the four steps below follow a prudent guideline for making
a new system.

1) cd /usr/src/share/mk; make install
2) mkdir /usr/obj; cd /usr/src; make obj
3) make -k build && make install
4) make cleandir

A quick explanation:
1) "fixes" Makefiles and make (if broken, which sometimes happens)
2) makes the directory for objects, then makes the objects
3) builds the entire system. "-k" is a flag to make that tries to have
	make progress if there are any errors. "make build" also builds
	the dependencies. "make install" makes SURE it gets installed--
	"make build" is supposed to do the installing.
4) this cleans up the source tree (deletes out extra binaries, etc)

5.2) The long version. These are very detailed instructions given to
misc@openbsd.org from Marco Hyman. If you aren't too paranoid, you can 
actually skip some of the stuff in there, at your own risk. Please read 
through carefully. If you aren't careful, you can actually hose your
system up :(