Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**

Sunday, March 10, 2024

Portclippy minetest finesse

I recently discovered another option that I left out of the exposed config for my unofficial minetest-dev port.  It is not much of a task to add another option but in the process of doing it I re-read some porter's handbook documentation (https://docs.freebsd.org/en/books/porters-handbook/testing/).  I was wondering how to test for correctness and whether all my dependencies were included.  I haven't had issues with building from my Makefile, although it warns that I may be including too many dependencies, things that it might not link to anyway.  These are only warnings, they could remain as is, though why not fix them, and I noticed mention of portclippy.

I've used portlint frequently and its direction has helped me correct flaws, including the most annoying "wrong linetype" issue when I copy-paste something and it converts from tabs to spaces.  This tool, portclippy is much more visual and makes the needed adjustments much more obvious.  Below is the output I had when I ran it on the minetest-dev Makefile.  The manpage describes "The output of portclippy is inspired by unified diff(1) output.  Here RUN_DEPENDS is in the wrong position (marked with -) and should be moved to before USES (marked with +)." which means there are a lot of line moves to do.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES

-CONFLICTS

USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
+USE_SDL

# USES=cmake related variables
CMAKE_ARGS

-USE_SDL
# Conflicts
+CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
-OPTIONS_SINGLE
-OPTIONS_MULTI

-MISC_DESC

+OPTIONS_GROUP_BUILD
+OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC

-NEEDS_DESC

OPTIONS_GROUP_NEEDS

-SYSTEM_DESC

OPTIONS_GROUP_SYSTEM

-SOFTWARE_DESC

+OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
+BUILD_DESC
+CLIENT_DESC
+CURL_DESC
+DATABASE_DESC
+DEVTEST_DESC
+DOCS_DESC
+EXAMPLES_DESC
+FREETYPE_DESC
+GLVND_DESC
+GRAPHICS_DESC
+LEGACY_DESC
+LEVELDB_DESC
+LTO_DESC
+MISC_DESC
+NCURSES_DESC
+NEEDS_DESC
+NLS_DESC
+PGSQL_DESC
+PROFILING_DESC
+PROMETHEUS_DESC
+REDIS_DESC
+SERVER_DESC
+SOFTWARE_DESC
+SOUND_DESC
+SPATIAL_DESC
+SYSTEM_DESC
+SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC

-SYSTEM_GMP_CMAKE_BOOL
-SYSTEM_GMP_CMAKE_ON
-SYSTEM_GMP_LIB_DEPENDS

SYSTEM_JSONCPP_DESC

-SYSTEM_JSONCPP_CMAKE_BOOL
-SYSTEM_JSONCPP_CMAKE_ON
-SYSTEM_JSONCPP_LIB_DEPENDS

SYSTEM_LUAJIT_DESC

-SYSTEM_LUAJIT_USES

-SYSTEM_FONTS_DESC

-SYSTEM_FONTS_RUN_DEPENDS

-BUILD_DESC

-OPTIONS_GROUP_BUILD

-EXAMPLES_DESC

-EXAMPLES_CMAKE_BOOL

-DEVTEST_DESC

-DEVTEST_CMAKE_BOOL

+TOUCH_DESC
UNITTESTS_DESC

# Options helpers
-UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE_GRAPHICS

-GRAPHICS_DESC
-GLVND_DESC

-GLVND_CMAKE_BOOL
-GLVND_CMAKE_ON
-GLVND_USE
-GLVND_LIB_DEPENDS

-LEGACY_DESC

-LEGACY_CMAKE_BOOL
-LEGACY_CMAKE_ON
-LEGACY_USE

-DATABASE_DESC

-OPTIONS_GROUP_DATABASE
-OPTIONS_SUB

-CLIENT_DESC

-CLIENT_CMAKE_BOOL_ON

CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE

-SERVER_DESC

-SERVER_CMAKE_BOOL

-CURL_DESC

-CURL_CMAKE_BOOL
CURL_LIB_DEPENDS

-SOUND_DESC

-SOUND_CMAKE_BOOL

-DOCS_DESC

+CURL_CMAKE_BOOL
+DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL

-FREETYPE_DESC

-FREETYPE_CMAKE_BOOL
+EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS

-NCURSES_DESC

-NCURSES_CMAKE_BOOL
-NCURSES_USES

-LEVELDB_DESC

-LEVELDB_CMAKE_BOOL
+FREETYPE_CMAKE_BOOL
+GLVND_LIB_DEPENDS
+GLVND_USE
+GLVND_CMAKE_BOOL
+GLVND_CMAKE_ON
+LEGACY_USE
+LEGACY_CMAKE_BOOL
+LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS

-PGSQL_DESC

+LEVELDB_CMAKE_BOOL
+LTO_CMAKE_BOOL
+NCURSES_USES
+NCURSES_CMAKE_BOOL
+NLS_USES
+NLS_CMAKE_BOOL
+NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL

-REDIS_DESC

-REDIS_CMAKE_BOOL
+PROFILING_CMAKE_BOOL
+PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS

-SPATIAL_DESC

+REDIS_CMAKE_BOOL
+SERVER_CMAKE_BOOL
+SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL

-NLS_DESC

-NLS_CMAKE_BOOL
-NLS_USES
-NLS_LDFLAGS

-TOUCH_DESC

+SYSTEM_FONTS_RUN_DEPENDS
+SYSTEM_GMP_LIB_DEPENDS
+SYSTEM_GMP_CMAKE_BOOL
+SYSTEM_GMP_CMAKE_ON
+SYSTEM_JSONCPP_LIB_DEPENDS
+SYSTEM_JSONCPP_CMAKE_BOOL
+SYSTEM_JSONCPP_CMAKE_ON
+SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
+UNITTESTS_CMAKE_BOOL

-PROMETHEUS_DESC

-PROMETHEUS_CMAKE_BOOL

-PROFILING_DESC

-PROFILING_CMAKE_BOOL

-LTO_DESC

-LTO_CMAKE_BOOL
# Unknown variables
# WARNING:
# The following variables were not recognized.
# They could just be typos or Portclippy needs to be made aware of them.
# Please double check them.
#
# Prefix them with an _ or wrap in '.ifnmake portclippy' to tell
# Portclippy to ignore them.
#
# If in doubt please report this on portfmt's bug tracker:
# https://codeberg.org/tobik/portfmt/issues
+CLIENT_CMAKE_BOOL_ON
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

So it looks like I will need to scroll down to the first group of lines with the "-" prefix, and move them where the matching lines with the "+" prefix are in the file.  After quite a bit of cut and paste using vi, I have re-run portclippy for the results below.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES
USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
USE_SDL

# USES=cmake related variables
CMAKE_ARGS

# Conflicts
CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
OPTIONS_GROUP_BUILD
OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC
OPTIONS_GROUP_NEEDS
OPTIONS_GROUP_SYSTEM
OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
BUILD_DESC
CLIENT_DESC
CURL_DESC
DATABASE_DESC
DEVTEST_DESC
DOCS_DESC
EXAMPLES_DESC
FREETYPE_DESC
GLVND_DESC
GRAPHICS_DESC
LEGACY_DESC
LEVELDB_DESC
LTO_DESC
MISC_DESC
NCURSES_DESC
NEEDS_DESC
NLS_DESC
PGSQL_DESC
PROFILING_DESC
PROMETHEUS_DESC
REDIS_DESC
SERVER_DESC
SOFTWARE_DESC
SOUND_DESC
SPATIAL_DESC
SYSTEM_DESC
SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC
SYSTEM_JSONCPP_DESC
SYSTEM_LUAJIT_DESC
TOUCH_DESC
UNITTESTS_DESC

# Options helpers
CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE
CLIENT_CMAKE_ON
CURL_LIB_DEPENDS
CURL_CMAKE_BOOL
DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL
EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS
FREETYPE_CMAKE_BOOL
GLVND_LIB_DEPENDS
GLVND_USE
GLVND_CMAKE_BOOL
GLVND_CMAKE_ON
LEGACY_USE
LEGACY_CMAKE_BOOL
LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS
LEVELDB_CMAKE_BOOL
LTO_CMAKE_BOOL
NCURSES_USES
NCURSES_CMAKE_BOOL
NLS_USES
NLS_CMAKE_BOOL
NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL
PROFILING_CMAKE_ON
PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS
REDIS_CMAKE_BOOL
SERVER_CMAKE_BOOL
SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL
SYSTEM_FONTS_RUN_DEPENDS
SYSTEM_GMP_LIB_DEPENDS
SYSTEM_GMP_CMAKE_BOOL
SYSTEM_GMP_CMAKE_ON
SYSTEM_JSONCPP_LIB_DEPENDS
SYSTEM_JSONCPP_CMAKE_BOOL
SYSTEM_JSONCPP_CMAKE_ON
SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE
-OPTIONS_SINGLE_GRAPHICS
-OPTIONS_SUB
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

I have small personal objection to how the options are ordered, since I like to group them together with all parts for any config option.  This way I am more sure not to miss something and for me its easier to read.  Above is the portclippy output after I complied with all but three lines of its instruction, the comments are generated by the tool, any comments actually in the Makefile are ignored.  I added similar comments as this is my first time doing this and it may help me with other ports I attempt.  If I complied 100% with what portclippy wanted changed, it would not provide any output, no feedback needed.

This is a nice tool, it very visually helps get the Makefile organized for official ports, so it will help those new to the process perfect their skills with this part of the job.  I am not sure whether I would revert the options order to what I prefer.  I could pre-add incompletely filled lines (leave out the assigned values part) of any new option for all of the different sections even if some remain unused (or might not be filled) as a way to avoid missing any.

Monday, March 4, 2024

Could it be an Arch conversion?

I have frequently looked to Arch Linux and their AUR (Arch Linux User Repository) for inspiration on how to port various things to FreeBSD.  I recently looked a little deeper due to revisiting an attempt to port Defold game engine.  One of the things I happened to look at is their version of a makefile, the PKGBUILD file.

An example framework for how a PKGBASE file is constructed that I found after more looking around.

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Your Name 
pkgname=NAME
pkgver=VERSION
pkgrel=1
epoch=
pkgdesc=""
arch=()
url=""
license=('GPL')
groups=()
depends=()
makedepends=()
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz"
        "$pkgname-$pkgver.patch")
noextract=()
sha256sums=()
validpgpkeys=()

prepare() {
	cd "$pkgname-$pkgver"
	patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
}

build() {
	cd "$pkgname-$pkgver"
	./configure --prefix=/usr
	make
}

check() {
	cd "$pkgname-$pkgver"
	make -k check
}

package() {
	cd "$pkgname-$pkgver"
	make DESTDIR="$pkgdir/" install
}

The one specific PKGBASE file I saw initially which I had believed was for Defold but I am guessing now it is for one of its dependencies instead.

# Maintainer: Jens Staal 

pkgname=sbase-hg
pkgver=20110624
pkgrel=1
pkgdesc="A suckless variant of the *nix core utilities"
arch=('i686' 'x86_64')
license=('MIT')
url="http://hg.suckless.org/sbase/"
makedepends=('mercurial')


