blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
24 stars 1 forks source link

feat: Add akmods module #89

Closed fiftydinar closed 8 months ago

fiftydinar commented 9 months ago

Credits: @C0dePlayer

This is not ideal as it does not support custom kernels & it involves editing Containerfile.

Custom kernels is something that upstream should solve I believe, so it's not a concern we should direct to.

I believe there is no other way but to make users edit Containerfile for those files to be even pulled of.

I would like this to be through the recipe only, so I will put this as a draft until some better ideas come.

2nd part of this work: https://github.com/ublue-os/startingpoint/pull/212

fiftydinar commented 9 months ago

Hmm, it fails here with these errors:

Error ``` === Launching module of type: kmods-installer === Installing kmods Installing: v4l2loopback winesync openrazer openrgb nct6687d gasket gcadapter_oc ryzen-smu xpadneo xone xpad-noone Enabled rpm-md repositories: copr:copr.fedorainfracloud.org:kylegospo:rom-properties copr:copr.fedorainfracloud.org:szydell:system76 copr:copr.fedorainfracloud.org:fiftydinar:gnome-shell-openweather-toppk copr:copr.fedorainfracloud.org:kylegospo:hl2linux-selinux copr:copr.fedorainfracloud.org:kylegospo:system76-scheduler copr:copr.fedorainfracloud.org:fiftydinar:gnome-shell-extension-middleclickclose-git copr:copr.fedorainfracloud.org:fiftydinar:gnome-randr-rust rpmfusion-nonfree-updates rpmfusion-free rpmfusion-free-updates rpmfusion-nonfree copr:copr.fedorainfracloud.org:ublue-os:akmods updates fedora-cisco-openh264 fedora updates-archive Importing rpm-md...done rpm-md repo 'copr:copr.fedorainfracloud.org:kylegospo:rom-properties' (cached); generated: 2023-12-24T05:12:20Z solvables: 27 rpm-md repo 'copr:copr.fedorainfracloud.org:szydell:system76' (cached); generated: 2023-12-17T04:02:26Z solvables: 24 rpm-md repo 'copr:copr.fedorainfracloud.org:fiftydinar:gnome-shell-openweather-toppk' (cached); generated: 2023-11-10T12:13:13Z solvables: 2 rpm-md repo 'copr:copr.fedorainfracloud.org:kylegospo:hl2linux-selinux' (cached); generated: 2023-08-22T22:04:08Z solvables: 6 rpm-md repo 'copr:copr.fedorainfracloud.org:kylegospo:system76-scheduler' (cached); generated: 2023-12-09T09:07:11Z solvables: 4 rpm-md repo 'copr:copr.fedorainfracloud.org:fiftydinar:gnome-shell-extension-middleclickclose-git' (cached); generated: 2023-11-08T17:30:48Z solvables: 2 rpm-md repo 'copr:copr.fedorainfracloud.org:fiftydinar:gnome-randr-rust' (cached); generated: 2023-10-31T17:44:25Z solvables: 4 rpm-md repo 'rpmfusion-nonfree-updates' (cached); generated: 2023-12-22T13:50:27Z solvables: 56 rpm-md repo 'rpmfusion-free' (cached); generated: 2023-11-04T16:49:08Z solvables: 445 rpm-md repo 'rpmfusion-free-updates' (cached); generated: 2023-12-22T13:27:08Z solvables: 108 rpm-md repo 'rpmfusion-nonfree' (cached); generated: 2023-11-04T17:26:32Z solvables: 208 rpm-md repo 'copr:copr.fedorainfracloud.org:ublue-os:akmods' (cached); generated: 2023-12-09T03:59:38Z solvables: 60 rpm-md repo 'updates' (cached); generated: 2023-12-25T01:17:57Z solvables: 16809 rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2023-03-14T10:57:01Z solvables: 4 rpm-md repo 'fedora' (cached); generated: 2023-11-01T00:12:39Z solvables: 70825 rpm-md repo 'updates-archive' (cached); generated: 2023-12-25T01:35:16Z solvables: 18828 Resolving dependencies...done error: Could not depsolve transaction; 3 problems detected: Problem 1: conflicting requests - nothing provides xpadneo-kmod-common >= 0.9.5 needed by kmod-xpadneo-6.6.7-200.fc39.x86_64-0.9.5-3.20230617git5970c4c.fc39.x86_64 from @commandline Problem 2: conflicting requests - nothing provides xone-kmod-common >= 0.3 needed by kmod-xone-6.6.7-200.fc39.x86_64-0.3-3.20230517gitbbf0dcc.fc39.x86_64 from @commandline Problem 3: conflicting requests - package kernel-devel-matched-6.6.7-200.fc39.x86_64 from updates-archive requires kernel-devel = 6.6.7-200.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.8-200.fc39.x86_64 from updates requires kernel-core = 6.6.8-200.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.8-200.fc39.x86_64 from updates-archive requires kernel-core = 6.6.8-200.fc39, but none of the providers can be installed - package kernel-devel-matched-6.5.6-300.fc39.x86_64 from fedora requires kernel-core = 6.5.6-300.fc39, but none of the providers can be installed - package kernel-devel-matched-6.5.10-300.fc39.x86_64 from updates-archive requires kernel-core = 6.5.10-300.fc39, but none of the providers can be installed - package kernel-devel-matched-6.5.11-300.fc39.x86_64 from updates-archive requires kernel-core = 6.5.11-300.fc39, but none of the providers can be installed - package kernel-devel-matched-6.5.12-300.fc39.x86_64 from updates-archive requires kernel-core = 6.5.12-300.fc39, but none of the providers can be installed - package kernel-devel-matched-6.5.9-300.fc39.x86_64 from updates-archive requires kernel-core = 6.5.9-300.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.2-201.fc39.x86_64 from updates-archive requires kernel-core = 6.6.2-201.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.3-200.fc39.x86_64 from updates-archive requires kernel-core = 6.6.3-200.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.4-200.fc39.x86_64 from updates-archive requires kernel-core = 6.6.4-200.fc39, but none of the providers can be installed - package kernel-devel-matched-6.6.6-200.fc39.x86_64 from updates-archive requires kernel-core = 6.6.6-200.fc39, but none of the providers can be installed - cannot install both kernel-devel-6.6.7-200.fc39.x86_64 from updates-archive and kernel-devel-6.6.8-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.8-200.fc39.x86_64 from updates and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.5.6-300.fc39.x86_64 from fedora and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.5.10-300.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.5.11-300.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.5.12-300.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.5.9-300.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.2-201.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.3-200.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.4-200.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.6-200.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System - cannot install both kernel-core-6.6.8-200.fc39.x86_64 from updates-archive and kernel-core-6.6.7-200.fc39.x86_64 from @System error building at STEP "RUN chmod +x /tmp/build.sh && /tmp/build.sh && rm -rf /tmp/* /var/* && ostree container commit": error while running runtime: exit status 1 time="2023-12-25T20:44:24Z" level=error msg="exit status 1" ```
xynydev commented 9 months ago

