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

Fix crash when ESP is not mounted #156

Merged
merged 2 commits into from
Aug 28, 2022
Merged

Conversation

WhyNotHugo
Copy link
Contributor

Generating a new bundle with an unmounted ESP would crash trying to find
one, even if one was explicitly specified.

This was due to Bundle instances always being created with a discovered
ESP path. However, this path is always overwritten based on the value
provided by the user, meaning that this default is unused and always
overwritten.

This changes NewBundle to simply use an empty ESP if finding one fails.
This has no impact on sbctl itself. This change COULD impact
applications using this codes as a library, but this only affects code
that previously panicked.

Fixes: #132

The previous rule setup SHOULD work, but I found several tools messed up
and were ignoring `cmd/sbctl`. E.g.: `ag` did not recurse into it when
searching.
Generating a new bundle with an unmounted ESP would crash trying to find
one, even if one was explicitly specified.

This was due to Bundle instances always being created with a discovered
ESP path. However, this path is always overwritten based on the value
provided by the user, meaning that this default is unused and always
overwritten.

This changes NewBundle to simply use an empty ESP if finding one fails.
This has no impact on `sbctl` itself. This change COULD impact
applications using this codes as a library, but this only affects code
that previously panicked.

Fixes: #132
@Foxboron Foxboron merged commit 099d6d9 into Foxboron:master Aug 28, 2022
@WhyNotHugo WhyNotHugo deleted the unmounted-esp branch August 28, 2022 12:59
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.

Generating a bundle fails if an ESP is not mounted
2 participants