Alternatively, you can try to overwrite the existing Ports tree with the Ports tarball on the OpenBSD source code disc assuming you bought the official CD set, but that's kind of hacky a
Trang 1It may be necessary to delete the old iwi-firmware package before you install the new one If so, use pkg_delete to get rid of it
4.2.4 Adding a new mrouted user
mrouted, the multicast router daemon, has changed to the point that it needs a new user account To create it, run this command:
useradd -u87 -g=uid -c"DVMRP Daemon" -d/var/empty -s /sbin/nologin _dvmrpd
4.2.5 Upgrading the Ports tree
Upgrading your Ports tree is best done through CVS Alternatively, you can try to overwrite the existing Ports tree with the Ports tarball on the OpenBSD source code disc (assuming you bought the official CD set), but that's kind of hacky and can lead to a lot of trouble if you have many programs installed through Ports
To update the Ports tree using CVS, follow this process:
1 First you need an anonymous CVS mirror near you to pull files from
There's a complete list at this address:
http://www.openbsd.org/anoncvs.html#WHICH
2 Next, get to the Ports directory: cd /usr/ports
3 Finally, use CVS to update the Ports tree (this mirror address is just an
example; use a mirror close to your location and substitute it for this one):
4 cvs -d anoncvs@anoncvs1.usa.openbsd.org:/cvs update -PdrOPENBSD_4_0
4.2.6 Upgrading your installed programs
Now that you've upgraded the Ports tree, you're in a better position to update your installed programs A recent addition to the pkg_add command is the ability to upgrade packages So if you've installed all of your programs through the pkg_add command, or by auto-fetching packages through the Ports tree, use this command
to upgrade your software and all of its dependent packages:
pkg_add -ui -F update -F updatedepends
Trang 2If there are any questions as to which package versions to upgrade from or to, you'll be asked to choose from a list
4.2.7 Upgrading the base system source code
If you installed the OpenBSD base system source code into /usr/src, it'll have to be replaced If you installed the source because you wanted to compile a custom
kernel, you probably want to save that kernel config as well Instead of deleting the /usr/src directory, it would be a better idea to overwrite it with the new source, which would keep your previous kernel configuration file in place It's a pretty simple operation:
1 Mount CD 3 from the official OpenBSD CD set, or download src.tar.gz from
an OpenBSD FTP mirror
2 Change to the /usr/src directory:
3 cd /usr/src
4 Unpack the tarball (your location may vary):
5 tar zxvf /mnt/cdrom/src.tar.gz
4.2.8 Recompiling your old custom kernel
This should be pretty simplejust do what you did last time you compiled the kernel Here's a refresher:
You need the updated OpenBSD source code first, so if you didn't go through the previous section on performing this procedure, scroll up and do it now
1 Navigate to the right directory (change i386 to amd64 if that's what you installed):
2 cd /sys/arch/i386/conf
Trang 33 Run config on it (MYKERNEL is the sample kernel config file):
4 /usr/sbin/config MYKERNEL
5 Change to the compile directory:
6 cd /compile/MYKERNEL
7 Then run this:
8 make depend
9 Then:
10 make install
You're all set: restart the computer to load the new kernel
Chapter 5 Post-Install Configuration
Now that you've got OpenBSD installed, it's time to start configuring it Let's start from the beginning with your first experience with the operating system after installation's over
5.1 First Boot in OpenBSD 4.0
The boot loader will pause briefly in case you want to load an alternate kernel If you can't wait the few seconds, press Enter to skip it
When you get to the login prompt, log in as root and put in your root password You'll be greeted with a paragraph of welcome text and a new mail notification If you are asked for your terminal type, type in pcvt25 and press Enter Go ahead and read the welcome message, then type in mail and press Enter to read the email You'll see a list of messages come up, but really there is only one right now, from Theo de Raadt To read it, type more 1 (that's the number one) and press Enter
Trang 4As you'll see, the email is a welcome message from the OpenBSD project leader Press the spacebar to scroll down to the next page of text It's not terribly long, but
it does tell you some basic information about OpenBSD that you'll find helpful, including a suggestion to read the afterboot manpage When you're done, you
should see a & prompt Type x and press Enter to quit the mail program, then type man afterboot to read a more in-depth introduction to OpenBSD
5.2 Creating User Accounts
For reasons of safety and security (mostly to prevent yourself from doing any
serious damage to your own operating system), it's best to create a user account to work from If necessary, you can switch to root permissions from within that
account by using the su command (the user must be a member of the wheel group
to do this)
The command that you would use on most Unix-like operating systems is useradd
If you're already familiar with this command and how to use it, go ahead and run it
If you have several user accounts to add, or would like a simpler utility for adding users, OpenBSD has a neat little script called adduser The first time you run
adduser, you are asked to set the default user parameters After those are set, you'll
be able to initialize a new user account So let's get started: type adduser and press Enter
Go ahead and put in the default user account settings If you don't know what to put in here, just press Enter to accept the defaults Once those are set, you'll be asked for a username and user-specific settings Go ahead and put them in as they appear When you're asked to invite the user to other groups, you will probably want to type in wheel here, as that's the group that allows a user to switch to root permissions If you do not want this user to be able to gain root access (if it's an account for someone else other than you, for instance), then don't invite them to the wheel group
At the end of the procedure, you'll be asked to verify the account settings you just entered After you approve them, the account will be created, and that user will be able to log in
5.3 A Quick Introduction to the vi Editor
The default editor in OpenBSD (and most other Unix-like operating systems) is vi It's a little old and archaic, and requires time and determination to learn to use it effectively If you want to learn more about it, install the Vim package from the
Trang 5OpenBSD Ports tree later on (Vim is an improved version of vi) and go through the in-program tutorial For now, though, you just need to know how to use it Here's a list of basic commands:
Press i to enter insert mode, which allows you to type and erase text
Press Escape to exit insert mode
Press colon (:) and then type w and press Enter to save a file, as in :w
Press the d key twice to delete a line
Press the / key and then enter a search string to perform a search
Press the o key to skip to the next line, insert a line break, and enter insert mode
Type in :q and press Enter to quit vi
To save and then quit, type :wq and press Enter
To quit without saving, type :q! and press Enter
Remember to exit insert mode before you try to execute other commands
5.4 Customizing the Terminal
Even if you're eventually going to end up controlling this machine remotely
through OpenSSH, or if you're going to be running a graphical desktop
environment, you still have some configuration work to do from the terminal Wouldn't it be helpful to adjust your key repeat rate and maybe add some color output to your screen? This section is entirely optional, but you will likely find it helpful
5.4.1 Changing the terminal type
The default VT220 terminal emulator is not able to display color, and it's difficult
to see what you're doing in command-line text editors when you can only see black and gray Fortunately this is a setting that can easily be changed; just follow this process:
1 Change to the home directory of the user whose terminal type you want to change (remember that root's home directory is /root):
2 cd /home/user/
3 Now edit the profile configuration file with vi or your preferred text editor
4 Add this line above the PATH statement: