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

MSD not working #2

Open
stewartwatson321 opened this issue Apr 22, 2023 · 3 comments
Open

MSD not working #2

stewartwatson321 opened this issue Apr 22, 2023 · 3 comments

Comments

@stewartwatson321
Copy link

stewartwatson321 commented Apr 22, 2023

Hi

I am hoping you can help me. I cannot get MSD working - I have the error:

root@orangepizero2:~# systemctl status kvmd-otg
× kvmd-otg.service - PiKVM - OTG setup
     Loaded: loaded (/lib/systemd/system/kvmd-otg.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-04-22 10:48:54 UTC; 1min 53s ago
    Process: 697 ExecStart=/usr/bin/kvmd-otg start (code=exited, status=1/FAILURE)
   Main PID: 697 (code=exited, status=1/FAILURE)
        CPU: 1.777s

Apr 22 10:48:54 orangepizero2 kvmd-otg[697]:     _chown(join(func_path, "lun.0/forced_eject"), user)
Apr 22 10:48:54 orangepizero2 kvmd-otg[697]:   File "/usr/local/lib/python3.10/dist-packages/kvmd/apps/otg/__init__.py", line 55, in _chown
Apr 22 10:48:54 orangepizero2 kvmd-otg[697]:     shutil.chown(path, user)
Apr 22 10:48:54 orangepizero2 kvmd-otg[697]:   File "/usr/lib/python3.10/shutil.py", line 1375, in chown
Apr 22 10:48:54 orangepizero2 kvmd-otg[697]:     os.chown(path, _user, _group)
Apr 22 10:48:54 orangepizero2 kvmd-otg[697]: FileNotFoundError: [Errno 2] No such file or directory: '/sys/kernel/config/usb_gadget/kvmd/functions/mass_storage.usb0/lun.0/forced_eject'
Apr 22 10:48:54 orangepizero2 systemd[1]: kvmd-otg.service: Main process exited, code=exited, status=1/FAILURE
Apr 22 10:48:54 orangepizero2 systemd[1]: kvmd-otg.service: Failed with result 'exit-code'.
Apr 22 10:48:54 orangepizero2 systemd[1]: Failed to start PiKVM - OTG setup.
Apr 22 10:48:54 orangepizero2 systemd[1]: kvmd-otg.service: Consumed 1.777s CPU time.

I can bypass this by commenting line 188 in /usr/local/lib/python3.10/dist-packages/kvmd/apps/otg/init.py

_if user != "root":
            _chown(join(func_path, "lun.0/cdrom"), user)
            _chown(join(func_path, "lun.0/ro"), user)
            _chown(join(func_path, "lun.0/file"), user)
#added comment here#            _chown(join(func_path, "lun.0/forced_eject"), user)_

but this causes other problems.

Any ideas/suggestions?

Thanks!

@0x676e67
Copy link
Owner

I don't have a solution at the moment

@stewartwatson321
Copy link
Author

stewartwatson321 commented Apr 25, 2023

Hi, in case it helps anyone, the problem is that forced_eject is not present in kernel version < 6.2.x.
It can be applied to lower version kernel with this kernel patch:

https://github.com/pikvm/packages/blob/master/packages/linux-rpi-pikvm/2002-usb-gadget-f_mass_storage-forced-eject.patch

@0x676e67
Copy link
Owner

Hi, in case it helps anyone, the problem is that forced_eject is not present in kernel version < 6.2.x.嗨,如果它对任何人有帮助,问题是内核版本 < 6.2.x 中不存在forced_eject。 It can be applied to lower version kernel with this kernel patch:可以使用此内核补丁将其应用于较低版本的内核:

https://github.com/pikvm/packages/blob/master/packages/linux-rpi-pikvm/2002-usb-gadget-f_mass_storage-forced-eject.patch

The BSP kernel hits this pudding, and the OTG analog HID fails

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

No branches or pull requests

2 participants