Basically, a collection of notes on building and running libreboot on t480. Hope it helps sb avoid a few pitfalls I’ve personally encountered. Corrections/other ways to do stuff are welcome.

  1. If you’re building libreboot from source like I did, you may want to replace repo URLs with mirrors in config/git/grub, as gnu repos are slow AF;
  2. To boot your system, you’ll need it to either be bootable via legacy bios (libreboot uses seabios by default), or, more realistically, have grub bootloader. On NixOS, I’ve changed the bootloader config to:
boot.loader.grub = {                          
  enable = true;                  
  device = "nodev"; # generate grub.cfg without installing grub itself  
  theme = lib.mkForce null;       
  font = lib.mkForce null;        
  splashImage = lib.mkForce null; 
};                                

Notice the disabled theming/fonts/background image: in my case, libreboot’s grub would only show the blank screen 'til I disabled them, so you may want to trim your config to only menu entries or something. Then when booting, you simply press ESC, choose grub, and select either loading the OS or searching for bootloader configs on NVMe.

  1. If you didn’t do [2], and are unable to boot your system, you may have some trouble with seabios not seeing your live USB you’re bringing to fix that. In this case, try again a few times: as far as I can tell, that happens when you press ESC too early.
  2. Having seabios auto-start grub: echo '/rom@img/grub2' > bootorder && cbfstool libreboot.rom add -f bootorder -n bootorder -t raw (slightly modified command from here). Dumping and re-flashing libreboot without an external programmer is done with flashprog -p internal and requires iomem=relaxed in kernel cmdline;
  3. Annoying stuff: FnLock turns on when booting or waking up from sleep; unsure on how to disable this as nvramtool refuses to work (mb a skill issue). Also, disconnecting the external battery while the laptop is powered on seems to cause a reboot.
  4. Libreboot’s grub can be themed: see this for how it’s currently done (although, note, that we need config/grub/xhci/config/payload and not config/grub/default/config/payload) and this for an example of how it can look.
  5. Battery stuff, probably related to the Embedded Controller’s firmware: charge thresholds don’t seem to work (and the corresponding files are missing), /sys/class/power_supply/BAT1/energy_{now,_full{,_design}} are now charge_full{,_design}, new option current_now [Edit 3: this seems to be related to changes in the kernel or something]

[Edit] 2 more bugs:

  1. Charge cycles are always 0 [mb an issue with my batteries, tho];
  2. The laptop constantly tries to power on if it dies due to depleted battery.

[Edit 2]:

  1. charge measurements don’t play well with cosmic-epoch on nixos in my particular case: the percentage doesn’t seem to get updated, but looks somewhat correct upon reboots;
  2. Reduced backlight brightness range: /sys/class/backlight/acpi_video0/max_brightness is now 15, and not ~1515 as it was before.
  • dingdongitsabear@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    12 days ago

    thank you for your service! I’m holding off till it’s at least in version 2 or 3 as it’s my main device.

    • do you know what your Lenovo UEFI version was before (i.e. latest)?
    • are both your batteries aftermarket?
    • have you tried a dock?
    • fl42v@lemmy.mlOP
      link
      fedilink
      arrow-up
      2
      ·
      12 days ago

      Makes sense, since it’s apparently not even merged into coreboot yet (at least it wasn’t yesterday).

      • I’m not entirely sure about the version, but likely 1.51 (I’ve last updated back in July, as far as I remember);
      • yap;
      • nope, although I’ll likely be able to close to the new year.