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

grub: support searching for boot by UUID #2524

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Oct 29, 2021

This adds support for a boot_uuid dropin sitting alongside both the
BIOS and EFI GRUB configs to specify the UUID to scan for instead of
relying on labels.

Part of coreos/fedora-coreos-tracker#976.

@openshift-ci
Copy link

openshift-ci bot commented Oct 29, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

src/create_disk.sh Outdated Show resolved Hide resolved
bgilbert
bgilbert previously approved these changes Nov 9, 2021
Copy link
Contributor

@bgilbert bgilbert left a comment

Choose a reason for hiding this comment

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

We should make sure to test this with petitboot; cc @coreos/multi-arch

@jlebon
Copy link
Member Author

jlebon commented Nov 9, 2021

Just updated the commit message on this because it was referencing the old filename. @Prashanth684 Would you be able to test this on ppc64le? Reach out to me on chat and we can work through it together.

@jlebon
Copy link
Member Author

jlebon commented Nov 22, 2021

Restarted CI! There's a new coreos-installer release in FCOS which can leverage this, so would be good to get this in soon.

@jlebon
Copy link
Member Author

jlebon commented Nov 22, 2021

So to test this:

  1. Build cosa with this patch plus this:
diff --cc src/create_disk.sh
index 567eb048a,567eb048a..c2778e541
--- a/src/create_disk.sh
+++ b/src/create_disk.sh
@@@ -321,8 -321,8 +321,10 @@@ els
      source ${config_directory}/boot_uuid
    fi
    if [ -n "${BOOT_UUID}" ]; then
++    echo "Searching boot device by UUID"
      search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
    else
++    echo "Searching boot device by label"
      search --label boot --set prefix --no-floppy
    fi
  fi
diff --cc src/grub.cfg
index eada7d19d,eada7d19d..215271bf5
--- a/src/grub.cfg
+++ b/src/grub.cfg
@@@ -23,8 -23,8 +23,10 @@@ els
      source ${config_directory}/boot_uuid
    fi
    if [ -n "${BOOT_UUID}" ]; then
++    echo "Searching boot device by UUID"
      search --fs-uuid "${BOOT_UUID}" --set boot --no-floppy
    else
++    echo "Searching boot device by label"
      search --label boot --set boot --no-floppy
    fi
  fi
  1. Build latest FCOS + coreos-boot-edit: run rdcore bind-boot fedora-coreos-config#1316, making sure that coreos-installer v0.11.0 gets pulled in
  2. Run cosa run -c
  3. Verify that the bootloader says "Searching boot device by label" on first boot.
  4. Run reboot in the VM
  5. Verify that the bootloader says "Searching boot device by UUID" on the subsequent boot.

@Prashanth684
Copy link
Contributor

So to test this:

  1. Build cosa with this patch plus this:
diff --cc src/create_disk.sh
index 567eb048a,567eb048a..c2778e541
--- a/src/create_disk.sh
+++ b/src/create_disk.sh
@@@ -321,8 -321,8 +321,10 @@@ els
      source ${config_directory}/boot_uuid
    fi
    if [ -n "${BOOT_UUID}" ]; then
++    echo "Searching boot device by UUID"
      search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
    else
++    echo "Searching boot device by label"
      search --label boot --set prefix --no-floppy
    fi
  fi
diff --cc src/grub.cfg
index eada7d19d,eada7d19d..215271bf5
--- a/src/grub.cfg
+++ b/src/grub.cfg
@@@ -23,8 -23,8 +23,10 @@@ els
      source ${config_directory}/boot_uuid
    fi
    if [ -n "${BOOT_UUID}" ]; then
++    echo "Searching boot device by UUID"
      search --fs-uuid "${BOOT_UUID}" --set boot --no-floppy
    else
++    echo "Searching boot device by label"
      search --label boot --set boot --no-floppy
    fi
  fi
  1. Build latest FCOS + coreos-boot-edit: run rdcore bind-boot fedora-coreos-config#1316, making sure that coreos-installer v0.11.0 gets pulled in
  2. Run cosa run -c
  3. Verify that the bootloader says "Searching boot device by label" on first boot.
  4. Run reboot in the VM
  5. Verify that the bootloader says "Searching boot device by UUID" on the subsequent boot.

tested on a p8 system and followed above steps and it works.

This adds support for a `bootuuid.cfg` dropin sitting alongside both the
BIOS and EFI GRUB configs to specify the UUID to scan for instead of
relying on labels.

Part of coreos/fedora-coreos-tracker#976.
@jlebon
Copy link
Member Author

jlebon commented Nov 22, 2021

Rebased for CI!

@jlebon jlebon merged commit 11f708b into coreos:main Nov 23, 2021
@jlebon jlebon deleted the pr/grub-boot-uuid branch November 23, 2021 14:26
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.

3 participants