-
Notifications
You must be signed in to change notification settings - Fork 72
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
recovery shell: ESP mount helper and tab completion #558
Conversation
a8d355f
to
ce3225c
Compare
I think this belongs somewhere other than At some point, it would be good to audit the ZBM library and relocate other functions as appropriate. Having the recovery shell dump errors right to the console, maybe colored red, would be an awesome feature. |
I linked this on IRC, but I'll add it here so that it's more accessible to the discussion at hand: Functions in zfsbootmenu-core.sh and their callers
|
My impetus for adding Based on the list above, |
If |
ce3225c
to
ebb17b9
Compare
I've added the relevant kernel modules for mounting an ESP to the optional modules list in |
I still don't know how these modules wind up in the release or recovery images, but including the modules explicitly if they are available seems like a good idea. |
I'm not sure how they're getting in there, either. I thought we were explicitly adding them in to the release/recovery images, but that's not the case. It's probably worth it to make them a hard requirement for release/recovery images on top of the best-effort installation effort that's the default. |
deb1389
to
77be7ba
Compare
Add a mount_esp helper with tab completion. This is a very thin wrapper over the new mount_block function. Add the relevant kernel modules to the optional modules list for both dracut and mkinitcpio images. Explicitly add the same modules to the release/recovery shared config.
77be7ba
to
cd6d101
Compare
Add a
mount_esp
function that mounts/dev/sdxY
at/mnt/sdxY
if nothing else is mounted there. If the device is already mounted, return the mountpoint. The shell completion helper only completes unmounted ESP devices.Unmounting the device is left as an exercise to the user. I'm interested in a reasonable argument for handling this when exiting the recovery shell, like we do for ZFS datasets.
The mount operation is possibly going to be a problem. I'm trapping errors and dumping them to the console, but that's not super graceful.
Edit:
Thinking about this more, I should log all errors via
zerror
and then add something to the recovery shell prompt that evaluates ifhas_errors
is set - if it is, dump the errors to the console and then clear the flag. This lets internal functions still Do The Right Thing if they're called by a program, but still have a mechanism for exposing their error text to a human operator if needed.