https://blue-build.org/ logo
Is there an equivalent to optfix in the pacman mod...
# questions
p
I have a couple of packages that want to install into /opt (reasonably enough), but it's proving difficult... @fiftydinar ?
a
message has been deleted
g
The CLI already handles symlinking for
/opt
. The problem comes down to programs that expect to make changes in their opt directory. The programs that are symlinked exist in a read only area of the file system
/usr/lib/opt
. Now you could manually install a program in
/opt
at runtime if you want as that should be mutable
p
Interesting - I hadn't realised that opt is symlinked to an unusable area during build and then to a mutable one.
g
Yeah cause it's normally symlinked to
/var/opt
, but files in there at build time do not get added when you boot the image. So instead we symlinked to that lib directory at build time. Any folder in the lib opt is symlinked at runtime into
/var/opt
using systemd tempfiles
This allows programs like Chrome to be installed at build time and then be available when you boot. Chrome itself doesn't write to its opt directory at runtime, so it works perfectly fine with this technique.
p
I'm beginning to wonder if this is a different issue to the one I thought. From your explanation it sounds as though packages installing to /opt end up in /usr/lib/opt - which is then readon-only at runtime, but, obviously, not at build time. My issue is happening at build time so I think it must be something else. Pacman is complaining that /opt already exists - which ,of course, it does. A search suggests to me that this could be fixed with optfix - but that doesn't exist in the pacman module and, anyway, is deprecated.
I feel like this is a bluebuild issue because I've not encountered it with these packages before - even using an immutable system.
I should say pacman and bluebuild since this, presumably, doesn't happen in fedora/rpm based systems...
b
I'm not sure if it would work, but you can try rm'ing the symlink with a snippet or script, make the opt directory, install using the pacman module, or a script if it doesn't work, then symlink the /opt directory back to /usr/lib/opt for the rest of the build. That won't fix the problem of stuff not being able to build at runtime, but that's a seperate problem.
Well, move everything from opt into /usr/lib/opt first, I think you can pick up what I'm putting down here.
p
Yes - I get what your saying. I think it'll be something like that - or, possibly, rebuilding the packages to install to /var/opt or /usr/lib/opt