Personal gentoo overlay
Go to file
projectmoon 70b340af2c WIP on firefox-pwa-connector 2023-03-16 10:19:15 +01:00
dev-python/epc dev-python/epc: prefer orjson-bin 2022-12-18 22:57:47 +01:00
dev-util/rust-analyzer-bin dev-util/rust-analyzer-bin: add 0_p20221212 2022-12-14 11:00:36 +01:00
docs Add kernel ebuild update documentation 2023-03-05 09:07:56 +00:00
media-fonts/fonts-meta remove cjk fonts that we do not know the free status of and are too lazy to check. 2022-11-10 14:51:20 +01:00
metadata correct email 2023-03-05 11:22:39 +00:00
profiles move librem-ec-acpi back to sys-kernel 2023-03-01 07:10:21 +01:00
sec-keys/openpgp-keys-linux-libre sec-keys/openpgp-keys-linux-libre: new package, add 20221123 2022-11-23 22:35:24 +01:00
sys-apps/purism_ectool move librem-ec-acpi back to sys-kernel 2023-03-01 07:10:21 +01:00
sys-kernel sys-kernel/libre-kernel: drop versions 2023-03-08 20:51:57 +00:00
sys-power/librem-control fix dep for librem-control 2023-03-01 07:12:11 +01:00
virtual/dist-kernel virtual/dist-kernel: add 5.15.94 2023-03-07 23:17:40 +00:00
www-plugins/firefox-pwa-connector WIP on firefox-pwa-connector 2023-03-16 10:19:15 +01:00
.gitignore only ignore md5 cache 2022-11-15 22:58:19 +01:00
README.md Documentation updates about how to use the overlay (quickstart coming soon) 2023-03-01 07:42:34 +01:00

README.md

Personal Gentoo overlay, focusing mostly on needed tools and compatibility for a libre version of Gentoo on the Librem 14 computer.

Available packages:

  • dev-python/ecp: Python implementation of Emacs RPC stack. Depends on orjson or orjson-bin from the GURU (or another) overlay.
  • sys-kernel/libre-kernel: A dist-kernel built from the Linux-libre sources.
  • media-fonts/fonts-meta: Modified version to remove non-Free fonts from the dependencies.
  • sys-kernel/librem-ec-acpi: An ebuild packaging the Librem 14 EC ACPI kernel module, necessary for proper functioning of the laptop's battery charging and function keys.
  • sys-power/librem-control: A GTK application to control parameters of the Librem EC (battery charge levels, etc).
  • sys-apps/purism_ectool: Tool for querying and flashing Purism EC firmware images on certain Librem laptops.

How to Add This Repository

Using eselect-repository:

# eselect repository add projectmoon git https://git.agnos.is/projectmoon/projectmoon-overlay

It usually a best practice to mask packages from overlays, except the ones you want:

In /etc/portage/package.mask:

*/*::projectmoon

Individual packages can be unmasked (and added to package.accept_keywords if necessary). In /etc/portage/package.unmask:

sys-kernel/libre-kernel::projectmoon
virtual/dist-kernel::projectmoon
sec-keys/openpgp-keys-linux-libre::projectmoon

The Linux-libre dist-kernel

This overlay provides a dist-kernel (based on sys-kernel/vanilla-kernel) using the Linux-libre kernel sources, and an accompanying updated version of virtual/dist-kernel. It is maintained and tested for my personal use on amd64. The Linux-libre kernel removes the ability for the Linux kernel to load firmware that is not Free Software. The ebuild roughly follows the current stable gentoo-kernel for amd64.

The libre kernel can be installed alongside other dist-kernels, and works with the dist-kernel and initramfs USE flags. The ebuild does NOT fail if non-free firmware (i.e. sys-kernel/linux-firmware with redistributable USE flag set) is installed, but it will warn you if this is the case. It will also warn you if the linux-firmware package is not found at all, like normal dist-kernel ebuilds.

The kernel installed by this ebuild has the version suffix -gnu-dist, making it easy to determine which kernel it is.

Signature Verification

It is recommended to enable GPG signature verification of sys-kenrel/libre-kernel by adding the USE flag to /etc/portage/package.use:

sys-kernel/libre-kernel verify-sig

Keeping the Linux-libre Kernel Installed

Portage will sometimes try to install sys-kernel/gentoo-kernel or another dist-kernel if there is a newer stable version than sys-kernel/libre-kernel. This happens because of a version bump to virtual/dist-kernel before this overlay has updated its own copy of virtual/dist-kernel.

To prevent portage from attempting to install another dist-kernel instead of the Linux-libre kernel, you should mask other dist-kernels in /etc/portage/package.mask:

# stay on libre kernel
sys-kernel/gentoo-kernel
sys-kernel/gentoo-kernel-bin
sys-kernel/vanilla-kernel

Linux Firmware

Note: If you are running the Linux-libre kernel, it is unlikely (though not impossible) that you need to install sys-kernel/linux-firmware.

To install only the Linux firmware that meets the Free Software Definition, configure /etc/portage/package.use accordingly:

# Install only libre firmware
sys-kernel/linux-firmware -redistributable -unknown-license

You can also edit /etc/portage/profile/package.use.mask to prevent the linux-firmware package from ever installing the closed-source firmware by adding this line:

# forcibly stop non-free firmware installation
sys-kernel/linux-firmware redistributable unknown-license

Using the Librem EC ACPI kernel module

The Librem EC ACPI kernel module should install and be automatically available (via modprobe) after installation, using emerge sys-kernel/librem-ec-acpi. The module is currently installed to /lib/modules/<kernel>/librem/.

This ebuild supports the dist-kernel USE flag, and the module will automatically be rebuilt when installing a new dist-kernel if that flag is enabled.

If you are not using a dist-kernel, you will need to do emerge @modules-rebuild to install the module after you upgrade or install a new kernel,

Librem Control and the Purism EC Tool

These two appliations can be used to manipulate device-specific features of the Librem 14, including the flashing of firmware images. It is not recommended to use the EC tool from this overlay for flashing a firmware image. Instead, follow the official firmware flashing instrutions.

Disclaimer

The ebuilds in this overlay are really only tested for my specific use-case. I do not test every combination of USE flags, for example. So there may be issues with non-Free dependencies etc in some cases.