Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add akmods module #89

Merged
merged 20 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions modules/akmods/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
> [!WARNING]
> Only Universal Blue based images are officially supported.

> [!WARNING]
> Universal Blue builds with Fedora 38 & below are not supported.

> [!WARNING]
> Custom kernels are not supported.

# `akmods` Module for Startingpoint

The `akmods` module is a tool used for managing and installing kernel modules. It simplifies the installation of kernel modules, improving the capabilities of your system.

List of all available kernel modules & versions/tags are here:
https://github.com/ublue-os/akmods

Ublue-os-akmods-addons & ublue-os-nvidia-addons are already included when necessary, so they are not needed to install.

To use the `akmods` module, specify the kernel modules you wish to install in the `install:` section of your recipe/configuration file.

## Example configuration
```yaml
type: akmods
install:
- openrazer
- openrgb
- v4l2loopback
- winesync
```

By default, the `akmods` module installs the `main` akmods for `latest` version of Fedora.
`main` akmods are also compatible with other images except `surface(-nvidia)` & `asus(-nvidia)`.

If you want to install akmods for `surface(-nvidia)` or `asus(-nvidia)` images, or for `older version of Fedora`, change this part in the Containerfile:

```
# Change this if you want different version/tag of akmods.
COPY --from=ghcr.io/ublue-os/akmods:main-39 /rpms /tmp/rpms
```
20 changes: 20 additions & 0 deletions modules/akmods/akmods.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -oue pipefail

BASED_IMAGE=$(echo "${BASE_IMAGE}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this? The BASE_IMAGEand BASED_IMAGE variable are identical, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there is no need for this.

I can correct this in another PR.


get_yaml_array INSTALL '.install[]' "$1"

INSTALL_PATH=("${INSTALL[@]/#/\/tmp/rpms/kmods/*}")
INSTALL_PATH=("${INSTALL_PATH[@]/%/*.rpm}")
INSTALL_STR=$(echo "${INSTALL_PATH[*]}" | tr -d '\n')

if [[ ${#INSTALL[@]} -gt 0 ]]; then
echo "Installing akmods"
echo "Installing: $(echo "${INSTALL[*]}" | tr -d '\n')"
if [[ "$BASED_IMAGE" =~ "surface" ]]; then
rpm-ostree install kernel-surface-devel-matched $INSTALL_STR
else
rpm-ostree install kernel-devel-matched $INSTALL_STR
fi
fi