-
Notifications
You must be signed in to change notification settings - Fork 196
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
Support layering rpms with files in /opt #1795
Conversation
Hah, cool. So...I'm generally OK with this but it won't help with e.g. Puppet which writes mutable data into But as for getting Chrome going , sure. |
All the tests fail with
Any idea what that is about? |
So, i had a similar issue locally. The problem is that the url of the libdnf git repo changed and for some reason old checkout just refuse to work as they refer to the old git commit which does not exist in the new upstream. The only way i could make this work was to blow away the old rpm-ostree checkout. |
Yeah it took me a while to figure out, you also need to edit the URL in |
@cgwalters How do we fix it for the CI tho? |
This PR is modifying the libdnf submodule. Should be good if you just drop that bit from the patch. |
73aacc6
to
1de298e
Compare
Ah, sorry about that, it was caused but the git submodule snafu. |
From
The cosa one...hmm, may be coreos/coreos-assembler#427 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach looks sane to me! Though as @cgwalters mentioned, this isn't a generic fix for #233, so maybe let's drop the "Fixes #233" commit msg footer?
Hmm that fixup is wrong some of it is against the test, not the base commit. Will force push a fix. |
08fb272
to
8f4b84c
Compare
@@ -388,6 +389,9 @@ run_script_in_bwrap_container (int rootfs_fd, | |||
/* Scripts can see a /var with compat links like alternatives */ | |||
rpmostree_bwrap_var_tmp_tmpfs (bwrap); | |||
|
|||
if (glnx_fstatat (rootfs_fd, "usr/lib/opt", &stbuf, AT_SYMLINK_NOFOLLOW, NULL) && S_ISDIR(stbuf.st_mode)) | |||
rpmostree_bwrap_append_bwrap_argv (bwrap, "--symlink", "usr/lib/opt", "/opt", NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this works for Chrome, then that's fine! Though I can imagine we'll have to switch to symlinking each /opt
subdir here too if scriptlets want to write to other dirs in /opt
. Anyway, we can do that later!
This adds support for layering rpms with files in /opt. The way we do this is that when importing the rpms we rewrite any files in /opt into /usr/lib/opt, and then we add back a symlink from the toplevels of /opt into /usr/lib/opt via the per-package tmpfiles.d. Also, in order for this to work with the %post script we bind /opt to usr/lib/opt during the script execution. This fixes coreos#233 at least for Google Chrome.
Awesome, thanks! I just pushed an updated commit message to be more precise that this doesn't fix all of #233. |
Closes: #1795 Approved by: jlebon
☀️ Test successful - status-atomicjenkins |
This adds support for layering rpms with files in /opt. The way we
do this is that when importing the rpms we rewrite any files in /opt
into /usr/lib/opt, and then we add back a symlink from the toplevels
of /opt into /usr/lib/opt via the per-package tmpfiles.d.
Also, in order for this to work with the %post script we bind /opt
to usr/lib/opt during the script execution.
This is enough to make layering chrome work.
This fixes #233