build() {
  cd $srcdir

# Update the repo, else clone a new one
	if [ -d sbase ]; then
		cd sbase
		hg pull -u
		cd $srcdir
	else
		hg clone http://hg.suckless.org/sbase
	fi
  rm -rf $srcdir/build # start fresh
  cp -ar $srcdir/sbase $srcdir/build
}

package() {
  cd $srcdir/build/
  make DESTDIR=$pkgdir PREFIX=/opt install
  mkdir -p $pkgdir/usr/share/licenses/$pkgname/
  install -m644 $srcdir/build/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}

So my thought, foreshadowed by the title, is might it be possible to use their efforts to bootstrap FreeBSD ports?  And surely if we can do this, the reverse can be true as well.  Considering most of our ports arrive via Linux, it is less likely that our ports tree is examined by Arch folks trying to get something to work but it could happen.  Both projects can certainly benefit from being able to translate between the two build/pkg systems easily.  I or others could complete this translation task but it may take some time.  If I manage some level of success I can write about it in another blog post, but I still would like to get Defold game engine ported regardless.

Monday, February 26, 2024

So many things to remember

I have been using FreeBSD for quite a long time but even with as often as some tasks occur, I still do not quickly remember where a config file belongs or which one I should edit.  I have kept a printout of my blog post about updating kernel and world so that I have a reference to the steps I use from time to time, usually about every 10-30 days.  I know that I could look in manpages or try the --help option for any executable but the solution I have chosen to do might be quicker or simpler in some way.

What I did is create a directory ~/Symbolic_links in my root directory, within this directory I have placed things like the following:

# ls -l
total 8
lrwxr-xr-x  1 root wheel 44 Sep 19 14:29 14amd64-blacklist -> /usr/local/etc/poudriere.d/14amd64-blacklist
lrwxr-xr-x  1 root wheel 44 Sep 19 14:28 14amd64-make.conf -> /usr/local/etc/poudriere.d/14amd64-make.conf
lrwxr-xr-x  1 root wheel 31 Feb  7  2022 app-defaults -> /usr/local/lib/X11/app-defaults
lrwxr-xr-x  1 root wheel 47 Sep 19 14:22 cache_14amd64 -> /usr/local/poudriere/data/cache/14amd64-default
lrwxr-xr-x  1 root wheel 35 Oct 19  2020 p-keg_ports -> /usr/local/poudriere/ports/default/
lrwxr-xr-x  1 root wheel 66 Sep 19 14:20 p-keg-logs_bulk_14amd64_latest-per-pkg -> /usr/local/poudriere/data/logs/bulk/14amd64-default/latest-per-pkg
lrwxr-xr-x  1 root wheel 35 Feb 26  2022 p-keg-logs_bulk_parent -> /usr/local/poudriere/data/logs/bulk
lrwxr-xr-x  1 root wheel 62 Sep 19 13:46 p-keg-ports_packages_all -> /usr/local/poudriere/data/packages/14amd64-default/.latest/All
lrwxr-xr-x  1 root wheel 24 Feb 13  2021 pkg_repo_conf_dir -> /usr/local/etc/pkg/repos
lrwxr-xr-x  1 root wheel 23 Feb 26 13:12 pkg.conf -> /usr/local/etc/pkg.conf
lrwxr-xr-x  1 root wheel 29 Nov 10  2020 poudriere.conf -> /usr/local/etc/poudriere.conf
lrwxr-xr-x  1 root wheel 26 Dec 18  2020 thePoudriereDir -> /usr/local/etc/poudriere.d
lrwxr-xr-x  1 root wheel 30 Jan 24  2022 xorg_configs -> /usr/local/etc/X11/xorg.conf.d
lrwxr-xr-x  1 root wheel 36 Sep 11 16:41 xorg-drivers-installed -> /usr/local/lib/xorg/modules/drivers/
lrwxr-xr-x  1 root wheel 31 Aug 28 17:34 Xterm_and_other_X_defaults_here -> /usr/local/lib/X11/app-defaults
lrwxr-xr-x  1 root wheel 37 Aug 28 17:33 xterm_app_defaults -> /usr/local/lib/X11/app-defaults/XTerm

Later, when I am wondering what I need to adjust or where that config file is that needs the adjustment, I can first look at these symbolic links and get to editing the file.

Another thing I've done which I am sure needs a bit of a cleanup and probably a revision, probably move the information to a different file, I've also thought about making the random notes one extensive alias to display it.  This is my .cshrc-personal file with all sorts of notes on various things I've run across in passing which come in handy or could someday.

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ROOT USER  .cshrc-personal
#______________________________________________

# sony exfat: mount.exfat-fuse /dev/da8s1 /mnt/usbstick

# If sound fails for firefox but works for other things, check if sndio is installed and remove that.
# Firefox from pkg also requires pango compiled with libthai option, pango pkg does not have this.
# mesa-dri should solve libGL error: failed to load driver: radeonsi

# rather oddly poudriere refused to update via the very brief incantation so instead the much more verbose and slower method seems to have worked:
# poudriere jail -m -v stable/14 -a amd64 -j 14amd64 -b -m src=/usr/src
# This may have been after /usr/src was already cleaned. Uncertain if the error from update via
# poudriere -u -j 14amd64
# was caused by a cleaned /usr/src or some other issue, also included a new symbolic link to /etc/src.conf in thepoudrieredir.
# Now there is the src-env.conf, src.conf, and make.conf used in there.

alias rekernconf	'ln -s /root/kernconf/ICHIGO /usr/src/sys/amd64/conf/ICHIGO ; ln -s /root/kernconf/RACK /usr/src/sys/amd64/conf/RACK'
alias kernconf		cp /root/kernconf/ICHIGO /usr/src/sys/amd64/conf/ICHIGO
alias remakeconf 	cp /etc/make.conf ~/Symbolic_Links/thePoudriereDir/13amd64-make.conf
alias sorta 		sort -d -u

alias portlint 		'echo;echo;\portlint'
alias plist		'echo "make makeplist > pkg-plist"'

alias fixnet		repairnet
alias fixtime		ntpdate -b 0.freebsd.pool.ntp.org
alias ezjail 		ezjail-admin
alias cmake-opts 	"cmake -L | awk '{if(f)print} /-- Cache values/{f=1}'"
alias autotools-opts	'./autogen.sh && ./configure --help=recursive'
alias myworldip		lynx -dump checkip.dyndns.org
alias nice 		/usr/bin/nice
alias redoGUI 		make-de-re-install-each GUI-fix-list
alias redogui 		make-de-re-install-each GUI-fix-list

alias eighty		'echo "1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^"'
alias seventy		'echo "123456789^123456789^123456789^123456789^123456789^123456789^123456789^"'

alias zfs-df		'zfs list -o space'
alias pkeg-distclean	'poudriere distclean -a'

alias rust-crates	'echo "From the port directory: make cargo-crates > Makefile.crates"'

alias port_deps_help 'echo "dependencies for port: `make build-depends-list && make run-depends-list`"; echo "dependencies still needed to install for a port: `make missing`"'
unalias h
unalias j
unalias la
unalias lf
unalias ll

# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/scripts $HOME/bin)

setenv	EDITOR	vi
#setenv	PAGER	less
setenv	PAGER	more
setenv	BLOCKSIZE	K


if ($?prompt) then
	# An interactive shell -- set some stuff up
	set prompt = "%N@%m:%~ %# "
	set promptchars = "%#"

	set filec
	set history = 1000
	set savehist = (1000 merge)
	set autolist = ambiguous
	# Use history to aid expansion
	set autoexpand
	set autorehash
	set mail = (/var/mail/$USER)
	if ( $?tcsh ) then
		bindkey "^W" backward-delete-word
		bindkey -k up history-search-backward
		bindkey -k down history-search-forward
	endif

endif

alias today 	date "+%m/%d/%Y"

# -a When it receives a packet make audible beep - internal tower speaker
# -A When it misses a packet make audible beep - internal tower speaker
# And change the interval to every 63 secs
alias ping      ping -i 63 -A

alias recert    make -C  /usr/ports/security/ca_root_nss reinstall clean

alias installmedia 'echo "dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync status=progress"'

setenv autologout 30

setenv LSCOLORS Exfxcxdxbxegedabagacad
setenv CLICOLOR true

setenv LANGUAGE en_US.UTF-8
setenv LANG en_US.UTF-8
setenv LC_ALL en_US.UTF-8
setenv LC_CTYPE POSIX

setenv QT_QPA_PLATFORM xcb

# default is blank, qt5ct utility must have
#  setenv QT_QPA_PLATFORMTHEME qt5ct
setenv QT_QPA_PLATFORMTHEME qt5ct

#setenv QT_QPA_PLATFORMTHEME default

# Additions to fix qt5 scale issue in FVWM
# Boolean 0/1
setenv QT_AUTO_SCREEN_SCALE_FACTOR 1

# Numeric
#setenv QT_SCREEN_SCALE_FACTORS .35

# With radeon driver this seems right
#setenv QT_SCREEN_SCALE_FACTORS 1.1
# PCDM dpi is screwy & wrong! Use 96dpi only
#best below
#setenv QT_SCREEN_SCALE_FACTORS .5
#setenv QT_SCREEN_SCALE_FACTORS .495

# dependencies for port: `make build-depends-list && make run-depends-list`
#
# dependencies still needed to install for a port: `make missing`

# pkg prime-origins | sort -d -u | more
#
# pkg query -x '%o %n %v %R' 'mesa-|drm.*kmod|gpu-firmware*' | sort

# fc-list :scalable=true:spacing=mono: family > xterm_fonts_choices
# After an edit to the file, combine it with what is in use already:
#   xrdb -merge ~/.Xresources
#
# Use the file and override whatever is already used:
#   xrdb ~/.Xresources
#
# man build:
#	MAKEOBJDIRPREFIX Defines the prefix for directory
#	KERNCONFDIR Overrides the directory in which KERNCONF and any files included by KERNCONF should be found.
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# $FreeBSD: stable/12/bin/csh/dot.cshrc 338374 2018-08-29 16:59:19Z brd $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
# make -V LIB_DEPENDS
#
# Whois for IP, including AS number:
# whois -h whois.cymru.com " -v 165.231.253.20"
#
# If needing to install something and everything balks, use this on make install line
#FORCE_PKG_REGISTER
#
# What is your graphics hardware?
# pciconf -lv | grep -B4 -A1 VGA
#
# If the system is running with a custom kernel, use nextboot(8) to set the
# kernel for the next boot to the updated /boot/GENERIC:
#
# nextboot -k GENERIC
#
# The machine should now be restarted with the updated kernel:
#
# shutdown -r now
#
## possibly helpful pkg output for script
#pkg query %n:%v:%o
#
## this might be causing a window manager to act as "default"
#/usr/local/etc/X11/xsm/system.xsm
#
# xorg individual config files are in  /usr/local/etc/X11/xorg.conf.d/
#
# /var/log/dmesg.boot contains the boot messages. /var/log/messages contains the current errors.
#
###
# AMD (Phenom & Athlon for certain) cannot have this sysctl set non-zero:
# vm.pmap.pti=0
# If set, boot to loader prompt, set vm.pmap.pti=0 then boot.
###
#
# cert for ssl stuff in browser.
# security/ca_root_nss
#
# Someone forgot to configure the certificate chain in the webserver.
# review the webserver config and make sure that the certificate chain configuration is valid?
# In particular, one should be able to test this with
#   openssl s_client -connect forums.freenas.org:443
# and not get the "unable to verify the first certificate" error.
#
# ps auxdww piped to less can help quite a bit in that regard
# it gives you a snapshot of the full process table at any given point in time
#
# Where is the pkg repo config files stored?
# /etc/pkg/FreeBSD.conf
# /usr/local/etc/pkg/repos/00_synth.conf
#
# # pkg origin pkg
# ports-mgmt/pkg
#
# make build-depends-list should show you the dependencies
# make all-depends-list will recurse through all dependencies
#
# What kernel compile options built
# sysctl kern.conftxt
#
# Show what device an irq is bound to
# vmstat -i
#
# dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync
###
#fat32 thumbdrive usbstick
#If you need to create a FAT32 formatted USB thumb drive, find out its devicename
#running dmesg(8) after inserting it. Then create an MBR schema, a single slice and
#format it:
# gpart create -s MBR ${devicename}
# gpart add -t fat32 ${devicename}
# newfs_msdos -F 32 -L thumbdrive ${devicename}s1
###
# phone sd card
#gpart show
#=>       63  249737153  da8  MBR  (119G)
#         63  249737153    1  fat32  (119G)
# mount -t msdos -o ro /dev/da8s1 /mnt
# umount /dev/da8s1
# Troubles with efreet of enlightenment were solved by removing a file "0"
# ~/.ecore/efreetd/0
#
# For lots of buildworld and related info, targets, knobs
# man 7 build
#
# FYI qt5ct settings for added style is here /usr/local/share/qt5ct/qss
# /usr/local/etc/slim.conf edit to modify how it functions or theme
#
#  # pkg remove -f pkg
# Updating database digests format: 100%
# Checking integrity... done (0 conflicting)
# Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):
#
# Installed packages to be REMOVED:
#         pkg-1.10.5_5
#
# Number of packages to be removed: 1
#
# The operation will free 13 MiB.
#
# Proceed with deinstalling packages? [y/N]: y
# [1/1] Deinstalling pkg-1.10.5_5...
# You may need to manually remove /usr/local/etc/pkg.conf if it is no longer needed.
# [1/1] Deleting files for pkg-1.10.5_5: 100%
#
#
# build world or kernel, settings here:  src-env.conf
#
#alias svn	svnlite
#alias fixnet	/etc/rc.d/netif restart lagg0
#
#alias pkg	pkg -N
#
### adjust this file for kernel/world build
# /etc/src-env.conf
#
### Initial /usr/src checkout:
# svn co https://svn0.us-east.freebsd.org/base/release/12.0.0 /usr/src
#
### If branch leaps such as Release to Stable, add 'ignore' switch
# svn  --ignore-ancestry switch ^/stable/12 /usr/src
#
### switch source branches easily! (was on stable-11)
# svn switch ^/stable/12 /usr/src
#
### when it times out without finishing add
# svn cleanup ;
#
#Audio capture desktop and firefox
# need virtual_oss from ports then:
# virtual_oss -Q 0 -C 2 -c 2 -r 48000 -b 16 -s 1024 -P /dev/dsp6 -R /dev/null -w vdsp.wav -l dsp
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# `procstat -k PID` shows the stack of all kernel threads associated with that process.
# That, with a tyro's grasp of kernels, makes it possible to work out where hangs etc.
# are coming from. Resource locks abound down there, and sometimes they break.
#
#`git clean -xdf` (removes all files not under version control)
#
# When pkg is seemingly stuck try to find out which command it is...
# ps auxwww | grep pkg
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# From /usr/local/share/doc/ccache/ccache-howto-freebsd.txt
# For csh/tcsh Add the following to /etc/csh.cshrc:
#
#  setenv PATH /usr/local/libexec/ccache:$PATH
#  setenv CCACHE_PATH /usr/bin:/usr/local/bin
#
# Ccache's default cache size is 1GB and this is larger than the default size of
# the root partition (/) on FreeBSD. To over come this you may specify a new
# cache location on a different partition with the following examples.
# For csh/tcsh Add the following to /etc/csh.cshrc:
#  setenv CCACHE_DIR "/usr/.ccache"
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# from https://forums.freebsd.org/threads/howto-freebsd-with-ccache.174/
# set ccache variables
#setenv PATH /usr/local/libexec/ccache:$PATH
#setenv CCACHE_PATH /usr/bin:/usr/local/bin
#setenv CCACHE_DIR /var/cache/ccache
#setenv CCACHE_LOGFILE /var/log/ccache.log
#
# set ccache temp size to 512MB (default 1GB)
#if ( -x /usr/local/bin/ccache ) then
#  /usr/local/bin/ccache -M 512M > /dev/null
#endif
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Tigersharke .cshrc
# $FreeBSD: stable/11/share/skel/dot.cshrc 278616 2015-02-12 05:35:00Z cperciva $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
# more examples available at /usr/share/examples/csh/
#
# Spiffy progress for dd, add to commandline: status=progress
#
#########
# record 2 hours of Zenith -- must press record button in player that appears!
# vlc -vvv http://148.163.81.10:8006/stream --stop-time 7200 vlc://quit
#########
#
#########
# record without interaction, auto-quits as well, just need to use `at` to schedule it.
# cvlc -vvv http://stream.dbmedia.se/gk70tal96 --prefetch-buffer-size=0 --sout file/mp4:testfile.mp4 --stop-time 120 vlc://quit
#########
#
# Replace audio without recompressing. Use audacity to modify the audio first.
# ffmpeg.exe -i input_video.mp4 -i replacement_audio.m4a -vcodec copy -acodec copy -map 0:0 -map 1:0 output.mp4
#
# Fix aspect ratio: ffmpeg -i [INPUT] -aspect 720:540 -c copy [OUTPUT]
#
# location of desktop files: /usr/local/share/applications
#
#alias openoffice exec [ ! -e `ls -t /usr/local/bin | grep -m 1 openoffice`]||echo "Not installed"
#alias openoffice exec `ls -t /usr/local | grep -m 1 openoffice`
#
#alias today 	date "+%m/%d/%Y"
#
# When it receives a packet make audible beep - internal tower speaker
# And change the interval to every 10 secs
#alias ping      ping -i 10 -a
#alias recert    make -C  /usr/ports/security/ca_root_nss reinstall clean
#
# read(2) of directories may not be desirable by default, as this will provoke
# EISDIR errors from each directory encountered.
# alias grep    grep -d skip
#
#alias neovim	nvim
#alias neovim-qt nvim-qt
#alias amphetadesk AmphetaDesk
#alias freedroidrpg freedroidRPG
#alias xstart xinit ~/.xinitrc -- -dpi 75 -nolisten tcp
#
# These are normally set through /etc/login.conf.  You may override them here
# if wanted.
# set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin)
# setenv	BLOCKSIZE	K
# A righteous umask
# umask 22
#
# when pkg is seemingly stuck try to find out which command it is...
# ps auxwww | grep pkg
#
# find all damned ports options!
# find * -maxdepth 2 -name Makefile -exec grep -Hn OPTIONS_DEFINE {} \; >> /root/options-list.txt
#
# Set default sound device in vlc: use any of /dev/dsp3.vp0 or similar,
# do `ls /dev | grep dsp` while vlc is running to see which audio devices exist, they only exist while in use.
# my fiberoptic is any of the dsp3, either dsp4.vp0 or dsp3.vp1
#
# # pkg set -o multimedia/vlc3:multimedia/vlc
#Change origin from multimedia/vlc3 to multimedia/vlc for vlc3-3.0.5,4? [y/N]: y
#
# Over quota? below will give you a sorted list of your directory sizes.
#  du -sh * | sort -h
#
# I find brace expansion useful for renaming files.
# This cmd expands to "mv Picture.jpg Picture-of-my-cat.jpg"
#   mv Picture{,-of-my-cat}.jpg
#
# /usr/ports/www/linux-flashplayer
# /usr/ports/www/nspluginwrapper/pkg-message
#
# When was the machine rebooted, shutdown, crashed?
# use the command: last
#
#setenv autologout 30
#
#setenv LSCOLORS Exfxcxdxbxegedabagacad
#setenv CLICOLOR true
#
#setenv LANGUAGE en_US.UTF-8
#setenv LANG en_US.UTF-8
#setenv LC_ALL en_US.UTF-8
#setenv LC_CTYPE POSIX
#
#setenv QT_QPA_PLATFORM xcb
################################################
## default is blank, qt5ct utility must have  ##
##  setenv QT_QPA_PLATFORMTHEME qt5ct	      ##
setenv QT_QPA_PLATFORMTHEME qt5ct
#setenv QT_QPA_PLATFORMTHEME default
################################################
## Additions to fix qt5 scale issue in FVWM   ##
## Boolean 0/1                                ##
#setenv QT_AUTO_SCREEN_SCALE_FACTOR 1
## Numeric                                    ##
#setenv QT_SCREEN_SCALE_FACTORS .35
# With radeon driver this seems right
#setenv QT_SCREEN_SCALE_FACTORS 1.1
# PCDM dpi is screwy & wrong! Use 96dpi only
#best below
#setenv QT_SCREEN_SCALE_FACTORS .5
#setenv QT_SCREEN_SCALE_FACTORS .495
################################################
#export LANGUAGE=en_US.UTF-8
#export LANG=en_US.UTF-8
#export LC_ALL=en_US.UTF-8
#export QT_QPA_PLATFORMTHEME=qt5ct
#setenv LANGUAGE en_US.UTF-8
#setenv LANG en_US.UTF-8
#setenv LC_ALL en_US.UTF-8
#setenv QT_QPA_PLATFORMTHEME qt5ct
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# just in case
# from https://forums.freebsd.org/threads/howto-freebsd-with-ccache.174/
# set ccache variables
#setenv PATH /usr/local/libexec/ccache:$PATH
#setenv CCACHE_PATH /usr/bin:/usr/local/bin
#setenv CCACHE_DIR /usr/.ccache
#setenv CCACHE_LOGFILE /var/log/ccache.log
#
## set ccache temp size to 512MB (default 1GB)
#if ( -x /usr/local/bin/ccache ) then
#  /usr/local/bin/ccache -M 512M > /dev/null
#endif
#
#
# If you experience issues when running OpenGL applications it is possible
# to force the use of DRI2 by setting the LIBGL_DRI3_DISABLE environment
# variable to 1 before starting any OpenGL application.  The easiest way to
# do this is by adding it to either your shell startup files or .xinitrc.
#setenv LIBGL_DRI3_DISABLE 1
#
#set path = ($path /media/sbin /media/bin /media/usr/sbin /media/usr/bin /media/usr/local/sbin /media/usr/local/bin /media$HOME/bin)
#
# Determine what requires llvm (3 lines output after)
# pkg info -rx llvm
#llvm10-10.0.1_5:
#        mesa-dri-20.2.3_1
#llvm11-11.0.1:
#
# /usr/ports/Mk for porting, and /usr/share/mk for software building.
#
#find what cmake options are available (from work/portbuild directory) from https://stackoverflow.com/questions/16851084/how-to-list-all-cmake-build-options-and-their-default-values
# cmake -LA | awk '{if(f)print} /-- Cache values/{f=1}'

I still have general organizing to do, but for now I have the whole mess loaded, at the bottom of my .cshrc file I added

source /root/.cshrc-local
source /root/.cshrc-personal

Lastly, although you may have seen them in passing via that .cshrc-personal file root has, I will show you the various aliases I have for my root and user accounts.  This is one more way to keep track of things and make the information more quickly to hand.

# alias
amphetadesk     AmphetaDesk
autotools-opts  ./autogen.sh && ./configure --help=recursive
cmake-opts      cmake -L | awk '{if(f)print} /-- Cache values/{f=1}'
eighty  echo "1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^"
ezjail  ezjail-admin
fixnet  repairnet
fixtime (ntpdate -b 0.freebsd.pool.ntp.org)
installmedia    echo "dd if=FreeBSD-10.2-RELEASE-amd64-memstick.img of=/dev/da0 bs=1M conv=sync status=progress"
kernconf        (cp /root/kernconf/ICHIGO /usr/src/sys/amd64/conf/ICHIGO)
less    (less --mouse)
myworldip       (lynx -dump checkip.dyndns.org)
neovim  nvim
neovim-qt       nvim-qt
nice    /usr/bin/nice
ping    (ping -i 63 -A)
pkeg-distclean  poudriere distclean -a
plist   echo "make makeplist > pkg-plist"
port_deps_help  echo "dependencies for port: `make build-depends-list && make run-depends-list`"; echo "dependencies still needed to install for a port: `make missing`"
portlint        echo;echo;\portlint
recert  (make -C /usr/ports/security/ca_root_nss reinstall clean)
redoGUI (make-de-re-install-each GUI-fix-list)
redogui (make-de-re-install-each GUI-fix-list)
rekernconf      ln -s /root/kernconf/ICHIGO /usr/src/sys/amd64/conf/ICHIGO ; ln -s /root/kernconf/RACK /usr/src/sys/amd64/conf/RACK
remakeconf      (cp /etc/make.conf /root/Symbolic_Links/thePoudriereDir/13amd64-make.conf)
rust-crates     echo "From the port directory: make cargo-crates > Makefile.crates"
seventy echo "123456789^123456789^123456789^123456789^123456789^123456789^123456789^"
sorta   (sort -d -u)
today   (date +%m/%d/%Y)
xstart  (xinit /root/.xinitrc -- -dpi 75 -nolisten tcp)
zfs-df  zfs list -o space
# exit

% alias
amphetadesk     AmphetaDesk
eighty  (echo 1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^1234567^)
freedroidrpg    freedroidRPG
ircII   irc
ircii   irc
less    (less --mouse)
ls      (ls -a)
neovim  nvim
neovim-qt       nvim-qt
today   (date +%m/%d/%Y)
veloren veloren-voxygen
virtoss virtual_oss -Q 0 -C 2 -c 2 -r 48000 -b 16 -s 1024 -P /dev/dsp6 -R /dev/null -w vdsp.wav -l dsp
xstart  (xinit ~/.xinitrc -- -dpi 75 -nolisten tcp

While there may be a ton of things to remember on a FreeBSD system, there are numerous ways to make it easier to find the information and to do it in such a way as to have fewer extra places to look through to find it.  Symbolic links can become stale, but are easily replaced and the link itself can be more descriptive than the object of its link.  Aliases can cause custom output in the form of echoed text, or be named to assist with recall of its purpose, or sometimes a common name and its executable are different.

What ever method you use, along with the usual methods of searching through a manpage or forum post, or asking on IRC or any other social media platform (or even feedback to your favorite podcast like BSDNow or 2.5admins), you can be sure to succeed with any task that has you stuck.  The above is how I have made the struggle lighter for myself.

Wednesday, February 7, 2024

Zpool-upgrade loader.efi fail

I recently bought a Sony Walkman android device, which I hoped would permit me to use an app to control my Deco S4 wifi devices.  The wifi hardware was added in hopes of improving local wifi from a single Xfinity device and in a more secure way by connecting via my OPNsense box.  Once I solved the wifi device app issue, I still had the Sony Walkman for audio.

Perhaps foolishly, I wanted to use larger better quality flac files, and knowing I still had quite a large number of CDs to run through ripperX, I tried to change my vdev to better compression.  What seemed to me as being better compression algorithms were unavailable to me because my zfs needed an update.  I had done as many as two updates in the past, one which switched me to 'feature flags' and each time was warned about compatibility but never had an issue.

Without any further investigation, assuming that it would be just as easy a process as in the past, so I upgraded zfs and then changed the compression of the vdev for my music files.  Everything ran fine, no issues.  Later, I was playing minetest and after some time in the midst of what I was attempting on the minetest server, my display and mouse, and pc froze up.  There has been an issue with something somewhere which has caused me a panic and reboot, so all I had once more was the inconvenient interruption.  This time it didn't reboot itself, just seemed to remain frozen, so I rebooted.

This is when I discovered that something was wrong.  It started the boot but before it got very far I was greeted with errors including "ZFS: unsupported feature: com.klarasystems:vdev_zaps_v2" and mention that it couldn't find any bootable drives.  Luckily there was a specific term which I could search online for more information: klarasystems:vdev_zaps_v2.

One search result was FreeBSD forum post 14-0-release-zfs-features-gotcha.91085 but I also looked at the 14.0 release notes, and /usr/src/UPDATING:

20160708:
	The stable/11 branch has been created from head@r302406.

After branch N is created, entries older than the N-2 branch point are removed
from this file. After stable/14 is branched and current becomes FreeBSD 15,
entries older than stable/12 branch point will be removed from current's
UPDATING file.

COMMON ITEMS:

	General Notes
	-------------
	Sometimes, obscure build problems are the result of environment
	poisoning.  This can happen because the make utility reads its
	environment when searching for values for global variables.  To run
	your build attempts in an "environmental clean room", prefix all make
	commands with 'env -i '.  See the env(1) manual page for more details.
	Occasionally a build failure will occur with "make -j" due to a race
	condition.  If this happens try building again without -j, and please
	report a bug if it happens consistently.

	When upgrading from one major version to another it is generally best to
	upgrade to the latest code in the currently installed branch first, then
	do an upgrade to the new branch. This is the best-tested upgrade path,
	and has the highest probability of being successful.  Please try this
	approach if you encounter problems with a major version upgrade.  Since
	the stable 4.x branch point, one has generally been able to upgrade from
	anywhere in the most recent stable branch to head / current (or even the
	last couple of stable branches). See the top of this file when there's
	an exception.

	The update process will emit an error on an attempt to perform a build
	or install from a FreeBSD version below the earliest supported version.
	When updating from an older version the update should be performed one
	major release at a time, including running `make delete-old` at each
	step.

	When upgrading a live system, having a root shell around before
	installing anything can help undo problems. Not having a root shell
	around can lead to problems if pam has changed too much from your
	starting point to allow continued authentication after the upgrade.

	This file should be read as a log of events. When a later event changes
	information of a prior event, the prior event should not be deleted.
	Instead, a pointer to the entry with the new information should be
	placed in the old entry. Readers of this file should also sanity check
	older entries before relying on them blindly. Authors of new entries
	should write them with this in mind.

	ZFS notes
	---------
	When upgrading the boot ZFS pool to a new version (via zpool upgrade),
	always follow these three steps:

	1) recompile and reinstall the ZFS boot loader and boot block
	(this is part of "make buildworld" and "make installworld")

	2) update the ZFS boot block on your boot drive (only required when
	doing a zpool upgrade):

	When booting on x86 via BIOS, use the following to update the ZFS boot
	block on the freebsd-boot partition of a GPT partitioned drive ada0:
		gpart bootcode -p /boot/gptzfsboot -i $N ada0
	The value $N will typically be 1.  For EFI booting, see EFI notes.

	3) zpool upgrade the root pool. New bootblocks will work with old
	pools, but not vice versa, so they need to be updated before any
	zpool upgrade.

	Non-boot pools do not need these updates.

	EFI notes
	---------

	There are two locations the boot loader can be installed into. The
	current location (and the default) is \efi\freebsd\loader.efi and using
	efibootmgr(8) to configure it. The old location, that must be used on
	deficient systems that don't honor efibootmgr(8) protocols, is the
	fallback location of \EFI\BOOT\BOOTxxx.EFI. Generally, you will copy
	/boot/loader.efi to this location, but on systems installed a long time
	ago the ESP may be too small and /boot/boot1.efi may be needed unless
	the ESP has been expanded in the meantime.

	Recent systems will have the ESP mounted on /boot/efi, but older ones
	may not have it mounted at all, or mounted in a different
	location. Older arm SD images with MBR used /boot/msdos as the
	mountpoint. The ESP is a MSDOS filesystem.

	The EFI boot loader rarely needs to be updated. For ZFS booting,
	however, you must update loader.efi before you do 'zpool upgrade' the
	root zpool, otherwise the old loader.efi may reject the upgraded zpool
	since it does not automatically understand some new features.

	See loader.efi(8) and uefi(8) for more details.


and then to the manpage for loader.efi, specifically:

EXAMPLES
   Updating loader.efi on the ESP
       The  following  examples	 shows	how to install a new loader.efi	on the
       ESP.

       First, find the partition of type "efi":

	     # gpart list | grep -Ew '(Name|efi)'
	     1.	Name: nvd0p1
		type: efi
	     2.	Name: nvd0p2
	     3.	Name: nvd0p3
	     4.	Name: nvd0p4
	     1.	Name: nvd0

       The name	of the ESP on this system is nvd0p1.

       Second, let's mount the ESP, copy loader.efi to	the  special  location
       reserved	for FreeBSD EFI	loaders, and unmount once finished:

	     # mount_msdosfs /dev/nvd0p1 /boot/efi
	     # cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi
	     # umount /boot/efi

SEE ALSO
       loader(8), uefi(8)

Since I had experienced similar issues with my box which meant I had to adjust what was on the hard drive, I knew that I would need bootable media so that I could reach the hard drive.  This is what became a more significant and time-consuming problem, at least partly due to my own stubborn foolishness.  I had a number of micro sd cards and a usb reader.  Out of three which had the potential to function as I needed, only one had an old NomadBSD installed upon it.  My mistake was that I insisted upon upgrading it from 12.x to 14.0 which ran into storage constraints and then breaking it from its normal startup process and eventually unable to boot at all.

Later I noticed an old Kingston Digital DataTraveler SE9 64GB USB 2.0 which I discovered has FreeNAS installed.  I could boot it and get to shell which allowed me to get the img file.  It was good enough for some attempts to create a bootable micro sd card but it eventually would fail too quickly during an ftp transfer or dd write, so that I had to find another option.  I was pretty sure that I had some cdroms or dvds which have some kind of FreeBSD, so once I found my cache, I decided to use a PC-BSD 8.2rc2 dvd.

This is when I was finally tired of the whole process and possibly more rested or something, so I actually, after a chunk of two days of attempts, finally made progress.  I booted the PC-BSD disc and after some tries for the GUI, I realized I only truly needed a shell.  From the shell, I was able to mount my target micro sd card which I used to store the downloaded (via ftp -a download.freebsd.org) img file.  I could also format an SSD which I bought more than 5 years ago in a group of four for adding zfs cache devices to my box (obviously still not accomplished).  I shifted the img file to the SSD so I could dd it to the micro sd card.  Once I had the FreeBSD 14.0 installer on the micro sd card, I booted it and began the process of the repair.

My initial plan was to first test the process by an update of the loader.efi on the micro sd card but got stymied.  I followed the steps above (in the loader.efi manpage example).  I discovered that the appropriate partition was ada2p1, which I mounted to /boot/efi and then found that there was no /boot/efi/efi/freebsd path.  What I had was /boot/efi/EFI/BOOT/BOOTxxx.EFI which I left alone.  Instead I created the needed freebsd directory in /boot/efi/EFI.  Once the path was setup, I could copy the loader.efi into the correct location.

This was my very first ever experience with this sort of repair or upgrade, so I was not sure of success until my reboot.  At some point during or shortly after this repair, I decided to properly install FreeBSD 14.0 onto the SSD as a failsafe against future similar problems, I kept the micro sd card as the FreeBSD 14.0 installer.  I used the SSD using the presently unavailable cables2go version of Generic-Adapter-Converter-Optical-External.  Aside from all of the above, I was able to connect to my local network with my Sony Walkman to look for answers and help.  If I can keep my Walkman able to use for such emergencies, this may be an easier method than keeping an entire network and FreeBSD installed on a box functioning, all I will likely need is wifi and access.  I have no plan to ever modify the Walkman away from its functional install.

Definite relief after I was able to properly boot up my box and use it on my last of a series of three days off from work.  I hope that you update your loader.efi BEFORE you upgrade zfs so that you can avoid the excitement of doing the repair above.

Tuesday, September 5, 2023

14-stable update, etcupdate, and a struggle

When I set out to update my system to use FreeBSD 14-stable in lieu of 13-stable, I knew there was a chance things could go awry.  Usually a switch between major versions will involve substantial changes to how things are done and thus indirectly invalidate a large swath of (or everything) that is installed.  I was ready for this task but first I had to get a running system to begin my other (userland) updates.

As usual, essentially the same way I've done many times, I updated my /usr/src to the most current 14-stable, and began the usual buildworld and kernel processes as described in another blog post,Kernel and world rebuild.  Since this was going to be a new ball of wax instead of some minor tweaks of 13-stable, I wisely chose to install a GENERIC kernel.

What I was not so aware of, was how issues with etcupdate could thwart a complete update.  After a couple attempts to rebuild and reinstall, I looked closer at etcupdate and what might possibly be the wrench in the works.  This discussion of my kernel and world challenge is being written from memory as I didn't remember to take any notes to be more precise.  What I recall is that I eventually clarified six or eight files so that they would match what was expected in the new system, etcupdate could then be satisfied (no more conflicts) and my usual process could be completed.

Aside from the etcupdate hiccup, the transformation from 13-stable to the new shiny 14-stable went rather smoothly and easily.  Since I now had a fresh install, I could work on getting my userland (ports) updated and back to a functioning desktop.  I now have a list of ports I need to re-install when I update my kernel and this along with a helpful script to iterate through each of them, would update anything needing the kernel and all the rest.

misc/pciids
graphics/libdrm
graphics/linux-c7-libdrm
graphics/libglvnd
graphics/libGLU
graphics/gpu-firmware-amd-kmod
x11/xorg
graphics/mesa-libs
graphics/mesa-dri
graphics/drm-kmod
devel/libudev-devd
x11-drivers/xf86-input-mouse
x11-drivers/xf86-input-keyboard

I had those ports rebuilt and reinstalled, and made sure that x11-wm/fvwm was installed as well.  When I tried to startx it told me there were no screens detected, which is an obscure way to say that there is no graphics driver, or that is just one cause of the message.  I tried to reinstall the few items I knew would affect this, and made sure to install graphics/gpu-firmware-amd-kmod because that is the hardware I have.  I was still unable to issue startx and get my fvwm desktop back up.  I figured that since I had trouble in the past and desktop-installer cured things before, I could use it now and get back a gui.

I recall there being a moment (but I am very uncertain where in the order of events) when I was unable to connect to the freebsd pkg repo, and I hadn't changed anything myself (directly, intentionally) so I looked online for some documentation about it.  At that time I may have noticed that ports were no longer updating.  Strangely, what had always worked was no longer functioning, I had to change my freebsd.conf to get that back.

This is my /usr/local/etc/pkg/repos/FreeBSD.conf with the former text all commented out with # characters, the working portion below.

# $FreeBSD$
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#
#
#FreeBSD: {
#  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
#  mirror_type: "srv",
#  signature_type: "fingerprints",
#  fingerprints: "/usr/share/keys/pkg",
#  enabled: yes
#  priority: 0
#}

FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
}

Since desktop-installer succeeded to set me up with SDDM and fluxbox, I had a GUI to work on the rest of my updates.  I needed to figure out or disable SDDM and get fvwm going.  At some point I noticed that graphics/drm-kmod had a way to auto choose the right port to install based upon the version of FreeBSD.  The Makefile did not permit the newer version for 14-stable to be drm-515-kmod as it at that moment could only install drm-505-kmod.

I tried to get things updated using the file list mentioned earlier but kept running into problems until I happened to use graphics/gpu-firmware-kmod to install things instead of the more direct amdgpu in the list.  Once I did this, both drm-505-kmod or drm-515-kmod worked fine.  When I reinstalled that list, I kept thinking that maybe one thing in the list affected others, and maybe they do but repeated installs did not solve it.

So finally again I had a gui and everything seemed to be going the right direction.  All it would take to bring things back to a broken state yet again is to update those ports.  I liked the idea of sysutils/auto-admin and it mostly worked fine, aside from how it would insist to reinstall (from pkg) versions with one-size-fits-all default port configs.  The more ridicules was ftp/curl which by removal caused auto-admin scripts themselves to fail.

Eventually I realized that if auto-admin wanted to deinstall ftp/curl and use bad defaults for it (I must have static for some other port) I could build it the way I need then lock it.  This became the solution for a number of issues.  Pango also needed the libthai option because firefox insisted upon it, so that was built and locked.  Some time later, vlc was also affected by changed options, MAD being the only mp3 decoder available, so this too rebuilt and locked.  I know ffmpeg and firefox were both eventually locked as well.

It seems that within the week or so that I rebuilt and reinstalled FreeBSD from 13-stable to now 14-stable, more things mysteriously broke and had to be fixed than usual.  I do not know what to point to as the precise cause.  Most if not all of these difficulties are within the realm of FreeBSD ports and not kernel or world related at all.

Somehow after updating fvwm3 to its most recent commit, what will be the next release version, I exited out to start the new version and couldn't get back.  I was getting a very odd message related to some sort of X windows thing which at this moment I cannot recall.  It was something like how it wasn't sure which amdgpu driver or definition or something to use.  This was odd as when I looked at what I thought was pertinent, there was only one related to this.  I think it was related to drivers again, or I assumed it was, so back to that list and reinstalling.  I eventually added new things to the list after finally getting fvwm up again, mostly.

The trouble was, even though I had fvwm up, my mouse cursor was stuck at the center of the screen and things felt stalled, I think they *were* stalled.  I tried reinstalling the mouse driver and then went back to desktop-installer for the essentials and hopefully a fix.  Once more, desktop-installer cured the issue.  I looked at what drivers were now installed and added more to the list.

x11/libXxf86dga
x11/libXxf86vm
x11-drivers/xf86-input-libinput
x11/xf86dga
x11/xmodmap

I believe now after desktop-installer saved me yet one more time, everything should be working and I would have no troubles.  Except that I was wrong of course.  Now I am unsure how but something with my keyboard configuration now lacked anything for arrow keys.  After a lot of digging around I finally found how to fix them.  What I didn't discover until in the process of writing this is that my delete key does not function (fixed in below list).  I had to edit /usr/local/etc/Xmodmap to add some lines.  Later with xmodmap -pke > ~/.Xmodmap I told xmodmap to copy the file to my home directory.  Vermaden's blog post on FreeBSD desktop (part 9) was also useful to help me remember xev and its function, and some other things.

keycode 111 = 0xFF52
keycode 116 = 0xFF99
keycode 114 = 0xFF98
keycode 113 = 0xFF96
keycode 119 = BackSpace

I keep adding to my 'kernel rebuilt redo GUI' file list, at present this is the correct listing, missteps left out but vulkan stuff added just in case as it is an AMD card.

misc/pciids
graphics/libdrm
graphics/linux-c7-libdrm
graphics/libglvnd
graphics/libGLU
graphics/gstreamer1-plugins-vulkan
graphics/realesrgan-ncnn-vulkan
graphics/realsr-ncnn-vulkan
graphics/vapoursynth-waifu2x-ncnn-vulkan
graphics/vulkan-caps-viewer
graphics/vulkan-extension-layer
graphics/vulkan-headers
graphics/vulkan-loader
graphics/vulkan-tools
graphics/vulkan-validation-layers
graphics/gpu-firmware-kmod
x11/xorg
graphics/mesa-libs
graphics/mesa-dri
graphics/drm-515-kmod
devel/libudev-devd
x11-drivers/xf86-input-mouse
x11-drivers/xf86-input-keyboard
x11/libXxf86dga
x11/libXxf86vm
x11-drivers/xf86-input-libinput
x11-drivers/xf86-video-amdgpu
x11/xf86dga
x11/xmodmap

They always say what does not kill you makes you stronger, well, in the software/computer world it might be more like perseverence along with a little knowledge will always lead to a victory against those inanimate objects.  There is definitely an aspect of the former saying, in that, the greater the struggle, the more extreme the frustration, surpassing both will lead to greater knowlege and understanding, but in a nutshell: just don't give up.  Look for answers, look for help, embrace the puzzle.

Writing about our difficulties, successes, and failures, will help others who find the content.  You too could start a FreeBSD blog.

Sunday, September 3, 2023

Revised minetest-dev: fonts!

Anyone watching my git repo for minetest-dev or any of the others will know that I have expanded a bit on what I attempt to maintain in a reasonably timely manner.  Not too long ago, during a period when my FreeBSD install was functioning without hiccups, I eventually figured out another improvement to the minetest-dev Makefile.  I also have done a little cleanup for the options exposed to those who wish to install it.

