afterboot-openbsd.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <!DOCTYPE html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /><meta name="keywords" content="GNU, Emacs, Libre Software, Hurd, Guile, Guix" /><meta name="description" content="GNUcode.me is a website focusing on libre software projects, especially the GNU project." /><link type="application/atom+xml" rel="alternate" title="GNUcode.me -- Feed" href="/feed.xml" /><a rel="me" href="https://fosstodon.org/@thegnuguy"></a><link type="text/css" href="css/footer.min.css" rel="stylesheet"></link><link type="text/css" href="css/header.min.css" rel="stylesheet"></link><link type="text/css" href="css/main.min.css" rel="stylesheet"></link><title>Afterboot OpenBSD — GNUcode.me</title></head><body><header><nav><ul><li><a href="index.html">GNUcode.me</a></li><li><a href="services.html">Services</a></li><li><a href="about.html">About</a></li><li><a href="business-ideas.html">Business-ideas</a></li></ul></nav></header><h1>Afterboot OpenBSD</h1><main><section class="basic-section-padding"><article><h3>by Joshua Branson — April 28, 2023</h3><div><h1>set up doas</h1><p>Let’s make any user that is in the group “wheel” able to execute privledged
  2. commands.</p><pre><code># cat /etc/examples/doas.conf | sed 's/keepenv/persist keepevn/' &gt; /etc/doas.conf</code></pre><h1>install packages</h1><pre><code># pkg_add emacs dino netsurf dino git fish mpv firefox gpg \
  3. hack-fonts pkg_add isync evince libreoffice xfce4-terminal \
  4. xfce4-screenshooter xfce4-dict i3</code></pre><p>When I installed isync, I got a message that said,
  5. the following rcscripts were installed: /etc/rc.d/saslauthd
  6. apparently openbsd’s packaged isync, lets you set up a daemon to periodically
  7. fetch your email. looking at the file, I’m not sure what it is.</p><p>Well I could list all of the packages that I minually installed, it is actually
  8. much easier to create a list of packages.</p><pre><code>pkg_info -mz | tee openbsd-pkg-list</code></pre><p>Now, when I want to re-install those packages I can just do this:</p><pre><code># pkg_add -l list</code></pre><h1>clone my various repos</h1><pre><code>cd ~/
  9. git clone https://notabug.org/jbranso/prog
  10. cd prog
  11. mkdir -p gnu/guix/
  12. cd gnu/guix
  13. git clone https://notabug.org/jbranso/guix
  14. mv guix guix-src
  15. git clone https://notabug.org/jbranso/guix-config</code></pre><h1>update my OpenBSD install</h1><p><code># doas syspatch</code></p><h1>enable softupdates</h1><p>Unless you are using really old ancient hardware, you should enable softupdates.</p><p>change</p><p><code>43434930490.a / ffs rw 1 1</code></p><p>to</p><p><code>43434930490.a / ffs rw,softdep 1 1</code></p><h1>window manager stuff</h1><h2>modify my ~/.xsession</h2><p>auto start xfce, prefer utf-8, set up a background color, and lock X after some
  16. inactivity.</p><pre><code>cat ~/.xsession
  17. # prefer UTF-8 whenever possible
  18. export LC_CTYPE=&quot;en_US.UTF-8&quot;
  19. # use UTF-8 everywhere
  20. export LANG=en_US.UTF-8
  21. # specify location of kshrc
  22. export ENV=$HOME/.kshrc
  23. # set your background color
  24. xsetroot -solid dimgray
  25. xidle -delay 5 -sw -program &quot;/usr/X11R6/bin/xlock -mode flag&quot; \
  26. -timeout 300
  27. exec i3</code></pre><h2>set up polybar for i3</h2><p><a href="https://forum.endeavouros.com/t/tutorial-easy-setup-endeavour-xfce-i3-tiling-window-manager/13171">https://forum.endeavouros.com/t/tutorial-easy-setup-endeavour-xfce-i3-tiling-window-manager/13171</a></p><pre><code># doas pkg_add polybar
  28. $ mkdir ~/.config/polybar
  29. $ cp /usr/local/share/examples/polybar/config ~/.config/polybar</code></pre><p>This <a href="https://github.com/polybar/polybar/wiki/Fonts">wiki page</a> has a lot of details about setting up fonts.</p><p>More information is in my <a href="https://notabug.org/jbranso/openbsd-home/src/master/.config/polybar">polybar config</a>.</p><h1>If this is a laptop with a battery, then install this</h1><p><a href="https://dataswamp.org/~solene/2022-03-21-openbsd-cool-frequency.html">https://dataswamp.org/~solene/2022-03-21-openbsd-cool-frequency.html</a></p><pre><code># doas pkg_add obsdfreqd
  30. # rcctl enable obsdfreqd
  31. # rcctl stop apmd
  32. # rcctl disable apmd
  33. # rcctl start obsdfreqd</code></pre><h1>set up doom emacs</h1><p>(I also need to ensure that <code>~/prog/gnu/guix/</code> exists because my emacs looks for
  34. some guix snippets).</p><pre><code>git clone --depth 1 https://github.com/doomemacsdoomemacs ~/.config/emacs
  35. ~/.config/emacs/bin/doom install</code></pre><p>add doom emacs to path</p><pre><code>cat ~/.profile
  36. # $OpenBSD: dot.profile,v 1.8 2022/08/10 07:40:37 tb Exp $
  37. #
  38. # sh/ksh initialization
  39. #
  40. PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/home/joshua/.config/emacs/bin
  41. export PATH HOME TERM</code></pre><h1>copy my ~/ config files</h1><p>cp .authinfo.gpg, .ssh, .mbsyncrc, .gnupg/</p><p>cp documents to ~/</p><h1>import my gpg keys from my usb stick.</h1><p><code>gpg --import ./dismail.de.gpg.key.asc</code></p><p><code>git config --global commit.gpgsign true</code></p><p><code>gpg --list-secret-keys --keyid-format=long</code></p><p>Copy the really long alphanumeric word from the above command. It'll
  42. look something like:</p><p>62A42A3CC13497D626FZ686C750BCFEF3A5E1572</p><p><code>git config --global user.signingkey &lt;your alphanumeric word&gt;</code></p><h2>set up pinentry</h2><pre><code>pkg_add pinentry-dmenu</code></pre><p>There are two things that you need to do to set up pinentry-dmenu, so that when I
  43. need to sign commits or decrypt stuff, the pinentry-dmenu popup happens.</p><ul><li><p>set up gpg agent</p><pre><code>cat ~/.gnupg/gpg-agent.conf
  44. pinentry-program /usr/local/bin/pinentry-dmenu
  45. default-cache-ttl 3600</code></pre></li><li><p><code>man gpg-agent</code> says to do this:</p><pre><code>You should always add the following lines to your .bashrc or whatever
  46. initialization file is used for all shell invocations:
  47. cat ~/.profile | grep GPG_TTY
  48. GPG_TTY=$(tty)
  49. export GPG_TTY</code></pre></li><li><p>start a dbus session</p><p>This is only needed if you want to use pinentry-gnome3</p><pre><code>cat ~/.xsession | grep dbus
  50. # start a dbus session, which I believe gpg needs to for graphical pinentry
  51. # I found this command in /usr/local/share/doc/pkg-readmes/dbus
  52. if [ -x /usr/local/bin/dbus-launch -a -z &quot;${DBUS_SESSION_BUS_ADDRESS}&quot; ]; then
  53. eval `dbus-launch --sh-syntax --exit-with-x11`</code></pre></li></ul><p>If you have difficulty getting pinentry to work, here are some steps to
  54. manually get pinentry to work:</p><p>in a fish terminal a type in:</p><pre><code>gpgconf --kill gpg-agent
  55. set GPG_TTY $(tty)
  56. export GPG_TTY
  57. git commit -m &quot;my commit message&quot;</code></pre><h1>change <code>/etc/motd</code></h1><p>I once set an invalid option up in /etc/fstab that threw me in a root shell with
  58. only root mounted. All of a sudden vi would not work. That below command is
  59. how to fix it: <code>export TERM=vt200</code></p><pre><code>cat /etc/motd
  60. OpenBSD 7.2 (GENERIC.MP) #7: Sat Feb 25 14:07:58 MST 2023
  61. Welcome to OpenBSD: The proactively secure Unix-like operating system.
  62. Please use the sendbug(1) utility to report bugs in the system.
  63. Before reporting a bug, please try to reproduce it with the latest
  64. version of the code. With bug reports, please try to ensure that
  65. enough information to reproduce the problem is enclosed, and if a
  66. known fix for it exists, include that as well.
  67. If you are having trouble using vi in the console try this:
  68. export TERM=vt200;</code></pre><h1>install haunt on OpenBSD</h1><p><code>doas pkg_add guile info</code></p><p>First install guile-commonmark:</p><pre><code>$ cd ~/prog/guile
  69. $ git clone git clone https://github.com/OrangeShark/guile-commonmark
  70. $ cd guile-commonmark
  71. # export AUTOCONF_VERSION=2.71
  72. # export export AUTOMAKE_VERSION=1.16.5
  73. # doas pkg_add autoconf automake</code></pre><p>Why am I seeing 2 aclocal binaries? No idea.</p><pre><code>ls /usr/local/bin/aclocal*
  74. ls /usr/local/bin/automake*
  75. /usr/local/bin/aclocal
  76. /usr/local/bin/aclocal-1.16
  77. /usr/local/bin/automake
  78. /usr/local/bin/automake-1.16</code></pre><p>Arsen on irc helped me figure out the next incantation.</p><pre><code>AUTOMAKE=automake-1.16 ACLOCAL=aclocal-1.16 ./bootstrap
  79. ./configure
  80. make
  81. make check
  82. # make install</code></pre><p>Now let’s install haunt</p><pre><code>git clone https://git.dthompson.us/haunt.git
  83. cd haunt
  84. AUTOMAKE=automake-1.16 ACLOCAL=aclocal-1.16 ./bootstrap
  85. ./configure
  86. make
  87. make check
  88. # make install</code></pre></div></article></section></main><footer><p>© 2020 Joshua Branson. The text on this site is free culture under the Creative Commons Attribution Share-Alike 4.0 International license.</p><p>This website is build with Haunt, a static site generator written in Guile Scheme. Source code is <a href="https://notabug.org/jbranso/gnucode.me">available.</a></p><p>The color theme of this website is based off of the famous <a href="#3f3f3f" target="_blank">zenburn</a> theme.</p></footer></body>