-
Notifications
You must be signed in to change notification settings - Fork 598
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
core-initrd,snap-bootstrap: look at env to mount directly to /sysroot #15076
base: master
Are you sure you want to change the base?
core-initrd,snap-bootstrap: look at env to mount directly to /sysroot #15076
Conversation
@ZeyadYasser this is probably the situation that you hit (24 kernel used in a 22 model). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15076 +/- ##
=========================================
Coverage ? 78.14%
=========================================
Files ? 1173
Lines ? 157782
Branches ? 0
=========================================
Hits ? 123296
Misses ? 26838
Partials ? 7648
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Wed Feb 19 15:45:59 UTC 2025 Failures:Preparing:
Executing:
Restoring:
|
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.
thanks, I think we want to keep a comment in the code why we are doing it this way, because is not super obvious
return false | ||
default: | ||
func createSysrootMount() bool { | ||
isCore24plus := osGetenv("CORE24_PLUS_INITRAMFS") |
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.
I think we want a comment in code here, why we want to this based on initramfs and not the UC/hybrid version
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.
Good point, I've added a comment
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.
+1 from me
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.
LGTM, Thank you!
I tested it against the exact scenario (core22 base with a 24 kernel) and it passed installation and first boot. Test used for testing is from #14867.
case "core20", "core22", "core22-desktop": | ||
return false | ||
default: | ||
func createSysrootMount() bool { |
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.
func createSysrootMount() bool { | |
func shouldCreateSysrootMount() bool { |
if isCore24plus == "1" || isCore24plus == "true" { | ||
return true | ||
} | ||
return false |
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 isCore24plus == "1" || isCore24plus == "true" { | |
return true | |
} | |
return false | |
return isCore24plus == "1" || isCore24plus == "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.
Changed
Previously we looked at the model and mounted base/rootfs directly if it was Ubuntu 24+. Now, we check instead an environment variable that is set if the initramfs is 24+. This is done so now the kernels that contain the 24+ initramfs can be booted in older Ubuntu releases with older bases. This situation is not something we really support, as the systemd of the initramfs will not match the one in the system, but it is something that could happen while remodeling and it seems safer to allow this at least temporarily.
9f90c64
to
5dfbe1e
Compare
Previously we looked at the model and mounted base/rootfs directly if it was Ubuntu 24+. Now, we check instead an environment variable that is set if the initramfs is 24+.
This is done so now the kernels that contain the 24+ initramfs can be booted in older Ubuntu releases with older bases. This situation is not something we really support, as the systemd of the initramfs will not match the one in the system, but it is something that could happen while remodeling and it seems safer to allow this at least temporarily.