Hmm, it fails here with these errors

The akmods repo example installs the akmods with the commands below. Maybe the wildcard is required?

RUN rpm-ostree install /tmp/rpms/ublue-os/ublue-os-akmods*.rpm
RUN rpm-ostree install /tmp/rpms/kmods/kmod-v4l2loopback*.rpm
xynydev commented 9 months ago

I was just looking at if there'd be a way to install the akmods directly using the module without Containerfile changes, and there is a COPR but it doesn't have everything and I'm not sure if it'd just work.

With a compiler-based approach this would be easier. I guess I should work on that sometime...

fiftydinar commented 8 months ago

@xynydev I have great news.

Module actually works! Those errors I had before seems to be a typical upstream error (from akmods repo).

Here's proof it works: https://github.com/fiftydinar/gidro-os/actions/runs/7473504118/job/20337794147#step:15:647

I think this is good to merge, I don't see what more of a changes is needed.

If you catch something that needs update, please let me know.

Edit: I remembered. We need to solve ${IMAGE_MAJOR_VERSION} tag in Containerfile for pulling akmods files instead of fixed Fedora version.

However, adding IMAGE_MAJOR_VERSION as an argument only works when building an image offline. Github Action fails.

So I think it's good as it is (not yet, see below).

It's a shame that akmods repo doesn't have latest tag available though. So you need to edit this manually whenever new Fedora gets a release. I filled an issue on this: https://github.com/ublue-os/akmods/issues/109

fiftydinar commented 8 months ago

I added support for Surface & Asus images as I noticed they don't install kernel-devel-matched package.

It auto-detects if the base image is right before installing kmods.

However, it seems that BASE_IMAGE variable is not recognized in cloud for some reason, hence builds failing. I'll have to investigate this further. Help is also appreciated.

fiftydinar commented 8 months ago

Here's proof that BASE_IMAGE variable works in terminal (but still not working in cloud): Screenshot from 2024-01-12 14-00-35

When I put something simple in module like echo "${BASE_IMAGE}"

it echoes base image normally

fiftydinar commented 8 months ago

Installing kernel-devel-matched actually works for all images & it's the more proper way of installing akmods. I tested surface, asus & main image as a base & module works wonderfully.

This time, it's really ready to merge.