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

build_library/grub_install: Try mounting ESP directory in a loop #1267

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented Oct 13, 2023

Apparently successful [[ -b "${LOOP_DEV}p1" ]] check is not enough - the mount can still fail. So instead of doing those checks, try mounting and reprobing in the loop with some small exponential backoffs.

Tested in http://jenkins.infra.kinvolk.io:8080/job/container/job/image/3905/

09:08:56  INFO    grub_install.sh: Installing GRUB arm64-efi in flatcar_production_image.bin
09:08:56  mount: /tmp/tmp.zIJJtMzPZe: special device /dev/loop0p1 does not exist.
09:08:56         dmesg(1) may have more information after failed mount system call.
09:08:56  WARNING grub_install.sh: loopback device node /dev/loop0p1 still missing, reprobing...
09:08:56  INFO    grub_install.sh: Compressing modules in flatcar/grub/arm64-efi
09:08:58  INFO    grub_install.sh: Generating flatcar/grub/arm64-efi/load.cfg

Apparently successful `[[ -b "${LOOP_DEV}p1" ]]` check is not enough -
the mount can still fail. So instead of doing those checks, try
mounting and reprobing in the loop with some small exponential
backoffs.
@krnowak krnowak added the main label Oct 13, 2023
@krnowak krnowak requested a review from a team October 13, 2023 07:10
@krnowak krnowak merged commit 612164c into main Oct 13, 2023
1 check failed
@krnowak krnowak deleted the krnowak/grub-install-workarounds branch October 13, 2023 08:06
fi
warn "loopback device node ${LOOP_DEV}p1 still missing, reprobing..."
sudo blockdev --rereadpt "${LOOP_DEV}"
Copy link
Member

Choose a reason for hiding this comment

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

If you want to be sure that it succeeds, use sudo partprobe "${LOOP_DEV}" because blockdev can fail with BLKRRPART: Device or resource busy

Copy link
Member

Choose a reason for hiding this comment

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

(Had the same problem with Ignition creating partitions on the boot device)

Copy link
Member Author

Choose a reason for hiding this comment

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

We can revisit this, if issues with grub install script crop up again.

krnowak added a commit that referenced this pull request Oct 18, 2023
build_library/grub_install: Try mounting ESP directory in a loop
krnowak added a commit that referenced this pull request Oct 18, 2023
build_library/grub_install: Try mounting ESP directory in a loop
krnowak added a commit that referenced this pull request Oct 18, 2023
build_library/grub_install: Try mounting ESP directory in a loop
krnowak added a commit that referenced this pull request Oct 18, 2023
build_library/grub_install: Try mounting ESP directory in a loop
@krnowak
Copy link
Member Author

krnowak commented Oct 18, 2023

Backported to 3033, 3510, 3602 and 3745.

@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants