-
Notifications
You must be signed in to change notification settings - Fork 170
Virtual Media Changes #489
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
base: main
Are you sure you want to change the base?
Conversation
What is the goal for the flag "/boot/usb.disk0.disabled"? |
Was trying to think, why did i do that ... I don't know all of how /boot/usb.disk0 is created, i could see it was created in virtual-device.go But, now it won't be, as that flag / logic will manage usb.disk1 instead. Additionally, i did not want to force enable the device, in the event an end-user wants to intentionally disable it. So, i gave the end-user an option to intentionally disable it. Hopefully that all makes sense, it was in consideration of both fresh / upgrade paths given the changes in virtual-device.go |
All flags in the /boot directory are user flags. The use should be able to control them via web interface or by manually creating/removing the file. |
sure, sounds good, ill make the changes |
2105cb5
to
86fc3b9
Compare
backend config for media control remove .disabled adding settings toggle add default text
6c98e87
to
a1df637
Compare
I compiled and tested it on my hardware. tpretz@a1df637#diff-50bcb645637346967e20608b5b6ebf3f3e6e1ddc540587458ece34def162dc29R19 The kernel does not accept empty image, this can be solved by using a new line (like echo does in the shell): tpretz@a1df637#diff-50bcb645637346967e20608b5b6ebf3f3e6e1ddc540587458ece34def162dc29L108 Enabling CD-ROM mode does not work after reboot. |
That second problem would be a shame, ill take a look into it. I would really like to avoid resetting the USB gadget, partly due to some bad bios behaviors on some of my hardware, but also because, it would reset the SD card media device that could be in-use and ideally would not be disrupted by changes in virtual media attachment. |
Can you expand on the issues with cdrom mode after reboot? Testing the USB gadget behavior manually, to see what its limitations are, i have swapped from cdrom to non-cdrom (and ro off and on) without needing to reset anything (apart from making sure "file" is unset before changing the cdrom and ro options). Virtual media won't be re-mounted after KVM reboot. I wonder if the imageNone problem is related, as if the image is not unmounted first then the change of cdrom and ro flags won't work. (ah, perhaps not there is an explicit newline written before) |
set imageNone to newline
Yes, i am aware of "Virtual media won't be re-mounted after KVM reboot." and this can be handled in a different PR/issue, not here. The cdrom issue can be easily reproduced:
Windows on target machine will recognize this but it is show as "unformatted" disk. |
Can't seem to reproduce it myself
what do you have matching /boot/usb.* ? although as long as /boot/usb.disk0 exists that should be sufficient to create whats needed for the server i will clean up a little more in image.go, not that it should have any impact on functionality |
I build NanoKVM from sources (with my buildroot) and replace the full /kvmapp folder and the init.d scripts. |
i don't think that will make any difference, it was just cleanup of unused code Ill do a fresh build from img on a test device tomorrow. No errors logged ?, especially around the "unmount image failed" ? If you could confirm that /etc/init.d/S03usbdev is the new version (given its copied from kvmapp) i have been caught out by not updating it. |
Yes, I can confirm S03usbdev is the new version. The strange thing is: If I put the "Virtual Image" switch off and on again and CD-ROM mode works, I do not need to reset again. After this I can switch from/to CD-ROM mode without reset. |
This reverts commit 7771d1f.
This makes a bit more sense, KVM is applying changes but running into host USB / OS behavioural differences. How about this commit?
|
Yes, I think this i a good approach. |
This PR's goal is to help address issues i have, only with specific hardware, losing HID connectivity when virtual media is inserted.
As part of debugging this problem, i split the mounting of SD card (virtual media toggle in settings) from iso virtual media.
This allows for SD card mounting to remain off (most cases i suspect people won't require it).
But still inject CDROM / boot media as required.
This change also removes the full reset of the USB gadget when boot media is inserted / ejected
I have tested, but only on the one device where i have had issues, and it seems to resolve them in most cases.
Multiple mass storage devices when both SD and boot media are attached.
Boot media can be changed without "replug" events on hid devices.
Unmount of media thats in use does still fail (as it did before) and may require a hid reset to force.
I can see a fix has been merged https://patchwork.kernel.org/project/linux-usb/patch/[email protected]/ which would allow for reliable unmounting of media. However thats not available in the current kernel version used.