Octaspire's OpenBSD configuration
Dotfiles and other configuration files to be used specifically with OpenBSD.
You MUST check that the install.sh
script is OK before running it. It will OVERWRITE files
and copy some files using SUDO.
cd OpenBSD_config
./install.sh
cd
startx
# Press CapsLock + Alt + enter
# Press CapsLock + Alt + f
git clone https://github.com/octaspire/dotfiles.git
cd dotfiles
stow tmux
stow mg
stow cwm
cd
tmux
# Press CapsLock + b and then %.
mg
# That's it.
Some highlights of the configuration:
Apache License 2.0. See the directory AnonymousPro
for the license of the TTF font.
Follow these instructions at your own risk. These instructions are not guaranteed to be correct or represent
any best practices; they work for me. Everything on the hard drive will be erased, so make backups
first and check that you can access data on those backups before starting. Also, entering a wrong device name
can cause wrong drive to be erased, if you have more than one, so check the device names and use different
names if there is a need!
Required: an empty USB flash drive, RJ45 ethernet cable, internet connection and
Thinkpad T470 or similar computer with empty hard drive.
Download OpenBSD 6.3 or newer for amd64 architecture and write it into the flash drive.
s <enter>
for shell.dd if=/dev/urandom of=/dev/rsd0c bs=1m
. Grab a coffee;fdisk -iy -g -b 960 sd0
.disklabel -E sd0
. Inside disklabel:
> a a
offset: [1024/whatever was suggested]
size: [500103386] *
FS type: [4.2BSD] RAID
> w
> q
bioctl -c C -l sd0a softraid0
. And write a new passphrase twice:Take a note of the volume name that is reported to be attached as a CRYPTO volume.
New passphrase: write_your_passphrase_here
Re-type passphrase: write_your_passphrase_here
...
softraid0: CRYPTO volume attached as sd3
cd /dev
sh MAKEDEV sd3
. Use the device name reported by the system at step 8.dd if=zero of=rsd3c bs=1m count=1
. Use a raw device name based on the nameexit <enter>
to return to the installer.I <enter>
to start installation.us <enter>
, sv <enter>
or something else.T470 <enter>
.em0 <enter>
to configure wired network.no <enter>
to disable sshd(8).sd3 <enter>
to tell what is the root disk (use the device reported by installer as the CRYPTO volume at step 8).H <enter>
for (H)alt.syspatch
./etc/installurl
run commandecho "https://ftp.eu.openbsd.org/pub/OpenBSD" > /etc/installurl
pkg_add sudo base64 colorls cppcheck cmake coreutils feh stow the_silver_searcher ggrep git gmake gsed gnupg-2.2.4 groff firefox zathura zathura-ps zathura-pdf-mupdf sdl2 sdl2-image sdl2-mixer sdl2-ttf mu offlineimap
visudo
command to give ‘wheel’ group sudo permissions,After logging out login as your regular user (that can now use
visudo
exit
sudo
to run commands as root).git clone https://github.com/octaspire/OpenBSD_config.git
cd OpenBSD_config
./install.sh
yes
.cd
git clone https://github.com/octaspire/dotfiles.git
cd dotfiles
stow tmux
stow mg
and stow cwm
/etc/hostname.iwm0
:sudoedit /etc/hostname.iwm0
Be sure to replace text your_wlan_id_here with the name/SSID of
nwid your_wlan_id_here
wpakey your_wlan_password_here
dhcp
sudoedit /etc/boot.conf
set timeout 2
, save the file and exit editor. Use longer time, if you want.doas /sbin/reboot
All done and the wireless connection should work also.
To build latest GNU Emacs, download emacs-26.1.tar.gz
, emacs-26.1.tar.gz.sig
and gnu-keyring.gpg
.
Issue commands:
gpg2 --import gnu-keyring.gpg
gpg2 --verify emacs-26.1.tar.gz.sig emacs-26.1.tar.gz # check that the signature is good.
tar xfz emacs-26.1.tar.gz
cd emacs-26.1
./configure --with-jpeg=no --with-gif=no --with-tiff=no
gmake -j4
sudo gmake install
You can make mounting of external flash drives easier by modifying file /etc/fstab
and
by adding line similar to the one below (check and use the correct device name):
/dev/sd2i /stick msdos rw,noauto
To Add a nice OpenBSD themed Desktop wallpaper, run the following commands:
curl -O https://www.openbsd.org/art/puffy/ppuf1000X907.gif
feh --bg-scale ppuf1000X907.gif
The commands above download a picture and then create a .fehbg
file..xinitrc
checks if that file exists and if it does, runs it, so the wallpaper
endures reboots.
Security features are more important in OpenBSD than
the system performance and thus some programs, for example
web browsers, might feel slow compared to other systems.
System performance can be improved, for example, by using
soft updates and ramdisk on /tmp.
Soft updates can be enabled by modifying file /etc/fstab
and using
option softdep
. For example:
... / ffs rw,softdep 1 1
Although it might be better to do this only for user partitions (?).
To use fast ramdisk for /tmp
, the previous /tmp
line in file/etc/fstab
can be replaced with this line (or with something
similar):
swap /tmp mfs rw,noexec,nosuid,nodev,noatime,-s=2G 0 0
By using other value instead of 2G
the size of the ramdisk
can be changed. Depending of the available RAM, you might
want to use a larger or smaller value.
Before the mountpoint /tmp
is mounted, the permissions
should be fixed:
# chmod 1777 /tmp
If this is not done, startx
(for example) might fail and
complaint that it cannot write into /tmp
. In this case
fixing the permissions of /tmp
and mounting it again
will fix the problem.
When updating the system (for example to follow current, or
to get a new release of OpenBSD), the (U)pgrade installer asks:
Available disks are: sd0 sd1.
which disk is the root disk?
Answer here sd1
.
xenodm(1)
can be enabled after installation with:
# rcctl enable xenodm
# rcctl start xenodm
In this case, to get the same settings that with startx(1)
(for example cwm
, CapsLock modifications, etc.)
the file .xsession
should contain the same
settings that file .xinitrc
.