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

compose: Include base dracut args in commitmeta #1997

Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Feb 26, 2020

Keep the base initramfs arguments used in the commit metadata. The
reasoning for this is that when regenerating the initramfs locally with
rpm-ostree initramfs --enable, we want to match how it was built in
the treecompose. This is important because the rest of the treecompose
assumes that e.g. certain dracut modules are included or omitted.

Right now, the way we achieve this is with using dracut --rebuild.
However, we no longer have access to the base initramfs when replacing
the kernel. Another issue with --rebuild is that when we do use it,
dracut just dumbly appends the arguments to the base args. So we then
end up with e.g. two --kver args, two --add ostree, two --tmpdir,
etc...

Another way to look at at this patch is that it unifies client-side and
server-side paths when generating the initramfs. The only difference
then is that we use the local /etc in the case of
rpm-ostree initramfs --enable.

@jlebon
Copy link
Member Author

jlebon commented Feb 26, 2020

Split out prep patches in #1998.

@jlebon
Copy link
Member Author

jlebon commented Feb 26, 2020

Another approach I didn't mention in the commit message was reading the initramfs args from /usr/share/rpm-ostree/treefile.json. But it'd actually be the first instance of rpm-ostree itself using that file as input for local composes. And I'm not sure if this is worth breaking away from that stance.

@jlebon jlebon force-pushed the pr/dracut-override-replace branch 2 times, most recently from b248d17 to 1725509 Compare February 27, 2020 04:06
@jlebon jlebon marked this pull request as ready for review February 27, 2020 14:13
@jlebon
Copy link
Member Author

jlebon commented Feb 27, 2020

OK, this one's ready to go!

Keep the base initramfs arguments used in the commit metadata. The
reasoning for this is that when regenerating the initramfs locally with
`rpm-ostree initramfs --enable`, we want to match how it was built in
the treecompose. This is important because the rest of the treecompose
assumes that e.g. certain dracut modules are included or omitted.

Right now, the way we achieve this is with using `dracut --rebuild`.
However, we no longer have access to the base initramfs when replacing
the kernel. Another issue with `--rebuild` is that when we *do* use it,
dracut just dumbly appends the arguments to the base args. So we then
end up with e.g. two `--kver` args, two `--add ostree`, two `--tmpdir`,
etc...

Another way to look at at this patch is that it unifies client-side and
server-side paths when generating the initramfs. The only difference
then is that we use the local `/etc` in the case of
`rpm-ostree initramfs --enable`.
Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense to me. I am a little uncomfortable at duplicating the "source of truth" since as discussed in the original PR lsinitrd on the base initramfs can already tell us what the arguments are, but eh, this is certainly way easier to parse.

src/daemon/rpmostree-sysroot-upgrader.c Show resolved Hide resolved
This is the second half of the previous commit. We check if the
canonical dracut args are available in the commit metadata, and prefer
those over using `--rebuild`. The latter is delegated as a backcompat
fallback.
@cgwalters
Copy link
Member

/lgtm

@jlebon
Copy link
Member Author

jlebon commented Feb 27, 2020

Sorry, I thought I had pushed the g_assert patch. But also something is screwy with GitHub and/or Jenkins and it was failing to check out the PR.

@cgwalters
Copy link
Member

/lgtm

@openshift-ci-robot
Copy link
Collaborator

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jlebon
Copy link
Member Author

jlebon commented Feb 27, 2020

Yup, CI is going to fail here. Will wait until #1999 is in then restart it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants