BSD Now

BSD Now

Download on the App Store

All BSD Now episodes

  • Episode 271: Automatic Drive Tests | BSD Now 271

    MidnightBSD 1.0 released, MeetBSD review, EuroBSDcon trip reports, DNS over TLS in FreeBSD 12, Upgrading OpenBSD with Ansible, how to use smartd to run tests on your drives automatically, and more.

    ##Headlines

    ###MidnightBSD 1.0 now available

    I’m happy to announce the availability of MidnightBSD 1.0 for amd64 and i386. Over the years, many ambitious goals were set for our 1.0 release. As it approached, it was clear we wouldn’t be able to accomplish all of them. This release is more of a natural progression rather than a groundbreaking event. It includes many updates to the base system, improvements to the package manager, an updated compiler, and tools.

    Of particular note, you can now boot off of ZFS and use NVME SSDs and some AMD Radeon graphics cards support acceleration. AMD Ryzen support has greatly improved in this release. We also have added bhyve from FreeBSD.
    The 1.0 release is finally available. Still building packages for i386 and plan to do an amd64 package build later in the week. The single largest issue with the release process has been the web server performance. The CPU is overloaded and has been at solid 100% for several days. The server has a core i7 7700 in it. I’m trying to figure out what to buy as an upgrade so that we don’t continue to have this issue going forward. As it’s actually blocked in multiple processes, a 6 or 8 core chip might be an improvement for the workload…

    • Download links: https://www.midnightbsd.org/download/
    • https://www.youtube.com/watch?time_continue=33&v=-rlk2wFsjJ4
    • ###MeetBSD Review

      MeetBSD 2018 took place at the sprawling Intel Santa Clara campus. The venue itself felt more like an olive branch than a simple friendly gesture by Intel. In truth it felt like a bit of an apology. You get the subtle sense they feel bad about how the BSD’s were treated with the Meltdown and Specter flaws. In fact, you may be right to think they felt a bit sorry towards the entire open source community.

      • MeetBSD 2018
      • At most massive venues the parking is the first concern, not so here - in fact that was rather straightforward. No, the real challenge is navigating the buildings. Luckily I had help from navigator extraordinaire, Hadea, who located the correct building, SC12 quickly. Finding the entrance took a moment or two though. The lobby itself was converted by iXsystems efficiently into the MeetBSD expo hall, clean, efficient and roomy with registration, some seating, and an extra conference room for on-on-one sessions. On day two sponsor booths were also setup. All who showed up on day one were warmly greeted with badges, lanyards and goodies by Denise and her friendly team.

        Like every great BSD event, plenty of food was made available. And as always they make it look effortless. These events showcase iXsystem’s inherent generosity toward its community; with breakfast items in the back of the main auditorium room in the morning, boxed lunches, fruit and cookies at lunch time, and snacks for the rest of the day. But just in case your still hungry, there is a pizza meetup in another Intel room after day one and two.
        MeetBSD leverages it’s realistically small crowd size on day one. The morning starts off with introductions of the entire group, the mic is passed around the room.
        The group is a good mix of pros in the industry (such as Juniper, Intel, Ebay, Groupon, Cisco, etc), iX staff, and a few enthusiast. Lots of people with a focus or passion for networking. And, of course, some friendly Linux bashing went down for good measure, always followed by a good natured chuckle.

        • MeetBSD Gives me The Feels
        • I find that I am subtly unnerved at this venue, and at lunch I saw it clearly. I have always had a strong geek radar, allowing me to navigate a new area (like Berkeley for MeetBSD of 2016, or even SCALE earlier this year in Pasadena), and in a glance I can see who is from my conference and who isn’t. This means it is easy, nearly effortless to know who to greet with a smile and a wave. These are MY people. Here at the Intel campus though it is different. The drive in alone reveals behemoth complexes all with well known tech names prominently displayed. This is Silicon Valley, and all of these people look like MY people. So much for knowing who’s from my conference. Thank goodness for those infamous BSD horns. None-the-less I am struck by how massive these tech giants are. And Intel is one of the largest of those giants, and see the physical reminders of this fact brought home the significance that they had opened their doors, wifi, and bathrooms to the BSD community.

          ###[EuroBSDcon 2018 Trip Reports]

          https://www.freebsdfoundation.org/blog/eurobsd-2018-trip-report-joseph-mingrone/
          https://www.freebsdfoundation.org/blog/eurobsd-2018-trip-report-vinicius-zavam/
          https://www.freebsdfoundation.org/blog/eurobsd-2018-trip-report-emmanuel-vadot/

          ##News Roundup

          ###DNS over TLS in FreeBSD 12

          With the arrival of OpenSSL 1.1.1, an upgraded Unbound, and some changes to the setup and init scripts, FreeBSD 12.0, currently in beta, now supports DNS over TLS out of the box.

          DNS over TLS is just what it sounds like: DNS over TCP, but wrapped in a TLS session. It encrypts your requests and the server’s replies, and optionally allows you to verify the identity of the server. The advantages are protection against eavesdropping and manipulation of your DNS traffic; the drawbacks are a slight performance degradation and potential firewall traversal issues, as it runs over a non-standard port (TCP port 853) which may be blocked on some networks. Let’s take a look at how to set it up.

          • Conclusion
          • We’ve seen how to set up Unbound—specifically, the local_unbound service in FreeBSD 12.0—to use DNS over TLS instead of plain UDP or TCP, using Cloudflare’s public DNS service as an example. We’ve looked at the performance impact, and at how to ensure (and verify) that Unbound validates the server certificate to prevent man-in-the-middle attacks.

            The question that remains is whether it is all worth it. There is undeniably a performance hit, though this may improve with TLS 1.3. More importantly, there are currently very few DNS-over-TLS providers—only one, really, since Quad9 filter their responses—and you have to weigh the advantage of encrypting your DNS traffic against the disadvantage of sending it all to a single organization. I can’t answer that question for you, but I can tell you that the parameters are evolving quickly, and if your answer is negative today, it may not remain so for long. More providers will appear. Performance will improve with TLS 1.3 and QUIC. Within a year or two, running DNS over TLS may very well become the rule rather than the experimental exception.

            ###Upgrading OpenBSD with Ansible

            • My router runs OpenBSD -current
            • A few months ago, I needed software that had just hit the ports tree. I didn’t want to wait for the next release, so I upgraded my router to use -current. Since then, I’ve continued running -current, which means upgrading to a newer snapshot every so often. Running -current is great, but the process of updating to a newer snapshot was cumbersome. Initially, I had to plug in a serial cable and then reboot into bsd.rd, hit enter ten times, then reboot, run sysmerge and update packages.

              I eventually switched to upobsd to be able to upgrade without the need for a serial connection. The process was better, but still tiresome. Usually, I would prepare the special version of bsd.rd, boot on bsd.rd, and do something like wash the dishes in the meantime. After about ten minutes, I would dry my hands and then go back to my workstation to see whether the bsd.rd part had finished so I could run sysmerge and pkg_add, and then return to the dishes while it upgraded packages.
              Out of laziness, I thought: “I should automate this,” but what happened instead is that I simply didn’t upgrade that machine very often. (Yes, laziness). With my router out of commission, life is very dull, because it is my gateway to the Internet. Even services hosted at my place (like my Mastodon instance) are not reachable when the router is down because I use multiple VLANs (so I need the router to jump across VLANs).

              • Ansible Reboot Module
              • I recently got a new job, and one of my first tasks was auditing the Ansible roles written by my predecessors. In one role, the machine rebooted and they used the wait_for_connection module to wait for it to come back up. That sounded quite hackish to me, so out of curiosity, I tried to determine whether there was a better way. I also thought I might be able to use something similar to further automate my OpenBSD upgrades, and wanted to assess the cleanliness of this method. ;-)

                I learned that with the then-upcoming 2.7 Ansible release, a proper reboot module would be included. I went to the docs, which stated that for a certain parameter:
                I took this to mean that there was no support for OpenBSD. I looked at the code and, indeed, there was not. However, I believed that it wouldn’t be too hard to add it. I added the missing pieces for OpenBSD, tested it on my poor Pine64 and then submitted it upstream. After a quick back and forth, the module’s author merged it into devel (having a friend working at Red Hat helped the process, merci Cyril !) A couple days later, the release engineer merged it into stable-2.7.
                I proceeded to actually write the playbook, and then I hit a bug. The parameter reboot_timeout was not recognized by Ansible. This feature would definitely be useful on a slow machine (such as the Pine64 and its dying SD card). Again, my fix was merged into master by the module’s author and then merged into stable-2.7. 2.7.1 will be the first release to feature these fixes, but if you use OpenBSD -current, you already have access to them. I backported the patches when I updated ansible.
                Fun fact about Ansible and reboots: “The win_reboot module was […] included with Ansible 2.1,” while for unix systems it wasn’t added until 2.7. :D For more details, you can read the module’s author blog article.

                • The explanations
                • Ansible runs my script on the remote host to fetch the sets. It creates an answer file from the template and then gives it to upobsd. Once upobsd has created the kernel, Ansible copies it in place of /bsd on the host. The router reboots and boots on /bsd, which is upobsd’s bsd.rd. The installer runs in auto_update mode. Once it comes back from bsd.rd land, it archives the kernel and finishes by upgrading all the packages.

                  It also supports upgrading without fetching the sets ahead of time. For instance, I upgrade this way on my Pine64 because if I cared about speed, I wouldn’t use this weak computer with its dying SD card. For this case, I just comment out the path_sets variable and Ansible instead creates an answer file that will instruct the installer to fetch the sets from the designated mirror.
                  I’ve been archiving my kernels for a few years. It’s a nice way to fill up / keep a history of my upgrades. If I spot a regression, I can try a previous kernel … which may not work with the then-desynchronized userland, but that’s another story.
                  sysmerge already runs with rc.sysmerge in batch mode and sends the result by email. I don’t think there’s merit to running it again in the playbook. The only perk would be discovering in the terminal whether any files need to be manually merged, rather than reading exactly the same output in the email.
                  Initially, I used the openbsd_pkg module, but it doesn’t work on -current just before a release because pkg_add automatically looks for pub/OpenBSD/${release}/packages/${arch} (which is empty). I wrote and tested this playbook while 6.4 was around the corner, so I switched to command to be able to pass the -Dsnap parameter.

                  • The result
                  • I’m very happy with the playbook! It performs the upgrade with as little intervention as possible and minimal downtime. \o/

                    ###Using smartd to automatically run tests on your drives

                    Those programs can “control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA/SATA, SCSI/SAS and NVMe disks. In many cases, these utilities will provide advanced warning of disk degradation and failure.” See the smartmontools website for more information.

                    NOTE: “Due to OS-specific issues and also depending on the different state of smartmontools development on the platforms, device support is not the same for all OS platforms.” – use the documentation for your OS.

                    I first started using smartd in March 2010 (according to that blog post, that’s when I still writing on both The FreeBSD Diary and this blog). Back then, and until recently, all I did was start smartd. As far as I can tell, all it did was send daily status messages via the FreeBSD periodic tools. I would set my drive devices via daily_status_smart_devices in /etc/periodic.conf and the daily status reports would include drive health information.

                    • Two types of tests
                    • My original abandoned attempt
                    • How do you prove it works?
                    • Looking at the test results
                    • Failed drive to the rescue
                    • smartd.conf I am using
                    • supernews
                    • ##Beastie Bits

                      • Decent Pics of “Relayd & Httpd Mastery” signature
                      • A Unix Shell poster from 1983
                      • Cambridge UNIX historians (Cambridge, United Kingdom)
                      • Goals for FreeBSD 13
                      • September/October 2018 Issue of the FreeBSD Journal Now Available
                      • Using acme.sh for Let’s Encrypt certificates on pkgsrc.org servers
                      • Deploying Anycast DNS Using OpenBSD and BGP
                      • How to check your data integrity?
                      • ##Feedback/Questions

                        • Raymond - MeetBSD California
                          • Dev Summit Videos: https://www.youtube.com/playlist?list=PLb87fdKUIo8TNG6f94xo9_W-XXrEbqgWI
                          • Conference Videos: https://www.youtube.com/playlist?list=PLb87fdKUIo8Q41aoPE6vssP-uF4dxk86b
                          • Conference videos are still being processed, the rest should appear over the next few weeks.

                          • Greg - Stable vs Release

                          • Mjrodriguez - Open/FreeBSD support for Single Board computers


                            • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                            • 1 hr 9 min
                            • Episode 270: Ghostly Releases | BSD Now 270

                              OpenBSD 6.4 released, GhostBSD RC2 released, MeetBSD - the ultimate hallway track, DragonflyBSD desktop on a Thinkpad, Porting keybase to NetBSD, OpenSSH 7.9, and draft-ietf-6man-ipv6only-flag in FreeBSD.

                              ##Headlines

                              ###OpenBSD 6.4 released

                              • See a detailed log of changes between the 6.3 and 6.4 releases.
                              • See the information on the FTP page for a list of mirror machines.
                              • Have a look at the 6.4 errata page for a list of bugs and workarounds.
                              • signify(1) pubkeys for this release:
                              • base: RWQq6XmS4eDAcQW4KsT5Ka0KwTQp2JMOP9V/DR4HTVOL5Bc0D7LeuPwA
                              • fw: RWRoBbjnosJ/39llpve1XaNIrrQND4knG+jSBeIUYU8x4WNkxz6a2K97
                              • pkg: RWRF5TTY+LoN/51QD5kM2hKDtMTzycQBBPmPYhyQEb1+4pff/H6fh/kA
                              • ###GhostBSD 18.10 RC2 Announced

                                This second release candidate of GhostBSD 18.10 is the second official release of GhostBSD with TrueOS under the hood. The official desktop of GhostBSD is MATE. However, in the future, there might be an XFCE community release, but for now, there is no community release yet.

                                • What has changed since RC1

                                • Removed drm-stable-kmod and we will let users installed the propper drm-*-kmod

                                • Douglas Joachin added libva-intel-driver libva-vdpau-driver to supports accelerated some video driver for Intel

                                • Issues that got fixed

                                • Bug #70 Cannot run Octopi, missing libgksu error.

                                • Bug #71 LibreOffice doesn’t start because of missing libcurl.so.4

                                • Bug #72 libarchive is a missing dependency

                                  Again thanks to iXsystems, TrueOS, Joe Maloney, Kris Moore, Ken Moore, Martin Wilke, Neville Goddard, Vester “Vic” Thacker, Douglas Joachim, Alex Lyakhov, Yetkin Degirmenci and many more who helped to make the transition from FreeBSD to TrueOS smoother.

                                  • Updating from RC1 to RC2:

                                  • sudo pkg update -f

                                  • sudo pkg install -f libarchive curl libgksu

                                  • sudo pkg upgrade

                                  • Where to download:

                                  • All images checksum, hybrid ISO(DVD, USB) and torrent are available here: https://www.ghostbsd.org/download

                                  • [ScreenShots]

                                  • https://www.ghostbsd.org/sites/default/files/Screenshot_at_2018-10-20_13-22-41.png

                                  • https://www.ghostbsd.org/sites/default/files/Screenshot_at_2018-10-20_13-27-26.png

                                    ###OpenSSH 7.9 has been released and it has support for OpenSSL 1.1

                                    Changes since OpenSSH 7.8
                                    =========================
                                    This is primarily a bugfix release.
                                    New Features
                                    ------------
                                    * ssh(1), sshd(8): allow most port numbers to be specified using
                                    service names from getservbyname(3) (typically /etc/services).
                                    * ssh(1): allow the IdentityAgent configuration directive to accept
                                    environment variable names. This supports the use of multiple
                                    agent sockets without needing to use fixed paths.
                                    * sshd(8): support signalling sessions via the SSH protocol.
                                    A limited subset of signals is supported and only for login or
                                    command sessions (i.e. not subsystems) that were not subject to
                                    a forced command via authorized_keys or sshd_config. bz#1424
                                    * ssh(1): support "ssh -Q sig" to list supported signature options.
                                    Also "ssh -Q help" to show the full set of supported queries.
                                    * ssh(1), sshd(8): add a CASignatureAlgorithms option for the
                                    client and server configs to allow control over which signature
                                    formats are allowed for CAs to sign certificates. For example,
                                    this allows banning CAs that sign certificates using the RSA-SHA1
                                    signature algorithm.
                                    * sshd(8), ssh-keygen(1): allow key revocation lists (KRLs) to
                                    revoke keys specified by SHA256 hash.
                                    * ssh-keygen(1): allow creation of key revocation lists directly
                                    from base64-encoded SHA256 fingerprints. This supports revoking
                                    keys using only the information contained in sshd(8)
                                    authentication log messages.
                                    Bugfixes
                                    --------
                                    * ssh(1), ssh-keygen(1): avoid spurious "invalid format" errors when
                                    attempting to load PEM private keys while using an incorrect
                                    passphrase. bz#2901
                                    * sshd(8): when a channel closed message is received from a client,
                                    close the stderr file descriptor at the same time stdout is
                                    closed. This avoids stuck processes if they were waiting for
                                    stderr to close and were insensitive to stdin/out closing. bz#2863
                                    * ssh(1): allow ForwardX11Timeout=0 to disable the untrusted X11
                                    forwarding timeout and support X11 forwarding indefinitely.
                                    Previously the behaviour of ForwardX11Timeout=0 was undefined.
                                    * sshd(8): when compiled with GSSAPI support, cache supported method
                                    OIDs regardless of whether GSSAPI authentication is enabled in the
                                    main section of sshd_config. This avoids sandbox violations if
                                    GSSAPI authentication was later enabled in a Match block. bz#2107
                                    * sshd(8): do not fail closed when configured with a text key
                                    revocation list that contains a too-short key. bz#2897
                                    * ssh(1): treat connections with ProxyJump specified the same as
                                    ones with a ProxyCommand set with regards to hostname
                                    canonicalisation (i.e. don't try to canonicalise the hostname
                                    unless CanonicalizeHostname is set to 'always'). bz#2896
                                    * ssh(1): fix regression in OpenSSH 7.8 that could prevent public-
                                    key authentication using certificates hosted in a ssh-agent(1)
                                    or against sshd(8) from OpenSSH <7.8.
                                    Portability
                                    -----------
                                    * All: support building against the openssl-1.1 API (releases 1.1.0g
                                    and later). The openssl-1.0 API will remain supported at least
                                    until OpenSSL terminates security patch support for that API version.
                                    * sshd(8): allow the futex(2) syscall in the Linux seccomp sandbox;
                                    apparently required by some glibc/OpenSSL combinations.
                                    * sshd(8): handle getgrouplist(3) returning more than
                                    _SC_NGROUPS_MAX groups. Some platforms consider this limit more
                                    as a guideline.

                                    ##News Roundup

                                    ###MeetBSD 2018: The Ultimate Hallway Track

                                    Founded in Poland in 2007 and first hosted in California in 2008, MeetBSD combines formal talks with UnConference activities to provide a level of interactivity not found at any other BSD conference. The character of each MeetBSD is determined largely by its venue, ranging from Hacker Dojo in 2010 to Intel’s Santa Clara headquarters this year. The Intel SC12 building provided a beautiful auditorium and sponsors’ room, plus a cafeteria for the Friday night social event and the Saturday night FreeBSD 25th Anniversary Celebration. The formal nature of the auditorium motivated the formation of MeetBSD’s first independent Program Committee and public Call for Participation. Together these resulted in a backbone of talks presented by speakers from the USA, Canada, and Poland, combined with UnConference activities tailored to the space.

                                    • MeetBSD Day 0
                                    • Day Zero of MeetBSD was a FreeBSD Developer/Vendor Summit hosted in the same auditorium where the talks would take place. Like the conference itself, this event featured a mix of scheduled talks and interactive sessions. The scheduled talks were LWPMFS: LightWeight Persistent Memory Filesystem by Ravi Pokala, Evaluating GIT for FreeBSD by Ed Maste, and NUMA by Mark Johnston. Ed’s overview of the advantages and disadvantages of using Git for FreeBSD development was of the most interest to users and developers, and the discussion continued into the following two days.

                                      • MeetBSD Day 1
                                      • The first official day of MeetBSD 2018 was kicked off with introductions led by emcee JT Pennington and a keynote, “Using TrueOS to boot-strap your FreeBSD-based project” by Kris Moore. Kris described a new JSON-based release infrastructure that he has exercised with FreeBSD, TrueOS, and FreeNAS. Kris’ talk was followed by “Intel & FreeBSD: Better Together” by Ben Widawsky, the FreeBSD program lead at Intel, who gave an overview of Intel’s past and current efforts supporting FreeBSD. Next came lunch, followed by Kamil Rytarowski’s “Bug detecting software in the NetBSD userland: MKSANITIZER”. This was followed by 5-Minute Lightning Talks, Andrew Fengler’s “FreeBSD: What to (Not) Monitor”, and an OpenZFS Panel Discussion featuring OpenZFS experts Michael W. Lucas, Allan Jude, Alexander Motin, Pawel Dawidek, and Dan Langille. Day one concluded with a social event at the Intel cafeteria where the discussions continued into the night.

                                        • MeetBSD Day 2
                                        • Day Two of MeetBSD 2018 kicked off with a keynote by Michael W. Lucas entitled “Why BSD?”, where Michael detailed what makes the BSD community different and why it attracts us all. This was followed by Dr. Kirk McKusick’s “The Early Days of BSD” talk, which was followed by “DTrace/dwatch in Production” by Devin Teske. After lunch, we enjoyed “A Curmudgeon’s Language Selection Criteria: Why I Don’t Write Everything in Go, Rust, Elixir, etc” by G. Clifford Williams and, “Best practices of sandboxing applications with Capsicum” by Mariusz Zaborski. I then hosted a Virtualization Panel Discussion that featured eight developers from FreeBSD, OpenBSD, and NetBSD. We then split up for Breakout Sessions and the one on Bloomberg’s controversial article on backdoored Supermicro systems was fascinating given the experts present, all of whom were skeptical of the feasibility of the attack. The day wrapped up with a final talk, “Tales of a Daemontown Performance Peddler: Why ‘it depends’ and what you can do about it” by Nick Principe, followed by the FreeBSD 25th Anniversary Celebration.

                                          • Putting the “meet” in MeetBSD
                                          • I confess the other organizers and I were nervous about how well one large auditorium would suit a BSD event but the flexible personal space it gave everyone allowed for countless meetings and heated hacking that often brought about immediate results. I watched people take ideas through several iterations with the help and input of obvious and unexpected experts, all of whom were within reach. Not having to pick up and leave for a talk in another room organically resulted in essentially a series of mini hackathons that none of us anticipated but were delighted to witness, taking the “hallway track” to a whole new level. The mix of formal and UnConference activities at MeetBSD is certain to evolve. Thank you to everyone who participated with questions, Lightning Talks, and Panel participation. A huge thanks to our sponsors, including Intel for both hosting and sponsoring MeetBSD California 2018, Western Digital, Supermicro, Verisign, Jupiter Broadcasting, the FreeBSD Foundation, Bank of America Merrill Lynch, the NetBSD Foundation, and the team at iXsystems.

                                            See you at MeetBSD 2020!

                                            ###Setup DragonflyBSD with a desktop on real hardware ThinkPad T410

                                            +Video Demo

                                            Linux has become too mainstream and standard BSD is a common thing now? How about DragonflyBSD which was created as a fork of FreeBSD 4.8 in conflict over system internals. This tutorial will show how to install it and set up a user-oriented desktop. It should work with DragonflyBSD, FreeBSD and probably all BSDs.

                                            Some background: BSD was is ultimately derived from UNIX back in the days. It is not Linux even though it is similar in many ways because Linux was designed to follow UNIX principles. Seeing is believing, so check out the video of the install!
                                            I did try two BSD distros before called GhostBSD and TrueOS and you can check out my short reviews. DragonflyBSD comes like FreeBSD bare bones and requires some work to get a desktop running.

                                            • Download image file and burn to USB drive or DVD

                                            • First installation

                                            • Setting up the system and installing a desktop

                                            • Inside the desktop

                                            • Install some more programs

                                            • How to enable sound?

                                            • Let’s play some free games

                                            • Setup WiFi

                                            • Power mode settings

                                            • More to do?

                                              You can check out this blog post if you want a much more detailed tutorial. If you don’t mind standard BSD, get the GhostBSD distro instead which comes with a ready-made desktop xcfe or mate and many functional presets.

                                              • A small summary of what we got on the upside:

                                                • Free and open source operating system with a long history
                                                • Drivers worked fine including Ethernet, WiFi, video 2D & 3D, audio, etc
                                                • Hammer2 advanced file system
                                                • You are very unique if you use this OS fork

                                                • Some downsides:


                                                • Less driver and direct app support than Linux


                                                • Installer and desktop have some traps and quirks and require work



                                                  ###Porting Keybase to NetBSD

                                                  Keybase significantly simplifies the whole keypair/PGP thing and makes what is usually a confusing, difficult experience actually rather pleasant. At its heart is an open-source command line utility that does all of the heavy cryptographic lifting. But it’s also hooked up to the network of all other Keybase users, so you don’t have to work very hard to maintain big keychains. Pretty cool!

                                                  So, this evening, I tried to get it to all work on NetBSD.
                                                  The Keybase client code base is, in my opinion, not very well architected… there exist many different Keybase clients (command line apps, desktop apps, mobile apps) and for some reason the code for all of them are seemingly in this single repository, without even using Git submodules. Not sure what that’s about.
                                                  Anyway, “go build”-ing the command line program (it’s written in Go) failed immediately because there’s some platform-specific code that just does not seem to recognize that NetBSD exists (but they do for FreeBSD and OpenBSD). Looks like the Keybase developers maintain a Golang wrapper around struct proc, which of course is different from OS to OS. So I literally just copypasted the OpenBSD wrapper, renamed it to “NetBSD”, and the build basically succeeded from there! This is of course super janky and untrustworthy, but it seems to Mostly Just Work…
                                                  I forked the GitHub repo, you can see the diff on top of keybase 2.7.3 here: bccaaf3096a
                                                  Eventually I ended up with a ~/go/bin/keybase which launches just fine. Meaning, I can main() okay. But the moment you try to do anything interesting, it looks super scary:

                                                  charlotte@sakuracity:~/go/bin ./keybase login
                                                  ▶ WARNING Running in devel mode
                                                  ▶ INFO Forking background server with pid=12932
                                                  ▶ ERROR unexpected error in Login: API network error: doRetry failed,
                                                  attempts: 1, timeout 5s, last err: Get
                                                  http://localhost:3000/_/api/1.0/merkle/path.json?last=3784314&load_deleted=1&load_reset_chain=1&poll=10&sig_hints_low=3&uid=38ae1dfa49cd6831ea2fdade5c5d0519:
                                                  dial tcp [::1]:3000: connect: connection refused

                                                  There’s a few things about this error message that stuck out to me:

                                                  • Forking a background server? What?
                                                  • It’s trying to connect to localhost? That must be the server that doesn’t work …
                                                  • Unfortunately, this nonfunctional “background server” sticks around even when a command as simple as ‘login’ command just failed:

                                                    charlotte@sakuracity:~/go/bin ps 12932
                                                    PID TTY STAT TIME COMMAND
                                                    12932 ? Ssl 0:00.21 ./keybase --debug --log-file
                                                    /home/charlotte/.cache/keybase.devel/keybase.service.log service --chdir
                                                    /home/charlotte/.config/keybase.devel --auto-forked

                                                    I’m not exactly sure what the intended purpose of the “background server” even is, but fortunately we can kill it and even tell the keybase command to not even spawn one:

                                                    charlotte@sakuracity:~/go/bin ./keybase help advanced | grep -- --standalone
                                                    --standalone Use the client without any daemon support.

                                                    And then we can fix wanting to connect to localhost by specifying an expected Keybase API server – how about the one hosted at https://keybase.io?

                                                    charlotte@sakuracity:~/go/bin ./keybase help advanced | grep -- --server
                                                    --server, -s Specify server API.

                                                    Basically, what I’m trying to say is that if you specify both of these options, the keybase command does what I expect on NetBSD:

                                                    charlotte@sakuracity:~/go/bin ./keybase --standalone -s https://keybase.io login
                                                    ▶ WARNING Running in devel mode
                                                    Please enter the Keybase passphrase for dressupgeekout (6+ characters):
                                                    charlotte@sakuracity:~/go/bin ./keybase --standalone -s https://keybase.io id dressupgeekout
                                                    ▶ WARNING Running in devel mode
                                                    ▶ INFO Identifying dressupgeekout
                                                    ✔ public key fingerprint: 7873 DA50 A786 9A3F 1662 3A17 20BD 8739 E82C 7F2F
                                                    ✔ "dressupgeekout" on github:
                                                    https://gist.github.com/0471c7918d254425835bf5e1b4bcda00 [cached 2018-10-11
                                                    20:55:21 PDT]
                                                    ✔ "dressupgeekout" on reddit:
                                                    https://www.reddit.com/r/KeybaseProofs/comments/9ng5qm/my_keybase_proof_redditdressupgeekout/
                                                    [cached 2018-10-11 20:55:21 PDT]

                                                    ###Initial implementation of draft-ietf-6man-ipv6only-flag

                                                    This change defines the RA "6" (IPv6-Only) flag which routers
                                                    may advertise, kernel logic to check if all routers on a link
                                                    have the flag set and accordingly update a per-interface flag.
                                                    If all routers agree that it is an IPv6-only link, ether_output_frame(),
                                                    based on the interface flag, will filter out all ETHERTYPE_IP/ARP
                                                    frames, drop them, and return EAFNOSUPPORT to upper layers.
                                                    The change also updates ndp to show the "6" flag, ifconfig to
                                                    display the IPV6_ONLY nd6 flag if set, and rtadvd to allow
                                                    announcing the flag.
                                                    Further changes to tcpdump (contrib code) are availble and will
                                                    be upstreamed.
                                                    Tested the code (slightly earlier version) with 2 FreeBSD
                                                    IPv6 routers, a FreeBSD laptop on ethernet as well as wifi,
                                                    and with Win10 and OSX clients (which did not fall over with
                                                    the "6" flag set but not understood).
                                                    We may also want to (a) implement and RX filter, and (b) over
                                                    time enahnce user space to, say, stop dhclient from running
                                                    when the interface flag is set. Also we might want to start
                                                    IPv6 before IPv4 in the future.
                                                    All the code is hidden under the EXPERIMENTAL option and not
                                                    compiled by default as the draft is a work-in-progress and
                                                    we cannot rely on the fact that IANA will assign the bits
                                                    as requested by the draft and hence they may change.
                                                    Dear 6man, you have running code.
                                                    Discussed with: Bob Hinden, Brian E Carpenter

                                                    ##Beastie Bits

                                                    • Running FreeBSD on macOS via xhyve
                                                    • Auction Winners
                                                    • OpenSSH Principals
                                                    • OpenBSD Foundation gets a second Iridium donation from Handshake
                                                    • NetBSD machines at Open Source Conference 2018 Kagawa
                                                    • Absolute FreeBSD now shipping!
                                                    • NextCloud on OpenBSD
                                                    • FreeBSD 12.0-BETA2 Available
                                                    • DTrace on Windows ported from FreeBSD
                                                    • HELBUG fall 2018 meeting scheduled - Thursday the 15th of November
                                                    • 35C3 pre-sale has started
                                                    • Stockholm BSD User Meeting: Tuesday Nov 13, 18:00 - 21:30
                                                    • Polish BSD User Group: Thursday Nov 15, 18:30 - 21:00
                                                    • ##Feedback/Questions

                                                      • Greg - Interview suggestion for the show
                                                      • Nelson - Ghostscript vulnerabilities
                                                      • Allison - Ports and GCC
                                                        • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                        • 1 hr 10 min
                                                        • Episode 269: Tiny Daemon Lib | BSD Now 269

                                                          FreeBSD Foundation September Update, tiny C lib for programming Unix daemons, EuroBSDcon trip reports, GhostBSD tested on real hardware, and a BSD auth module for duress.

                                                          ##Headlines

                                                          ###FreeBSD Foundation Update, September 2018

                                                          • MESSAGE FROM THE EXECUTIVE DIRECTOR
                                                          • Dear FreeBSD Community Member, It is hard to believe that September is over. The Foundation team had a busy month promoting FreeBSD all over the globe, bug fixing in preparation for 12.0, and setting plans in motion to kick off our 4th quarter fundraising and advocacy efforts. Take a minute to see what we’ve been up to and please consider making a donation to help us continue our efforts supporting FreeBSD!

                                                            • September 2018 Development Projects Update
                                                            • In preparation for the release of FreeBSD 12.0, I have been working on investigating and fixing a backlog of kernel bug reports. Of course, this kind of work is never finished, and we will continue to make progress after the release. In the past couple of months I have fixed a combination of long-standing issues and recent regressions. Of note are a pair of UNIX domain socket bugs which had been affecting various applications for years. In particular, Chromium tabs would frequently hang unless a workaround was manually applied to the system, and the bug had started affecting recent versions of Firefox as well. Fixing these issues gave me an opportunity to revisit and extend our regression testing for UNIX sockets, which, in turn, resulted in some related bugs being identified and fixed.

                                                              Of late I have also been investigating reports of issues with ZFS, particularly, those reported on FreeBSD 11.2. A number of regressions, including a kernel memory leak and issues with ARC reclamation, have already been fixed for 12.0; investigation of other reports is ongoing. Those who closely follow FreeBSD-CURRENT know that some exciting work to improve memory usage on NUMA systems is now enabled by default. As is usually the case when new code is deployed in a diverse array of systems and workloads, a number of problems since have been identified. We are working on resolving them as soon as possible to ensure the quality of the release.
                                                              I’m passionate about maintaining FreeBSD’s stability and dependability as it continues to expand and grow new features, and I’m grateful to the FreeBSD Foundation for sponsoring this work. We depend on users to report problems to the mailing lists and via the bug tracker, so please try running the 12.0 candidate builds and help us make 12.0 a great release.

                                                              • Fundraising Update: Supporting the Project
                                                              • It’s officially Fall here at Foundation headquarters and we’re heading full-steam into our final fundraising campaign of the year. We couldn’t even have begun to reach our funding goal of $1.25 million dollars without the support from the companies who have partnered with us this year. Thank you to Verisign for becoming a Silver Partner. They now join a growing list of companies like Xiplink, NetApp, Microsoft, Tarsnap, VMware, and NeoSmart Technologies that are stepping up and showing their commitment to FreeBSD!

                                                                Funding from commercial users like these and individual users like yourself, help us continue our efforts of supporting critical areas of FreeBSD such as:

                                                                • Operating System Improvements: Providing staff to immediately respond to urgent problems and implement new features and functionality allowing for the innovation and stability you’ve come to rely on.
                                                                • Security: Providing engineering resources to bolster the capacity and responsiveness of the Security team providing your users with piece of mind when security issues arise.
                                                                • Release Engineering: Continue providing a full-time release engineer, resulting in timely and reliable releases you can plan around.
                                                                • Quality Assurance: Improving and increasing test coverage, continuous integration, and automated testing with a full-time software engineer to ensure you receive the highest quality, secure, and reliable operating system.
                                                                • New User Experience: Improving the process and documentation for getting new people involved with FreeBSD, and supporting those people as they become integrated into the FreeBSD Community providing the resources you may need to get new folks up to speed.
                                                                • Training: Supporting more FreeBSD training for undergraduates, graduates, and postgraduates. Growing the community means reaching people and catching their interest in systems software as early as possible and providing you with a bigger pool of candidates with the FreeBSD skills you’re looking for.
                                                                • Face-to-Face Opportunities: Facilitating collaboration among members of the community, and building connections throughout the industry to support a healthy and growing ecosystem and make it easier for you to find resources when questions emerge .
                                                                • We can continue the above work, if we meet our goal this year!

                                                                  If your company uses FreeBSD, please consider joining our growing list of 2018 partners. If you haven’t made your donation yet, please consider donating today. We are indebted to the individual donors, and companies listed above who have already shown their commitment to open source.
                                                                  Thank you for supporting FreeBSD and the Foundation!

                                                                  • September 2018 Release Engineering Update
                                                                  • The FreeBSD Release Engineering team continued working on the upcoming 12.0 RELEASE. At present, the 12.0 schedule had been adjusted by one week to allow for necessary works-in-progress to be completed.

                                                                    Of note, one of the works-in-progress includes updating OpenSSL from 1.0.2 to 1.1.1, in order to avoid breaking the application binary interface (ABI) on an established stable branch.
                                                                    Due to the level of non-trivial intrusiveness that had already been discovered and addressed in a project branch of the repository, it is possible (but not yet definite) that the schedule will need to be adjusted by another week to allow more time for larger and related updates for this particular update.
                                                                    Should the 12.0-RELEASE schedule need to be adjusted at any time during the release cycle, the schedule on the FreeBSD project website will be updated accordingly. The current schedule is available at:
                                                                    https://www.freebsd.org/releases/12.0R/schedule.html

                                                                    • BSDCam 2018 Trip Report: Marie Helene Kvello-Aune
                                                                    • I’d like to start by thanking the FreeBSD Foundation for sponsoring my trip to BSDCam(bridge) 2018. I wouldn’t have managed to attend otherwise. I’ve used FreeBSD in both personal and professional deployments since the year 2000, and over the last few years I have become more involved with development and documentation.

                                                                      I arrived in Gatwick, London at midnight. On Monday, August 13, I took the train to Cambridge, and decided to do some touristy activities as I walked from the train station to Churchill College. I ran into Allan outside the hotel right before the sky decided it was time for a heavy rainfall. Monday was mostly spent settling in, recouping after travel, and hanging out with Allan, Brad, Will and Andy later in the afternoon/evening. Read more…

                                                                      • Continuous Integration Update
                                                                      • The FreeBSD Foundation has sponsored the development of the Project’s continuous integration system, available at https://ci.FreeBSD.org, since June. Over the summer, we improved both the software and hardware infrastructure, and also added some new jobs for extending test coverage of the -CURRENT and -STABLE branches. Following are some highlights.

                                                                        • New Hardware
                                                                        • The Foundation purchased 4 new build machines for scaling up the computation power for the various test jobs. These newer, faster machines substantially speed up the time it takes to test amd64 builds, so that failing changes can be identified more quickly. Also, in August, we received a donation of 2 PINE A64-LTS boards from PINE64.org, which will be put in the hardware test lab as one part of the continuous tests.

                                                                          • CI Staging Environment
                                                                          • We used hardware from a previous generation CI system to build a staging environment for the CI infrastructure, which is available at

                                                                            https://ci-dev.freebsd.org. It executes the configurations and scripts from the “staging” branch of the FreeBSD-CI repository, and the development feature branches. We also use it to experiment with the new version of the jenkins server and plugins. Having a staging environment avoids affecting the production CI environment, reducing downtime.

                                                                            • Mail Notification
                                                                            • In July, we turned on failure notification for all the kernel and world build jobs. Committers will receive email containing the build information and failure log to inform them of possible problems with their modification on certain architectures. For amd64 of the -CURRENT branch, we also enabled the notification on failing regression test cases. Currently mail is sent only to the individual committers, but with help from postmaster team, we have created a dev-ci mailing list and will soon be also sending notifications there.

                                                                              • New Test Job
                                                                              • In August, we updated the embedded script of the virtual machine image. Originally it only executed pre-defined tests, but now this behavior can be modified by the data on the attached disk. This mechanism is used for adding new ZFS tests jobs. We are also working on analyzing and fixing the failing and skipped test cases.

                                                                                • Work in Progress
                                                                                • In August and September, we had two developer summits, one in Cambridge, UK and one in Bucharest, Romania. In these meetings, we discussed running special tests, such as ztest, which need a longer run time. We also planned the network testing for TCP/IP stack

                                                                                  ###Daemonize - a Tiny C Library for Programming the UNIX Daemons

                                                                                  Whatever they say, writing System-V style UNIX daemons is hard. One has to follow many rules to make a daemon process behave correctly on diverse UNIX flavours. Moreover, debugging such a code might be somewhat tricky. On the other hand, the process of daemon initialisation is rigid and well defined so the corresponding code has to be written and debugged once and later can be reused countless number of times.

                                                                                  Developers of BSD UNIX were very aware of this, as there a C library function daemon() was available starting from version 4.4. The function, although non-standard, is present on many UNIXes. Unfortunately, it does not follow all the required steps to reliably run a process in the background on systems which follow System-V semantics (e.g. Linux). The details are available at the corresponding Linux man page. The main problem here, as I understand it, is that daemon() does not use the double-forking technique to avoid the situation when zombie processes appear.
                                                                                  Whenever I encounter a problem like this one, I know it is time to write a tiny C library which solves it. This is exactly how ‘daemonize’ was born (GitHub mirror). The library consists of only two files which are meant to be integrated into the source tree of your project. Recently I have updated the library and realised that it would be good to describe how to use it on this site.
                                                                                  If for some reason you want to make a Windows service, I have a battle tested template code for you as well.

                                                                                  • System-V Daemon Initialisation Procedure
                                                                                  • To make discussion clear we shall quote the steps which have to be performed during a daemon initialisation (according to daemon(7) manual page on Linux). I do it to demonstrate that this task is more tricky than one might expect.

                                                                                    • So, here we go:

                                                                                    • Close all open file descriptors except standard input, output, and error (i.e. the first three file descriptors 0, 1, 2). This ensures that no accidentally passed file descriptor stays around in the daemon process. On Linux, this is best implemented by iterating through /proc/self/fd, with a fallback of iterating from file descriptor 3 to the value returned by getrlimit() for RLIMIT_NOFILE.

                                                                                    • Reset all signal handlers to their default. This is best done by iterating through the available signals up to the limit of _NSIG and resetting them to SIG_DFL.

                                                                                    • Reset the signal mask using sigprocmask().

                                                                                    • Sanitize the environment block, removing or resetting environment variables that might negatively impact daemon runtime.

                                                                                    • Call fork(), to create a background process.

                                                                                    • In the child, call setsid() to detach from any terminal and create an independent session.

                                                                                    • In the child, call fork() again, to ensure that the daemon can never re-acquire a terminal again.

                                                                                    • Call exit() in the first child, so that only the second child (the actual daemon process) stays around. This ensures that the daemon process is re-parented to init/PID 1, as all daemons should be.

                                                                                    • In the daemon process, connect /dev/null to standard input, output, and error.

                                                                                    • In the daemon process, reset the umask to 0, so that the file modes passed to open(), mkdir() and suchlike directly control the access mode of the created files and directories.

                                                                                    • In the daemon process, change the current directory to the root directory (/), in order to avoid that the daemon involuntarily blocks mount points from being unmounted.

                                                                                    • In the daemon process, write the daemon PID (as returned by getpid()) to a PID file, for example /run/foobar.pid (for a hypothetical daemon “foobar”) to ensure that the daemon cannot be started more than once. This must be implemented in race-free fashion so that the PID file is only updated when it is verified at the same time that the PID previously stored in the PID file no longer exists or belongs to a foreign process.

                                                                                    • In the daemon process, drop privileges, if possible and applicable.

                                                                                    • From the daemon process, notify the original process started that initialization is complete. This can be implemented via an unnamed pipe or similar communication channel that is created before the first fork() and hence available in both the original and the daemon process.

                                                                                    • Call exit() in the original process. The process that invoked the daemon must be able to rely on that this exit() happens after initialization is complete and all external communication channels are established and accessible.

                                                                                      The discussed library does most of the above-mentioned initialisation steps as it becomes immediately evident that implementation details for some of them heavily dependent on the internal logic of an application itself, so it is not possible to implement them in a universal library. I believe it is not a flaw, though, as the missed parts are safe to implement in an application code.

                                                                                      • The Library’s Application Programming Interface
                                                                                      • The generic programming interface was loosely modelled after above-mentioned BSD’s daemon() function. The library provides two user available functions (one is, in fact, implemented on top of the other) as well as a set of flags to control a daemon creation behaviour.

                                                                                        • Conclusion
                                                                                        • The objective of the library is to hide all the trickery of programming a daemon so you could concentrate on the more creative parts of your application. I hope it does this well.

                                                                                          If you are not only interested in writing a daemon, but also want to make yourself familiar with the techniques which are used to accomplish that, the source code is available. Moreover, I would advise anyone, who starts developing for a UNIX environment to do that, as it shows many intricacies of programming for these platforms.

                                                                                          ##News Roundup

                                                                                          ###EuroBSDCon 2018 travel report and obligatory pics

                                                                                          This was my first big BSD conference. We also planned - planned might be a big word - thought about doing a devsummit on Friday. Since the people who were in charge of that had a change of plans, I was sure it’d go horribly wrong.

                                                                                          The day before the devsummit and still in the wrong country, I mentioned the hours and venue on the wiki, and booked a reservation for a restaurant.
                                                                                          It turns out that everything was totally fine, and since the devsummit was at the conference venue (that was having tutorials that day), they even had signs pointing at the room we were given. Thanks EuroBSDCon conference organizers!
                                                                                          At the devsummit, we spent some time hacking. A few people came with “travel laptops” without access to anything, like Riastradh, so I gave him access to my own laptop. This didn’t hold very long and I kinda forgot about it, but for a few moments he had access to a NetBSD source tree and an 8 thread, 16GB RAM machine with which to build things.
                                                                                          We had a short introduction and I suggested we take some pictures, so here’s the ones we got. A few people were concerned about privacy, so they’re not pictured. We had small team to hold the camera :-)
                                                                                          At the actual conference days, I stayed at the speaker hotel with the other speakers. I’ve attempted to make conversation with some visibly FreeBSD/OpenBSD people, but didn’t have plans to talk about anything, so there was a lot of just following people silently.
                                                                                          Perhaps for the next conference I’ll prepare a list of questions to random BSD people and then very obviously grab a piece of paper and ask, “what was…”, read a bit from it, and say, “your latest kernel panic?”, I’m sure it’ll be a great conversation starter.
                                                                                          At the conference itself, was pretty cool to have folks like Kirk McKusick give first person accounts of some past events (Kirk gave a talk about governance at FreeBSD), or the second keynote by Ron Broersma.
                                                                                          My own talk was hastily prepared, it was difficult to bring the topic together into a coherent talk. Nevertheless, I managed to talk about stuff for a while 40 minutes, though usually I skip over so many details that I have trouble putting together a sufficiently long talk.
                                                                                          I mentioned some of my coolest bugs to solve (I should probably make a separate article about some!). A few people asked for the slides after the talk, so I guess it wasn’t totally incoherent.
                                                                                          It was really fun to meet some of my favourite NetBSD people. I got to show off my now fairly well working laptop (it took a lot of work by all of us!).
                                                                                          After the conference I came back with a conference cold, and it took a few days to recover from it. Hopefully I didn’t infect too many people on the way back.

                                                                                          ###GhostBSD tested on real hardware T410 – better than TrueOS?

                                                                                          You might have heard about FreeBSD which is ultimately derived from UNIX back in the days. It is not Linux even though it is similar in many ways because Linux was designed to follow UNIX principles. Seeing is believing, so check out the video of the install and some apps as well!

                                                                                          Nowadays if you want some of that BSD on your personal desktop how to go about? Well there is a full package or distro called GhostBSD which is based on FreeBSD current with a Mate or XFCE desktop preconfigured. I did try another package called TrueOS before and you can check out my blog post as well.

                                                                                          Let’s give it a try on my Lenovo ThinkPad T410. You can download the latest version from ghostbsd.org. Creating a bootable USB drive was surprisingly difficult as rufus did not work and created a corrupted drive. You have to follow this procedure under Windows: download the 2.5GB .iso file and rename the extension to .img. Download Win32 Disk imager and burn the img file to an USB drive and boot from it. You will be able to start a live session and use the onboard setup to install GhostBSD unto a disk.

                                                                                          I did encounter some bugs or quirks along the way. The installer failed the first time for some unknown reason but worked on the second attempt. The first boot stopped upon initialization of the USB3 ports (the T410 does not have USB3) but I could use some ‘exit’ command line magic to continue. The second boot worked fine. Audio was only available through headphones, not speakers but that could partially be fixed using the command line again. Lot’s of installed apps did not show up in the start menu and on goes the quirks list.

                                                                                          Overall it is still better than TrueOS for me because drivers did work very well and I could address most of the existing bugs.

                                                                                          • On the upside:

                                                                                          • Free and open source FreeBSD package ready to go

                                                                                          • Mate or XFCE desktop (Mate is the only option for daily builds)

                                                                                          • Drivers work fine including LAN, WiFi, video 2D & 3D, audio, etc

                                                                                          • UFS or ZFS advanced file systems available

                                                                                          • Some downsides:

                                                                                          • Less driver and direct app support than Linux

                                                                                          • Installer and desktop have some quirks and bugs

                                                                                          • App-store is cumbersome, inferior to TrueOS

                                                                                            ##Beastie Bits

                                                                                            • EuroBSDCon 2018 and NetBSD sanitizers
                                                                                            • New mandoc feature: -T html -O toc
                                                                                            • EuroBSDcon 2018
                                                                                            • Polish BSD User Group
                                                                                            • garbage[43]: What year is it?
                                                                                            • The Demo @ 50
                                                                                            • Microsoft ports DTrace from FreeBSD to Windows 10
                                                                                            • OpenBSD joins Twitter
                                                                                            • NetBSD curses ripoffline improvements
                                                                                            • FCP-0101: Deprecating most 10/100 Ethernet drivers
                                                                                            • Announcing the pkgsrc-2018Q3 release
                                                                                            • Debian on OpenBSD vmd (without qemu or another debian system)
                                                                                            • A BSD authentication module for duress passwords (Joshua Stein)
                                                                                            • Disk Price/Performance Analysis
                                                                                            • ##Feedback/Questions

                                                                                              • DJ - Zombie ZFS
                                                                                              • Josua - arm tier 1? how to approach it
                                                                                              • -Gamah - 5ghz
                                                                                                • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                • 1 hr 29 min
                                                                                                • Episode 268: Netcat Demystified | BSD Now 268

                                                                                                  6 metrics for zpool performance, 2FA with ssh on OpenBSD, ZFS maintaining file type information in dirs, everything old is new again, netcat demystified, and more.

                                                                                                  ##Headlines

                                                                                                  ###Six Metrics for Measuring ZFS Pool Performance Part 1

                                                                                                  The layout of a ZFS storage pool has a significant impact on system performance under various workloads. Given the importance of picking the right configuration for your workload and the fact that making changes to an in-use ZFS pool is far from trivial, it is important for an administrator to understand the mechanics of pool performance when designing a storage system.

                                                                                                  • To quantify pool performance, we will consider six primary metrics:
                                                                                                  • Read I/O operations per second (IOPS)
                                                                                                  • Write IOPS
                                                                                                  • Streaming read speed
                                                                                                  • Streaming write speed
                                                                                                  • Storage space efficiency (usable capacity after parity versus total raw capacity)
                                                                                                  • Fault tolerance (maximum number of drives that can fail before data loss)
                                                                                                  • For the sake of comparison, we’ll use an example system with 12 drives, each one sized at 6TB, and say that each drive does 100MB/s streaming reads and writes and can do 250 read and write IOPS. We will visualize how the data is spread across the drives by writing 12 multi-colored blocks, shown below. The blocks are written to the pool starting with the brown block on the left (number one), and working our way to the pink block on the right (number 12).
                                                                                                  • Note that when we calculate data rates and IOPS values for the example system, they are only approximations. Many other factors can impact pool access speeds for better (compression, caching) or worse (poor CPU performance, not enough memory).

                                                                                                    There is no single configuration that maximizes all six metrics. Like so many things in life, our objective is to find an appropriate balance of the metrics to match a target workload. For example, a cold-storage backup system will likely want a pool configuration that emphasizes usable storage space and fault tolerance over the other data-rate focused metrics.
                                                                                                    Let’s start with a quick review of ZFS storage pools before diving into specific configuration options. ZFS storage pools are comprised of one or more virtual devices, or vdevs. Each vdev is comprised of one or more storage providers, typically physical hard disks. All disk-level redundancy is configured at the vdev level. That is, the RAID layout is set on each vdev as opposed to on the storage pool. Data written to the storage pool is then striped across all the vdevs. Because pool data is striped across the vdevs, the loss of any one vdev means total pool failure. This is perhaps the single most important fact to keep in mind when designing a ZFS storage system. We will circle back to this point in the next post, but keep it in mind as we go through the vdev configuration options.
                                                                                                    Because storage pools are made up of one or more vdevs with the pool data striped over the top, we’ll take a look at pool configuration in terms of various vdev configurations. There are three basic vdev configurations: striping, mirroring, and RAIDZ (which itself has three different varieties). The first section will cover striped and mirrored vdevs in this post; the second post will cover RAIDZ and some example scenarios.
                                                                                                    A striped vdev is the simplest configuration. Each vdev consists of a single disk with no redundancy. When several of these single-disk, striped vdevs are combined into a single storage pool, the total usable storage space would be the sum of all the drives. When you write data to a pool made of striped vdevs, the data is broken into small chunks called “blocks” and distributed across all the disks in the pool. The blocks are written in “round-robin” sequence, meaning after all the disks receive one row of blocks, called a stripe, it loops back around and writes another stripe under the first. A striped pool has excellent performance and storage space efficiency, but absolutely zero fault tolerance. If even a single drive in the pool fails, the entire pool will fail and all data stored on that pool will be lost.
                                                                                                    The excellent performance of a striped pool comes from the fact that all of the disks can work independently for all read and write operations. If you have a bunch of small read or write operations (IOPS), each disk can work independently to fetch the next block. For streaming reads and writes, each disk can fetch the next block in line synchronized with its neighbors. For example, if a given disk is fetching block n, its neighbor to the left can be fetching block n-1, and its neighbor to the right can be fetching block n+1. Therefore, the speed of all read and write operations as well as the quantity of read and write operations (IOPS) on a striped pool will scale with the number of vdevs. Note here that I said the speeds and IOPS scale with the number of vdevs rather than the number of drives; there’s a reason for this and we’ll cover it in the next post when we discuss RAID-Z.
                                                                                                    Here’s a summary of the total pool performance (where N is the number of disks in the pool):

                                                                                                    • N-wide striped:
                                                                                                    • Read IOPS: N * Read IOPS of a single drive
                                                                                                    • Write IOPS: N * Write IOPS of a single drive
                                                                                                    • Streaming read speed: N * Streaming read speed of a single drive
                                                                                                    • Streaming write speed: N * Streaming write speed of a single drive
                                                                                                    • Storage space efficiency: 100%
                                                                                                    • Fault tolerance: None!
                                                                                                    • Let’s apply this to our example system, configured with a 12-wide striped pool:

                                                                                                      • 12-wide striped:
                                                                                                      • Read IOPS: 3000
                                                                                                      • Write IOPS: 3000
                                                                                                      • Streaming read speed: 1200 MB/s
                                                                                                      • Streaming write speed: 1200 MB/s
                                                                                                      • Storage space efficiency: 72 TB
                                                                                                      • Fault tolerance: None!
                                                                                                      • Below is a visual depiction of our 12 rainbow blocks written to this pool configuration:
                                                                                                      • The blocks are simply striped across the 12 disks in the pool. The LBA column on the left stands for “Logical Block Address”. If we treat each disk as a column in an array, each LBA would be a row. It’s also easy to see that if any single disk fails, we would be missing a color in the rainbow and our data would be incomplete. While this configuration has fantastic read and write speeds and can handle a ton of IOPS, the data stored on the pool is very vulnerable. This configuration is not recommended unless you’re comfortable losing all of your pool’s data whenever any single drive fails.

                                                                                                        A mirrored vdev consists of two or more disks. A mirrored vdev stores an exact copy of all the data written to it on each one of its drives. Traditional RAID-1 mirrors usually only support two drive mirrors, but ZFS allows for more drives per mirror to increase redundancy and fault tolerance. All disks in a mirrored vdev have to fail for the vdev, and thus the whole pool, to fail. Total storage space will be equal to the size of a single drive in the vdev. If you’re using mismatched drive sizes in your mirrors, the total size will be that of the smallest drive in the mirror.
                                                                                                        Streaming read speeds and read IOPS on a mirrored vdev will be faster than write speeds and IOPS. When reading from a mirrored vdev, the drives can “divide and conquer” the operations, similar to what we saw above in the striped pool. This is because each drive in the mirror has an identical copy of the data. For write operations, all of the drives need to write a copy of the data, so the mirrored vdev will be limited to the streaming write speed and IOPS of a single disk.

                                                                                                        Here’s a summary:

                                                                                                        • N-way mirror:

                                                                                                        • Read IOPS: N * Read IOPS of a single drive

                                                                                                        • Write IOPS: Write IOPS of a single drive

                                                                                                        • Streaming read speed: N * Streaming read speed of a single drive

                                                                                                        • Streaming write speed: Streaming write speed of a single drive

                                                                                                        • Storage space efficiency: 50% for 2-way, 33% for 3-way, 25% for 4-way, etc. [(N-1)/N]

                                                                                                        • Fault tolerance: 1 disk per vdev for 2-way, 2 for 3-way, 3 for 4-way, etc. [N-1]

                                                                                                        • For our first example configuration, let’s do something ridiculous and create a 12-way mirror. ZFS supports this kind of thing, but your management probably will not.

                                                                                                        • 1x 12-way mirror:

                                                                                                        • Read IOPS: 3000

                                                                                                        • Write IOPS: 250

                                                                                                        • Streaming read speed: 1200 MB/s

                                                                                                        • Streaming write speed: 100 MB/s

                                                                                                        • Storage space efficiency: 8.3% (6 TB)

                                                                                                        • Fault tolerance: 11

                                                                                                          As we can clearly see from the diagram, every single disk in the vdev gets a full copy of our rainbow data. The chainlink icons between the disk labels in the column headers indicate the disks are part of a single vdev. We can lose up to 11 disks in this vdev and still have a complete rainbow. Of course, the data takes up far too much room on the pool, occupying a full 12 LBAs in the data array.

                                                                                                          Obviously, this is far from the best use of 12 drives. Let’s do something a little more practical and configure the pool with the ZFS equivalent of RAID-10. We’ll configure six 2-way mirror vdevs. ZFS will stripe the data across all 6 of the vdevs. We can use the work we did in the striped vdev section to determine how the pool as a whole will behave. Let’s first calculate the performance per vdev, then we can work on the full pool:

                                                                                                          • 1x 2-way mirror:

                                                                                                          • Read IOPS: 500

                                                                                                          • Write IOPS: 250

                                                                                                          • Streaming read speed: 200 MB/s

                                                                                                          • Streaming write speed: 100 MB/s

                                                                                                          • Storage space efficiency: 50% (6 TB)

                                                                                                          • Fault tolerance: 1

                                                                                                          • Now we can pretend we have 6 drives with the performance statistics listed above and run them through our striped vdev performance calculator to get the total pool’s performance:

                                                                                                          • 6x 2-way mirror:

                                                                                                          • Read IOPS: 3000

                                                                                                          • Write IOPS: 1500

                                                                                                          • Streaming read speed: 3000 MB/s

                                                                                                          • Streaming write speed: 1500 MB/s

                                                                                                          • Storage space efficiency: 50% (36 TB)

                                                                                                          • Fault tolerance: 1 per vdev, 6 total

                                                                                                          • Again, we will examine the configuration from a visual perspective:

                                                                                                            Each vdev gets a block of data and ZFS writes that data to all of (or in this case, both of) the disks in the mirror. As long as we have at least one functional disk in each vdev, we can retrieve our rainbow. As before, the chain link icons denote the disks are part of a single vdev. This configuration emphasizes performance over raw capacity but doesn’t totally disregard fault tolerance as our striped pool did. It’s a very popular configuration for systems that need a lot of fast I/O. Let’s look at one more example configuration using four 3-way mirrors. We’ll skip the individual vdev performance calculation and go straight to the full pool:

                                                                                                            • 4x 3-way mirror:
                                                                                                            • Read IOPS: 3000
                                                                                                            • Write IOPS: 1000
                                                                                                            • Streaming read speed: 3000 MB/s
                                                                                                            • Streaming write speed: 400 MB/s
                                                                                                            • Storage space efficiency: 33% (24 TB)
                                                                                                            • Fault tolerance: 2 per vdev, 8 total
                                                                                                            • While we have sacrificed some write performance and capacity, the pool is now extremely fault tolerant. This configuration is probably not practical for most applications and it would make more sense to use lower fault tolerance and set up an offsite backup system.

                                                                                                              Striped and mirrored vdevs are fantastic for access speed performance, but they either leave you with no redundancy whatsoever or impose at least a 50% penalty on the total usable space of your pool. In the next post, we will cover RAIDZ, which lets you keep data redundancy without sacrificing as much storage space efficiency. We’ll also look at some example workload scenarios and decide which layout would be the best fit for each.

                                                                                                              ###2FA with ssh on OpenBSD

                                                                                                              Five years ago I wrote about using a yubikey on OpenBSD. The only problem with doing this is that there’s no validation server available on OpenBSD, so you need to use a different OTP slot for each machine. (You don’t want to risk a replay attack if someone succeeds in capturing an OTP on one machine, right?) Yubikey has two OTP slots per device, so you would need a yubikey for every two machines with which you’d like to use it. You could use a bastion—and use only one yubikey—but I don’t like the SPOF aspect of a bastion. YMMV.

                                                                                                              After I played with TOTP, I wanted to use them as a 2FA for ssh. At the time of writing, we can’t do that using only the tools in base. This article focuses on OpenBSD; if you use another operating system, here are two handy links.

                                                                                                              • SEED CONFIGURATION
                                                                                                              • The first thing we need to do is to install the software which will be used to verify the OTPs we submit.

                                                                                                                # pkg_add login_oath

                                                                                                                We need to create a secret - aka, the seed - that will be used to calculate the Time-based One-Time Passwords. We should make sure no one can read or change it.

                                                                                                                $ openssl rand -hex 20 > ~/.totp-key

                                                                                                                $ chmod 400 ~/.totp-key

                                                                                                                Now we have a hexadecimal key, but apps usually want a base32 secret. I initially wrote a small script to do the conversion.

                                                                                                                While writing this article, I took the opportunity to improve it. When I initially wrote this utility for my use, python-qrcode hadn’t yet been imported to the OpenBSD ports/packages system. It’s easy to install now, so let’s use it.
                                                                                                                Here’s the improved version. It will ask for the hex key and output the secret as a base32-encoded string, both with and without spacing so you can copy-paste it into your password manager or easily retype it. It will then ask for the information needed to generate a QR code. Adding our new OTP secret to any mobile app using the QR code will be super easy!

                                                                                                                • SYSTEM CONFIGURATION
                                                                                                                • We can now move to the configuration of the system to put our new TOTP to use. As you might guess, it’s going to be quite close to what we did with the yubikey.

                                                                                                                  We need to tweak login.conf. Be careful and keep a root shell open at all times. The few times I broke my OpenBSD were because I messed with login.conf without showing enough care.

                                                                                                                  • SSHD CONFIGURATION
                                                                                                                  • Again, keeping a root shell around decreases the risk of losing access to the system and being locked outside.

                                                                                                                    A good standard is to use PasswordAuthentication no and to use public key only. Except… have a guess what the P stands for in TOTP. Yes, congrats, you guessed it!
                                                                                                                    We need to switch to PasswordAuthentication yes. However, if we made this change alone, sshd would then accept a public key OR a password (which are TOTP because of our login.conf). 2FA uses both at the same time.
                                                                                                                    To inform sshd we intend to use both, we need to set AuthenticationMethods publickey,password. This way, the user trying to login will first need to perform the traditional publickey authentication. Once that’s done, ssh will prompt for a password and the user will need to submit a valid TOTP for the system.
                                                                                                                    We could do this the other way around, but I think bots could try passwords, wasting resources. Evaluated in this order, failing to provide a public key leads to sshd immediately declining your attempt.

                                                                                                                    • IMPROVING SECURITY WITHOUT IMPACTING UX
                                                                                                                    • My phone has a long enough password that most of the time, I fail to type it correctly on the first try. Of course, if I had to unlock my phone, launch my TOTP app and use my keyboard to enter what I see on my phone’s screen, I would quickly disable 2FA.

                                                                                                                      To find a balance, I have whitelisted certain IP addresses and users. If I connect from a particular IP address or as a specific user, I don’t want to go through 2FA. For some users, I might not even enable 2FA.
                                                                                                                      To sum up, we covered how to create a seed, how to perform a hexadecimal to base32 conversion and how to create a QR code for mobile applications. We configured the login system with login.conf so that ssh authentication uses the TOTP login system, and we told sshd to ask for both the public key and the Time-based One-Time Password. Now you should be all set to use two-factor ssh authentication on OpenBSD!

                                                                                                                      ##News Roundup

                                                                                                                      ###How ZFS maintains file type information in directories

                                                                                                                      As an aside in yesterday’s history of file type information being available in Unix directories, I mentioned that it was possible for a filesystem to support this even though its Unix didn’t. By supporting it, I mean that the filesystem maintains this information in its on disk format for directories, even though the rest of the kernel will never ask for it. This is what ZFS does.

                                                                                                                      The easiest way to see that ZFS does this is to use zdb to dump a directory. I’m going to do this on an OmniOS machine, to make it more convincing, and it turns out that this has some interesting results. Since this is OmniOS, we don’t have the convenience of just naming a directory in zdb, so let’s find the root directory of a filesystem, starting from dnode 1 (as seen before).

                                                                                                                      # zdb -dddd fs3-corestaff-01/h/281 1

                                                                                                                      Dataset [....]
                                                                                                                      [...]
                                                                                                                      microzap: 512 bytes, 4 entries
                                                                                                                      [...]
                                                                                                                      ROOT = 3

                                                                                                                      # zdb -dddd fs3-corestaff-01/h/281 3
                                                                                                                      Object lvl iblk dblk dsize lsize %full type
                                                                                                                      3 1 16K 1K 8K 1K 100.00 ZFS directory
                                                                                                                      [...]
                                                                                                                      microzap: 1024 bytes, 8 entries

                                                                                                                      RESTORED = 4396504 (type: Directory)
                                                                                                                      ckstst = 12017 (type: not specified)
                                                                                                                      ckstst3 = 25069 (type: Directory)
                                                                                                                      .demo-file = 5832188 (type: Regular File)
                                                                                                                      .peergroup = 12590 (type: not specified)
                                                                                                                      cks = 5 (type: not specified)
                                                                                                                      cksimap1 = 5247832 (type: Directory)
                                                                                                                      .diskuse = 12016 (type: not specified)
                                                                                                                      ckstst2 = 12535 (type: not specified)

                                                                                                                      This is actually an old filesystem (it dates from Solaris 10 and has been transferred around with ‘zfs send | zfs recv’ since then), but various home directories for real and test users have been created in it over time (you can probably guess which one is the oldest one). Sufficiently old directories and files have no file type information, but more recent ones have this information, including .demo-file, which I made just now so this would have an entry that was a regular file with type information.

                                                                                                                      Once I dug into it, this turned out to be a change introduced (or activated) in ZFS filesystem version 2, which is described in ‘zfs upgrade -v’ as ‘enhanced directory entries’. As an actual change in (Open)Solaris, it dates from mid 2007, although I’m not sure what Solaris release it made it into. The upshot is that if you made your ZFS filesystem any time in the last decade, you’ll have this file type information in your directories.
                                                                                                                      How ZFS stores this file type information is interesting and clever, especially when it comes to backwards compatibility. I’ll start by quoting the comment from zfs_znode.h:

                                                                                                                      /*

                                                                                                                      * The directory entry has the type (currently unused on
                                                                                                                      * Solaris) in the top 4 bits, and the object number in
                                                                                                                      * the low 48 bits. The "middle" 12 bits are unused.
                                                                                                                      */

                                                                                                                      In yesterday’s entry I said that Unix directory entries need to store at least the filename and the inode number of the file. What ZFS is doing here is reusing the 64 bit field used for the ‘inode’ (the ZFS dnode number) to also store the file type, because it knows that object numbers have only a limited range. This also makes old directory entries compatible, by making type 0 (all 4 bits 0) mean ‘not specified’. Since old directory entries only stored the object number and the object number is 48 bits or less, the higher bits are guaranteed to be all zero.

                                                                                                                      The reason this needed a new ZFS filesystem version is now clear. If you tried to read directory entries with file type information on a version of ZFS that didn’t know about them, the old version would likely see crazy (and non-existent) object numbers and nothing would work. In order to even read a ‘file type in directory entries’ filesystem, you need to know to only look at the low 48 bits of the object number field in directory entries.

                                                                                                                      ###Everything old is new again

                                                                                                                      Just because KDE4-era software has been deprecated by the KDE-FreeBSD team in the official ports-repository, doesn’t mean we don’t care for it while we still need to. KDE4 was released on January 11th, 2008 — I still have the T-shirt — which was a very different C++ world than what we now live in. Much of the code pre-dates the availability of C11 — certainly the availability of compilers with C11 support. The language has changed a great deal in those ten years since the original release.

                                                                                                                      The platforms we run KDE code on have, too — FreeBSD 12 is a long way from the FreeBSD 6 or 7 that were current at release (although at the time, I was more into OpenSolaris). In particular, since then the FreeBSD world has switched over to Clang, and FreeBSD current is experimenting with Clang 7. So we’re seeing KDE4-era code being built, and running, on FreeBSD 12 with Clang 7. That’s a platform with a very different idea of what constitutes correct code, than what the code was originally written for. (Not quite as big a difference as Helio’s KDE1 efforts, though)
                                                                                                                      So, while we’re counting down to removing KDE4 from the FreeBSD ports tree, we’re also going through and fixing it to work with Clang 7, which defaults to a newer C++ standard and which is quite picky about some things. Some time in the distant past, when pointers were integers and NULL was zero, there was some confusion about booleans. So there’s lots of code that does list.contains(element) > 0 … this must have been a trick before booleans were a supported type in all our compilers. In any case it breaks with Clang 7, since contains() returns a QBool which converts to a nullptr (when false) which isn’t comparable to the integer 0. Suffice to say I’ve spent more time reading KDE4-era code this month, than in the past two years.
                                                                                                                      However, work is proceeding apace, so if you really really want to, you can still get your old-school kicks on a new platform. Because we care about packaging things right, even when we want to get rid of it.

                                                                                                                      ###OpenBSD netcat demystified

                                                                                                                      Owing to its versatile functionalities, netcat earns the reputation as “TCP/IP Swiss army knife”. For example, you can create a simple chat app using netcat:

                                                                                                                      • (1) Open a terminal and input following command:
                                                                                                                      • # nc -l 3003

                                                                                                                        This means a netcat process will listen on 3003 port in this machine (the IP address of current machine is 192.168.35.176).

                                                                                                                        • (2) Connect aforemontioned netcat process in another machine, and send a greeting:
                                                                                                                        • # nc 192.168.35.176 3003

                                                                                                                          hello

                                                                                                                          Then in the first machine’s terminal, you will see the “hello” text:

                                                                                                                          # nc -l 3003

                                                                                                                          hello

                                                                                                                          A primitive chatroom is built successfully. Very cool! Isn’t it? I think many people can’t wait to explore more features of netcatnow. If you are among them, congratulations! This tutorial may be the correct place for you.

                                                                                                                          In the following parts, I will delve into OpenBSD’s netcatcode to give a detailed anatomy of it. The reason of picking OpenBSD’s netcat rather than others’ is because its code repository is small (~2000 lines of code) and neat. Furthermore, I also hope this little book can assist you learn more socket programming knowledge not just grasping usage of netcat.
                                                                                                                          We’re all set. Let’s go!

                                                                                                                          ##Beastie Bits

                                                                                                                          • What’s in store for NetBSD 9.0
                                                                                                                          • NetBSD machines at Open Source Conference 2018 Hiroshima
                                                                                                                          • nmctl adapted with limited privileges: nmctl-0.6.0
                                                                                                                          • Submit Your Work: Check out SCALE 17x and FOSDEM ’19 CFPs
                                                                                                                          • OpenBSD 6.4 site is up! (with a partial list of new features)
                                                                                                                          • Using Alpine to Read Your Email on OpenBSD
                                                                                                                          • ##Feedback/Questions

                                                                                                                            • Morgan - Send/Receive to Manage Fragmentation?
                                                                                                                            • Ryan - ZFS and mmap
                                                                                                                            • Marcus - Linux Compat
                                                                                                                            • Ben - Multiple Pools
                                                                                                                              • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                              • 1 hr 8 min
                                                                                                                              • Episode 267: Absolute FreeBSD | BSD Now 267

                                                                                                                                We have a long interview with fiction and non-fiction author Michael W. Lucas for you this week as well as questions from the audience.

                                                                                                                                ##Headlines

                                                                                                                                ##Interview - Michael W. Lucas - [email protected] / @mwlauthor

                                                                                                                                • BR: [Welcome Back]
                                                                                                                                • AJ: What have you been doing since last we talked to you [ed, ssh, and af3e]
                                                                                                                                • BR: Tell us more about AF3e
                                                                                                                                • AJ: How did the first Absolute FreeBSD come about?
                                                                                                                                • BR: Do you have anything special planned for MeetBSD?
                                                                                                                                • AJ: What are you working on now? [FM:Jails, Git sync Murder]
                                                                                                                                • BR: What are your plans for next year?
                                                                                                                                • AJ: How has SEMIBug been going?
                                                                                                                                • Auction at https://mwl.io

                                                                                                                                  Patreon Link:

                                                                                                                                  ##Feedback/Questions

                                                                                                                                  • Paul - Recent bhyve related videos (daemon)
                                                                                                                                  • Michael - freebsd-update question
                                                                                                                                  • Sigflup - pkg file search
                                                                                                                                    • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                    • 1 hr 8 min
                                                                                                                                    • Episode 266: File Type History | BSD Now 266

                                                                                                                                      Running OpenBSD/NetBSD on FreeBSD using grub2-bhyve, vermaden’s FreeBSD story, thoughts on OpenBSD on the desktop, history of file type info in Unix dirs, Multiboot a Pinebook KDE neon image, and more.

                                                                                                                                      ##Headlines

                                                                                                                                      ###OpenBSD/NetBSD on FreeBSD using grub2-bhyve

                                                                                                                                      When I was writing a blog post about the process title, I needed a couple of virtual machines with OpenBSD, NetBSD, and Ubuntu. Before that day I mainly used FreeBSD and Windows with bhyve. I spent some time trying to set up an OpenBSD using bhyve and UEFI as described here. I had numerous problems trying to use it, and this was the day I discovered the grub2-bhyve tool, and I love it!

                                                                                                                                      The grub2-bhyve allows you to load a kernel using GRUB bootloader. GRUB supports most of the operating systems with a standard configuration, so exactly the same method can be used to install NetBSD or Ubuntu. First, let’s install grub2-bhyve on our FreeBSD box:

                                                                                                                                      # pkg install grub2-bhyve

                                                                                                                                      To run grub2-bhyve we need to provide at least the name of the VM. In bhyve, if the memsize is not specified the default VM is created with 256MB of the memory.

                                                                                                                                      # grub-bhyve test

                                                                                                                                      GNU GRUB version 2.00
                                                                                                                                      Minimal BASH-like line editing is supported. For the first word, TAB lists possible command
                                                                                                                                      completions. Anywhere else TAB lists possible device or file completions.


                                                                                                                                      grub>

                                                                                                                                      After running grub-bhyve command we will enter the GRUB loader. If we type the ls command, we will see all the available devices. In the case of the grub2-bhyve there is one additional device called “(host)” that is always available and allows the host filesystem to be accessed. We can list files under that device.

                                                                                                                                      grub> ls

                                                                                                                                      (host)
                                                                                                                                      grub> ls (host)/
                                                                                                                                      libexec/ bin/ usr/ bhyve/ compat/ tank/ etc/ boot/ net/ entropy proc/ lib/ root/ sys/ mnt/ rescue/ tmp/ home/ sbin/ media/ jail/ COPYRIGHT var/ dev/
                                                                                                                                      grub>

                                                                                                                                      To exit console simply type ‘reboot’. I would like to install my new operating system under a ZVOL ztank/bhyve/post. On another terminal, we create:

                                                                                                                                      # zfs create -V 10G ztank/bhyve/post

                                                                                                                                      If you don’t use ZFS for some crazy reason you can also create a raw blob using the truncate(1) command.

                                                                                                                                      # truncate -s 10G post.img

                                                                                                                                      I recommend installing an operating system from the disk image (installXX.fs for OpenBSD and NetBSD-X.X-amd64-install.img for NetBSD). Now we need to create a device map for a GRUB.

                                                                                                                                      cat > /tmp/post.map << EOF

                                                                                                                                      (hd0) /directory/to/disk/image
                                                                                                                                      (hd1) /dev/zvol/ztank/bhyve/post
                                                                                                                                      EOF

                                                                                                                                      The mapping files describe the names for files in the GRUB. In our case under hd0 we will have an installation image and in hd1 we will have our ZVOL/blob. You can also try to use an ISO image then instead of using hd0 device name use a cd0. When we will run the grub-bhyve command we will see two additional devices.

                                                                                                                                      # grub-bhyve -m /tmp/post.map post

                                                                                                                                      grub> ls
                                                                                                                                      (hd0) (hd0,msdos4) (hd0,msdos1) (hd0,openbsd9) (hd0,openbsd1) (hd1) (host)

                                                                                                                                      The hd0 (in this example OpenBSD image) contains multiple partitions. We can check what is on it.

                                                                                                                                      grub> ls (hd0,msdos4)/

                                                                                                                                      boot bsd 6.4/ etc/

                                                                                                                                      And this is the partition that contains a kernel. Now we can set a root device, load an OpenBSD kernel and boot:

                                                                                                                                      grub> set root=(hd0,msdos4)

                                                                                                                                      grub> kopenbsd -h com0 -r sd0a /bsd
                                                                                                                                      grub> boot

                                                                                                                                      After that, we can run bhyve virtual machine. In my case it is:

                                                                                                                                      # bhyve -c 1 -w -u -H \

                                                                                                                                      -s 0,amd_hostbridge \
                                                                                                                                      -s 3,ahci-hd,/directory/to/disk/image \
                                                                                                                                      -s 4,ahci-hd,/dev/zvol/ztank/bhyve/post \
                                                                                                                                      -s 31,lpc -l com1,stdio \
                                                                                                                                      post

                                                                                                                                      Unfortunately explaining the whole bhyve(8) command line is beyond this article. After installing the operating system remove hd0 from the mapping file and the image from the bhyve(8) command. If you don’t want to type all those GRUB commands, you can simply redirect them to the standard input.

                                                                                                                                      cat << EOF | grub-bhyve -m /tmp/post.map -M 512 post

                                                                                                                                      set root=(hd0,4)
                                                                                                                                      kopenbsd -h com0 -r sd0a /bsd
                                                                                                                                      boot
                                                                                                                                      EOF

                                                                                                                                      ###My FreeBSD Story

                                                                                                                                      My first devices/computers/consoles (not at the same time) that I remember were Atari 2600 and Pegasus console which was hardware clone of the Nintendo NES.

                                                                                                                                      Back then I did not even knew that it was Atari 2600 as I referred to it as Video Computer System … and I did not even knew any english by then. It took me about two decades to get to know (by accident) that this Video Computer System was Atari 2600
                                                                                                                                      Then I got AMIGA 600 computer (or should I say my parents bought it for me) which served both for playing computer games and also other activities for the first time. AMIGA is the computer that had the greatest influence on me, as it was the first time I studied the books about Amiga Workbench operating system and learned commands from Amiga Shell terminal. I loved the idea of Ram Disk icon/directory on the desktop that allowed me to transparently put any things in system memory. I still miss that concept on today’s desktop systems … and I still remember how dismal I was when I watched Amiga Deathbed Vigil movie.
                                                                                                                                      At the end of 1998 I got my first PC that of course came with Windows and that computer served both as gaming machine and as well as typical tool. One time I dig into the internals with Windows Registry (which left me disgusted by its concepts and implementation) and its limited command line interface provided by CMD.EXE executable. I remember that the heart of this box was not the CPU or the motherboard but the graphics accelerator – the legendary 3Dfx Voodoo card. This company (3Dfx) – their attitude and philosophy – also left solid fingerprint on my way. Like AMIGA did.
                                                                                                                                      After ‘migration’ from AMIGA to PC it never again ‘felt right’. The games were cool but the Windows system was horrible. Time has passed and different Windows versions and hardware modifications took place. Windows XP felt really heavy at that time, not to mention Windows 2000 for example with even bigger hardware requirements. I also do not understand all the hate about Windows ME. It crashed with the same frequency as Windows 98 or later Windows 98 Second Edition but maybe my hardware was different ??
                                                                                                                                      I do not have any ‘mine’ screenshots from that period as I lost all my 40 GB (huge then) drive of data when I moved/resized the partition with Partition Magic to get some more space from the less filled C: drive. That day I learned hard that “there are people who do backups and people who will do backups”. I never lost data again as I had multiple copies of my data, but the same as Netheril fall the lost data was was gone forever.
                                                                                                                                      I always followed various alternatives which led me to try Linux in 2003, after reading about various distributions philosophies I decided to run Slackware Linux with KDE 3. My buddy used Aurox Linux by then (one of the few Linux distributions from Poland) and encouraged me to do the same – especially in the context of fixing possible problems as he already knew it and also as he recently dumped Windows system. But Slackware sounded like a better idea so I took that path instead. At first I dual booted between Windows XP and Slackware Linux cause I had everything worked out on the Windows world while I often felt helpless in the Linux world, so I would reboot into Windows to play some games or find a solution for Linux problem if that was required. I remember how strange the concept of dual clipboards (PRIMARY and SECONDARY) was for me by then. I was amazed why ‘so much better’ system as Linux (at least marketed that way) needs a system tray program to literally manage the clipboard. On Windows it was obvious, you do [CTRL]+[C] to copy and [CTRL]+[V] to paste things, but on Linux there (no I know its X11 feature) there were two clipboards that were synchronized by this little system tray program from KDE 3. It was also unthinkable for me that I will ‘lost’ contents of last/recent [CTRL]+[C] operation if I close the application from which the copy was made. I settled down a little on Slackware but not for long. I really did not liked manual dependency management for packages for example. Also KDE 3 was really ugly and despite trying all possible options I was not able to tweak it into something nice looking.
                                                                                                                                      After half a year on Slackware I checked the Linux distributions again and decided to try Gentoo Linux. I definitely agree with the image below which visualizes Gentoo Linux experience, especially when You install it for he first time ??
                                                                                                                                      Of course I went with the most hardcore version with self building Stage 1 (compiler and toolchain) which was horrible idea at that time because compilation on slow single core machine took forever … but after many hours I got Gentoo installed. I now have to decide which desktop environment to use. I have read a lot of good news about Fluxbox at that time so this is what I tried. It was very weird experience (to create everything in GUI from scratch) but very pleasant one. That recalled me the times of AMIGA … but Linux came in the way too much often. The more I dig into Gentoo Linux the more I read that lots of Gentoo features are based on FreeBSD solutions. Gentoo Portage is a clone of FreeBSD Ports. That ‘central’ /etc/rc.conf system configuration file concept was taken from FreeBSD as well. So I started to gather information about FreeBSD. The (then) FreeBSD website or FreeBSD Ports site (still) felt little outdated to say the least but that did not discouraged me.
                                                                                                                                      Somewhere in 2005 I installed FreeBSD 5.4 on my computer. The beginnings were hard, like the earlier step with Gentoo but similarly like Gentoo the FreeBSD project came with a lot of great documentation. While Gentoo documentation is concentrated within various Gentoo Wiki sites the FreeBSD project comes with ‘official’ documentation in the form of Handbook and FAQ. I remember my first questions at the now nonexistent BSDForums.org site – for example one of the first ones – how to scroll the terminal output in the plain console. I now know that I had to push Scroll Lock button but it was something totally new for me.
                                                                                                                                      Why FreeBSD and not OpenBSD or NetBSD? Probably because Gentoo based most their concepts on the FreeBSD solutions, so that led me to FreeBSD instead of the other BSD operating systems. Currently I still use FreeBSD but I keep an steady eye on the OpenBSD, HardenedBSD and DragonFly BSD solutions and improvements.
                                                                                                                                      As the migration path from Linux to FreeBSD is a lot easier – all configuration files from /home can be just copied – the migration was quite fast easy. I again had the Fluxbox configuration which I used on the Gentoo. Now – on FreeBSD – it started to fell even more like AMIGA times. Everything is/has been well thought and had its place and reason. The documentation was good and the FreeBSD Community was second to none.
                                                                                                                                      After 15 years of using various Windows, UNIX (macOS/AIX/HP-UX/Solaris/OpenSolaris/Illumos/FreeBSD/OpenBSD/NetBSD) and UNIX-like (Linux) systems I always come to conclusion that FreeBSD is the system that sucks least. And sucks least with each release and one day I will write why FreeBSD is such great operating system … if I already haven’t

                                                                                                                                      ##News Roundup

                                                                                                                                      ###OpenBSD on the Desktop: some thoughts

                                                                                                                                      I’ve been using OpenBSD on my ThinkPad X230 for some weeks now, and the experience has been peculiar in some ways.

                                                                                                                                      The OS itself in my opinion is not ready for widespread desktop usage, and the development team is not trying to push it in the throat of anybody who wants a Windows or macOS alternative. You need to understand a little bit of how *NIX systems work, because you’ll use CLI more than UI. That’s not necessarily bad, and I’m sure I learned a trick or two that could translate easily to Linux or macOS. Their development process is purely based on developers that love to contribute and hack around, just because it’s fun. Even the mailing list is a cool place to hang on! Code correctness and security are a must, nothing gets committed if it doesn’t get reviewed thoroughly first - nowadays the first two properties should be enforced in every major operating system.
                                                                                                                                      I like the idea of a platform that continually evolves. pledge(2) and unveil(2) are the proof that with a little effort, you can secure existing software better than ever.
                                                                                                                                      I like the “sensible defaults” approach, having an OS ready to be used - UI included if you selected it during the setup process - is great.
                                                                                                                                      Just install a browser and you’re ready to go.
                                                                                                                                      Manual pages on OpenBSD are real manuals, not an extension of the “–help” command found in most CLI softwares. They help you understand inner workings of the operating system, no internet connection needed. There are some trade-offs, too.
                                                                                                                                      Performance is not first-class, mostly because of all the security mitigations and checks done at runtime.
                                                                                                                                      I write Go code in neovim, and sometimes you can feel a slight slowdown when you’re compiling and editing multiple files at the same time, but usually I can’t notice any meaningful difference. Browsers are a different matter though, you can definitely feel something differs from the experience you can have on mainstream operating systems. But again, trade-offs.
                                                                                                                                      To use OpenBSD on the desktop you must be ready to sacrifice some of the goodies of mainstream OSes, but if you’re searching for a zen place to do your computing stuff, it’s the best you can get right now.

                                                                                                                                      ###The history of file type information being available in Unix directories

                                                                                                                                      The two things that Unix directory entries absolutely have to have are the name of the directory entry and its ‘inode’, by which we generically mean some stable kernel identifier for the file that will persist if it gets renamed, linked to other directories, and so on. Unsurprisingly, directory entries have had these since the days when you read the raw bytes of directories with read(), and for a long time that was all they had; if you wanted more than the name and the inode number, you had to stat() the file, not just read the directory. Then, well, I’ll quote myself from an old entry on a find optimization:

                                                                                                                                      […], Unix filesystem developers realized that it was very common for programs reading directories to need to know a bit more about directory entries than just their names, especially their file types (find is the obvious case, but also consider things like ‘ls -F’). Given that the type of an active inode never changes, it’s possible to embed this information straight in the directory entry and then return this to user level, and that’s what developers did; on some systems, readdir(3) will now return directory entries with an additional d_type field that has the directory entry’s type.
                                                                                                                                      On Twitter, I recently grumbled about Illumos not having this d_type field. The ensuing conversation wound up with me curious about exactly where d_type came from and how far back it went. The answer turns out to be a bit surprising due to there being two sides of d_type.
                                                                                                                                      On the kernel side, d_type appears to have shown up in 4.4 BSD. The 4.4 BSD /usr/src/sys/dirent.h has a struct dirent that has a d_type field, but the field isn’t documented in either the comments in the file or in the getdirentries(2) manpage; both of those admit only to the traditional BSD dirent fields. This 4.4 BSD d_type was carried through to things that inherited from 4.4 BSD (Lite), specifically FreeBSD, but it continued to be undocumented for at least a while.
                                                                                                                                      (In FreeBSD, the most convenient history I can find is here, and the d_type field is present in sys/dirent.h as far back as FreeBSD 2.0, which seems to be as far as the repo goes for releases.)
                                                                                                                                      Documentation for d_type appeared in the getdirentries(2) manpage in FreeBSD 2.2.0, where the manpage itself claims to have been updated on May 3rd 1995 (cf). In FreeBSD, this appears to have been part of merging 4.4 BSD ‘Lite2’, which seems to have been done in 1997. I stumbled over a repo of UCB BSD commit history, and in it the documentation appears in this May 3rd 1995 change, which at least has the same date. It appears that FreeBSD 2.2.0 was released some time in 1997, which is when this would have appeared in an official release.
                                                                                                                                      In Linux, it seems that a dirent structure with a d_type member appeared only just before 2.4.0, which was released at the start of 2001. Linux took this long because the d_type field only appeared in the 64-bit ‘large file support’ version of the dirent structure, and so was only return by the new 64-bit getdents64() system call. This would have been a few years after FreeBSD officially documented d_type, and probably many years after it was actually available if you peeked at the structure definition.
                                                                                                                                      As far as I can tell, d_type is present on Linux, FreeBSD, OpenBSD, NetBSD, Dragonfly BSD, and Darwin (aka MacOS or OS X). It’s not present on Solaris and thus Illumos. As far as other commercial Unixes go, you’re on your own; all the links to manpages for things like AIX from my old entry on the remaining Unixes appear to have rotted away.
                                                                                                                                      Sidebar: The filesystem also matters on modern Unixes
                                                                                                                                      Even if your Unix supports d_type in directory entries, it doesn’t mean that it’s supported by the filesystem of any specific directory. As far as I know, every Unix with d_type support has support for it in their normal local filesystems, but it’s not guaranteed to be in all filesystems, especially non-Unix ones like FAT32. Your code should always be prepared to deal with a file type of DT_UNKNOWN.
                                                                                                                                      It’s also possible to have things the other way around, where you have a filesystem with support for file type information in directories that’s on a Unix that doesn’t support it. There are a number of plausible reasons for this to happen, but they’re either obvious or beyond the scope of this entry.

                                                                                                                                      ###Multiboot Pinebook KDE neon

                                                                                                                                      Recently a KDE neon image for the Pinebook was announced. There is a new image, with a handful of fixes, which the KDE Plasma team has been working on over the past week and a half.

                                                                                                                                      Here’s a picture of my Pinebook running KDE neon — watching Panic! At the Disco’s High Hopes — sitting in front of my monitor that’s hooked up to one of my openSUSE systems. There are still some errata, and watching video sucks up battery, but for hacking on documentation from my hammock in the garden, or doing IRC meetings it’s a really nice machine.
                                                                                                                                      But one of the neat things about running KDE neon off of an SD card on the Pinebook is that it’s portable — that SD card can move around. So let’s talk about multiboot in the sense of “booting the same OS storage medium in different hardware units” rather than “booting different OS from a medium in a single hardware unit”. On these little ARM boards, u-boot does all the heavy lifting early in the boot process. So to re-use the KDE neon Pinebook image on another ARM board, the u-boot blocks need to be replaced.
                                                                                                                                      I have the u-boot from a Pine64 image (I forget what) lying around, 1015 blocks of 1024 bytes, which I can dd over the u-boot blocks on the SD card, dd bs=1k conv=notrunc,sync if=uboot.img of=/dev/da0 seek=8, and then the same SD card, with the filesystem and data from the Pinebook, will boot on the Pine64 board. Of course, to move the SD card back again, I need to restore the Pinebook u-boot blocks.
                                                                                                                                      Here’s a picture of my Pineboard (the base is a piece of the garden fence, it’s Douglas pine, with 4mm threaded rods acting as the corner posts for my Pine64 mini-rack), with power and network and a serial console attached, along with the serial console output of the same.
                                                                                                                                      The nice thing here is that the same software stack runs on the Pine64 but then has a wired network — which in turn means that if I switch on the other boards in that mini-rack, I’ve got a distcc-capable cluster for fast development, and vast NFS storage (served from ZFS on my FreeBSD machines) for source. I can develop in a high(er) powered environment, and then swap the card around into the Pinebook for testing-on-the-go.
                                                                                                                                      So to sum up: you can multiboot the KDE neon Pinebook image on other Pine64 hardware (i.e. the Pine64 board). To do so, you need to swap around u-boot blocks. The blocks can be picked out of an image built for each board, and then a particular image (e.g. the latest KDE neon Pinebook) can be run on either board.

                                                                                                                                      ##Beastie Bits

                                                                                                                                      • Unexpected benefit with Ryzen – reducing power for build server
                                                                                                                                      • Happy #CIDRDay!
                                                                                                                                      • Absolute FreeBSD 3e ship date
                                                                                                                                      • MWL FreeBSD talk @ October 9th 2018 - MUG Meeting
                                                                                                                                      • MeetBSD Oct 19-20
                                                                                                                                      • October’s London *BSD meetup - 9th Oct 2018
                                                                                                                                      • NRW BUG Meeting at Trivago Oct. 9
                                                                                                                                      • Lars Wittebrood blogs about his visit to EuroBSDCon 2018
                                                                                                                                      • EuroBSDcon 2018 OpenBSD slides available
                                                                                                                                      • EuroBSDCon conference site has most slides as well
                                                                                                                                      • ##Feedback/Questions

                                                                                                                                        • Brad - Unmounted ZFS sends
                                                                                                                                        • Niclas - Report from a Meetup
                                                                                                                                        • Ghislain - Bhyve not used?
                                                                                                                                        • Shane - zpool history and snapshots
                                                                                                                                          • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                          • 1 hr 15 min
                                                                                                                                          • Episode 265: Software Disenchantment | BSD Now 265

                                                                                                                                            We report from our experiences at EuroBSDcon, disenchant software, LLVM 7.0.0 has been released, Thinkpad BIOS update options, HardenedBSD Foundation announced, and ZFS send vs. rsync.

                                                                                                                                            ##Headlines

                                                                                                                                            ###[FreeBSD DevSummit & EuroBSDcon 2018 in Romania]

                                                                                                                                            • Your hosts are back from EuroBSDcon 2018 held in Bucharest, Romania this year. The first two days of the conference are used for tutorials and devsummits (FreeBSD and NetBSD), while the last two are for talks.
                                                                                                                                            • Although Benedict organized the devsummit in large parts, he did not attend it this year. He held his Ansible tutorial in the morning of the first day, followed by Niclas Zeising’s new ports and poudriere tutorial (which had a record attendance). It was intended for beginners that had never used poudriere before and those who wanted to create their first port. The tutorial was well received and Niclas already has ideas for extending it for future conferences.
                                                                                                                                            • On the second day, Benedict took Kirk McKusick’s “An Introduction to the FreeBSD Open-Source Operating System” tutorial, held as a one full day class this year. Although it was reduced in content, it went into enough depth of many areas of the kernel and operating system to spark many questions from attendees. Clearly, this is a good start into kernel programming as Kirk provides enough material and backstories to understand why certain things are implemented as they are.
                                                                                                                                            • Olivier Robert took [https://www.talegraph.com/tales/l2o9ltrvsE](pictures from the devsummit) and created a nice gallery out of it.
                                                                                                                                            • Devsummit evenings saw dinners at two restaurants that allowed developers to spend some time talking over food and drinks.
                                                                                                                                            • The conference opened on the next day with the opening session held by Mihai Carabas. He introduced the first keynote speaker, a colleague of his who presented “Lightweight virtualization with LightVM and Unikraft”.
                                                                                                                                            • Benedict helped out at the FreeBSD Foundation sponsor table and talked to people. He saw the following talks in between:
                                                                                                                                            • Selfhosting as an alternative to the public cloud (by Albert Dengg)

                                                                                                                                              Using Boot Environments at Scale (by Allan Jude)
                                                                                                                                              Livepatching FreeBSD kernel (by Maciej Grochowski)
                                                                                                                                              FreeBSD: What to (Not) Monitor (by Andrew Fengler)
                                                                                                                                              FreeBSD Graphics (by Niclas Zeising)

                                                                                                                                              • Allan spent a lot of time talking to people and helping track down issues they were having, in addition to attending many talks:
                                                                                                                                              • Hacking together a FreeBSD presentation streaming box – For as little as possible (by Tom Jones)

                                                                                                                                                Introduction of FreeBSD in new environments (by Baptiste Daroussin)
                                                                                                                                                Keynote: Some computing and networking historical perspectives (by Ron Broersma)
                                                                                                                                                Livepatching FreeBSD kernel (by Maciej Grochowski)
                                                                                                                                                FreeBSD: What to (Not) Monitor (by Andrew Fengler)
                                                                                                                                                Being a BSD user (by Roller Angel)
                                                                                                                                                From “Hello World” to the VFS Layer: building a beadm for DragonFly BSD (by Michael Voight)

                                                                                                                                              • We also met the winner of our Power Bagel raffle from Episode 2^8. He received the item in the meantime and had it with him at the conference, providing a power outlet to charge other people’s devices.
                                                                                                                                              • During the closing session, GroffTheBSDGoat was handed over to Deb Goodkin, who will bring the little guy to the Grace Hopper Celebration of Women in Computing conference and then to MeetBSD later this year. It was also revealed that next year’s EuroBSDcon will be held in Lillehammer, Norway.
                                                                                                                                              • Thanks to all the speakers, helpers, sponsors, organizers, and attendees for making it a successful conferences. There were no talks recorded this year, but the slides will be uploaded to the EuroBSDcon website in a couple of weeks. The OpenBSD talks are already available, so check them out.
                                                                                                                                              • ###Software disenchantment

                                                                                                                                                I’ve been programming for 15 years now. Recently our industry’s lack of care for efficiency, simplicity, and excellence started really getting to me, to the point of me getting depressed by my own career and the IT in general.

                                                                                                                                                Modern cars work, let’s say for the sake of argument, at 98% of what’s physically possible with the current engine design. Modern buildings use just enough material to fulfill their function and stay safe under the given conditions. All planes converged to the optimal size/form/load and basically look the same.
                                                                                                                                                Only in software, it’s fine if a program runs at 1% or even 0.01% of the possible performance. Everybody just seems to be ok with it. People are often even proud about how much inefficient it is, as in “why should we worry, computers are fast enough”:
                                                                                                                                                @tveastman: I have a Python program I run every day, it takes 1.5 seconds. I spent six hours re-writing it in rust, now it takes 0.06 seconds. That efficiency improvement means I’ll make my time back in 41 years, 24 days :-)
                                                                                                                                                You’ve probably heard this mantra: “programmer time is more expensive than computer time”. What it means basically is that we’re wasting computers at an unprecedented scale. Would you buy a car if it eats 100 liters per 100 kilometers? How about 1000 liters? With computers, we do that all the time.

                                                                                                                                                • Everything is unbearably slow
                                                                                                                                                • Look around: our portable computers are thousands of times more powerful than the ones that brought man to the moon. Yet every other webpage struggles to maintain a smooth 60fps scroll on the latest top-of-the-line MacBook Pro. I can comfortably play games, watch 4K videos but not scroll web pages? How is it ok?

                                                                                                                                                  Google Inbox, a web app written by Google, running in Chrome browser also by Google, takes 13 seconds to open moderately-sized emails:
                                                                                                                                                  It also animates empty white boxes instead of showing their content because it’s the only way anything can be animated on a webpage with decent performance. No, decent doesn’t mean 60fps, it’s rather “as fast as this web page could possibly go”. I’m dying to see web community answer when 120Hz displays become mainstream. Shit barely hits 60Hz already.
                                                                                                                                                  Windows 10 takes 30 minutes to update. What could it possibly be doing for that long? That much time is enough to fully format my SSD drive, download a fresh build and install it like 5 times in a row.
                                                                                                                                                  Pavel Fatin: Typing in editor is a relatively simple process, so even 286 PCs were able to provide a rather fluid typing experience.
                                                                                                                                                  Modern text editors have higher latency than 42-year-old Emacs. Text editors! What can be simpler? On each keystroke, all you have to do is update tiny rectangular region and modern text editors can’t do that in 16ms. It’s a lot of time. A LOT. A 3D game can fill the whole screen with hundreds of thousands (!!!) of polygons in the same 16ms and also process input, recalculate the world and dynamically load/unload resources. How come?
                                                                                                                                                  As a general trend, we’re not getting faster software with more features. We’re getting faster hardware that runs slower software with the same features. Everything works way below the possible speed. Ever wonder why your phone needs 30 to 60 seconds to boot? Why can’t it boot, say, in one second? There are no physical limitations to that. I would love to see that. I would love to see limits reached and explored, utilizing every last bit of performance we can get for something meaningful in a meaningful way.

                                                                                                                                                  • Everything is HUUUUGE
                                                                                                                                                  • And then there’s bloat. Web apps could open up to 10× faster if you just simply block all ads. Google begs everyone to stop shooting themselves in their feet with AMP initiative—a technology solution to a problem that doesn’t need any technology, just a little bit of common sense. If you remove bloat, the web becomes crazy fast. How smart do you have to be to understand that?

                                                                                                                                                    Android system with no apps takes almost 6 Gb. Just think for a second how obscenely HUGE that number is. What’s in there, HD movies? I guess it’s basically code: kernel, drivers. Some string and resources too, sure, but those can’t be big. So, how many drivers do you need for a phone?
                                                                                                                                                    Windows 95 was 30Mb. Today we have web pages heavier than that! Windows 10 is 4Gb, which is 133 times as big. But is it 133 times as superior? I mean, functionally they are basically the same. Yes, we have Cortana, but I doubt it takes 3970 Mb. But whatever Windows 10 is, is Android really 150% of that?
                                                                                                                                                    Google keyboard app routinely eats 150 Mb. Is an app that draws 30 keys on a screen really five times more complex than the whole Windows 95? Google app, which is basically just a package for Google Web Search, is 350 Mb! Google Play Services, which I do not use (I don’t buy books, music or videos there)—300 Mb that just sit there and which I’m unable to delete.
                                                                                                                                                    All that leaves me around 1 Gb for my photos after I install all the essential (social, chats, maps, taxi, banks etc) apps. And that’s with no games and no music at all! Remember times when an OS, apps and all your data fit on a floppy?
                                                                                                                                                    Your desktop todo app is probably written in Electron and thus has userland driver for Xbox 360 controller in it, can render 3d graphics and play audio and take photos with your web camera.
                                                                                                                                                    A simple text chat is notorious for its load speed and memory consumption. Yes, you really have to count Slack in as a resource-heavy application. I mean, chatroom and barebones text editor, those are supposed to be two of the less demanding apps in the whole world. Welcome to 2018.
                                                                                                                                                    At least it works, you might say. Well, bigger doesn’t imply better. Bigger means someone has lost control. Bigger means we don’t know what’s going on. Bigger means complexity tax, performance tax, reliability tax. This is not the norm and should not become the norm. Overweight apps should mean a red flag. They should mean run away scared.

                                                                                                                                                    • Better world manifesto
                                                                                                                                                    • I want to see progress. I want change. I want state-of-the-art in software engineering to improve, not just stand still. I don’t want to reinvent the same stuff over and over, less performant and more bloated each time. I want something to believe in, a worthy end goal, a future better than what we have today, and I want a community of engineers who share that vision.

                                                                                                                                                      What we have today is not progress. We barely meet business goals with poor tools applied over the top. We’re stuck in local optima and nobody wants to move out. It’s not even a good place, it’s bloated and inefficient. We just somehow got used to it.
                                                                                                                                                      So I want to call it out: where we are today is bullshit. As engineers, we can, and should, and will do better. We can have better tools, we can build better apps, faster, more predictable, more reliable, using fewer resources (orders of magnitude fewer!). We need to understand deeply what are we doing and why. We need to deliver: reliably, predictably, with topmost quality. We can—and should–take pride in our work. Not just “given what we had…”—no buts!
                                                                                                                                                      I hope I’m not alone at this. I hope there are people out there who want to do the same. I’d appreciate if we at least start talking about how absurdly bad our current situation in the software industry is. And then we maybe figure out how to get out.

                                                                                                                                                      ##News Roundup

                                                                                                                                                      ###[llvm-announce] LLVM 7.0.0 Release

                                                                                                                                                      I am pleased to announce that LLVM 7 is now available.
                                                                                                                                                      Get it here: https://llvm.org/releases/download.html#7.0.0
                                                                                                                                                      The release contains the work on trunk up to SVN revision 338536 plus
                                                                                                                                                      work on the release branch. It is the result of the community's work
                                                                                                                                                      over the past six months, including: function multiversioning in Clang
                                                                                                                                                      with the 'target' attribute for ELF-based x86/x86_64 targets, improved
                                                                                                                                                      PCH support in clang-cl, preliminary DWARF v5 support, basic support
                                                                                                                                                      for OpenMP 4.5 offloading to NVPTX, OpenCL C++ support, MSan, X-Ray
                                                                                                                                                      and libFuzzer support for FreeBSD, early UBSan, X-Ray and libFuzzer
                                                                                                                                                      support for OpenBSD, UBSan checks for implicit conversions, many
                                                                                                                                                      long-tail compatibility issues fixed in lld which is now production
                                                                                                                                                      ready for ELF, COFF and MinGW, new tools llvm-exegesis, llvm-mca and
                                                                                                                                                      diagtool. And as usual, many optimizations, improved diagnostics, and
                                                                                                                                                      bug fixes.
                                                                                                                                                      For more details, see the release notes:
                                                                                                                                                      https://llvm.org/releases/7.0.0/docs/ReleaseNotes.html
                                                                                                                                                      https://llvm.org/releases/7.0.0/tools/clang/docs/ReleaseNotes.html
                                                                                                                                                      https://llvm.org/releases/7.0.0/tools/clang/tools/extra/docs/ReleaseNotes.html
                                                                                                                                                      https://llvm.org/releases/7.0.0/tools/lld/docs/ReleaseNotes.html
                                                                                                                                                      Thanks to everyone who helped with filing, fixing, and code reviewing
                                                                                                                                                      for the release-blocking bugs!
                                                                                                                                                      Special thanks to the release testers and packagers: Bero
                                                                                                                                                      Rosenkränzer, Brian Cain, Dimitry Andric, Jonas Hahnfeld, Lei Huang
                                                                                                                                                      Michał Górny, Sylvestre Ledru, Takumi Nakamura, and Vedant Kumar.
                                                                                                                                                      For questions or comments about the release, please contact the
                                                                                                                                                      community on the mailing lists. Onwards to LLVM 8!
                                                                                                                                                      Cheers,
                                                                                                                                                      Hans

                                                                                                                                                      ###Update your Thinkpad’s bios with Linux or OpenBSD

                                                                                                                                                      • Get your new bios
                                                                                                                                                      • At first, go to the Lenovo website and download your new bios:

                                                                                                                                                        • Go to lenovo support
                                                                                                                                                        • Use the search bar to find your product (example for me, x270)
                                                                                                                                                        • Choose the right product (if necessary) and click search
                                                                                                                                                        • On the right side, click on Update Your System
                                                                                                                                                        • Click on BIOS/UEFI
                                                                                                                                                        • Choose *BIOS Update (Bootable CD) for Windows *
                                                                                                                                                        • Download
                                                                                                                                                        • For me the file is called like this : r0iuj25wd.iso

                                                                                                                                                          • Extract bios update
                                                                                                                                                          • Now you will need to install geteltorito.

                                                                                                                                                            • With OpenBSD:
                                                                                                                                                            • $ doas pkg_add geteltorito

                                                                                                                                                              quirks-3.7 signed on 2018-09-09T13:15:19Z
                                                                                                                                                              geteltorito-0.6: ok

                                                                                                                                                              • With Debian:
                                                                                                                                                              • $ sudo apt-get install genisoimage

                                                                                                                                                                • Now we will extract the bios update :
                                                                                                                                                                • $ geteltorito -o bios_update.img r0iuj25wd.iso

                                                                                                                                                                  Booting catalog starts at sector: 20
                                                                                                                                                                  Manufacturer of CD: NERO BURNING ROM VER 12
                                                                                                                                                                  Image architecture: x86
                                                                                                                                                                  Boot media type is: harddisk
                                                                                                                                                                  El Torito image starts at sector 27 and has 43008 sector(s) of 512 Bytes

                                                                                                                                                                  Image has been written to file "bios_update.img".
                                                                                                                                                                  This will create a file called bios_update.img.

                                                                                                                                                                  • Put the image on an USB key
                                                                                                                                                                  • CAREFULL : on my computer, my USB key is sda1 on Linux and sd1 on OpenBSD.
                                                                                                                                                                  • Please check twice on your computer the name of your USB key.

                                                                                                                                                                    • With OpenBSD :
                                                                                                                                                                    • $ doas dd if=bios_update.img of=/dev/rsd1c

                                                                                                                                                                      • With Linux :
                                                                                                                                                                      • $ sudo dd if=bios_update.img of=/dev/sda

                                                                                                                                                                        Now all you need is to reboot, to boot on your USB key and follow the instructions. Enjoy 😉

                                                                                                                                                                        ###Announcing The HardenedBSD Foundation

                                                                                                                                                                        In June of 2018, we announced our intent to become a not-for-profit, tax-exempt 501©(3) organization in the United States. It took a dedicated team months of work behind-the-scenes to make that happen. On 06 September 2018, HardenedBSD Foundation Corp was granted 501©(3) status, from which point all US-based persons making donations can deduct the donation from their taxes.

                                                                                                                                                                        We are grateful for those who contribute to HardenedBSD in whatever way they can. Thank you for making HardenedBSD possible. We look forward to a bright future, driven by a helpful and positive community.

                                                                                                                                                                        ###How you migrate ZFS filesystems matters

                                                                                                                                                                        If you want to move a ZFS filesystem around from one host to another, you have two general approaches; you can use ‘zfs send’ and ‘zfs receive’, or you can use a user level copying tool such as rsync (or ‘tar -cf | tar -xf’, or any number of similar options). Until recently, I had considered these two approaches to be more or less equivalent apart from their convenience and speed (which generally tilted in favour of ‘zfs send’). It turns out that this is not necessarily the case and there are situations where you will want one instead of the other.

                                                                                                                                                                        We have had two generations of ZFS fileservers so far, the Solaris ones and the OmniOS ones. When we moved from the first generation to the second generation, we migrated filesystems across using ‘zfs send’, including the filesystem with my home directory in it (we did this for various reasons). Recently I discovered that some old things in my filesystem didn’t have file type information in their directory entries. ZFS has been adding file type information to directories for a long time, but not quite as long as my home directory has been on ZFS.
                                                                                                                                                                        This illustrates an important difference between the ‘zfs send’ approach and the rsync approach, which is that zfs send doesn’t update or change at least some ZFS on-disk data structures, in the way that re-writing them from scratch from user level does. There are both positives and negatives to this, and a certain amount of rewriting does happen even in the ‘zfs send’ case (for example, all of the block pointers get changed, and ZFS will re-compress your data as applicable).
                                                                                                                                                                        I knew that in theory you had to copy things at the user level if you wanted to make sure that your ZFS filesystem and everything in it was fully up to date with the latest ZFS features. But I didn’t expect to hit a situation where it mattered in practice until, well, I did. Now I suspect that old files on our old filesystems may be partially missing a number of things, and I’m wondering how much of the various changes in ‘zfs upgrade -v’ apply even to old data.
                                                                                                                                                                        (I’d run into this sort of general thing before when I looked into ext3 to ext4 conversion on Linux.)
                                                                                                                                                                        With all that said, I doubt this will change our plans for migrating our ZFS filesystems in the future (to our third generation fileservers). ZFS sending and receiving is just too convenient, too fast and too reliable to give up. Rsync isn’t bad, but it’s not the same, and so we only use it when we have to (when we’re moving only some of the people in a filesystem instead of all of them, for example).
                                                                                                                                                                        PS: I was going to try to say something about what ‘zfs send’ did and didn’t update, but having looked briefly at the code I’ve concluded that I need to do more research before running my keyboard off. In the mean time, you can read the OpenZFS wiki page on ZFS send and receive, which has plenty of juicy technical details.
                                                                                                                                                                        PPS: Since eliminating all-zero blocks is a form of compression, you can turn zero-filled files into sparse files through a ZFS send/receive if the destination has compression enabled. As far as I know, genuine sparse files on the source will stay sparse through a ZFS send/receive even if they’re sent to a destination with compression off.

                                                                                                                                                                        ##Beastie Bits

                                                                                                                                                                        • BSD Users Stockholm Meetup #4: Tuesday, November 13, 2018 at 18:00
                                                                                                                                                                        • BSD Poland User Group: Next Meeting: October 11, 2018, 18:15 - 21:15 at Warsaw University of Technology
                                                                                                                                                                        • n2k18 Hackathon report: Ken Westerback (krw@) on disklabel(8) work, dhclient(8) progress
                                                                                                                                                                        • Running MirageOS Unikernels on OpenBSD in vmm (Now Works)
                                                                                                                                                                        • vmm(4) gets support for qcow2
                                                                                                                                                                        • MeetBSD and SecurityBsides
                                                                                                                                                                        • Colin Percival reduced FreeBSD startup time from 10627ms (11.2) to 4738ms (12.0)
                                                                                                                                                                        • FreeBSD 11.1 end-of-life
                                                                                                                                                                        • KnoxBug: Monday, October 1, 2018 at 18:00: Real-world Performance Advantages of NVDIMM and NVMe: Case Study with OpenZFS
                                                                                                                                                                        • ##Feedback/Questions

                                                                                                                                                                          • Todd - 2 Nics, 1 bhyve and a jail cell
                                                                                                                                                                          • Thomas - Deep Dive
                                                                                                                                                                          • Morgan - Send/Receive to Manage Fragmentation?
                                                                                                                                                                          • Dominik - hierarchical jails -> networking
                                                                                                                                                                            • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                                                            • 1 hr 42 min
                                                                                                                                                                            • Episode 264: Optimized-out | BSD Now 264

                                                                                                                                                                              FreeBSD and DragonflyBSD benchmarks on AMD’s Threadripper, NetBSD 7.2 has been released, optimized out DTrace kernel symbols, stuck UEFI bootloaders, why ed is not a good editor today, tell your BSD story, and more.

                                                                                                                                                                              ##Headlines

                                                                                                                                                                              ###FreeBSD & DragonFlyBSD Put Up A Strong Fight On AMD’s Threadripper 2990WX, Benchmarks Against Linux

                                                                                                                                                                              The past two weeks I have been delivering a great deal of AMD Threadripper 2990WX benchmarks on Linux as well as some against Windows and Windows Server. But recently I got around to trying out some of the BSD operating systems on this 32-core / 64-thread processor to see how they would run and to see whether they would have similar scaling issues or not like we’ve seen on the Windows side against Linux. In this article are FreeBSD and DragonFlyBSD benchmarks with the X399 + 2990WX compared to a few Linux distributions.

                                                                                                                                                                              The BSDs I focused my testing on were FreeBSD 11.2-STABLE and 12.0-CURRENT/ALPHA1 (the version in development) as well as iX System’s TrueOS that is tracking FreeBSD 12.0-CURRENT. Also included were DragonFlyBSD, with FreeBSD and DragonFlyBSD being tied as my favorite operating systems when it comes to the BSDs. When it came to FreeBSD 11.2-STABLE and 12.0-ALPHA1 on the Threadripper 2990WX, it worked out surprisingly well. I encountered no real issues during my two days of benchmarking on FreeBSD (and TrueOS). It was a great experience and FreeBSD was happy to exploit the 64 threads on the system.
                                                                                                                                                                              DragonFlyBSD was a bit of a different story… Last week when I started this BSD testing I tried DragonFly 5.2.2 as the latest stable release as well as a DragonFlyBSD 5.3 development snapshot from last week: both failed to boot in either BIOS or UEFI modes.
                                                                                                                                                                              But then a few days ago DragonFlyBSD lead developer Matthew Dillon bought himself a 2990WX platform. He made the necessary changes to get DragonFlyBSD 5.3 working and he ended up finding really great performance and potential out of the platform. So I tried the latest DragonFlyBSD 5.3 daily ISO on 22 August and indeed it now booted successfully and we were off to the races. Thus there are some DragonFlyBSD 5.3 benchmarks included in this article too.
                                                                                                                                                                              Just hours ago, Matthew Dillon landed some 2990WX topology and scheduler enhancements but that fell out of the scope of when DragonFly was installed on this system. But over the weekend or so I plan to re-test DragonFlyBSD 5.3 and see how those optimizations affect the overall 2990WX performance now on that BSD. DragonFlyBSD 5.4 stable should certainly be an interesting release on several fronts!
                                                                                                                                                                              With FreeBSD 11.2-STABLE and 12.0-ALPHA1 I ran benchmarks when using their stock compiler (LLVM Clang 6.0) as well as GCC 7.3 obtained via GCC 7.3. That was done to rule out compiler differences in benchmarking against the GCC-based Linux distributions. On DragonFlyBSD 5.3 it defaults to the GCC 5.4.1 but via pkg I also did a secondary run when upgraded to GCC 7.3.
                                                                                                                                                                              The hardware and BIOS/UEFI settings were maintained the same throughout the entire benchmarking process. The system was made up of the AMD Ryzen Threadripper 2990WX at stock speeds, the ASUS ROG ZENITH EXTREME motherboard, 4 x 8GB DDR4-3200MHz memory, Samsung 970 EVO 500GB NVMe SSD, and Radeon RX Vega 56 graphics card.
                                                                                                                                                                              All of these Linux vs. BSD benchmarks were carried out in a fully-automated and reproducible manner using the open-source Phoronix Test Suite benchmarking framework.
                                                                                                                                                                              While for the last of today’s BSD vs. Linux benchmarking on the Threadripper 2990WX, the Linux distributions came out slightly ahead of FreeBSD and DragonFlyBSD with GCC (another test having issues with Clang 6.0 on the BSDs).
                                                                                                                                                                              Overall, I was quite taken away by the BSD performance on the Threadripper 2990WX – particularly FreeBSD. In a surprising number of benchmarks, the BSDs were outperforming the tested Linux distributions though often by incredibly thin margins. Still, quite an accomplishment for these BSD operating systems and considering how much better Linux is already doing than Windows 10 / Windows Server on this 32-core / 64-thread processor. Then again, the BSDs like Linux have a long history of running on high core/thread-count systems, super computers, and other HPC environments.
                                                                                                                                                                              It will be interesting to see how much faster DragonFlyBSD can run given today’s commit to its kernel with scheduler and topology improvements for the 2990WX. Those additional DragonFlyBSD benchmarks will be published in the coming days once they are completed.

                                                                                                                                                                              ###NetBSD 7.2 released

                                                                                                                                                                              The NetBSD Project is pleased to announce NetBSD 7.2, the second feature update of the NetBSD 7 release branch. It represents a selected subset of fixes deemed important for security or stability reasons, as well as new features and enhancements.

                                                                                                                                                                              • General Security Note
                                                                                                                                                                              • The NetBSD 7.2 release is a maintenance release of the netbsd-7 branch, which had it's first major release, NetBSD 7.0 in September 2015. A lot of security features have been added to later NetBSD versions, and for new installations we highly recommend using our latest release, NetBSD 8.0 instead.

                                                                                                                                                                                • Some highlights of the 7.2 release are:
                                                                                                                                                                                • Support for USB 3.0.
                                                                                                                                                                                • Enhancements to the Linux emulation subsystem.
                                                                                                                                                                                • Fixes in binary compatibility for ancient NetBSD executables.
                                                                                                                                                                                • iwm(4) driver for Intel Wireless 726x, 316x, 826x and 416x series added.
                                                                                                                                                                                • Support for Raspberry Pi 3 added.
                                                                                                                                                                                • Fix interrupt setup on Hyper-V VMs with Legacy Network Adapter.
                                                                                                                                                                                • SVR4 and IBCS2 compatibility subsystems have been disabled by default (besides IBCS2 on VAX). These subsystems also do not auto-load their modules any more.
                                                                                                                                                                                • Various USB stability enhancements.
                                                                                                                                                                                • Numerous bug fixes and stability improvements.
                                                                                                                                                                                • Complete source and binaries for NetBSD 7.2 are available for download at many sites around the world. A list of download sites providing FTP, AnonCVS, SUP, and other services may be found at https://www.NetBSD.org/mirrors/. We encourage users who wish to install via ISO or USB disk images to download via BitTorrent by using the torrent files supplied in the images area. A list of hashes for the NetBSD 7.2 distribution has been signed with the well-connected PGP key for the NetBSD Security Officer: https://cdn.NetBSD.org/pub/NetBSD/security/hashes/NetBSD-7.2_hashes.asc

                                                                                                                                                                                  NetBSD is free. All of the code is under non-restrictive licenses, and may be used without paying royalties to anyone. Free support services are available via our mailing lists and website. Commercial support is available from a variety of sources. More extensive information on NetBSD is available from our website:

                                                                                                                                                                                  ##News Roundup

                                                                                                                                                                                  ###Including optimized-out kernel symbols in dtrace on FreeBSD

                                                                                                                                                                                  Have you ever had dtrace(1) on FreeBSD fail to list a probe that should exist in the kernel? This is because Clang will optimize-out some functions. The result is ctfconvert(1) will not generate debugging symbols that dtrace(1) uses to identify probes. I have a quick solution to getting those probes visible to dtrace(1).

                                                                                                                                                                                  In my case, I was trying to instrument on ieee80211_ioctl_get80211, whose sister function ieee80211_ioctl_set80211 has a dtrace(1) probe in the generic FreeBSD 11 and 12 kernels. Both functions are located in /usr/src/sys/net80211/ieee80211_ioctl.c.

                                                                                                                                                                                  My first attempt was to add to /etc/make.conf as follows and recompile the kernel.

                                                                                                                                                                                  CFLAGS+=-O0 and -fno-inline-functions

                                                                                                                                                                                  This failed to produce the dtrace(1) probe. Several other attempts failed and I was getting inconsistent compilation results (Is it me or is ieee80211_ioctl.c compiled with different flags if NO_CLEAN=1 is set?). When I manually compiled the object file by copying the compilation line for the object file and adding -O0 -fno-inline-functions, nm(1) on both the object file and kernel demonstrated that the symbol was present. I installed the kernel, rebooted and it was listed as a dtrace probe. Great!

                                                                                                                                                                                  But as I continued to debug my WiFi driver (oh yeah, I’m very slowly extending rtwn(4)), I found myself rebuilding the kernel several times and frequently rebooting. Why not do this across the entire kernel?

                                                                                                                                                                                  After hacking around, my solution was to modify the build scripts. My solution was to edit /usr/src/sys/conf/kern.pre.mk and modify all optimization level 2 to optimization level 0. The following is my diff(1) on FreeBSD 12.0-CURRENT.

                                                                                                                                                                                  • A few thoughts:
                                                                                                                                                                                  • This seems like a hack rather than a long-term solution. Either the problem is with the hard-coded optimization flags, or the inability to overwrite them in all places in make.conf.

                                                                                                                                                                                    Removing optimizations is only something I would do in a non-production kernel, so its as if I have to choose between optimizations for a production kernel or having dtrace probes. But dtrace explicitly markets itself as not impactful on production.
                                                                                                                                                                                    Using the dtrace pony as your featured image on WordPress does not render properly and must be rotated and modified. Blame Bryan Cantrill.
                                                                                                                                                                                    If you have a better solution, please let me know and I will update the article, but this works for me!

                                                                                                                                                                                    ###FreeBSD: UEFI Bootloader stuck on BootCurrent/BootOrder/BootInfo on Asus Motherboards (and fix!)

                                                                                                                                                                                    Starting with FreeBSD CURRENT from about a few weeks of posting date, but including FreeBSD 12 alpha releases (not related to DEC Alpha), I noticed one thing: When I boot FreeBSD from UEFI on a homebuilt desktop with a Asus H87M-E motherboard, and have Root on ZFS, the bootloader gets stuck on lines like BootCurrent, BootOrder, and BootInfo. This issue occurs when I try to boot directly to efi\boot\bootx64.efi.

                                                                                                                                                                                    One person had a similar issue on a Asus H87I-PLUS motherboard. This issue may or may not exist on other Asus motherboards, desktops, or laptops. This may be specific to Asus motherboards for Intel’s Haswell, but may also exist on newer systems (e.g. Skylake) or older (e.g. Ivy Bridge) with Asus motherboards, as well as Asus desktops or laptops.

                                                                                                                                                                                    • There are two solutions to this problem:
                                                                                                                                                                                    • Use Legacy BIOS mode instead of UEFI mode
                                                                                                                                                                                    • Install a FreeBSD UEFI Boot entry
                                                                                                                                                                                    • Keep in mind that I am not going to talk about this issue and third-party UEFI boot managers such as rEFInd here.

                                                                                                                                                                                      The first option is rather straightforward: you need to make sure your computer has “Secure Boot” disabled and “Legacy Boot” or “CSM” enabled. Then, you need to make sure FreeBSD is installed in BIOS mode. However, this solution is (in my opinion) suboptimal. Why? Because:
                                                                                                                                                                                      You won’t be able to use hard drives bigger than 2TB
                                                                                                                                                                                      You are limited to MBR Partitioning on Asus motherboards with UEFI as Asus motherboards refuse to boot GPT partitioned disks in BIOS mode
                                                                                                                                                                                      Legacy BIOS mode may not exist on future computers or motherboards (although those systems may not have this issue, and this issue may get fixed by then)
                                                                                                                                                                                      The second option, however, is less straightforward, but will let you keep UEFI. Many UEFI systems, including affected Asus motherboards described here, include a boot manager built into the UEFI. FreeBSD includes a tool called efibootmgr to manage this, similar to the similarly-named tool in Linux, but with a different syntax.

                                                                                                                                                                                      ###Why ed(1) is not a good editor today

                                                                                                                                                                                      I’ll start with my tweet:

                                                                                                                                                                                      Heretical Unix opinion time: ed(1) may be the 'standard Unix editor', but it is not a particularly good editor outside of a limited environment that almost never applies today.

                                                                                                                                                                                      There is a certain portion of Unixdom that really likes ed(1), the ‘standard Unix editor’. Having actually used ed for a not insignificant amount of time (although it was the friendlier ‘UofT ed’ variant), I have some reactions to what I feel is sometimes overzealous praise of it. One of these is what I tweeted.

                                                                                                                                                                                      The fundamental limitation of ed is that it is what I call an indirect manipulation interface, in contrast to the explicit manipulation interfaces of screen editors like vi and graphical editors like sam (which are generally lumped together as ‘visual’ editors, so called because they actually show you the text you’re editing). When you edit text in ed, you have some problems that you don’t have in visual editors; you have to maintain in your head the context of what the text looks like (and where you are in it), you have to figure out how to address portions of that text in order to modify them, and finally you have to think about how your edit commands will change the context. Copious use of ed’s p command can help with the first problem, but nothing really deals with the other two. In order to use ed, you basically have to simulate parts of ed in your head.
                                                                                                                                                                                      Ed is a great editor in situations where the editor explicitly presenting this context is a very expensive or outright impossible operation. Ed works great on real teletypes, for example, or over extremely slow links where you want to send and receive as little data as possible (and on real teletypes you have some amount of context in the form of an actual printout that you can look back at). Back in the old days of Unix, this described a fairly large number of situations; you had actual teletypes, you had slow dialup links (and later slow, high latency network links), and you had slow and heavily overloaded systems.
                                                                                                                                                                                      However, that’s no longer the situation today (at least almost all of the time). Modern systems and links can easily support visual editors that continually show you the context of the text and generally let you more or less directly manipulate it (whether that is through cursoring around it or using a mouse). Such editors are easier and faster to use, and they leave you with more brainpower free to think about things like the program you’re writing (which is the important thing).
                                                                                                                                                                                      If you can use a visual editor, ed is not a particularly good editor to use instead; you will probably spend a lot of effort (and some amount of time) on doing by hand something that the visual editor will do for you. If you are very practiced at ed, maybe this partly goes away, but I maintain that you are still working harder than you need to be.
                                                                                                                                                                                      The people who say that ed is a quite powerful editor are correct; ed is quite capable (although sadly limited by only editing a single file). It’s just that it’s also a pain to use.
                                                                                                                                                                                      (They’re also correct that ed is the foundation of many other things in Unix, including sed and vi. But that doesn’t mean that the best way to learn or understand those things is to learn and use ed.)
                                                                                                                                                                                      This doesn’t make ed a useless, vestigial thing on modern Unix, though. There are uses for ed in non-interactive editing, for example. But on modern Unix, ed is a specialized tool, much like dc. It’s worth knowing that ed is there and roughly what it can do, but it’s probably not worth learning how to use it before you need it. And you’re unlikely to ever be in a situation where it’s the best choice for interactive editing (and if you are, something has generally gone wrong).
                                                                                                                                                                                      (But if you enjoy exploring the obscure corners of Unix, sure, go for it. Learn dc too, because it’s interesting in its own way and, like ed, it’s one of those classical old Unix programs.)

                                                                                                                                                                                      ##Beastie Bits

                                                                                                                                                                                      • Is there any interest in a #BSD user group in #Montreal?
                                                                                                                                                                                      • Tell your BSD story
                                                                                                                                                                                      • Finishing leftover tasks from Google Summer of Code
                                                                                                                                                                                      • Fuzzing the OpenBSD Kernel
                                                                                                                                                                                      • ARM - any Tier-1 *BSD options?
                                                                                                                                                                                      • ##Feedback/Questions

                                                                                                                                                                                        • Chris - byhve question
                                                                                                                                                                                        • Paulo - Topic suggestion
                                                                                                                                                                                        • Bostjan - How data gets to disk
                                                                                                                                                                                          • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                                                                          • 1 hr 12 min
                                                                                                                                                                                          • Episode 263: Encrypt That Pool | BSD Now 263

                                                                                                                                                                                            Mitigating Spectre/Meltdown on HP Proliant servers, omniOS installation setup, debugging a memory corruption issue on OpenBSD, CfT for OpenZFS native encryption, Asigra TrueNAS backup appliance shown at VMworld, NetBSD 6 EoL, and more.

                                                                                                                                                                                            ##Headlines

                                                                                                                                                                                            ###How to mitigate Spectre and Meltdown on an HP Proliant server with FreeBSD

                                                                                                                                                                                            As recently announced in a previous article I wanted to write a couple of guides on how to mitigate Spectre and Meltdown vulnerabilities in GNU/Linux and UNIX environments. It is always a good and I hope a standard practice to have your systems patched and if they aren’t for whatever the reason (that legacy thing you’re carrying on for ages) you may take the necessary extra steps to protect your environment. I never planned to do any article on patching anything. Nowadays it’s a no brainer and operating systems have provided the necessary tools for this to be easy and as smooth as possible. So why this article?

                                                                                                                                                                                            Spectre and Meltdown are both hardware vulnerabilities. Major ones. They are meaningful for several reasons among them the world wide impact since they affect Intel and AMD systems which are ubiquitous. And second because patching hardware is not as easy, for the manufacturer and for the users or administrators in charge of the systems. There is still no known exploit around left out in the open hitting servers or desktops anywhere. The question is not if it will ever happen. The question is when will it happen. And it may be sooner than later. This is why big companies, governments and people in charge of big deployments are patching or have already patched their systems. But have you done it to your system? I know you have a firewall. Have you thought about CVE-2018-3639? This particular one could make your browser being a vector to get into your system. So, no, there is no reason to skip this.
                                                                                                                                                                                            Patching these set of vulnerabilities implies some more steps and concerns than updating the operating system. If you are a regular Windows user I find rare you to be here and many of the things you will read may be foreign to you. I am not planning to do a guide on Windows systems since I believe someone else has or will do it and will do it better than me since I am not a pro Windows user. However there is one basic and common thing for all OS’s when dealing with Spectre and Meltdown and that is a microcode update is necessary for the OS patches to effectively work.
                                                                                                                                                                                            What is microcode? You can read the Wikipedia article but in short it is basically a layer of code that allows chip manufacturers to deal with modifications on the hardware they’ve produced and the operating systems that will manage that hardware. Since there’s been some issues (namely Spectre and Meltdown) Intel and AMD respectively have released a series of microcode updates to address those problems. First series did come with serious problems and some regressions, to the point GNU/Linux producers stopped releasing the microcode updates through their release channels for updates and placed the ball on Intel’s roof. Patching fast does always include risks, specially when dealing with hardware. OS vendors have resumed their microcode update releases so all seems to be fine now.
                                                                                                                                                                                            In order to update the microcode we’re faced with two options. Download the most recent BIOS release from our vendor, provided it patches the Spectre and Meltdown vulnerabilities, or patch it from the OS. If your hardware vendor has decided not to provide support on your hardware you are forced to use the latter solution. Yes, you can still keep your hardware. They usually come accompanied with a “release notes” file where there are some explanatory notes on what is fixed, what is new, etc. To make the search easy for you a news site collected the vendors list and linked the right support pages for anyone to look. In some scenarios it would be desirable not to replace the whole BIOS but just update the microcode from the OS side. In my case I should update an HP Proliant ML110 G7 box and the download link for that would be this.
                                                                                                                                                                                            Instead of using the full blown BIOS update path we’ll use the inner utilities to patch Spectre and Meltdown on FreeBSD. So let’s put our hands on it

                                                                                                                                                                                            • See the article for the technical breakdown
                                                                                                                                                                                            • ###A look beyond the BSD teacup: OmniOS installation

                                                                                                                                                                                              Five years ago I wrote a post about taking a look beyond the Linux teacup. I was an Arch Linux user back then and since there were projects like ArchBSD (called PacBSD today) and Arch Hurd, I decided to take a look at and write about them. Things have changed. Today I’m a happy FreeBSD user, but it’s time again to take a look beyond the teacup of operating systems that I’m familiar with.

                                                                                                                                                                                              • Why Illumos / OmniOS?
                                                                                                                                                                                              • There are a couple of reasons. The Solaris derivatives are the other big community in the *nix family besides Linux and the BSDs and we hadn’t met so far. Working with ZFS on FreeBSD, I now and then I read messages that contain a reference to Illumos which certainly helps to keep up the awareness. Of course there has also been a bit of curiosity – what might the OS be like that grew ZFS?

                                                                                                                                                                                                Also the Ravenports project that I participate in planned to support Solaris/Illumos right from the beginning. I wanted to at least be somewhat “prepared” when support for that platform would finally land. So I did a little research on the various derivatives available and settled on the one that I had heard a talk about at last year’s conference of the German Unix Users Group: “OmniOS – Solaris for the Rest of Us”. I would have chosen SmartOS as I admire what Bryan Cantrill does but for getting to know Illumos I prefer a traditional installation over a run-from-RAM system.
                                                                                                                                                                                                Of course FreeBSD is not run by corporations, especially when compared to the state of Linux. And when it comes to sponsoring, OpenBSD also takes the money… When it comes to FreeBSD developers, there’s probably some truth to the claim that some of them are using macOS as their desktop systems while OpenBSD devs are more likely to develop on their OS of choice. But then there’s the statement that “every innovation in the past decade comes from Solaris”. Bhyve alone proves this wrong. But let’s be honest: Two of the major technologies that make FreeBSD a great platform today – ZFS and DTrace – actually do come from Solaris. PAM originates there and a more modern way of managing services as well. Also you hear good things about their zones and a lot of small utilities in general.
                                                                                                                                                                                                In the end it was a lack of time that made me cheat and go down the easiest road: Create a Vagrantfile and just pull a VM image of the net that someone else had prepared… This worked to just make sure that the Raven packages work on OmniOS. I was determined to return, though – someday. You know how things go: “someday” is a pretty common alias for “probably never, actually.”
                                                                                                                                                                                                But then I heard about a forum post on the BSDNow! podcast. The title “Initial OmniOS impressions by a BSD user” caught my attention. I read that it was written by somebody who had used FreeBSD for years but loathed the new Code of Conduct enough to leave. I also oppose the Conduct and have made that pretty clear in my February post [ ! -z ${COC} ] && exit 1. As stated there, I have stayed with my favorite OS and continue to advocate it. I decided to stop reading the post and try things out on my own instead. Now I’ve finally found the time to do so.

                                                                                                                                                                                                • What’s next?
                                                                                                                                                                                                • That’s it for part one. In part two I’ll try to make the system useful. So far I have run into a problem that I haven’t been able to solve. But I have some time now to figure things out for the next post. Let’s see if I manage to get it working or if I have to report failure!

                                                                                                                                                                                                  ###What are all these types of memory in top(1)?

                                                                                                                                                                                                  • Earlier this week I convinced Mark Johnston, one of the FreeBSD VM experts to update a page on the FreeBSD wiki that I saw was being referenced on stackoverflow and similar sites
                                                                                                                                                                                                  • Mark updated the explanations to be more correct, and to include more technical detail for inquiring minds
                                                                                                                                                                                                  • He also added the new type that appeared in FreeBSD somewhat recently
                                                                                                                                                                                                  • Active - Contains memory “actively” (recently) being used by applications

                                                                                                                                                                                                    Inactive - Contains memory that has not been touched recently, or was released from the Buffer Cache
                                                                                                                                                                                                    Laundry - Contains memory that Inactive but still potentially contains useful data that needs to be stored before this memory can be used again
                                                                                                                                                                                                    Wired - Memory that cannot be swapped out, including the kernel, network stack, and the ZFS ARC
                                                                                                                                                                                                    Buf - Buffer Cache, used my UFS and most filesystems except ZFS (which uses the ARC)
                                                                                                                                                                                                    Free - Memory that is immediately available for use by the rest of the system

                                                                                                                                                                                                    ##News Roundup

                                                                                                                                                                                                    ###OpenBSD saves me again! — Debug a memory corruption issue

                                                                                                                                                                                                    Yesterday, I came across a third-part library issue, which crashes at allocating memory:

                                                                                                                                                                                                    Program terminated with signal SIGSEGV, Segmentation fault.

                                                                                                                                                                                                    #0 0x00007f594a5a9b6b in _int_malloc () from /usr/lib/libc.so.6
                                                                                                                                                                                                    (gdb) bt
                                                                                                                                                                                                    #0 0x00007f594a5a9b6b in _int_malloc () from /usr/lib/libc.so.6
                                                                                                                                                                                                    #1 0x00007f594a5ab503 in malloc () from /usr/lib/libc.so.6
                                                                                                                                                                                                    #2 0x00007f594b13f159 in operator new (sz=5767168) at /build/gcc/src/gcc/libstdc++-v3/libsupc++/new_op.cc:50

                                                                                                                                                                                                    It is obvious that the memory tags are corrupted, but who is the murder? Since the library involves a lot of maths computation, it is not an easy task to grasp the code quickly. So I need to find another way:

                                                                                                                                                                                                    (1) Open all warnings during compilation: -Wall. Nothing found.
                                                                                                                                                                                                    (2) Use valgrind, but unfortunately, valgrind crashes itself:

                                                                                                                                                                                                    valgrind: the 'impossible' happened:

                                                                                                                                                                                                    Killed by fatal signal

                                                                                                                                                                                                    host stacktrace:
                                                                                                                                                                                                    ==43326== at 0x58053139: get_bszB_as_is (m_mallocfree.c:303)
                                                                                                                                                                                                    ==43326== by 0x58053139: get_bszB (m_mallocfree.c:315)
                                                                                                                                                                                                    ==43326== by 0x58053139: vgPlain_arena_malloc (m_mallocfree.c:1799)
                                                                                                                                                                                                    ==43326== by 0x5800BA84: vgMemCheck_new_block (mc_malloc_wrappers.c:372)
                                                                                                                                                                                                    ==43326== by 0x5800BD39: vgMemCheck___builtin_vec_new (mc_malloc_wrappers.c:427)
                                                                                                                                                                                                    ==43326== by 0x5809F785: do_client_request (scheduler.c:1866)
                                                                                                                                                                                                    ==43326== by 0x5809F785: vgPlain_scheduler (scheduler.c:1433)
                                                                                                                                                                                                    ==43326== by 0x580AED50: thread_wrapper (syswrap-linux.c:103)
                                                                                                                                                                                                    ==43326== by 0x580AED50: run_a_thread_NORETURN (syswrap-linux.c:156)

                                                                                                                                                                                                    sched status:
                                                                                                                                                                                                    running_tid=1

                                                                                                                                                                                                    (3) Change compiler, use clang instead of gcc, and hope it can give me some clues. Still no effect.

                                                                                                                                                                                                    (4) Switch Operating System from Linux to OpenBSD, the program crashes again. But this time, it tells me where the memory corruption occurs:

                                                                                                                                                                                                    Program terminated with signal SIGSEGV, Segmentation fault.

                                                                                                                                                                                                    #0 0x000014b07f01e52d in addMod (r=, a=4693443247995522, b=28622907746665631,

                                                                                                                                                                                                    I figure out the issue quickly, and not bother to understand the whole code. OpenBSD saves me again, thanks!

                                                                                                                                                                                                    ###Native Encryption for ZFS on FreeBSD (Call for Testing)

                                                                                                                                                                                                    To anyone with an interest in native encryption in ZFS please test the projects/zfs-crypto-merge-0820 branch in my freebsd repo: https://github.com/mattmacy/networking.git

                                                                                                                                                                                                    git clone https://github.com/mattmacy/networking.git -b projects/zfs-crypto-merge-0820

                                                                                                                                                                                                    The UI is quite close to the Oracle Solaris ZFS crypto with minor differences for specifying key location.

                                                                                                                                                                                                    Please note that once a feature is enabled on a pool it can’t be disabled. This means that if you enable encryption support on a pool you will never be able to import it in to a ZFS without encryption support. For this reason I would strongly advise against using this on any pool that can’t be easily replaced until this change has made its way in to HEAD after the freeze has been lifted.
                                                                                                                                                                                                    By way of background the original ZoL commit can be found at:

                                                                                                                                                                                                    • https://github.com/zfsonlinux/zfs/pull/5769/commits/5aef9bedc801830264428c64cd2242d1b786fd49
                                                                                                                                                                                                    • ###VMworld 2018: Showcasing Hybrid Cloud, Persistent Memory and the Asigra TrueNAS Backup Appliance

                                                                                                                                                                                                      During its last year in Las Vegas before moving back to San Francisco, VMworld was abuzz with all the popular buzzwords, but the key focus was on supporting a more agile approach to hybrid cloud.

                                                                                                                                                                                                      Surveys of IT stakeholders and analysts agree that most businesses have multiple clouds spanning both public cloud providers and private data centers. While the exact numbers vary, well over half of businesses have a hybrid cloud strategy consisting of at least three different clouds.
                                                                                                                                                                                                      This focus on hybrid cloud provided the perfect timing for our announcement that iXsystems and Asigra are partnering to deliver the Asigra TrueNAS Backup Appliance, which combines Asigra Cloud Backup software backed by TrueNAS storage. Asigra TrueNAS Backup Appliances provide a self-healing and ransomware-resistent OpenZFS backup repository in your private cloud. The appliance can simultaneously be used as general-purpose file, block, and object storage. How does this tie in with the hybrid cloud? The Asigra Cloud Backup software can backup data from public cloud repositories – G Suite, Office 365, Salesforce, etc. – as well as intelligently move backed-up data to the public cloud for long-term retention.
                                                                                                                                                                                                      Another major theme at the technical sessions was persistent memory, as vSphere 6.7 added support for persistent memory – either as a storage tier or virtualized and presented to a guest OS. As detailed in our blog post from SNIA’s Persistent Memory Summit 2018, persistent memory is rapidly becoming mainstream. Persistent memory bridges the gap between memory and flash storage – providing near-memory latency storage that persists across reboots or power loss. vSphere allows both legacy and persistent memory-aware applications to leverage this ultra-fast storage tier. We were excited to show off our newly-introduced TrueNAS M-Series at VMworld, as all TrueNAS M40 and M50 models leverage NVDIMM persistent memory technology to provide a super-fast write cache, or SLOG, without any of the limitations of Flash technology.
                                                                                                                                                                                                      The iXsystems booth’s theme was “Enterprise Storage, Open Source Economics”. iXsystems leverages the power of Open Source software, combined with our enterprise-class hardware and support, to provide incredibly low TCO storage for virtualization environments. Our TrueNAS unified storage and server offerings are an ideal solution for your organization’s private cloud infrastructure. Combined with VMware NSX Hybrid Connect – formerly known as VMware Hybrid Cloud Extension – you can seamlessly shift running systems into a public cloud environment for a true hybrid cloud solution.
                                                                                                                                                                                                      Another special treat at this year’s booth was iXsystems Vice President of Engineering Kris Moore giving demos of an early version of “Project TrueView”, a single-pane of glass management solution for administration of multiple FreeNAS and TrueNAS systems. In addition to simplified administration and enhanced monitoring, Project TrueView will also provide Role-Based Access Control for finer-grained permissions management. A beta version of Project TrueView is expected to be available at the end of this year.
                                                                                                                                                                                                      Overall, we had a great week at VMworld 2018 with lots of good conversations with customers, press, analysts, and future customers about TrueNAS, the Asigra TrueNAS Backup Appliance, iXsystems servers, Project TrueView, and more – our booth was more popular than ever!

                                                                                                                                                                                                      ###End of life for NetBSD 6.x

                                                                                                                                                                                                      In keeping with NetBSD’s policy of supporting only the latest (8.x) and next most recent (7.x) major branches, the recent release of NetBSD 8.0 marks the end of life for NetBSD 6.x. As in the past, a month of overlapping support has been provided in order to ease the migration to newer releases.

                                                                                                                                                                                                      • As of now, the following branches are no longer maintained:

                                                                                                                                                                                                      • netbsd-6-1

                                                                                                                                                                                                      • netbsd-6-0

                                                                                                                                                                                                      • netbsd-6

                                                                                                                                                                                                      • This means:

                                                                                                                                                                                                      • There will be no more pullups to those branches (even for security issues)

                                                                                                                                                                                                      • There will be no security advisories made for any those branches

                                                                                                                                                                                                      • The existing 6.x releases on ftp.NetBSD.org will be moved into /pub/NetBSD-archive/

                                                                                                                                                                                                      • May NetBSD 8.0 serve you well! (And if it doesn’t, please submit a PR!)

                                                                                                                                                                                                        ##Beastie Bits

                                                                                                                                                                                                        • Blast from the past: OpenBSD 3.7 CD artwork
                                                                                                                                                                                                        • People are asking about scale of BSD projects. Let’s figure it out…
                                                                                                                                                                                                        • Tuesday, 21 August 18: me, on ed(1), at SemiBUG
                                                                                                                                                                                                        • arm64 gains RETGUARD
                                                                                                                                                                                                        • Call for participation
                                                                                                                                                                                                        • FreeBSD-UPB/bhyvearm64-utils
                                                                                                                                                                                                        • ##Feedback/Questions

                                                                                                                                                                                                          • Eric - FreeNAS for Vacation
                                                                                                                                                                                                          • Patrick - Long Live Unix
                                                                                                                                                                                                          • Jason - Jason - Full MP3 Recordings
                                                                                                                                                                                                          • Bostjan - Question about jails and kernel
                                                                                                                                                                                                            • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                                                                                            • 1 hr 4 min
                                                                                                                                                                                                            • Episode 262: OpenBSD Surfacing | BSD Now 262

                                                                                                                                                                                                              OpenBSD on Microsoft Surface Go, FreeBSD Foundation August Update, What’s taking so long with Project Trident, pkgsrc config file versioning, and MacOS remnants in ZFS code.

                                                                                                                                                                                                              ##Headlines

                                                                                                                                                                                                              ###OpenBSD on the Microsoft Surface Go

                                                                                                                                                                                                              For some reason I like small laptops and the constraints they place on me (as long as they’re still usable). I used a Dell Mini 9 for a long time back in the netbook days and was recently using an 11" MacBook Air as my primary development machine for many years. Recently Microsoft announced a smaller, cheaper version of its Surface tablets called Surface Go which piqued my interest.

                                                                                                                                                                                                              • Hardware
                                                                                                                                                                                                              • The Surface Go is available in two hardware configurations: one with 4Gb of RAM and a 64Gb eMMC, and another with 8Gb of RAM with a 128Gb NVMe SSD. (I went with the latter.) Both ship with an Intel Pentium Gold 4415Y processor which is not very fast, but it’s certainly usable.

                                                                                                                                                                                                                The tablet measures 9.65" across, 6.9" tall, and 0.3" thick. Its 10" diagonal 3:2 touchscreen is covered with Gorilla Glass and has a resolution of 1800x1200. The bezel is quite large, especially for such a small screen, but it makes sense on a device that is meant to be held, to avoid accidental screen touches.
                                                                                                                                                                                                                The keyboard and touchpad are located on a separate, removable slab called the Surface Go Signature Type Cover which is sold separately. I opted for the “cobalt blue” cover which has a soft, cloth-like alcantara material. The cover attaches magnetically along the bottom edge of the device and presents USB-attached keyboard and touchpad devices. When the cover is folded up against the screen, it sends an ACPI sleep signal and is held to the screen magnetically. During normal use, the cover can be positioned flat on a surface or slightly raised up about 3/4" near the screen for better ergonomics. When using the device as a tablet, the cover can be rotated behind the screen which causes it to automatically stop sending keyboard and touchpad events until it is rotated back around.
                                                                                                                                                                                                                The keyboard has a decent amount of key travel and a good layout, with Home/End/Page Up/Page Down being accessible via Fn+Left/Right/Up/Down but also dedicated Home/End/Page Up/Page Down keys on the F9-F12 keys which I find quite useful since the keyboard layout is somewhat small. By default, the F1-F12 keys do not send F1-F12 key codes and Fn must be used, either held down temporarily or Fn pressed by itself to enable Fn-lock which annoyingly keeps the bright Fn LED illuminated. The keys are backlit with three levels of adjustment, handled by the keyboard itself with the F7 key.
                                                                                                                                                                                                                The touchpad on the Type Cover is a Windows Precision Touchpad connected via USB HID. It has a decent click feel but when the cover is angled up instead of flat on a surface, it sounds a bit hollow and cheap.

                                                                                                                                                                                                                • Surface Go Pen
                                                                                                                                                                                                                • The touchscreen is powered by an Elantech chip connected via HID-over-i2c, which also supports pen input. A Surface Pen digitizer is available separately from Microsoft and comes in the same colors as the Type Covers. The pen works without any pairing necessary, though the top button on it works over Bluetooth so it requires pairing to use. Either way, the pen requires an AAAA battery inside it to operate. The Surface Pen can attach magnetically to the left side of the screen when not in use.

                                                                                                                                                                                                                  A kickstand can swing out behind the display to use the tablet in a laptop form factor, which can adjust to any angle up to about 170 degrees. The kickstand stays firmly in place wherever it is positioned, which also means it requires a bit of force to pull it out when initially placing the Surface Go on a desk.
                                                                                                                                                                                                                  Along the top of the display are a power button and physical volume rocker buttons. Along the right side are the 3.5mm headphone jack, USB-C port, power port, and microSD card slot located behind the kickstand.
                                                                                                                                                                                                                  Charging can be done via USB-C or the dedicated charge port, which accommodates a magnetically-attached, thin barrel similar to Apple’s first generation MagSafe adapter. The charging cable has a white LED that glows when connected, which is kind of annoying since it’s near the mid-line of the screen rather than down by the keyboard. Unlike Apple’s MagSafe, the indicator light does not indicate whether the battery is charged or not. The barrel charger plug can be placed up or down, but in either direction I find it puts an awkward strain on the power cable coming out of it due to the vertical position of the port.
                                                                                                                                                                                                                  Wireless connectivity is provided by a Qualcomm Atheros QCA6174 802.11ac chip which also provides Bluetooth connectivity.
                                                                                                                                                                                                                  Most of the sensors on the device such as the gyroscope and ambient light sensor are connected behind an Intel Sensor Hub PCI device, which provides some power savings as the host CPU doesn’t have to poll the sensors all the time.

                                                                                                                                                                                                                  • Firmware
                                                                                                                                                                                                                  • The Surface Go’s BIOS/firmware menu can be entered by holding down the Volume Up button, then pressing and releasing the Power button, and releasing Volume Up when the menu appears. Secure Boot as well as various hardware components can be disabled in this menu. Boot order can also be adjusted. A temporary boot menu can be brought up the same way but using Volume Down instead.

                                                                                                                                                                                                                    ###FreeBSD Foundation Update, August 2018

                                                                                                                                                                                                                    • MESSAGE FROM THE EXECUTIVE DIRECTOR
                                                                                                                                                                                                                    • Dear FreeBSD Community Member,

                                                                                                                                                                                                                      It’s been a busy summer for the Foundation. From traveling around the globe spreading the word about FreeBSD to bringing on new team members to improve the Project’s Continuous Integration work, we’re very excited about what we’ve accomplished. Take a minute to check out the latest updates within our Foundation sponsored projects; read more about our advocacy efforts in Bangladesh and community building in Cambridge; don’t miss upcoming Travel Grant deadlines, and new Developer Summits; and be sure to find out how your support will ensure our progress continues into 2019.
                                                                                                                                                                                                                      We can’t do this without you! Happy reading!! Deb

                                                                                                                                                                                                                      • August 2018 Development Projects Update
                                                                                                                                                                                                                      • Fundraising Update: Supporting the Project
                                                                                                                                                                                                                      • August 2018 Release Engineering Update
                                                                                                                                                                                                                      • BSDCam 2018 Recap
                                                                                                                                                                                                                      • October 2018 FreeBSD Developer Summit Call for Participation
                                                                                                                                                                                                                      • SANOG32 and COSCUP 2018 Recap
                                                                                                                                                                                                                      • MeetBSD 2018 Travel Grant Application Deadline: September 7
                                                                                                                                                                                                                      • ##News Roundup

                                                                                                                                                                                                                        ###Project Trident: What’s taking so long?

                                                                                                                                                                                                                        • What is taking so long?
                                                                                                                                                                                                                        • The short answer is that it’s complicated.

                                                                                                                                                                                                                          Project Trident is quite literally a test of the new TrueOS build system. As expected, there have been quite a few bugs, undocumented features, and other optional bits that we discovered we needed that were not initially present. All of these things have to be addressed and retested in a constant back and forth process.
                                                                                                                                                                                                                          While Ken and JT are both experienced developers, neither has done this kind of release engineering before. JT has done some release engineering back in his Linux days, but the TrueOS and FreeBSD build system is very different. Both Ken and JT are learning a completely new way of building a FreeBSD/TrueOS distribution. Please keep in mind that no one has used this new TrueOS build system before, so Ken and JT want to not only provide a good Trident release, but also provide a model or template for other potential TrueOS distributions too!

                                                                                                                                                                                                                          • Where are we now?
                                                                                                                                                                                                                          • Through perseverance, trial and error, and a lot of head-scratching we have reached the point of having successful builds. It took a while to get there, but now we are simply working out a few bugs with the new installer that Ken wrote as well as finding and fixing all the new Xorg configuration options which recently landed in FreeBSD. We also found that a number of services have been removed or replaced between TrueOS 18.03 and 18.06 so we are needing to adjust what we consider the “base” services for the desktop. All of these issues are being resolved and we are continually rebuilding and pulling in new patches from TrueOS as soon as they are committed.

                                                                                                                                                                                                                            In the meantime we have made an early BETA release of Trident available to the users in our Telegram Channel for those who want to help out in testing these early versions.

                                                                                                                                                                                                                            • Do you foresee any other delays?
                                                                                                                                                                                                                            • At the moment we are doing many iterations of testing and tweaking the install ISO and package configurations in order to ensure that all the critical functionality works out-of-box (networking, sound, video, basic apps, etc). While we do not foresee any other major delays, sometimes things happen that our outside of our control. For an example, one of the recent delays that hit recently was completely unexpected: we had a hard drive failure on our build server. Up until recently, The aptly named “Poseidon” build server was running a Micron m500dc drive, but that drive is now constantly reporting errors. Despite ordering a replacement Western Digital Blue SSD several weeks ago, we just received it this past week. The drive is now installed with the builder back to full functionality, but we did lose many precious days with the delay.

                                                                                                                                                                                                                              The build server for Project Trident is very similar to the one that JT donated to the TrueOS project. JT had another DL580 G7, so he donated one to the Trident Project for their build server. Poseidon also has 256GB RAM (64 x 4GB sticks) which is a smidge higher than what the TrueOS builder has.
                                                                                                                                                                                                                              Since we are talking about hardware, we probably should address another question we get often, “What Hardware are the devs testing on?” So let’s go ahead and answer that one now.

                                                                                                                                                                                                                              • Developer Hardware

                                                                                                                                                                                                                              • JT: His main test box is a custom-built Intel i7 7700K system running 32GB RAM, dual Intel Optane 900P drives, and an Nvidia 1070 GTX with four 4K Acer Monitors. He also uses a Lenovo x250 ThinkPad alongside a desk full of x230t and x220 ThinkPads. One of which he gave away at SouthEast LinuxFest this year, which you can read about here. However it’s not done there, being a complete hardware hoarder, JT also tests on several Intel NUCs and his second laptop a Fujitsu t904, not to mention a Plethora of HP DL580 servers, a DL980 server, and a stack of BL485c, BL460c, and BL490c Blades in his HP c7000 and c3000 Bladecenter chassis. (Maybe it’s time for an intervention for his hardware collecting habits)

                                                                                                                                                                                                                              • Ken: For a laptop, he primarily uses a 3rd generation X1 Carbon, but also has an old Eee PC T101MT Netbook (dual core 1GHz, 2GB of memory) which he uses for verifying how well Trident works on low-end hardware. As far as workstations go, his office computer is an Intel i7 with an NVIDIA Geforce GTX 960 running three 4K monitors and he has a couple other custom-built workstations (1 AMD, 1 Intel+NVIDIA) at his home. Generally he assembled random workstations based on hardware that was given to him or that he could acquire cheap.

                                                                                                                                                                                                                              • Tim: is using a third gen X1 Carbon and a custom built desktop with an Intel Core i5-4440 CPU, 16 GiB RAM, Nvidia GeForce GTX 750 Ti, and a RealTek 8168 / 8111 network card.

                                                                                                                                                                                                                              • Rod: Rod uses… No one knows what Rod uses, It’s kinda like how many licks does it take to get to the center of a Tootsie-Roll Tootsie-Pop… the world may just never know.

                                                                                                                                                                                                                                ###NetBSD GSoC: pkgsrc config file versioning

                                                                                                                                                                                                                                • A series of reports from the course of the summer on this Google Summer of Code project
                                                                                                                                                                                                                                • The goal of the project is to integrate with a VCS (Version Control System) to make managing local changes to config files for packages easier
                                                                                                                                                                                                                                • GSoC 2018 Reports: Configuration files versioning in pkgsrc, Part 1
                                                                                                                                                                                                                                • Packages may install code (both machine executable code and interpreted programs), documentation and manual pages, source headers, shared libraries and other resources such as graphic elements, sounds, fonts, document templates, translations and configuration files, or a combination of them.

                                                                                                                                                                                                                                  Configuration files are usually the means through which the behaviour of software without a user interface is specified. This covers parts of the operating systems, network daemons and programs in general that don’t come with an interactive graphical or textual interface as the principal mean for setting options.
                                                                                                                                                                                                                                  System wide configuration for operating system software tends to be kept under /etc, while configuration for software installed via pkgsrc ends up under LOCALBASE/etc (e.g., /usr/pkg/etc).
                                                                                                                                                                                                                                  Software packaged as part of pkgsrc provides example configuration files, if any, which usually get extracted to LOCALBASE/share/examples/PKGBASE/.
                                                                                                                                                                                                                                  Don’t worry: automatic merging is disabled by default, set $VCSAUTOMERGE to enable it.
                                                                                                                                                                                                                                  In order to avoid breakage, installed configuration is backed up first in the VCS, separating user-modified files from files that have been already automatically merged in the past, in order to allow the administrator to easily restore the last manually edited file in case of breakage.
                                                                                                                                                                                                                                  VCS functionality only applies to configuration files, not to rc.d scripts, and only if the environment variable $NOVCS is unset.
                                                                                                                                                                                                                                  The version control system to be used as a backend can be set through $VCS. It default to RCS, the Revision Control System, which works only locally and doesn’t support atomic transactions.
                                                                                                                                                                                                                                  Other backends such as CVS are supported and more will come; these, being used at the explicit request of the administrator, need to be already installed and placed in a directory part of $PATH.

                                                                                                                                                                                                                                  • GSoC 2018 Reports: Configuration files versioning in pkgsrc, part 2: remote repositories (git and CVS)
                                                                                                                                                                                                                                  • pkgsrc is now able to deploy configuration from packages being installed from a remote, site-specific vcs repository.

                                                                                                                                                                                                                                    User modified files are always tracked even if automerge functionality is not enabled, and a new tool, pkgconftrack(1), exists to manually store user changes made outside of package upgrade time.
                                                                                                                                                                                                                                    Version Control software is executed as the same user running pkg_add or make install, unless the user is “root”. In this case, a separate, unprivileged user, pkgvcsconf, gets created with its own home directory and a working login shell (but no password). The home directory is not strictly necessary, it exists to facilitate migrations betweens repositories and vcs changes; it also serves to store keys used to access remote repositories.
                                                                                                                                                                                                                                    Using git instead of rcs is simply done by setting VCS=git in pkg_install.conf

                                                                                                                                                                                                                                    • GSoC 2018 Reports: Configuration files versioning in pkgsrc, part 3: remote repositories (SVN and Mercurial)
                                                                                                                                                                                                                                    • GSoC 2018 Reports: Configuration files versioning in pkgsrc, part 4: configuration deployment, pkgtools and future improvements
                                                                                                                                                                                                                                    • Support for configuration tracking is in scripts, pkginstall scripts, that get built into binary packages and are run by pkg_add upon installation. The idea behind the proposal suggested that users of the new feature should be able to store revisions of their installed configuration files, and of package-provided default, both in local or remote repositories. With this capability in place, it doesn’t take much to make the scripts “pull” configuration from a VCS repository at installation time.

                                                                                                                                                                                                                                      That’s what setting VCSCONFPULL=yes in pkg_install.conf after having enabled VCSTRACK_CONF does: You are free to use official, third party prebuilt packages that have no customization in them, enable these options, and point pkgsrc to a private conf repository. If it contains custom configuration for the software you are installing, an attempt will be made to use it and install it on your system. If it fails, pkginstall will fall back to using the defaults that come inside the package. RC scripts are always deployed from the binary package, if existing and PKG_RCD_SCRIPTS=yes in pkg_install.conf or the environment.
                                                                                                                                                                                                                                      This will be part of packages, not a separate solution like configuration management tools. It doesn’t support running scripts on the target system to customize the installation, it doesn’t come with its domain-specific language, it won’t run as a daemon or require remote logins to work. It’s quite limited in scope, but you can define a ROLE for your system in pkg_install.conf or in the environment, and pkgsrc will look for configuration you or your organization crafted for such a role (e.g., public, standalone webserver vs reverse proxy or node in a database cluster)

                                                                                                                                                                                                                                      ###A little bit of the one-time MacOS version still lingers in ZFS

                                                                                                                                                                                                                                      Once upon a time, Apple came very close to releasing ZFS as part of MacOS. Apple did this work in its own copy of the ZFS source base (as far as I know), but the people in Sun knew about it and it turns out that even today there is one little lingering sign of this hoped-for and perhaps prepared-for ZFS port in the ZFS source code. Well, sort of, because it’s not quite in code.

                                                                                                                                                                                                                                      Lurking in the function that reads ZFS directories to turn (ZFS) directory entries into the filesystem independent format that the kernel wants is the following comment:

                                                                                                                                                                                                                                      objnum = ZFS_DIRENT_OBJ(zap.za_first_integer);

                                                                                                                                                                                                                                      /*
                                                                                                                                                                                                                                      * MacOS X can extract the object type here such as:
                                                                                                                                                                                                                                      * uint8_t type = ZFS_DIRENT_TYPE(zap.za_first_integer);
                                                                                                                                                                                                                                      */

                                                                                                                                                                                                                                      • Specifically, this is in zfs_readdir in zfs_vnops.c .
                                                                                                                                                                                                                                      • ZFS maintains file type information in directories. This information can’t be used on Solaris (and thus Illumos), where the overall kernel doesn’t have this in its filesystem independent directory entry format, but it could have been on MacOS (‘Darwin’), because MacOS is among the Unixes that support d_type. The comment itself dates all the way back to this 2007 commit, which includes the change ‘reserve bits in directory entry for file type’, which created the whole setup for this.

                                                                                                                                                                                                                                        I don’t know if this file type support was added specifically to help out Apple’s MacOS X port of ZFS, but it’s certainly possible, and in 2007 it seems likely that this port was at least on the minds of ZFS developers. It’s interesting but understandable that FreeBSD didn’t seem to have influenced them in the same way, at least as far as comments in the source code go; this file type support is equally useful for FreeBSD, and the FreeBSD ZFS port dates to 2007 too (per this announcement).
                                                                                                                                                                                                                                        Regardless of the exact reason that ZFS picked up maintaining file type information in directory entries, it’s quite useful for people on both FreeBSD and Linux that it does so. File type information is useful for any number of things and ZFS filesystems can (and do) provide this information on those Unixes, which helps make ZFS feel like a truly first class filesystem, one that supports all of the expected general system features.

                                                                                                                                                                                                                                        ##Beastie Bits

                                                                                                                                                                                                                                        • Mac-like FreeBSD Laptop
                                                                                                                                                                                                                                        • Syncthing on FreeBSD
                                                                                                                                                                                                                                        • New ZFS Boot Environments Tool
                                                                                                                                                                                                                                        • My system’s time was so wrong, that even ntpd didn’t work
                                                                                                                                                                                                                                        • OpenSSH 7.8/7.8p1 (2018-08-24)
                                                                                                                                                                                                                                        • EuroBSD (Sept 20-23rd) registration Early Bird Period is coming to an end
                                                                                                                                                                                                                                        • MeetBSD (Oct 18-20th) is coming up fast, hurry up and register!
                                                                                                                                                                                                                                        • AsiaBSDcon 2019 Dates
                                                                                                                                                                                                                                        • ##Feedback/Questions

                                                                                                                                                                                                                                          • Will - Kudos and a Question
                                                                                                                                                                                                                                          • Peter - Fanless Computers
                                                                                                                                                                                                                                          • Ron - ZFS disk clone or replace or something
                                                                                                                                                                                                                                          • Bostjan - ZFS Record Size
                                                                                                                                                                                                                                            • Send questions, comments, show ideas/topics, or stories you want mentioned on the show to [email protected]
                                                                                                                                                                                                                                            • 1 hr 14 min