3

It’s been about six months since I first installed Fedora on my GPD Pocket. I’ve updated my original July 2017 post twice since then to keep you all updated. So much has changed since those early days that a new post is in order. The old post still has a lot of useful information, so I will be referring to it often, but a lot of it is outdated. Here’s what’s new:

The Biggest Problem First

I’ve had only one catastrophe, which occurred about a month ago. I did have to re-install the Fedora system due to a sudo dnf autoremove command removing some important grub2 packages. The result of removing these packages was that the bootloader would fail to boot and instead demand a “MOK” or Machine Owner Key, which I did not have, and did not know how to create. I was able to chroot into the hard drive from the Fedora 25 USB installation medium and recover all of my data. Nothing was lost. Reinstalling the removed grub2 packages from the chroot environment might have fixed the problem, but at the time I did not have the knowledge to test this hypothesis.

During the reinstallation process, I done went and deleted the Windows EFI boot partition, wrongly believing it was the Linux boot partition. This left me unable to boot into Windows. Now, GPD did make the Windows image available through an update on the Pocket’s Indiegogo page. I probably could have restored Windows from that. I opted instead to wipe the windows partition altogether and go full Fedora reinstallation. I was running up against HDD space limitations while running the Pocket as a dual boot machine. Adding that 30 Gig to my Linux installation has given me some much needed breathing space. If you are running a dual-boot system and find you need to re-install Linux while keeping your system dual-boot, be very mindful of your EFI partitions. I recommend not deleting them.

The grub2 packages that you need to preserve in order to avoid this mayhem are as follows:

Screenshot from 2017-12-05 06-33-30

I’m not sure which one of these packages actually causes the problem when it’s removed, but preserving all of them definitely prevents the problem—and some are dependent on others, so you will find yourself preserving several of them anyway. If you attempt a sudo dnf autoremove and you see these packages in the list, be sure to reinstall them before you shut your computer down. If you accidentally remove these packages and reboot to that “MOK” request, you might try chrooting into your hard drive from the Fedora installation USB and reinstalling the packages. (Unless you’ve got some fancier tricks up your sleeve, this will require a USB hub to accommodate both the Fedora USB installation drive and a USB wired interned connection in the Pocket’s single functioning USB slot.) After manually reinstalling these packages, they should not be marked for autoremoval anymore, so the sudo dnf autoremove command should be safe thenceforth.

Installing from the Fedora USB Installation Medium

When I had to reinstall Fedora in December of 2018, the current version of Fedora was, and still is as of this writing, Version 27. I tried first to use a Fedora 27 installation USB, but I had a Dickens of a time rotating the screen for some reason. There must have been a change to the GNOME interface for this setting that makes rotating the screen harder. I gave up and went back to the Fedora 25 installation USB to reinstall. The .iso is still available here. You may follow the instructions on my original post to install. Remember to open and close the clam shell a few times when your screen goes black for a while. Since I wiped my Windows partition, freeing up 30 GB of space, I bumped my root partition up from 12GB to 16GB and gave the rest of the space over to my home partition. Feel free to size your root and home partitions to taste.

Enable WiFi

If you use the Fedora 25 installation USB to install, then you will need to find a way to copy brcmfmac4356-pcie.txt to /lib/firmware/brcm to get wireless working. You may download this file on another computer and copy it over on a USB drive, or you may download through a wired USB internet connection.

Set Default Boot Options?

When I had to reinstall Fedora, I had forgotten for quite some time to add the line

GRUB_CMDLINE_LINUX_DEFAULT="i915.fastboot=1 fbcon=rotate:1 intel_pstate=disable"

to /etc/default/grub without noticing any major problems. I did eventually add the line without noticing much change. You can add it or don’t. It didn’t seem to be as urgent as it once was.

Enable the Fan

This is one area where I personally have not yet realized any improvements since July. The redditors stockmind and efluffy joined forces to make a script that installs an ad-hoc service to get the fan running. It did a great job at that, but to my knowledge no kernel upgrades since then have built in this functionality. I tried compiling a kernel with some sort of “GPIO fan” setting to no avail. If there is a way to compile a recent kernel to get the fan working on its own, it’s beyond me. I still use the gpdfand service installed by the script. That script is no longer available at it’s original location, but I saved it, and with credit to stockmind and efluffy, you can download it from my Google Drive, here: fan-service-install.sh. After running the script with sudo sh fan-service-install.sh to install the service, start and enable it as before, using the following commands:

$ sudo systemctl enable gpdfand
$ sudo systemctl start gpdfand

To make matters a little worse, Fedora’s distribution kernel seems to have dropped the /sys/class/gpio functionality necessary for this fan script to work. Attempting to start the service while running any recent Fedora distribution kernel will now result in a error. Don’t worry too much about it. The service runs perfectly under other kernels, which I will soon mention.

Upgrade to Fedora 27

In my original post, I mentioned a bunch of commands to issue to begin the Fedora upgrade process. I now use the GNOME Software app (aka PackageKit) to do most of my routine upgrading and easy installations. I think I read somewhere that DNF and PackageKit don’t talk to each other all that well, and this results in a ballooning PackageKit directory in /var/cache. I reckon it best to stick to one or the other, so I’ve been sticking to PackageKit as much as possible for installs and upgrades. Anyway, give that app, the Software app a try to do your upgrading. It’s king of easy.

Install Custom Kernels

