Switched from Ubuntu-based to Fedora


tl;dr: Fedora’s debugging packages work, Ubuntu’s are out of date.

Linux = Linux = Linux, whether Arch or Slackware or Ubuntu or OpenSUSE or Linux from scratch as I once did (before there were instructions!). Unless and until the kernel forks and someone decides to modify the syscall table, they all use the same basic syscalls, they typically share the same basic libraries and core utilities, etc. They’re all the same.

Why did I use Ubuntu-based distributions? (Note: Not Debian) Because Ubuntu came pre-configured with all the things I did not care to learn or manually configure: ACPI, firmware, X11, a pretty WM theme, etc. I did not particularly care whether I was running Mint, Elementary, Ubuntu MATE or basic Ubuntu (except Unity…nah). As long as it did not do strange things like remove /sbin/ifconfig or have a radically different file structure than I was used to. I felt at home with knowing where the standard file paths were, and knew how to administer my machine. Their package repository was pretty solid. It had almost everything I wanted – and what little was not on it was typically available in Debian-package format. The broader Linux community effectively standardized on this package format. This is crucial. Debian’s apt and FreeBSD’s pkg are in my muscle-memory at this point.

Literally one thing pushed me over: Ubuntu’s SystemTap was broken. Utterly broken!

I got into OS-level programming, specifically, porting a Linux WiFi driver to FreeBSD. I wanted to use SystemTap, Linux’s answer to DTrace, to help understand what is going on during live execution. But SystemTap does not work on Ubuntu – at least currently.

But wait, I thought Linux = Linux = Linux and programs from 20 years ago will still work. Why does SystemTap fail?

SystemTap works by producing C code for a kernel module, compiling it and loading it into memory. Sometime ago, the kernel team changed the get_user_pages() kernel API call. This meant that any code compiled against the old function definition failed. I encountered this in the professional space when the VMWare kernel modules failed to build and I hacked it until it worked. (They think I’m a wizard now). I was on Kernel 4.10 but the version of systemtap Ubuntu used was nearly 2 years old. This meant no one from the Ubuntu team was using it.

I submitted a bug report and installed Fedora 26.

SystemTap was developed by Red Hat and was trivial to get working under Fedora. And while not every single package is available (Bitcoin, Steam thus far), there is enough that moving over was trivial. Also, they come in Cinnamon, which I prefer, with a pretty theme. And it provides a clean terminal out-of-the-box. Which I need. (I would rather use stock XFCE if their terminal was clean than fully-loaded CentOS with an ugly terminal)

dnf took a little getting used to, but a hop-over from apt. So whatever on that front….

I would be willing to try OpenSUSE again, but the latest time I did, they got rid of /sbin/ifconfig for /sbin/ip, which is unacceptable. Silly, perhaps…Does it come in Cinammon? What does it offer? Are the packages as clean and up to date? I may never know, unless another business-need arises. I do not care to run any of these “hardware” distributions, like Arch. I paid my Linux dues around kernel 2.2 on Slackware and its time to move on from that.

Thoughts?

But look, if you’re 99% of the Linux world, any specific distribution is trivial. Pick one and go with it. Unless you’re doing very specific tasks like me, it really does not matter what you use. So stop Distro Hoping!

Advertisements

FreeBSD and Linux Remote Dual Booting


The following is a quick and dirty guide on how to setup remote dual booting for FreeBSD (12.0-CURRENT) and Linux (Ubuntu 16.04). Granted, this method is slightly a hack, but it works and suits my needs.

Why remote dual-booting? I am currently developing a FreeBSD kernel module for a PCIe card. The device is supported on Linux and I am using the Linux implementation as documentation. As such, I find myself frequently rebooting into Linux to look printk() outputs, or booting into FreeBSD to test kernel code. This device is located at my house, and I typically work on it during my downtime at work.

Why not use Grub? I would have preferred Grub! But for whatever reason, Grub failed to install on FreeBSD. I do not know why, but even a very minimalistic attempt gave a non-descriptive error message.

efibootmgr? Any change I made with efibootmgr failed to survive a reboot. This is apparently a known problem. Also, this tool only exists on Linux, as FreeBSD does not seem to have an efibootmgr equivalent.

Ugh, so what do I do???

The solution I came up with was to manually swap EFI files on the EFI partition no an as-needed basis.

First, I went into the BIOS and disabled legacy BIOS booting, enabled EFI booting, and disabled secure booting.

Then, I installed Ubuntu. I had to manually create the partition tables, since by default the installer would consume the entire disk. However, this does not automatically create the EFI partition. So, you must manually create one. I set mine to 200MBs as the first partition. After installation, I booted up, mounted the /dev/sda1. I found that ubuntu had created /EFI/ubuntu/grubx64.efi and other related files. Great!

Next, I installed FreeBSD and while manually setting up the partition tables, FreeBSD auto-created an EFI partition. One already exists, so I safely deleted it, and proceeded with the rest of the install. Right before rebooting, I mounted /dev/ada0p1 (sda1 on Linux) as /boot.local/ and /dev/da0p1 as /boot.installer/. I then copied /boot.installer/EFI/BOOT/BOOTX64.EFI too /boot.local/EFI/BOOT/EFIBOOT/BOOTX64.EFI (I think I had to re-create EFI/BOOT, I’m forgetting off-hand). Then I rebooted.

When I rebooted the machine, Ubuntu still came up. This is because Ubuntu edits the EFI boot order and places ubuntu as the first partition. Ordinarily you should be able to use efibootmgr here to boot into FreeBSD and use the non-existent FreeBSD equivalent to boot back, but with the lack of that option, I mounted the EFI partition (/dev/sda1) as /boot/efi, and when I wanted boot into FreeBSD, I renamed /boot/efi/EFI/ubuntu/grubx64.efi to ubuntu.efi and then copied /boot/efi/EFI/BOOT/BOOTX64.EFI to /boot/efi/EFI/ubuntu/grubx64.efi. When I rebooted, FreeBSD came back up! Then on the FreeBSD side, I mounted /dev/sda1 to /boot/efi and did copied /boot/efi/EFI/ubuntu/ubuntu.efi to /boot/efi/EFI/ubuntu/grubx64.efi.

And that’s it! I can now remotely boot back and forth between the two systems.

Ugly? Yes. But it does the job.

Linux could fix this problem by debugging their efibootmgr utility and FreeBSD could fix this by having an efibootmgr equivalent at all.

Thoughts?

Differences between Mint and Ubuntu


 

I looked into the differences between Mint and Ubuntu to see which was best for me. I watched tons of videos, reviews, comparisons, ran them both for months, etc. Here’s what I learned…

They’re the same damn thing. No really, they are identical. The only differences are what software comes pre-installed and some user interface prettiness. Otherwise, no difference in the  underlying system at all. Literally no difference.

Next question?

BSD? No thanks, I’ll stick with Linux


Warning, this is an unstructured Rant.

I’m going to be setting up FreeNAS to manage my home’s personal NAS server. I spent a bit of time looking up the hardware and learning how FreeNAS works. I also really like that its a FreeBSD system at the back-end, so that I can always configure it exactly how I want. This resparked an interest in me to look into the BSD variants to see if they would be better for me.

TL;DR – No, I’m sticking with Linux.

People talk about BSD being “more mature”. But I have yet to get a solid understanding of what this means to the end-user, where Linux seems pretty damn mature to me. I haven’t had Linux crash on me since some bug in kernel 2.6.

Or is the code more reviewed? The Linux kernel is heavily, heavily reviewed.

Or is BSD an OS whereas Linux is a Kernel? Okay, I use Debian distributions, not just a raw Linux kernel. And besides, there are basically 4 main distributions that are largely differ on trivial matters behind the scenes. But you have like 5 main variants of BSD – OpenBSD, FreeBSD, NetBSD, DragonflyBSD and now MacOS X. These OS’s have, in some cases 20 years of variations between them, whereas at least all Linux’s share a common kernel.

And another thing – why do people treat BSD as some common platform, as if they’re all the same? Do the 20+ years of divergence mean nothing?

NetBSD likes to brag about being able to run on a toaster. Great. But in the year 2015, I don’t need to run on a computer from 1986. I don’t plan on running a Unix/Linux system on a Playstation.

Okay, so OpenBSD has security built-in. Are you talking the security in packages or the security of the OS? If you mean the security of the packages, this can be trivially done on Linux. If you mean the security of the OS, you’re talking about memory protection and related features that can, and are, very easily ported over to Linux.

Or is it that BSD systems are for servers? I currently work for a company that measures its internet presence of IP space in the percentages, and we use Redhat or CentOS – and legacy AIX and other random systems.

okay okay, maybe BSD is great for niche devices. But I don’t see its benefit anywhere over Linux anywhere else. I would have picked the FreeNAS equivalent for Linux if I could — well no I prob wouldn’t, I’d wanna see what BSD can do.

oh, and if you’re going to give me a very technical response to why BSD is better, allow me to preempt your response:

  • If your responses are related to something buried well behind the scenes of the system that are trivial to the end-user, you lose.
  • If your responses are blaming the user of the system for not being responsible by running the hardware or software you choose and running the system as you wish, you lose.
  • If your responses are about how BSD invented stuff that Linux stole, I’ll say you lose because you aren’t using the OS that invented the mouse.

End-rant. Okay, I’m gonna install PC-BSD on my spare beat-up computer.

Syncing my Bluetooth headset on Kubuntu


I had a bit of trouble getting my Linux (Kubuntu) to function as a bluetooth headset for my computer and I wanted to write this guide for anyone else having trouble.

First, I’m running Ubuntu 14.04.1 LTS

Second, get your device to pair. I used Blueman, an applet that came with Kubuntu.

snapshot1Getting it to pair was annoying enough, but once I got that working, I clicked Setup, then paired it as a Headset. I then edited the file /etc/bluetooth/audio.conf and changed the following:

HFP=false

It was True. I then Uncommented

#[A2DP]
SBCSources=1
MPEG12Sources=0

Then, I rebooted pulseaudio by doing a simple:

sudo killall -9 pulseaudio

and then restarted pulseaudio as root. Per the folks on Freenode’s #Linux I could have also started a program that uses pulseaudio, but this worked. Afterwards, audio was playing on both my computer’s regular speakers and the headset.

Only downside: When I play a game like Counter-strike, there is a very slight delay between the action and the audio. I have no idea what the cause of that is.