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

fix(rpm-ostree): Optfix is not properly creating symlinks on new installs #165

Closed
Oakleafknight06 opened this issue Mar 16, 2024 · 14 comments
Labels
priority: low Might be supported or done in the future, but won't be prioritised type: bug Something isn't working.

Comments

@Oakleafknight06
Copy link

I run a custom image, https://github.com/Oakleafknight06/startingleaf, in which I install Mullvad VPN, which requires optfix as it installs into /opt. On my main workstation, this is working perfectly. However, on my secondary test system, the last two fresh installs I have done the symlink is not created correctly. The files are present in /usr/lib/opt/Mullvad\ VPN, but not in /opt/Mullvad\ VPN .
To fix temporarily I have run sudo ln -s /usr/lib/opt/Mullvad\ VPN /opt/Mullvad\ VPN and with that mullvad works normally.

(and a sidenote, I am new to filing issues so if I dont include anything you need or any other way I don't do the correct thing let me know, I'm happy to help)

@fiftydinar
Copy link
Collaborator

I don't know how optfix functions currently to fix this issue now, but I know that we are waiting for rpm-ostree v2024.3 update to land in Fedora, which includes this function natively, which will hopefully work better.

Related issue:
#112

@fiftydinar fiftydinar added the type: bug Something isn't working. label Mar 16, 2024
@Oakleafknight06
Copy link
Author

I assume that fix will land sometime soon when its ready? I was a bit confused going from bluebuild docs to the mentioned issue which was merged, wasnt sure when that lands in regular fedora atomic desktops

@Oakleafknight06
Copy link
Author

Probably no need for a fix with the current system as there's a manual workaround and an upstream fix coming sometime soon

@fiftydinar fiftydinar added the priority: low Might be supported or done in the future, but won't be prioritised label Mar 16, 2024
@fiftydinar fiftydinar changed the title optfix not properly creating symlinks on new installs fix(rpm-ostree): Optfix is not properly creating symlinks on new installs Mar 16, 2024
@AuraHerreroRuiz
Copy link

I don't know how optfix functions currently to fix this issue now, but I know that we are waiting for rpm-ostree v2024.3 update to land in Fedora, which includes this function natively, which will hopefully work better.

I'm the original writer of the work around (Well, only did the bash code for it as a script in my personal image, but some other users started using it in theirs and it was made into a module by somebody else) and how it works is that it first symlinks /opt to point to /var/opt, and then it iterates through the specified directories and creates symlinks on /var/opt/[directory] to /usr/lib/opt/[directory] before installing packages.

This makes the packages successfully install, but for some reason, these symlinks sometimes don't make it to the final image.

I've tried to look into it, but I eventually gave up as I couldn't consistently reproduce the issue consistently. Sadly, it isn't an easy fix.

I could look into it once more, but as mentioned in #112, upstream's experimental feature should work better, so if I have time I'll take a look at how to enable it by default and make a pull request.

@xynydev
Copy link
Member

xynydev commented Apr 8, 2024

My current optfix version is v2024.4. Do yall's builds work fine without using optfix at all?

@AuraHerreroRuiz
Copy link

AuraHerreroRuiz commented Apr 9, 2024

My current optfix version is v2024.4

I assume you mean rpm-ostree?

Do yall's builds work fine without using optfix at all?

Mine doesn't, and my rpm-ostree version is v2024.4 as well. I created a branch from main in my image and removed the optfix section I have on the rpm-ostree module and the build fails when installing the packages.

@fiftydinar
Copy link
Collaborator

fiftydinar commented Apr 9, 2024

Mine doesn't, and my rpm-ostree version is v2024.4 as well. I created a branch from main in my image and removed the optfix section I have on the rpm-ostree module and the build fails when installing the packages.

I believe that optfix needs to be enabled as the experimental feature in rpm-ostree

I don't know currently how to do that in build-time, but I will try to investigate.

@fiftydinar
Copy link
Collaborator

fiftydinar commented Apr 9, 2024

Here's how it works:

coreos/rpm-ostree#233 (comment)

I think that we should go with environment variable solution (Modifying rpm-ostreed.service.d)

@fiftydinar
Copy link
Collaborator

fiftydinar commented Apr 9, 2024

Needs to be tested.

#191

EDIT: Environment variable approach doesn't work.
It's not documented how to use optfix in "compose time" at all to try the 2nd solution, so Idk how to solve this.

@AuraHerreroRuiz
Copy link

AuraHerreroRuiz commented Apr 9, 2024

It's not documented how to use optfix in "compose time"

The only mention I've found of that is in the release page:

rpm-ostree now has experimental support for installing RPMs with files in /opt and /usr/local. This can be enabled at compose time (via the opt-usrlocal-overlays switch), or client-side using coreos/rpm-ostree#233 (comment).

However, I can't find where this switch is. I've tried rpm-ostree [command] --help and searching the source code for it and no dice.

@xynydev
Copy link
Member

xynydev commented Apr 9, 2024

Oh yeah, I think opt-usrlocal-overlays is in the treefile. We should try to contrib that in upstream Fedora or at least make an issue.

@AuraHerreroRuiz
Copy link

I think someone already did? coreos/fedora-coreos-tracker#1681

@AuraHerreroRuiz
Copy link

However, I can't find where this switch is. I've tried rpm-ostree [command] --help and searching the source code for it and no dice.

Okay, I figured it out. This switch was changed to an enum named opt-usrlocal. As you said, it's on the treefile. https://coreos.github.io/rpm-ostree/treefile/#experimental-options

@xynydev
Copy link
Member

xynydev commented Apr 10, 2024

This is where the treefiles are. I can make an issue there later, if someone doesn't go first.

https://gitlab.com/fedora/ostree/ci-test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Might be supported or done in the future, but won't be prioritised type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

4 participants