I’ve been keeping three kernel variations up to date on my system. Each have advantages and disadvantages.

  • The Fedora distribution kernel: The advantage is that it updates itself with no thought or input from me. The disadvantage, as noted above, is that gpdfand will not work with it. It also retains the “black screen while booting” problem, causing a need to open and close the thing a few times in order to see the login screen. Version installed as of this writing: 4.14.13-300.fc27.x86_64.
  • The latest stable kernel from kernel.org: The advantage of kernel.org is that you have the option of compiling the latest mainline kernel, which is kind of bleeding edge, and may carry some new functionality before any other variations. This was most important to me back when the 4.13 kernel was new, for this kernel promised some new functionality necessary for the GPD Pocket. Now that we’re on kernel 4.14 and 4.15, I’ve been compiling the latest stable kernel, and leaving the bleeding edge stuff to the famous Hans De Goede kernel. I believe the first time I compiled a kernel.org kernel, I used Hans’s .config file. (I’m not quite sure where to get that anymore.) Another advantage I’ve found to using kernel.org is that for a while there have been no boot screen error messages. This kinda makes me think it is a decent choice for everyday work. Version installed as of this writing: 4.14.13
  • Hans de Goede’s GPD tailored kernel: Being specially developed with an eye toward GPD products, this kernel offers the most functionality, which I will mention shortly. I usually prefer this one, until either I get occasional kernel crash warning messages or the Goodix touchscreen, which I use often at work, crashes. I find that kernel.org sometimes fares better where crashing is a concern. Version installed as of this writing: 4.15.0-rc7+.

You can refer to my original post for instructions on how to compile. One thing I learned over time is that when compiling a kernel, the command

$ make -j5

will utilize all cores to the utmost, and reduce the compile time to maybe an hour or so, whereas the command without the -j5 option will take around 6 hours. Also the CONFIG_HDMI_LPE_AUDIO issue appears to have been resolved for all kernels. You can leave this set to =m now without losing sound.

Touch Input and Login Screen Rotations

These work pretty well now. I believe no extra steps are needed to rotate touch input at any time. I believe recent kernels have taken care of that. The login screen does still need to be rotated, and this is now done simply by copying your own monitors.xml file to /var/lib/gdm/.config as follows:

$ sudo cp ~/.config/monitors.xml /var/lib/gdm/.config/monitors.xml

See the ArchWiki GDM article for more details on this simple, proper functionality. No need to download any special monitors.xml file from anywhere else anymore, and the touchscreen rotates as one would expect.

The Pocket’s Brightness Keys

I believe this feature is still a Hans de Goede exclusive. Keep using the

$ sudo dracut -f --add-drivers "pwm-lpss pwm-lpss-platform" /boot/initramfs-$(uname -r).img $(uname -r)

command to get them working.

Bluetooth, USB Type-C data, and Built-in Microphone

There has been some improvements on these fronts. Using the Hans de Goede kernel, I believe I did not have to fidget with any btusb stuff to get the bluetooth working. I can’t really remember, but if you find that not to be case, my original post has some fidgets to try.

Today, for the first time, I did hear some audio through my Bluetooth headphones. The trick for me was, under the sound settings, to set my Bluetooth headphones’ audio profile to “High Fidelity Playback (A2DP Sink)”.  The audio is too choppy to enjoy, but Googling around about it, this seems to be a common issue not specific to the GPD Pocket’s hardware. If I find a solution, I’ll be sure to post it here. Suffice to say today that I did hear audio from my Bluetooth headphones, and I consider that to be progress.

Also, today, for the first time, I was able to read data from a SD card pluggen in via the USB Type-C hub that came with the Pocket. Hans’s most recent kernel config, for his 4.15.0-rc7+, had a new “TYPEC” kind of option, which I set to =m. Whether that is what finally did it or not, I can’t really say, but it sure didn’t hurt!

Lastly for this section of new features, Hans did mention getting the built-in microphone to work through has latest kernel. I have not tested that yet, but I ought to soon.

Lingering Minor Annoyances

Having used Fedora on the GPD Pocket for the last six months, I’ve found these things to annoy me:

  • There is still apparently no fix for the rotated grub2 menu and splash screen. I gotta tilt my head to select the kernel version I want.
  • The machine is highly sensitive to shock. If you lay it down with any sort of bump whatsoever, the thing crashes and reboots. Probably not much could have been done about this. My old cell phone did the same thing. I think it’s, like, a solid state issue.
  • Facebook videos don’t play in Firefox. I’ve been wanting to hop on the Firefox Quantum bandwagon, and the only thing stopping me from doing that on the Pocket is my inability to watch facebook videos in Firefox. I’ve installed Flash and even purchased the Fluendo OnePlay Codec Pack. This got multimedia going on just about every other site, but still no dice for facebook videos and GIFs. I’m stumped in Firefox, but downloading the Chrome .rpm from its website and installing it, with Flash bundled, does the trick.
  • Keeping the thing powered has been a struggle. When the battery gets a good night’s charge, it has a comfortable life: just about a full day’s worth of on-again-off-again work. Once the battery is low, however, it’s tough to charge it back up, especially while working on it. And heaven forbid I do a heavy task, like compile a kernel, on low power. The battery actually drains while the unit is plugged in! Worst of all, if I let the battery drain to the low single digits and then shut it down, it won’t start up again until the battery has charged back up to at least 10%, which could take around 15 or 20 minutes. Every night, I must take care to fully shut it down and charge it completely for the following day’s work.
  • The computer takes five whole minutes to shut down. Three of these minutes are spent running a stop job for firewalld. I’m eagerly awaiting a fix for this. I once tried replacing firewalld with iptables with no luck. For now I’m just stuck waiting.

Ending on a Positive Note

I do quite love this machine. I wouldn’t put all the effort into it if I didn’t. Kudos to the GPD team, and kudos to the Fedora developers, Hans de Goede, stockmind, efluffy, and all the cats who have made Linux on the Pocket what it is.  I work at a school, and I frequently get questions and comments on it because it is so awesome, and I’m proud to day it’s a GPD Pocket running Fedora!