-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snap-bootstrap: wait in
mountNonDataPartitionMatchingKernelDisk
* snap-bootstrap: wait in `mountNonDataPartitionMatchingKernelDisk` The current snap-bootstrap has a race when mounting the seed partition in `mountNonDataPartitionMatchingKernelDisk` on EFI systems. The code determines the partUUID of the disk that booted the kernel by reading the EFI LoaderDevicePartUUID variable. However there is no guarantee that this partition is available when snap-bootstrap runs, the kernel may still enumerate the HW. This can be observed on a fast NUC when booting from a USB stick. Note that the `the-tool.serice` already has a "After=systemd-udev-settle.service" set but that is still racy because any `udev settle` (or `udev trigger --settle`) is racy, the only option is to poll for the part uuid to appear. This is a minimal commit to avoid too much churn in code. Thanks to Sertac for reporting this bug. * snap-bootstrap: rework waitPartSrc to improve testing (thanks to Alberto and Ian) * snap-bootstrap: show a log message if waitPartSrc needs to wait If waitPartSrc needs to wait for the device this commit makes it show a logger.Noticef() message. The message is only shown once because waiting for the device is usually super quick and if it is not that is most likely an error anyway so spamming the terminal will not help. * snap-bootstrap: add test that ensures that if no waiting is needed for partSrc no log message is displayed * snap-bootstrap: rename waitPartSrc -> waitFile * snap-bootstrap: fix time.Duration() casting on 32bit systems
- Loading branch information
Showing
3 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters