-
Notifications
You must be signed in to change notification settings - Fork 157
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
30ignition-coreos: Add coreos-boot-edit.{service,sh}
#743
30ignition-coreos: Add coreos-boot-edit.{service,sh}
#743
Conversation
9b682d8
to
416b77c
Compare
overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-cleanup-firstboot-network.sh
Outdated
Show resolved
Hide resolved
hmm. I wonder if we could just do something similar to what i.e. there was a lot of logic put in there to make sure we ran after Ignition was complete, we may want to re-use some of it. |
....d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-cleanup-firstboot-network.service
Outdated
Show resolved
Hide resolved
....d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-cleanup-firstboot-network.service
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-cleanup-firstboot-network.sh
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/15coreos-network/coreos-cleanup-firstboot-network.sh
Outdated
Show resolved
Hide resolved
@dustymabe sorry I didn't really follow. Did you mean that the current |
It should be fine, but to me it would be nice to only clean up these files once all stages of Ignition have run. Maybe |
ah got it. I guess it wouldn't hurt to be safer? |
Meh, I'm fine either way really. Like I mentioned in IRC, I think a fundamental difference here from the network teardown one (and the |
We would like to mount `/boot` read-only in the real root, so remove the current 15-coreos-firstboot-network.conf since it would not work once `/boot` is mounted ro. Drop a stamp file instead so that `coreos-boot-edit.service` would notice and perform the clean up later in the initramfs. xref coreos#659
416b77c
to
7e684bf
Compare
coreos-boot-edit.{service,sh}
overlay.d/05core/usr/lib/dracut/modules.d/30ignition-coreos/coreos-boot-edit.service
Outdated
Show resolved
Hide resolved
overlay.d/05core/usr/lib/dracut/modules.d/30ignition-coreos/coreos-boot-edit.service
Outdated
Show resolved
Hide resolved
`coreos-boot-edit.service` will run late in the initrd process after Ignition is completed successfully and temporarily mount /boot read-write to make edits in (e.g. removing firstboot networking configuration files if necessary).
7e684bf
to
4e38b36
Compare
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!
@@ -36,4 +36,11 @@ install() { | |||
# units only started when we have a boot disk | |||
# path generated by systemd-escape --path /dev/disk/by-label/root | |||
install_ignition_unit coreos-gpt-setup.service ignition-diskful.target | |||
|
|||
inst_script "$moddir/coreos-boot-edit.sh" \ | |||
"/usr/sbin/coreos-boot-edit" |
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.
Hmm, this should probably be /usr/libexec
instead, but not worth a respin! :)
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 overall but is there any specific reason to not directly always remove the files? I don't think we need to be extra careful here.
# Since we are mounting /boot, require the device first | ||
Requires=dev-disk-by\x2dlabel-boot.device | ||
After=dev-disk-by\x2dlabel-boot.device |
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 don't think that's needed with After=ignition-files.service
. But this probably does not hurt either.
@travier I think you're right. The stamp file seems a bit unnecessary now. It was originally there because we could potentially not run the service that removes those files if there are no files to clean up in |
Unnecessary complexity may lead to issues but things here looks fine. We will revisit later if needed. |
…etwork.stamp That way we completely avoid mounting `/boot` rw if we don't need to. Also clarify comment about the boot dependency. Additional roles for this service ideally would follow the same pattern. Minor follow-up to coreos#743.
I think the stamp file is useful so that we can make this whole unit conditional: #745. |
coreos-boot-edit.service
will run late in the initrd process afterIgnition is completed successfully and temporarily mount /boot read write
to make edits (e.g. removing firstboot networking configuration
files if necessary).
We would like to mount
/boot
read-only in the real root,so remove the current 15-coreos-firstboot-network.conf since
it would not work once
/boot
is mounted ro. Drop a stampfile instead so that
coreos-boot-edit.service
would noticeand perform the clean up later in the initramfs.
xref #659