fakeempire / about

openbsd first boot

posted on june 9th in openbsd

So now you have a brand new OpenBSD install and just booted it up for the first time. Let run through the basics. First things first. Read afterboot(8). Read the whole thing. Follow that link or just run man afterboot on your system. After that, here is basically what I do.

New User and Sudo

Add a new user for day to day usage. Put them in the wheel and wsrc groups then run visudo

# useradd -m -G wheel,wsrc -g users maple
# passwd maple
# visudo

You can now uncomment the following lines to give the wheel group sudo privileges.

%wheel  ALL=(ALL) SETENV: ALL

Now save the file and logout. You should now login as your newly created user. You shouldn't need to login as root anymore except in rare situations. Just use your normal user and sudo.

Keyboard

Run these and then edit /etc/wsconsctl.conf to make these changes permanent. First one gets rid of the annoying beeps and the next makes the keyboard repeat rate a bit quicker.

# sudo wsconsctl keyboard.bell.volume=0
# sudo wsconsctl keyboard.repeat.deln=40

Soft Dependencies

Enabling softdeps results in significant speedups for file create/delete operations. Modify your /etc/fstab to enable softdeps on all FFS slices. I personally don't enable them on the root partition. Just habit. Not sure if this is standard procedure. Example:

/dev/wd0e /tmp ffs rw,nodev,nosuid,softdep 1 2

Sleep Mode

To have sleep work you first need to have an DOS partition like we did in the OpenBSD Installation. We will need to format that partition and then install tphdisk to create the sleep bin file. I use su to run this. I've had issues multiple times running with just sudo. Not sure why currently. Just get permission denied errors. Didn't spend the time to hunt down that issue.

# sudo newfs_msdos -F 16 /dev/rwd0i
# sudo mount_msdos /dev/wd0i /mnt
# sudo pkg_add ftp://rt.fm/pub/OpenBSD/snapshots/packages/i386/tphdisk
# su 
# tphdisk 1527 > /mnt/save2dsk.bin
# exit

Edit /etc/rc.conf.local and add the following lines to have apmd start on boot and automatically scale the CPU to save battery when not plugged in.

apmd_flags="-A"

Now you can run zzz or just shut the lid on certain machines to put OpenBSD to sleep. It works great on my laptop. Make sure you read the apm manpage.

Reboot

That's about it for the first boot. I reboot now to have everything we just changed take effect.

# sudo shutdown -r now

© 2009 fakeempire