-
Notifications
You must be signed in to change notification settings - Fork 158
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
Make handling of boot=
and root=
kargs idempotent
#2141
Conversation
Hmm, so this is to support a Re. this PR specifically, the use of |
Yep, I plan to get something scheduled for this soon this month!
This scenario arises when one boots one FCOS-derived system, and is using it to install to a different disk. But this isn't critical to merge soon, so I just marked as draft. |
c3b40d2
to
5ecb25b
Compare
In this case, we shouldn't have anything to do. This is needed for `bootc install` which currently sets up these kargs in advance. containers/bootc#30
This will be used with bootc which will default to injecting a karg for `boot`.
For bootc compatibility.
We can assume the disk image is already set up in this case.
5ecb25b
to
d01094a
Compare
OK, lifting draft on this one. |
# Copied from | ||
# https://github.com/dracutdevs/dracut/blob/9491e599282d0d6bb12063eddbd192c0d2ce8acf/modules.d/99base/dracut-lib.sh#L586 | ||
# rather than sourcing it. | ||
label_uuid_to_dev() { |
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.
Maybe this should move to rdcore or so?
boot=
karg idempotentboot=
and root=
kargs idempotent
Hm, not seeing the failure there in the logs. |
|
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.
Seems like the last two commits could be merged?
@@ -9,6 +9,7 @@ After=ignition-disks.service | |||
# If we've reprovisioned the rootfs, then there's no need to restamp | |||
ConditionPathExists=!/run/ignition-ostree-transposefs | |||
ConditionKernelCommandLine=!rootfs.roothash | |||
ConditionKernelCommandLine=!root |
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 this would break multipath, where currently you have to put the root
karg at install time but we do still want the restamping. Is this actually required for bootc? The service will run but the script should no-op if the filesystem UUID was already randomized.
Similarly for coreos-gpt-setup.service
.
} | ||
|
||
# This is copied from coreos-boot-mount-generator which we should likely run | ||
# in the initramfs too |
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.
Yeah, I think that'd be a safer path. This seems to be trying to undo the assumption that /dev/disk/by-label/boot
points to our boot disk at first boot, but only for one service, whereas it's an assumption embedded all over the place. The generator could put the found device in e.g. /run/coreos/bootdev
?
*) echo "Unknown boot karg '${bootkarg}'; falling back to ${bootdev}";; | ||
esac | ||
# This is used for the first boot only | ||
elif [ -f /run/coreos/bootfs_uuid ]; then |
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.
This is written by coreos-boot-edit
and isn't relevant here.
For now, won't be targeting FCOS with |
dracut/boot-edit: Do nothing if we have a boot= karg
In this case, we shouldn't have anything to do. This is needed
for
bootc install
which currently sets up these kargs in advance.containers/bootc#30
dracut/ignition-setup: Use boot= karg if it exists
This will be used with bootc which will default to injecting
a karg for
boot
.ignition-uuid-root: no-op if we already have a root= karg
For bootc compatibility.
overlay: More no-ops if we have a boot= and/or root= karg
We can assume the disk image is already set up in this case.