-
Notifications
You must be signed in to change notification settings - Fork 311
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
lib/sysroot: Support /usr/lib/modules/$kver for kernel/initramfs #1079
Conversation
Oh ug, the uboot code looks in |
2722ec5
to
b0e1cc7
Compare
Reworked this. |
docs/manual/deployment.md
Outdated
First, the tree must include a kernel stored as | ||
`vmlinuz(-.*)?-$checksum` in either `/boot` or `/usr/lib/ostree-boot`. | ||
First, the tree must include a kernel (and optionally an initramfs). The | ||
current standard locations for this is `/usr/lib/modules/$kver/vmlinuz` and |
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.
Nit: s/this is/these are/ ?
* with rpm-ostree with Fedora today, until rpm-ostree learns the new layout. | ||
*/ | ||
g_autoptr(OstreeKernelLayout) legacy_layout = g_new0 (OstreeKernelLayout, 1); | ||
legacy_layout->boot_dfd = -1; |
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.
/me puts on Coverity hat
This feels like it deserves an _ostree_kernel_layout_new ()
to be safe, though up to you!
} | ||
} | ||
|
||
/* ret_boot_dfd will point to either /usr/lib/ostree-boot or /boot, let's |
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.
s/ret_boot_dfd/legacy_layout->boot_dfd/
g_auto(GLnxDirFdIterator) dfditer = { 0, }; | ||
if (!glnx_dirfd_iterator_init_at (ret_boot_dfd, ".", FALSE, &dfditer, error)) | ||
if (!glnx_dirfd_iterator_init_at (legacy_layout->boot_dfd, ".", FALSE, &dfditer, error)) | ||
return FALSE; | ||
|
||
while (TRUE) |
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.
Could we factor this out as well into a separate function similar to get_kernel_from_tree_usrlib_modules
that spits out the legacy_layout
? Would make this function much nicer to read if it just has the business logic.
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.
Yep, definitely looks nicer. Update ⬇️
This is the new Fedora kernel standard layout; it has the advantage of being in `/usr` like `/usr/lib/ostree-boot`, but it's not OSTree specific. Further, I think in practice forcing tree builders to compute the checksum is an annoying stumbling block; since we already switched to e.g. computing checksums always when doing pulls, the cost of doing another checksum for the kernel/initramfs is tiny. The "bootcsum" becomes more of an internal implementation detail. Now, there is a transition; my current thought for this is that rpm-ostree will change to default to injecting into both `/usr/lib/ostree-boot` and `/usr/lib/modules`, and stop doing `/boot`, then maybe next year say we drop the `/usr/lib/ostree-boot` by default. A twist here is that the default Fedora kernel RPM layout (and what's in rpm-ostree today) includes a kernel but *not* an initramfs in `/usr/lib/modules`. If we looked only there, we'd just find the kernel. So we need to look in both, and then special case this - pick the legacy layout if we have `/usr/lib/modules` but not an initramfs. While here, rework the code to have an `OstreeKernelLayout` struct which makes dealing with all of the variables nicer.
b0e1cc7
to
ae00359
Compare
Nice! @rh-atomic-bot r+ ae00359 |
⌛ Testing commit ae00359 with merge 3ab0d5e... |
☀️ Test successful - status-atomicjenkins |
Follow up to <ostreedev#1079>; I was working on the rpm-ostree updates for this, and I think it's more consistent if we have `.img` here, since that's a closer match to the "remove $kver" that results in `vmlinuz`. Also just best practice to have file suffix types where they make sense. The astute reader might notice this sneaks in a change where we'd crash if the legacy bootdir didn't have an initramfs...yeah, should probably have test coverage of that.
Follow up to <#1079>; I was working on the rpm-ostree updates for this, and I think it's more consistent if we have `.img` here, since that's a closer match to the "remove $kver" that results in `vmlinuz`. Also just best practice to have file suffix types where they make sense. The astute reader might notice this sneaks in a change where we'd crash if the legacy bootdir didn't have an initramfs...yeah, should probably have test coverage of that. Closes: #1095 Approved by: jlebon
Follow up to <#1079>; I was working on the rpm-ostree updates for this, and I think it's more consistent if we have `.img` here, since that's a closer match to the "remove $kver" that results in `vmlinuz`. Also just best practice to have file suffix types where they make sense. The astute reader might notice this sneaks in a change where we'd crash if the legacy bootdir didn't have an initramfs...yeah, should probably have test coverage of that. Closes: #1095 Approved by: jlebon
This is the new default; we end up with the kernel data in only once place. See the treefile docs as well as ostreedev/ostree#1079 and discussion in ostreedev/ostree#1873
This is the new default; we end up with the kernel data in only once place. See the treefile docs as well as ostreedev/ostree#1079 and discussion in ostreedev/ostree#1873
This is the new default; we end up with the kernel data in only once place. See the treefile docs as well as ostreedev/ostree#1079 and discussion in ostreedev/ostree#1873
This is the new Fedora kernel standard layout; it has the advantage
of being in
/usr
like/usr/lib/ostree-boot
, but it's not OSTreespecific.
Further, I think in practice forcing tree builders to compute the checksum is an
annoying stumbling block; since we already switched to e.g. computing checksums
always when doing pulls, the cost of doing another checksum for the
kernel/initramfs is tiny. The "bootcsum" becomes more of an internal
implementation detail.
Now, there is a transition; my current thought for this is that rpm-ostree will
change to default to injecting into both
/usr/lib/ostree-boot
and/usr/lib/modules
, and stop doing/boot
, then maybe next year say we drop the/usr/lib/ostree-boot
by default.