Something I have wanted to do but hadn't the motivation or free time simultaneously is to have a way for the fonts installed on the system to be used by minetest, instead of duplicating them.  The solution I worked out is definitely not the best and actually begs upstream developers to include a proper mechanism to do this properly.  I understand that the minetest client should be guaranteed to have fonts it expects but without a mechanism within its build structure or configuration, we are stuck with a duplication of files for no real purpose.

minetest-dev:

PORTNAME=       minetest
DISTVERSION=    g20230902
CATEGORIES=     games
PKGNAMESUFFIX=  -dev
DISTNAME=       ${PORTNAME}-${GH_TAGNAME}
DIST_SUBDIR=    ${PORTNAME}${PKGNAMESUFFIX}

MAINTAINER=     nope@nothere
COMMENT=        Near-infinite-world block sandbox game
WWW=            https://www.minetest.net/

LICENSE=        LGPL21+

LIB_DEPENDS=    libIrrlichtMt.so:x11-toolkits/irrlicht-minetest libzstd.so:archivers/zstd

USES=           cmake compiler:c++14-lang iconv:wchar_t sqlite luajit
# Upstream requires Clang 3.5+ which for our criteria matches c++14-lang
# since https://en.cppreference.com/w/cpp/compiler_support
# lists "C++14 library support status (complete as of 3.5)"
# All other dependency version numbers are more direct and obvious, and surpass requirement.

CONFLICTS=      minetest

USE_GITHUB=     nodefault
GH_ACCOUNT=     minetest
GH_PROJECT=     minetest
GH_TAGNAME=     83b85ba16aaab7bddc479beada4ca3af9fa54a1b

CMAKE_ARGS=     -DCMAKE_BUILD_TYPE="MinSizeRel" \
                -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
                -DCUSTOM_MANDIR="${PREFIX}/man"

WRKSRC=         ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}

OPTIONS_DEFINE=                 CURL DOCS FREETYPE LUAJIT NCURSES NLS SOUND SPATIAL TOUCH PROMETHEUS
OPTIONS_DEFAULT=                CURL DOCS FREETYPE LUAJIT SOUND SPATIAL SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP CLIENT GLVND

OPTIONS_SINGLE=                 GRAPHICS
OPTIONS_MULTI=                  SYSTEM COMP
OPTIONS_GROUP=                  BUILD DATABASE

COMP_DESC=                      Software components
OPTIONS_MULTI_COMP=             CLIENT SERVER

SYSTEM_DESC=                    System subsitutes
OPTIONS_MULTI_SYSTEM=           SYSTEM_GMP SYSTEM_JSONCPP SYSTEM_FONTS

SYSTEM_GMP_DESC=                Use gmp from ports (ENABLE_SYSTEM_GMP)
SYSTEM_GMP_CMAKE_BOOL=          ENABLE_SYSTEM_GMP
SYSTEM_GMP_CMAKE_ON=            -DGMP_INCLUDE_DIR="${PREFIX}/include"
SYSTEM_GMP_LIB_DEPENDS=         libgmp.so:math/gmp

SYSTEM_JSONCPP_DESC=            Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)
SYSTEM_JSONCPP_CMAKE_BOOL=      ENABLE_SYSTEM_JSONCPP
SYSTEM_JSONCPP_CMAKE_ON=        -DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"
SYSTEM_JSONCPP_LIB_DEPENDS=     libjsoncpp.so:devel/jsoncpp

SYSTEM_FONTS_DESC=              Use or install default fonts from ports
SYSTEM_FONTS_RUN_DEPENDS=       ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf:x11-fonts/croscorefonts-fonts-ttf \
                                ${LOCALBASE}/share/fonts/Droid/DroidSans.ttf:x11-fonts/droid-fonts-ttf

BUILD_DESC=                     Dev Build options
OPTIONS_GROUP_BUILD=            BENCHMARKS EXAMPLES UNITTESTS DEVTEST

BENCHMARKS_DESC=                Build benchmark sources (BUILD_BENCHMARKS)
BENCHMARKS_CMAKE_BOOL=          BUILD_BENCHMARKS
EXAMPLES_DESC=                  BUILD_EXAMPLES
EXAMPLES_CMAKE_BOOL=            BUILD_EXAMPLES
DEVTEST_DESC=                   Install Development Test game also (INSTALL_DEVTEST)
DEVTEST_CMAKE_BOOL=             INSTALL_DEVTEST
UNITTESTS_DESC=                 Build unittest sources (BUILD_UNITTESTS)
UNITTESTS_CMAKE_BOOL=           BUILD_UNITTESTS

OPTIONS_SINGLE_GRAPHICS=        GLVND LEGACY
GRAPHICS_DESC=                  Graphics support

GLVND_DESC=                     Use libOpenGL or libGLX
GLVND_CMAKE_BOOL=               ENABLE_GLVND
GLVND_CMAKE_ON=                 -DOPENGL_GL_PREFERENCE="GLVND" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
GLVND_USE=                      GL+=opengl

LEGACY_DESC=                    Use libGL - where GLVND may be broken on nvidia
LEGACY_CMAKE_BOOL=              ENABLE_LEGACY
LEGACY_CMAKE_ON=                -DOPENGL_GL_PREFERENCE="LEGACY" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
LEGACY_USE=                     GL+=opengl

DATABASE_DESC=                  Database support
OPTIONS_GROUP_DATABASE=         LEVELDB PGSQL REDIS

OPTIONS_SUB=                    yes

CLIENT_DESC=                    Build client
CLIENT_CMAKE_BOOL=              BUILD_CLIENT
CLIENT_LIB_DEPENDS=             libIrrlichtMt.so:x11-toolkits/irrlicht-minetest \
                                libpng.so:graphics/png

CLIENT_USES=                    gl xorg
CLIENT_USE=                     jpeg GL=gl,glu \
                                XORG=ice,sm,x11,xext,xcb,xres,xshmfence,xau,xaw,xcomposite,xcursor,xdamage,xdmcp,\
                                xfixes,xft,xi,xinerama,xkbfile,xmu,xpm,xrandr,xrender,xscreensaver,xt,xtst,xv,xxf86vm

SERVER_DESC=                    Build server
SERVER_CMAKE_BOOL=              BUILD_SERVER

CURL_DESC=                      Enable cURL support for fetching media
CURL_CMAKE_BOOL=                ENABLE_CURL
CURL_LIB_DEPENDS=               libcurl.so:ftp/curl

SOUND_DESC=                     Enable sound via openal-soft
SOUND_CMAKE_BOOL=               ENABLE_SOUND

FREETYPE_DESC=                  Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=            ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=           libfreetype.so:print/freetype2

NCURSES_DESC=                   Enables server side terminal (cli option: --terminal)
NCURSES_CMAKE_BOOL=             ENABLE_CURSES
NCURSES_USES=                   ncurses

# This option is becoming uncertain, though it does something, is it useful?
LUAJIT_DESC=                    Require LUAJIT (always enabled)
LUAJIT_CMAKE_BOOL_ON=           REQUIRE_LUAJIT
LUAJIT_CMAKE_BOOL_OFF=          ENABLE_LUAJIT

LEVELDB_DESC=                   Enable LevelDB backend
LEVELDB_CMAKE_BOOL=             ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=            libleveldb.so:databases/leveldb

PGSQL_DESC=                     Enable PostgreSQL map backend
PGSQL_USES=                     pgsql
PGSQL_CMAKE_BOOL=               ENABLE_POSTGRESQL

REDIS_DESC=                     Enable Redis backend
REDIS_CMAKE_BOOL=               ENABLE_REDIS
REDIS_LIB_DEPENDS=              libhiredis.so:databases/hiredis

SPATIAL_DESC=                   Enable SpatialIndex (Speeds up AreaStores)
SPATIAL_LIB_DEPENDS=            libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=             ENABLE_SPATIAL

NLS_DESC=                       Native Language Support (ENABLE_GETTEXT)
NLS_CMAKE_BOOL=                 ENABLE_GETTEXT
NLS_USES=                       gettext
NLS_LDFLAGS=                    -L${LOCALBASE}/lib

TOUCH_DESC=                     Build with touch interface support
TOUCH_CMAKE_BOOL=               ENABLE_TOUCH
# dependency?

PROMETHEUS_DESC=                Build with Prometheus metrics exporter
PROMETHEUS_CMAKE_BOOL=          ENABLE_PROMETHEUS
# dependency?

.include 

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=                  openal
LIB_DEPENDS+=           libogg.so:audio/libogg \
                        libvorbis.so:audio/libvorbis \
                        libvorbisfile.so:audio/libvorbis
.endif

.if ${PORT_OPTIONS:MSERVER}
#USE_RC_SUBR=   ${PORTNAME}
#USERS=         ${PORTNAME}
#GROUPS=        ${PORTNAME}
#USE_RC_SUBR=           minetest/ERX
USE_RC_SUBR=            minetest
USERS=                  minetest
GROUPS=                 minetest
.endif

# Exactly why this must be done this way eludes me but this works and satisfies the install needs.
.if ${PORT_OPTIONS:MSYSTEM_FONTS}
pre-install:
        ${MKDIR} ${LOCALBASE}/share/minetest/fonts
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Bold.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-BoldItalic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Italic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Bold.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-BoldItalic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Italic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Regular.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/DroidSansFallbackFull.ttf
        ${MKDIR} ${LOCALBASE}/share/minetest/fonts
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-Bold.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-BoldItalic.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-BoldItalic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Italic.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-Italic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Bold.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Bold.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-BoldItalic.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-BoldItalic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Italic.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Italic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Regular.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Regular.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/Droid/DroidSansFallbackFull.ttf ${LOCALBASE}/share/minetest/fonts/DroidSansFallbackFull.ttf
.endif

post-install:
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  "${PREFIX}/etc/"minetest.conf.example explains options and gives their default values. "
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  Local network issues could cause singleplayer to fail. "
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  Alternate graphics driver may be set in client config, must be set to get used."
        @${ECHO_MSG} " "
        @${ECHO_MSG} " "

# hacky way to not bring irrlicht and X11 depends for server only
#.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
#BROKEN= server only hack fails for irrlicht fork
#.endif
# From wiki:
#  Building without Irrlicht / X dependency
# You can build the Minetest server without library dependencies to Irrlicht or any graphical stuff.
# You still need the Irrlicht headers for this, so first, download the irrlicht source to somewhere.
#
# When invoking CMake, use -DBUILD_CLIENT=0 -DIRRLICHT_SOURCE_DIR=/wherever/you/unzipped/the/source.

#----------------------------------------------------------------------
#
# Strangely network issues can prevent singleplayer from functioning.
# GCC           7.5+    or Clang 6.0+
# CMake         3.5+
# IrrlichtMt    -       Custom version of Irrlicht, see https://github.com/minetest/irrlicht
# Freetype      2.0+
# SQLite3       3+
# Zstd          1.0+
# LuaJIT        2.0+    Bundled Lua 5.1 is used if not present
# GMP           5.0.0+  Bundled mini-GMP is used if not present
# JsonCPP       1.0.0+  Bundled JsonCPP is used if not present
# Curl          7.56.0+ Optional
# gettext       -       Optional
#----------------------------------------------------------------------
.include 

