summaryrefslogtreecommitdiff
path: root/posts/librem5:crimson-daily-driver.md
blob: f56fb87c457658f589f9d4863e98bf7308148f1d (plain)
    1 Librem5: Crimson Daily Driver
    2 =============================
    3 
    4 If you have a Librem 5 phone and are like me, you are eagerly anticipating the
    5 release of Crimson, because you're stuck on Byzantium which has a super old
    6 version of just about every package, but most notably, phosh and chatty.
    7 
    8 A few weeks ago, I finally decided to try Crimson as a daily driver, and that
    9 caused me some great headache a couple of times. I am still using it as a daily
   10 driver however, but there are still some pretty sizeable issues which I have
   11 accepted for the tie being. The issues:
   12 
   13 The issues
   14 ----------
   15 
   16 ### No camera support yet
   17 
   18 Pretty self explanatory here. I imagine this has something to do with the
   19 libcamera api that is being worked on.
   20 
   21 ### No SD card support yet
   22 
   23 ...so if you use your SD card for your home directory, you'll have to rsync to
   24 internal storage and use that. In my case, I have too much on my card, so I had
   25 to be selective about what I put on internal storage.
   26 
   27 ### You can have bluetooth audio, or phone call audio, but not both
   28 
   29 Essentially, the current config for _pulseaudio_ doesn't work with bluetooth,
   30 but audio generally works fine everywhere else. If you try switching to
   31 _pipewire_, bluetooth audio works mostly well (switching audio outputs has to
   32 be done manually from the settings), but you won't have any audio, microphone
   33 or earpiece, on phone calls. This is because of [a
   34 bug](https://gitlab.com/mobian1/callaudiod/-/issues/35) in _callaudiod_. This
   35 issue is fixed in version `1.1.10`, but Crimson currently releases with
   36 `0.1.9`, so pipewire support is broken as of 2024.10.22.
   37 
   38 
   39 ### Installing upgrades is too perilous
   40 
   41 ![Monty Python No, it's too perilous](/files/monty-python-peril.jpg)
   42 
   43 This actually isn't strictly true for me anymore. You just have to be diligent
   44 when installing updates. Currently, the package `libgl1-mesa-dri` wants to
   45 upgrade `24.2.4-1`, which breaks `phosh`, causing a crash loop. The only way to
   46 fix it is to plug in a keyboard, `ctrl + alt + f2`, then `sudo apt install -y
   47 libgl1-mesa-dri=22.3.6-1+deb12u1` to downgrade to `22.3.6-1`. Of course, while
   48 you're doing this, phosh is continuing to launch and crash every 5 seconds, so
   49 you have to keep doing the `ctrl + alt + f2` sequence as systemd takes you back
   50 to `tty1`. `<sarcasm>Isn't systemd great?</sarcasm>`
   51 
   52 To avoid the above shenanigans, every time you run `sudo apt upgrade`, _be
   53 absolutely sure_ to also run `sudo apt install
   54 libgl1-mesa-dri=22.3.6-1+deb12u1` before you reboot the phone, or you'll end up
   55 in a crash loop of phosh.
   56 
   57 
   58 Updates
   59 -------
   60 
   61 ### Update 2024.10.26
   62 
   63 In rather frustrating timing, an important phone call came in today while I
   64 wasn't home and the phone completely crashed and boot looped.  When I got home
   65 and could troubleshoot, I discovered an update of libseat1 to 0.9.0 had broken
   66 the phone, and it needs to stay at version `libseat1=0.7.0-6` for now.
   67 
   68 Here's an all-in-one command to keep your crimson phone working.
   69 
   70 ```
   71 sudo apt install libgl1-mesa-dri=22.3.6-1+deb12u1 libseat1=0.7.0-6
   72 ```
   73 
   74 And a couple of pieces of related advice:
   75 1. Only install crimson updates when you are at home with a keyboard handy to recover with
   76 2. Always reboot your phone after installing said updates so you don't discover
   77    your phone is broken when you're away from said keyboard.
   78 
   79 I'll update this post with other caveats as they come to me. If you're fine
   80 with the above issues though, 
   81 
   82 
   83 ### Update 2024.11.21
   84 
   85 I removed the `alsa-ucm-conf` piece of the below script, as that version of the
   86 package is now available in the crimson repos. Woo!
   87 
   88 Additionally, still no SDcard support and the libseat and libgl1-mesa-dri
   89 downgrades is still required, despite _many_ updates having come in from
   90 upstream. It's moving right along! At this point, we're seeing somewhere
   91 between 2 and 30 package updates per day.
   92 
   93 
   94 Hacks to get running
   95 --------------------
   96 
   97 Because I want to easily rebuild this phone if I need to, without following a
   98 long checklist of shell commands, I put all this in a clean shell script which
   99 handles everything for me/you.
  100 
  101 I do recommend putting this in its own directory, as it has to download and
  102 extract some of its own artifacts (alsa-ucm-conf) to complete.
  103 
  104 In short, the following script:
  105 
  106 * Overrides the system alsa-ucm-conf ucm2 directories with those from upstream
  107   latest.
  108 
  109 * Adds a few additional apt repos to bring in "unstable" packages so the phone
  110   can actually be updated.
  111 
  112 
  113 **~/crimson/fixup.sh**
  114 
  115 ```
  116 #!/usr/bin/env bash
  117 
  118 set -euo pipefail
  119 export IFS=$'\n\t'
  120 
  121 # By default Crimson comes with the crimson repos, which is very broken last I
  122 # checked.
  123 # This adds landing, crimson-security, crimson-updates, and
  124 # crimson-updates-proposed repos. These might make things unstable in the long
  125 # run, but for now this is required to get things up and running.
  126 #
  127 apt_set_repos() {
  128   sudo tee /etc/apt/sources.list <<EOF
  129 deb http://repo.pureos.net/pureos landing main
  130 deb http://repo.pureos.net/pureos crimson main
  131 deb http://repo.pureos.net/pureos crimson-security main
  132 deb http://repo.pureos.net/pureos crimson-updates main
  133 deb http://repo.pureos.net/pureos crimson-updates-proposed main
  134 EOF
  135 }
  136 
  137 apt_set_repos
  138 ```
  139 
  140 Run that and most of the issues should be resolved.

Generated by cgit