initramfs: Fix using local /etc when also replacing kernel#1998
Conversation
We don't support `/etc/dnf/dnf.conf`, so tell libdnf to not look for it. This squashes warnings from libdnf (which turn into hard errors when hacking locally with `G_DEBUG=fatal-warnings`). As mentioned in the comment, the reason for putting this in `main.c` is that it controls a global variable, which is used in a few places in libdnf. So rather than duplicating this across callsites, just set it upfront. And yeah... we should improve that API.
E.g. if it contains spaces as is the case when one does `rpm-ostree initramfs --arg=-I --arg='/file1 /file2'`.
|
This is split out from #1997 and is all that's technically needed to fix https://bugzilla.redhat.com/show_bug.cgi?id=1806588. Though I think we should do something like #1997 too. Keeping as draft until I add tests here. |
|
To fix Prow: coreos/coreos-assembler#1154 |
f09b77c to
d286b87
Compare
|
OK, added a test for this. Ready to review! |
We do, it's in the base tree. So my vague recollection here is that the current behavior was somewhat intentional - the concept is that e.g. We do distinguish in the interface/code today between Isn't this something more like we should look at the origin and see whether initramfs regeneration was requested and if so use the local |
OK, sure :), but it's not super handy. We'd have to re-check it out somewhere under the temp rootfs so dracut can access it. Actually, a first iteration of this patch was to keep the base initramfs under
Hmm yeah, I think that makes sense. Will tweak! |
d286b87 to
341b4e7
Compare
|
Yeah, I think I agree with #1997 |
341b4e7 to
38adeb7
Compare
|
OK, updated! ⬆️ |
38adeb7 to
6fe9bcc
Compare
|
Nice, thanks! |
Instead of basing our decision to use the local `/etc` on whether we're using `dracut --rebuild`, base it directly on a boolean parameter. This is relevant in the client-side when initramfs regeneration is requested as well as a kernel override. In such cases, we do want to use the local `/etc`, but we'd skip that path because we didn't also use `dracut --rebuild`. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1806588
We're hitting issues with packages getting tagged out of the pool: https://pagure.io/releng/issue/9281 This in turn means we can't reliably recompose older builds right now, which breaks our CI. For now at least, let's compose from the latest. (Note we were already also composing the latest FCOS in the vmcheck branch.)
6fe9bcc to
52bec19
Compare
|
Had to push another commit here to work around https://pagure.io/releng/issue/9281. Though I also took the opportunity to drop a stale comment I had added. |
|
/lgtm |
It's the latest, and matches the rest of the host we're running on. But also, pulling f30 is hitting 503s from the Fedora registry: https://pagure.io/releng/issue/9282
|
OK, had to add yet another commit here to fix testing. 😢 Hopefully this is the one! |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, jlebon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@jlebon I assume this should also work for initramfs --enable --arg=-I --arg="/etc/foo.conf /etc/bar.conf" right ? |
|
@yanirq Yup, I could've probably tweaked the config to use that. But note: https://bugzilla.redhat.com/show_bug.cgi?id=1806588#c6 |
Instead of basing our decision to use the local
/etcon whether we'reusing
dracut --rebuild, base it directly on a boolean parameter.This is relevant in the client-side when initramfs regeneration is
requested as well as a kernel override. In such cases, we do want to use
the local
/etc, but we'd skip that path because we didn't also usedracut --rebuild.Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1806588