The post-install message is there for information which I believe an official port wouldn't even place within a pkg-message file, and why must I bother with another file if this remains the same much of the time. It would be one more file to track and possibly update.

Once more: I am not an official port maintainer of official ports, and although I may have based my initial Makefiles upon prior works, these are different, unique, and likely never to be annointed in their format or style or technique.  Use them as you choose, the risk is yours regardless of whether they seem safe and effective on my system, caveat emptor for both and all.  I will attempt to keep both updated nearly as frequently as I discover new commits.

Repo urls:

Maintaining these unofficial ports [tree leaf contents files] is an enjoyable hobby which ensures that I also have the very most current software.  The process to do this officially or not is not particularly difficult but it can certainly be a challenge.  I have yet to completely beat dbeaver into utter submission, but the datestamp solution is less than obvious even with a partial answer I am uncertain how to adapt it.  You will never know how you could succeed if you never attempt it.  If there is ANYTHING out there in the Linux world which you want to have for yourself, you can try to port it.  Read the porter's handbook, my own blog posts relate my experiences.

Wednesday, May 24, 2023

The trouble with alsa

The trouble with alsa-plugins could be unique to me, which seems too often to be the case when I do choose to submit a bug report.  I have decided to play Veloren a bit more often in lieu of minetest.  In ports now is games/veloren-weekly which means this game client/server combo install will be updated by the maintainer on a 7-day cycle.  I adjusted a copy of the Makefile in my personal Ported_Software directory after copying everything else from /usr/ports/games/veloren-weekly.  My only change being to revise the commit hash and date.  This is one of the few ports that I know of which would follow the most recent git repo commit hash in a similar fashion as my own.  My revised veloren port got through all of its build and then the install of it discovered that alsa was incomplete, alsa-plugins being one of the dependencies, and it failed to install.

Instead of alsa-plugins getting installed, it stops with an error from pkg-static:

mkdir -p /usr/ports/audio/alsa-plugins/work/stage/usr/local/etc/alsa/conf.d
cd /usr/ports/audio/alsa-plugins/work/stage/usr/local/etc/alsa/conf.d
/bin/rm -f 60-speex.conf; ln -s /usr/local/share/alsa/alsa.conf.d/60-speex.conf .
cd /usr/ports/audio/alsa-plugins/work/stage/usr/local/etc/alsa/conf.d && for i in [0-9][0-9]-*.conf ; do  /bin/ln -sf ../../../share/alsa/alsa.conf.d/$i .  ; done
====> Compressing man pages (compress-man)
===>   Installing ldconfig configuration file
===>  Installing for alsa-plugins-1.2.2_9
===>  Checking if alsa-plugins is already installed
===>   Registering installation for alsa-plugins-1.2.2_9
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/etc/alsa/conf.d/10-rate-lav.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/etc/alsa/conf.d/60-a52-encoder.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_pcm_a52.la:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_pcm_a52.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate.la:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate_fast.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate_faster.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate_high.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/lib/alsa-lib/libasound_module_rate_lavrate_higher.so:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/share/alsa/alsa.conf.d/10-rate-lav.conf:No such file or directory
pkg-static: Unable to access file /usr/ports/audio/alsa-plugins/work/stage/usr/local/share/alsa/alsa.conf.d/60-a52-encoder.conf:No such file or directory
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/audio/alsa-plugins
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/audio/alsa-plugins
*** Error code 1

Stop.
make: stopped in /usr/ports/audio/alsa-plugins
root@ichigo:/usr/ports/audio/alsa-plugins #

Since I have handled numerous updates to my unofficial ports, from time to time I see a similar message.  What this means is that something about the install has changed but the pkg-plist no longer matches what was built.  Just as when updating minetest-dev or some other of my unofficial ports, what needs to be done is to set aside the pkg-plist by renaming it pkg-plist-old, and then re-creating one.  This is a quick and easy task, simply make makeplist > pkg-plist and edit the result to remove one line.  I assume that what gets built with my present alsa-plugins configuration is what would satisfy Veloren, I will just replace the pkg-plist to solve the pkg-static error messages.  The result of creating the new pkg-plist when I do a diff between them, just to show you how they are not identical, is below.  The one line I had to remove is: /you/have/to/check/what/makeplist/gives/you

root@ichigo:/usr/ports/audio/alsa-plugins # diff -y -W 120 pkg-plist pkg-plist-old | more
etc/alsa/conf.d/10-samplerate.conf                         |    %%FFMPEG%%etc/alsa/conf.d/10-rate-lav.conf
etc/alsa/conf.d/10-speexrate.conf                          |    %%SAMPLERATE%%etc/alsa/conf.d/10-samplerate.conf
etc/alsa/conf.d/50-arcam-av-ctl.conf                       |    %%FFMPEG%%etc/alsa/conf.d/60-a52-encoder.conf
etc/alsa/conf.d/50-oss.conf                                |    @comment etc/alsa/conf.d/50-arcam-av-ctl.conf
etc/alsa/conf.d/60-speex.conf                              |    @comment etc/alsa/conf.d/50-oss.conf
etc/alsa/conf.d/60-upmix.conf                              |    @comment etc/alsa/conf.d/50-pulseaudio.conf
etc/alsa/conf.d/60-vdownmix.conf                           |    %%SPEEX%%etc/alsa/conf.d/60-speex.conf
etc/alsa/conf.d/98-usb-stream.conf                         |    @comment etc/alsa/conf.d/60-upmix.conf
                                                           >    @comment etc/alsa/conf.d/60-vdownmix.conf
                                                           >    @comment etc/alsa/conf.d/98-usb-stream.conf
                                                           >    @comment etc/alsa/conf.d/99-pulseaudio-default.conf.exa
                                                           >    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.
                                                           >    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.
lib/alsa-lib/libasound_module_ctl_arcam_av.la                   lib/alsa-lib/libasound_module_ctl_arcam_av.la
lib/alsa-lib/libasound_module_ctl_arcam_av.so                   lib/alsa-lib/libasound_module_ctl_arcam_av.so
lib/alsa-lib/libasound_module_ctl_oss.la                        lib/alsa-lib/libasound_module_ctl_oss.la
lib/alsa-lib/libasound_module_ctl_oss.so                        lib/alsa-lib/libasound_module_ctl_oss.so
                                                           >    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.l
                                                           >    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.s
                                                           >    %%FFMPEG%%lib/alsa-lib/libasound_module_pcm_a52.la
                                                           >    %%FFMPEG%%lib/alsa-lib/libasound_module_pcm_a52.so
                                                           >    %%JACK%%lib/alsa-lib/libasound_module_pcm_jack.la
                                                           >    %%JACK%%lib/alsa-lib/libasound_module_pcm_jack.so
lib/alsa-lib/libasound_module_pcm_oss.la                        lib/alsa-lib/libasound_module_pcm_oss.la
lib/alsa-lib/libasound_module_pcm_oss.so                        lib/alsa-lib/libasound_module_pcm_oss.so
lib/alsa-lib/libasound_module_pcm_speex.la                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.l
lib/alsa-lib/libasound_module_pcm_speex.so                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.s
                                                           >    %%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.la
                                                           >    %%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.so
lib/alsa-lib/libasound_module_pcm_upmix.la                      lib/alsa-lib/libasound_module_pcm_upmix.la
lib/alsa-lib/libasound_module_pcm_upmix.so                      lib/alsa-lib/libasound_module_pcm_upmix.so
lib/alsa-lib/libasound_module_pcm_usb_stream.la                 lib/alsa-lib/libasound_module_pcm_usb_stream.la
lib/alsa-lib/libasound_module_pcm_usb_stream.so                 lib/alsa-lib/libasound_module_pcm_usb_stream.so
lib/alsa-lib/libasound_module_pcm_vdownmix.la                   lib/alsa-lib/libasound_module_pcm_vdownmix.la
lib/alsa-lib/libasound_module_pcm_vdownmix.so                   lib/alsa-lib/libasound_module_pcm_vdownmix.so
lib/alsa-lib/libasound_module_rate_samplerate.la           |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate.la
lib/alsa-lib/libasound_module_rate_samplerate.so           |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate.so
lib/alsa-lib/libasound_module_rate_samplerate_best.so      |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate_fa
lib/alsa-lib/libasound_module_rate_samplerate_linear.so    |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate_fa
lib/alsa-lib/libasound_module_rate_samplerate_medium.so    |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate_hi
lib/alsa-lib/libasound_module_rate_samplerate_order.so     |    %%FFMPEG%%lib/alsa-lib/libasound_module_rate_lavrate_hi
lib/alsa-lib/libasound_module_rate_speexrate.la            |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_speexrate.so            |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_speexrate_best.so       |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_speexrate_medium.so     |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
libdata/ldconfig/alsa-plugins                              |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
share/alsa/alsa.conf.d/10-samplerate.conf                  |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
share/alsa/alsa.conf.d/10-speexrate.conf                   |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.l
share/alsa/alsa.conf.d/50-arcam-av-ctl.conf                |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.s
share/alsa/alsa.conf.d/50-oss.conf                         |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_b
share/alsa/alsa.conf.d/60-speex.conf                       |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_m
share/alsa/alsa.conf.d/60-upmix.conf                       |    %%FFMPEG%%share/alsa/alsa.conf.d/10-rate-lav.conf
share/alsa/alsa.conf.d/60-vdownmix.conf                    |    %%SAMPLERATE%%share/alsa/alsa.conf.d/10-samplerate.conf
share/alsa/alsa.conf.d/98-usb-stream.conf                  |    @comment share/alsa/alsa.conf.d/50-arcam-av-ctl.conf
                                                           >    @comment share/alsa/alsa.conf.d/50-oss.conf
                                                           >    %%PULSEAUDIO%%share/alsa/alsa.conf.d/50-pulseaudio.conf
                                                           >    %%FFMPEG%%share/alsa/alsa.conf.d/60-a52-encoder.conf
                                                           >    %%SPEEX%%share/alsa/alsa.conf.d/60-speex.conf
                                                           >    @comment share/alsa/alsa.conf.d/60-upmix.conf
                                                           >    @comment share/alsa/alsa.conf.d/60-vdownmix.conf
                                                           >    @comment share/alsa/alsa.conf.d/98-usb-stream.conf

You may notice those items which are in the error messages from install are omitted from the new pkg-plist on the left or have changed to reflect what is now installed.  Of course, because I am doing this sort of 'quick and dirty' solve for installing this dependency for games/veloren, there are a number of other differences.  The old pkg-plist includes all options ticked which have conditional pkg include tags related to each config option, such as %%SPEEX%% and %%FFMPEG%% which I may not have ticked in this recent install.

