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

dracut/ignition-ostree: Regenerate UUIDs for /boot and / #354

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

This is a general best practice; the intention of filesystem
UUIDs is that they're unique. It helps backup systems and the like
if we change this.

But in the future, we may also switch to using these UUIDs for subsequent
boots; see: coreos/fedora-coreos-tracker#465

ConditionKernelCommandLine=ostree
ConditionPathExists=!/run/ostree-live
# We run pretty early
Before=coreos-copy-firstboot-network.service
Copy link
Member Author

Choose a reason for hiding this comment

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

If we switch to having a boot.mount in the initramfs then this would just be:
Before=boot.mount.

@dustymabe
Copy link
Member

If we switch to having a boot.mount in the initramfs then this would just be:
Before=boot.mount.

Yeah I'm in favor of a boot.mount I think.

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Independent of coreos/fedora-coreos-tracker#465, I think this is a good idea. LGTM overall, just one nit!

ConditionPathExists=!/run/ostree-live
# We run pretty early
Before=coreos-copy-firstboot-network.service
Before=ignition-fetch.service
Copy link
Member

Choose a reason for hiding this comment

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

Minor: we don't need this ordering here. It's already implied by being ordered Before=ignition-setup-{base,user}.service below. (This is harmless of course, but it's a pet peeve of mine to have ordering requirements like this which seem to imply the order of all the Ignition stages aren't in fact strictly ordered.)

Copy link
Contributor

@darkmuggle darkmuggle left a comment

Choose a reason for hiding this comment

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

I like this idea. Let's ship it.

cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request May 13, 2020
For reasons I don't fully understand, trying to use
`tune2fs -U random /dev/disk/by-label/boot` fails without
this explicit fsck step, even though the filesystem appears
cleanly unmounted.

This is for coreos/fedora-coreos-config#354
to regenerate the UUID of `/boot` on firstboot.

Anyways, explicitly unmounting things seems better than relying
on `umount -R` to sort it, and having a `fsck` on `/boot` is
cheap.
cgwalters added a commit to cgwalters/coreos-assembler that referenced this pull request May 13, 2020
For reasons I don't fully understand, trying to use
`tune2fs -U random /dev/disk/by-label/boot` fails without
this explicit fsck step, even though the filesystem appears
cleanly unmounted.

This is for coreos/fedora-coreos-config#354
to regenerate the UUID of `/boot` on firstboot.

Anyways, explicitly unmounting things seems better than relying
on `umount -R` to sort it, and having a `fsck` on `/boot` is
cheap.
@cgwalters
Copy link
Member Author

Whee, some sort of race in an unrelated test:

"Found device /dev/disk/by-label/boot."
"Starting Ignition OSTree: Regenerate filesystem UUID (boot)..."
"Missed 5 kernel messages"
" vda: vda1 vda2 vda3 vda4"
"audit: type=1130 audit(1589409301.519:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=ignition-ostree-uuid-boot comm=\"systemd\" exe=\"/usr/lib/systemd/systemd\" hostname=? addr=? terminal=? res=failed'"
"SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=ignition-ostree-uuid-boot comm=\"systemd\" exe=\"/usr/lib/systemd/systemd\" hostname=? addr=? terminal=? res=failed'"
"ignition-ostree-uuid-boot.service: Main process exited, code=exited, status=1/FAILURE"
"/usr/sbin/ignition-ostree-firstboot-uuid: Failed to find block device /dev/disk/by-label/boot"
"ignition-ostree-uuid-boot.service: Failed with result 'exit-code'."
"Failed to start Ignition OSTree: Regenerate filesystem UUID (boot)."

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Looks sane to me! Just one minor comment (there was also #354 (comment) from a previous review).

Comment on lines 17 to 23
regenerate_uuid_if() {
local path=$1
shift


}

Copy link
Member

Choose a reason for hiding this comment

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

Extraneous?

This is a general best practice; the intention of filesystem
UUIDs is that they're unique.  It helps backup systems and the like
if we change this.

This builds on coreos/coreos-assembler@e3905fd

In the future, we may also switch to using these UUIDs for subsequent
boots; see: coreos/fedora-coreos-tracker#465
@jlebon
Copy link
Member

jlebon commented Jul 2, 2020

This is now part of #503.

@jlebon jlebon closed this Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants