Bug 2459819

Summary: kmodtool: akmods-ostree-post call in %post is fatal
Product: [Fedora] Fedora Reporter: Jon Mulder <jon.e.mulder>
Component: kmodtoolAssignee: Nicolas Chauvet (kwizart) <kwizart>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: getchoo, hans, hobbes1069, kwizart, leigh123linux, negativo17, nicolas.vieville
Target Milestone: ---Keywords: Bugfix
Target Release: ---   
Hardware: x86_64   
OS: Linux   
URL: https://github.com/mulderje/ublue-oldair/actions/runs/24681672015/job/72180274839#step:2:1
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2026-05-16 12:30:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jon Mulder 2026-04-20 18:16:02 UTC
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 [44/48] Installing akmods-0:0.6.2-9.fc4 100% | 854.4 KiB/s |  70.1 KiB |  00m00s
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 >>> Running %post scriptlet: akmods-0:0.6.2-9.fc43.noarch                       
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 >>> Finished %post scriptlet: akmods-0:0.6.2-9.fc43.noarch                      
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 >>> Scriptlet output:                                                           
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 >>> Created symlink '/etc/systemd/system/multi-user.target.wants/akmods.service'
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.27 >>>                                                                             
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 [45/48] Installing akmod-facetimehd-0:0 100% |   2.7 MiB/s |  54.4 KiB |  00m00s
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> Running %post scriptlet: akmod-facetimehd-0:0.7.0.1-1.20260420143206402277.m
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> Non-critical error in %post scriptlet: akmod-facetimehd-0:0.7.0.1-1.20260420
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> Scriptlet output:                                                           
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> Building /usr/src/akmods/facetimehd-kmod-0.7.0.1-1.20260420143206402277.main
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> ERROR: Not to be used as root; start as user or 'akmodsbuild' instead.      
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>>                                                                             
[15:47:33 g.i/m/ublue-oldair:pr-24-43] => #41 15.29 >>> [RPM] %post(akmod-facetimehd-0.7.0.1-1.20260420143206402277.main.20260420git
[15:47:34 g.i/m/ublue-oldair:pr-24-43] => #41 15.31 [46/48] Installing facetimehd-0:0.7.0.1 100% |   4.6 MiB/s |  18.7 KiB |  00m00s
[15:47:34 g.i/m/ublue-oldair:pr-24-43] => #41 15.31 [47/48] Installing python3-rpmautospec- 100% |  25.7 MiB/s | 500.8 KiB |  00m00s
[15:47:34 g.i/m/ublue-oldair:pr-24-43] => #41 15.89 [48/48] Installing systemd-rpm-macros-0 100% |  15.4 KiB/s |   8.9 KiB |  00m01s
[15:47:34 g.i/m/ublue-oldair:pr-24-43] => #41 15.89 Transaction failed: Rpm transaction failed.


Reproducible: Always

Steps to Reproduce:
1. Try to install certain akmods via containers
2. Fails RPM transaction in post
3. Fatal error on install
Actual Results:
“Transaction failed: Rpm transaction failed.”

Expected Results:
Rpm installs with a warning

Additional Information:
Commit here [1] seems to fix for me. As an FYI, I used Claude to debug the issue and summarize for the commit message.

1: https://src.fedoraproject.org/fork/mulderje/rpms/kmodtool/c/982c2d15bc8b6ac206851f0cf7243592d52d0a9b?branch=rawhide

Comment 1 Jon Mulder 2026-04-20 18:19:23 UTC
PR posted here: https://src.fedoraproject.org/rpms/kmodtool/pull-request/18

Comment 2 Nicolas Chauvet (kwizart) 2026-04-20 19:02:27 UTC
That doesn't look the appropriate way to fix this issue.

I'm not into bootc, and unsure about why they would run as non-root (even if fake root) in order to install RPM packages at all, breaking assumptions.
But if akmods-ostree-post  fails, there is no mean for the akmod-foo package to do it's duty. Then it's it sound likes appropriate to error here.

It sounds like your LLVM only hide the error without fixing the problem.

Comment 3 Nicolas Chauvet (kwizart) 2026-04-21 11:39:40 UTC
You might use this workaround:
touch /run/ostree-booted

Then install akmod-foo, and
rm /run/ostree-booted

But then akmods will not build and extract the kmod-foo, like expected. (that's why your are using akmods --force in your scripts, which also workarounds the previous bug without fixing it).

Comment 4 Nicolas Chauvet (kwizart) 2026-04-21 11:41:21 UTC
For info, what is the content of os-release in your bootc ?

Comment 5 Seth Flynn 2026-08-13 18:05:08 UTC
I just came across this same error when basing my images off of `quay.io/fedora-ostree-desktops/base-atomic`. It seems everything stems from this conditional: https://src.fedoraproject.org/rpms/akmods/blob/3979c172b8067de5246f18cc2be1ddb9c1420f72/f/akmods-ostree-post#_33

The bootc images (correctly) don't have a `/run/ostree-booted` file, but they *do* have `OSTREE_VERSION` in /etc/os-release:

```
bash-5.3# grep OSTREE_VERSION /etc/os-release
OSTREE_VERSION='44.20260813.0'
```

So this issue should be fixed by either only relying on the presence of `/run/ostree-booted` to detect true (non-bootc) OSTree systems, or the removal of `OSTREE_VERSION` from `/etc/os-release` in the bootc images. The following is a terrible workaround in the meantime:

```
RUN <<EOF
sed -i "/^OSTREE_VERSION='/d" /etc/os-release
dnf install akmod-nvidia

kernel_version="$(cd /usr/lib/modules && echo *)"
akmods --force --kernels "$kernel_version" --kmod nvidia
EOF
```