After this cure for the pkg-plist issue I had when installing alsa-plugins to satisfy the dependency for veloren-weekly, it can be successfully installed (because the pkg-plist will now match what will get installed) and I can then install veloren-weekly as initially desired.  This sort of fix is fairly simple and could apply to nearly any port which strangely has a pkg-plist issue like this one.  With regard to my veloren-weekly install, I would need to re-generate the distinfo file in order to begin the reinstall process with the updated upstream commit source.

Should this pkg-plist disparity linger for any significant period of time, it would be a good candidate for a bugzilla report to help its maintainer to recognize an adjustment needs to be made for the pkg-plist.  However, I intend to assume that my system, my install, my build methods, and anything else which could affect the legitimacy of such a bug report are suspect or different or incorrect or flawed, and so I will not be making a report.  It may also already be the case that this has been updated within the time it has taken me to write this blog post.

Addendum

Whoops, a more proper less quick or dirty fix for alsa-plugins means I have to revise the pkg-plist correctly.  I had hoped that my less pretty solution would have worked but I lacked audio even though veloren was satisfied by the dependencies and successfully built.  This meant I did a much more careful comparison (diff) and modification of the generated pkg-plist to match what had been built.

The diff that I ended with is below.  If you compare the fixed one with the unedited pkg-plist in the above blog post, there are still oddities of things missing or present or renamed.  Even though it seems odd, the fixed pkg-plist did result with audio in veloren.

root@ichigo:/usr/ports/audio/alsa-plugins # diff -y -W 120 pkg-plist pkg-plist-fixed | more
etc/alsa/conf.d/10-samplerate.conf                         |    %%SAMPLERATE%%etc/alsa/conf.d/10-samplerate.conf
etc/alsa/conf.d/10-speexrate.conf                          |    %%SPEEX%%etc/alsa/conf.d/10-speexrate.conf
etc/alsa/conf.d/50-arcam-av-ctl.conf                       |    @comment etc/alsa/conf.d/50-arcam-av-ctl.conf
etc/alsa/conf.d/50-jack.conf                               |    @comment etc/alsa/conf.d/50-jack.conf
etc/alsa/conf.d/50-oss.conf                                |    @comment etc/alsa/conf.d/50-oss.conf
etc/alsa/conf.d/50-pulseaudio.conf                         |    @comment etc/alsa/conf.d/50-pulseaudio.conf
etc/alsa/conf.d/60-speex.conf                              |    %%SPEEX%%etc/alsa/conf.d/60-speex.conf
etc/alsa/conf.d/60-upmix.conf                              |    @comment etc/alsa/conf.d/60-upmix.conf
etc/alsa/conf.d/60-vdownmix.conf                           |    @comment etc/alsa/conf.d/60-vdownmix.conf
etc/alsa/conf.d/98-usb-stream.conf                         |    @comment etc/alsa/conf.d/98-usb-stream.conf
etc/alsa/conf.d/99-pulseaudio-default.conf.example         |    @comment etc/alsa/conf.d/99-pulseaudio-default.conf.exa
lib/alsa-lib/libasound_module_conf_pulse.la                |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.
lib/alsa-lib/libasound_module_conf_pulse.so                |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_conf_pulse.
lib/alsa-lib/libasound_module_ctl_arcam_av.la                   lib/alsa-lib/libasound_module_ctl_arcam_av.la
lib/alsa-lib/libasound_module_ctl_arcam_av.so                   lib/alsa-lib/libasound_module_ctl_arcam_av.so
lib/alsa-lib/libasound_module_ctl_oss.la                        lib/alsa-lib/libasound_module_ctl_oss.la
lib/alsa-lib/libasound_module_ctl_oss.so                        lib/alsa-lib/libasound_module_ctl_oss.so
lib/alsa-lib/libasound_module_ctl_pulse.la                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.l
lib/alsa-lib/libasound_module_ctl_pulse.so                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_ctl_pulse.s
lib/alsa-lib/libasound_module_pcm_jack.la                  |    %%JACK%%lib/alsa-lib/libasound_module_pcm_jack.la
lib/alsa-lib/libasound_module_pcm_jack.so                  |    %%JACK%%lib/alsa-lib/libasound_module_pcm_jack.so
lib/alsa-lib/libasound_module_pcm_oss.la                        lib/alsa-lib/libasound_module_pcm_oss.la
lib/alsa-lib/libasound_module_pcm_oss.so                        lib/alsa-lib/libasound_module_pcm_oss.so
lib/alsa-lib/libasound_module_pcm_pulse.la                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.l
lib/alsa-lib/libasound_module_pcm_pulse.so                 |    %%PULSEAUDIO%%lib/alsa-lib/libasound_module_pcm_pulse.s
lib/alsa-lib/libasound_module_pcm_speex.la                 |    %%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.la
lib/alsa-lib/libasound_module_pcm_speex.so                 |    %%SPEEX%%lib/alsa-lib/libasound_module_pcm_speex.so
lib/alsa-lib/libasound_module_pcm_upmix.la                      lib/alsa-lib/libasound_module_pcm_upmix.la
lib/alsa-lib/libasound_module_pcm_upmix.so                      lib/alsa-lib/libasound_module_pcm_upmix.so
lib/alsa-lib/libasound_module_pcm_usb_stream.la                 lib/alsa-lib/libasound_module_pcm_usb_stream.la
lib/alsa-lib/libasound_module_pcm_usb_stream.so                 lib/alsa-lib/libasound_module_pcm_usb_stream.so
lib/alsa-lib/libasound_module_pcm_vdownmix.la                   lib/alsa-lib/libasound_module_pcm_vdownmix.la
lib/alsa-lib/libasound_module_pcm_vdownmix.so                   lib/alsa-lib/libasound_module_pcm_vdownmix.so
lib/alsa-lib/libasound_module_rate_samplerate.la           |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_samplerate.so           |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_samplerate_best.so      |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_samplerate_linear.so    |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_samplerate_medium.so    |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_samplerate_order.so     |    %%SAMPLERATE%%lib/alsa-lib/libasound_module_rate_sample
lib/alsa-lib/libasound_module_rate_speexrate.la            |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.l
lib/alsa-lib/libasound_module_rate_speexrate.so            |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate.s
lib/alsa-lib/libasound_module_rate_speexrate_best.so       |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_b
lib/alsa-lib/libasound_module_rate_speexrate_medium.so     |    %%SPEEX%%lib/alsa-lib/libasound_module_rate_speexrate_m
libdata/ldconfig/alsa-plugins                                   libdata/ldconfig/alsa-plugins
share/alsa/alsa.conf.d/10-samplerate.conf                  |    %%SAMPLERATE%%share/alsa/alsa.conf.d/10-samplerate.conf
share/alsa/alsa.conf.d/10-speexrate.conf                   |    %%SPEEX%%share/alsa/alsa.conf.d/10-speexrate.conf
share/alsa/alsa.conf.d/50-arcam-av-ctl.conf                |    @comment share/alsa/alsa.conf.d/50-arcam-av-ctl.conf
share/alsa/alsa.conf.d/50-jack.conf                        |    %%JACK%%share/alsa/alsa.conf.d/50-jack.conf
share/alsa/alsa.conf.d/50-oss.conf                         |    @comment share/alsa/alsa.conf.d/50-oss.conf
share/alsa/alsa.conf.d/50-pulseaudio.conf                  |    %%PULSEAUDIO%%share/alsa/alsa.conf.d/50-pulseaudio.conf
share/alsa/alsa.conf.d/60-speex.conf                       |    %%SPEEX%%share/alsa/alsa.conf.d/60-speex.conf
share/alsa/alsa.conf.d/60-upmix.conf                       |    @comment share/alsa/alsa.conf.d/60-upmix.conf
share/alsa/alsa.conf.d/60-vdownmix.conf                    |    @comment share/alsa/alsa.conf.d/60-vdownmix.conf
share/alsa/alsa.conf.d/98-usb-stream.conf                  |    @comment share/alsa/alsa.conf.d/98-usb-stream.conf

Sunday, October 30, 2022

LibreSSL hermit cousin

I have now been through a process of switching back and forth between LibreSSL and openssl at least a few too many times.  I really would prefer to use LibreSSL but it is very much not suited to a standard desktop system with a bunch of other things like multimedia and games installed.  The trouble is not precisely LibreSSL itself but that it is like openssl's hermit cousin, left off in the wilderness somewhere perfectly secure but not dealing much with others.

I'm sure the open source community at large and software in general would be best served if LibreSSL were widely adopted except that it is not.  If you use OpenBSD, I'm certain that LibreSSL is a first class citizen, as well as seeing the soonest updates of LibreSSL for anything OpenBSD or its users actively maintain.  Here in FreeBSD land, we are a bit more cozy with Linux and its upstream whims and therefore cannot expect LibreSSL to be noticed for what it is and can do.  We therefore should not attempt to keep LibreSSL on our personal use machines if we also use a plethora of other software because eventually something will become updated or break or lack compatibility with LibreSSL for a short time or if we're unlucky for weeks or permanently.

In our world, LibreSSL compatibility is not a huge concern, except for firewall-router platforms such as OPNsense.  It may not always be the first choice but it is a choice and with the more security and network oriented applications or plugins involved on such a platform, we can be most assured that LibreSSL will be treated properly, kept up to date with everything else, and likely the software it finds itself among will be well aware of LibreSSL.

I have had LibreSSL in my custom base install for a while, then due to updates of FreeBSD temporarily shifted to openssl, and then back to LibreSSL when I had the time to do so.  Even when I did not have it explicitly in my base install, I had it installed from ports and expected everything to use it.  My most recent difficulty is what has lead me to the bizarre (as in why did it take me so damn long) realization that I should quit attempting to use LibreSSL on my desktop machine.  For the longest moment things were working just fine, but then this always ends kinda sudden, with one more mass build via poudriere and huge pkg upgrade process which then leaves me without any of various previously installed things.

Two ports that have each become a 'lynchpin' for numerous others, and in some ways that defy my own understanding of dependency mechanisms, are rust and py-cryptography.  I understand that crypto for or related to ssl makes sense but it and rust seem to prevent many ports from building when they fail within a poudriere bulk build.  I can look at any number of the ports which are claimed to need rust or py-cryptography but they are most certainly not a first order requirement for some as expected.  Firefox has needed rust for quite a while now, so I can understand that failing but since when has Xorg or x apps themselves individually been built needing rust?  In order to battle past this seeming database confusion I now regularly pkg check -Ba to hopefully correct or alert me of issues.

I don't mean for this to be a diatribe against LibreSSL which performs its job well when used.  It is not the fault of LibreSSL that more things have not been made compatible with it, it is the shortcomings of what is largely the Linux community for not offering it as a functional drop-in where ssl is concerned.  It may be that LibreSSL works best on OpenBSD and for limited software installs such as router-firewall devices, or perhaps even a very limited desktop, but hoping for it to never fail you when having thousands of other things including games and multimedia installed is expecting too much-- and even then it is still not LibreSSL that is the actual issue.  Avoid future headaches, use openssl on your do-everything desktop but employ it for your firewall-router box, or maybe containerize all your other tools and games where they can use openssl while the host functions nicely with LibreSSL.

Frequently viewed this week