Freeing update disk space

Since moving house, the FreeBSD box has reverted to a headless server, with all updates taking place via the CLI. I have Webmin installed but this is mainly as a backup / alternative and to view a few things graphically, like disk space.

I use the the OneDrive port to manually sync my OneDrive as an offline copy as I only run it on demand so works as an offline copy. The downsize is that I am rapidly running out of disk space as never envisaged a 1Tb store to be backed up to the FB disks.

With the combination of Headless Server and no longer a need for the X interface, I was left with a large number of X applications no longer needed. Just judicious use of PKG Delete and port deinstall I removed a fair amount of unnecessary applications. I thought that was that, but then reminded of the PKG AUTOREMOVE command which freed up another 4Gb from the main drive and 286 packages from the tree. As I look to update to the next branch of the FreeBSD upgrade stream, this should ease the amount of packages and data that will need to be processed to complete the upgrade.

LetsEncrypt update failures

As the server is hosted from home, sometime the droning of the Hard Drive and fans annoys me and as I only host this for fun and self learning it occasionally gets turned of. This meant it missed the Cron Jobs that that should have replaced the cert long before renewal date.

Added to that, when I moved I locked down the router config and only allowed port 443 thru to the webserver to only permit TLS/SSL traffic and not plain HTTP. In the main this has worked well, but also meant the certbot script failed to renew the cert on demand as it could not write to the .wellknown folder on port 80.

So, now port forwarded port 80 to the server and the certificate has updated as required.

Clearing up disc space

my ports \distfiles directory had grown to over 30Gb in the 4 years since I last did a complete clean fresh build and as its something of a test rig for trying stuff out, it had grown rather large.

by running the following commands I regained c22Gb of disc space, ready for which ever pet project I choose to tinker with next.

sudo portmaster --check-depends 
sudo portmaster --check-port-dbdir 
sudo portmaster -s 
sudo portmaster -y --clean-distfiles

Python27, LLVM and CLI for OneDrive

One of the most useful features I use the Freebsd box for is to cache a copy of my MS OneDrive that is only periodically synced, so that is MS has a problem I have a full offline copy or if I manage delete a file from the cloud that I really didn’t want to do and hopefully I still have a copy in the unsynced cache.

All was fine until the OneDrive port for FreeBSD insisted on reinstalling the long deprecated Python27 libraries. No matter how much cleaning and checking dependencies prevented Python27 being rebuilt from ports each time.

I managed to spend some time today looking at each of the OneDrive dependencies and found that LLVM70 and LLVM10 are both listed. Oddly LLVM10 supersedes LLVM70 and calls in the more modern Python37. So by building LLVM10 first so the dependency is met, when I rebuild OneDrive I no longer get the obsolete version installed.

The Metaport of LLVM is not clear which version is built, I already have LLVM90 installed but does not seem to satisfy the OneDrive dependencies. Not sure if this is OneDrive maintenance issue, or a LLVM issue. but thankfully now resolved and the box can get back to doing what it should. –

Update – LLVM was not the issue, but LDC which calls in LLVM. When the next port update to OneDrive came out, LDC rebuilt LLVM70. So now looking at LDC as the culprit.

The OneDrive CLI client is not unique to BSD and the default GitHub page for Linux version can be found here.

re-build world again….

might not be full lockdown, but the vaccines are here so time to rebuild both the virtual and IRL world.. Updated FreeBSD to 12.2 which had probably been one of the simplest OS updates. I usually get caught out with merging the updated config files but guess the second point update to 12.x probably was not a major change to get wrong. Also made easier by stripping off MATE and most of the desktop apps that I occassionally dabbled with as its back to running as as Headless Server with all access over SSH or Web Interface.

PHPipam, FreeBSD and network discovery

PHPipam is an IP Address Management utility written in PHP. Slightly overkill for managing a home network with just one subnet and just a possible 255 different IP addresses for me to manage, but hey, its free and we use it at work so being able to hack about with it in the safety of my own home is quite nice.

However, FreeBSD is not first choice for PHPipam average users so the default locations for Ping and FPing are not where a standard Linux install would expect to find them. For FreeBSD you have to log into your PHPipam landing page and head to the Administration section and amend the path for :

/bin/ping to /sbin/ping note the extra s

and

/bin/fping to /usr/local/sbin/fping

and then network discovery scans should work for you

Grrr Nettle woes next

After finally getting RHASH to build, a few easy days and then Nettle would not build. I tried everything, MAKE CLEAN, DEINSTALL, rebuilding build dependencies, nothing worked. Re-installing the old package again kept everything work.

In deperation, I saw the the GHOST-BSD laptop I am currently testing had a built package for nettle-3.6 so in desparation and part trial, I copied the nettle package from the laptop to the server and then issued SUDO PKG ADD path/to/nettle.3.5.xxx and hey presto, it installed and after several reboots and rebuilds of dependent packages it works. Its probably not the safest or more secure, but allowed all the packages that then depend on GNUTLS to build to the latest ports.

RHASH build woes

Have spent two weeks trying to update RHASH from 1.3.5 to 1.3.9 via ports, but kept giving build errors on openssl.mod which no one else was reporting. Tried to deinstall clean and rebuild and still no go.

Checked Freshports for updates and it is not updated very often but did notice that gettext-tools and gettext-runtime where listed as dependencies too. So quick make deinstall clean and re-install I thought might help. But part way thru reinstalling, Sudo no longer worked on getting gettext-runtime to function. Seems deinstalling gettext-tools broke Sudo. So quick SU to rebuild gettext-tools and sign out and back in again might fix it.

but oh no, still the same build error. However asking portmaster to build atril, it then went away happily and updated RHASH thereby allowing CMAKE to update and now the remaining ports seems to be updating happily enough.

Things to do in lockdown – rebuild world!

Well, FreeBSD world. time had come to update to 12.1 release and thankfully its been much easier than the jump from 11.x to 12.0 Merge did not throw up any issues and 12.1 base built itself overnight ready for installing yesterday morning.

Only pain has been trying to stop python2 getting installed with re-installing all the ports. I think I am just going to have to accept until everything is rebuilt and then remove it. Default versions have been defined in make.conf but seems some ports ignore.

Biggest challenge I was running the Kmod-legacy-drm drivers in the belief these were correct. Several reboots and reinstalls and tinkering did not resolve the unreadable display at boot time meant I had to SSH in from elsewhere to work on it. The cure in the end was quite simple, install the current kmod driver port and voila hi-res text and graphics have been restored. Only issue now is that the Mate Desktop menu’s have disappeared to I can’t actually quit the desktop. but least I can work the box directly now.

EDIT: reinstall of Mate notifications and menu ports has restored my menus.

Old School BIOS Update – via CD-ROM

Planning for the next major FreeBSD update, I decided I should update the old BIOS first, Lenovo are very good at releasing updates to BIOS/UEFI long after the product has ceased being available.

Suffice to say a quick check of https://pcsupport.leveno.com/gb/en and pumping in the Model No (or device serial no) detailed a list of updates for my hardware a good 5 years newer than the original BIOS that shipped with this box.

However is its non-Windows all the usual update tools where irrelevant. Litterally had to dust down my DVD/CD recordable drive and download the BIOS ISO and burn to CD. A quick dabble to change the boot order and re-enable the original DVD drive and I was finally able to flash the BIOS. All very slow compared to in-windows updates on my other devices.

No major great improvements, but better support for any more modern hardware I might chuck inside like SSD’s in the future.