baskerville / plato

Document reader
Other
1.27k stars 107 forks source link

usb disconnection crash #190

Closed tobald closed 3 years ago

tobald commented 3 years ago

Disconnecting usb cable crashes plato, even when no file file is added/removed to the device. I am using clara hd and tried a recent and an old firmware.

Can't reload database: can't open file /mnt/onboard/.metadata.json: No such file or directory (os error 2).
Remove entry: 4E5A44320000160C, misc/plato_GUIDE.md at master · baskerville_plato.epub.
Remove entry: (...)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/library.rs:343:60

Host says:

aoû 29 15:21:08 pad kernel: FAT-fs (sdb): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Lauched usb-enable.sh manually and spotted the usb-disable LOADED_MODULE variable, fix attached below :

[admin@nova scripts]# ./usb-enable.sh 
[admin@nova scripts]# grep -oE '\bg_(file|mass)_storage\b' /proc/modules
g_file_storage
g_file_storage
g_file_storage
[admin@nova scripts]# cat /proc/modules 
g_file_storage 4248 0 - Live 0x7f85f000
usb_f_mass_storage 38129 2 g_file_storage, Live 0x7f84e000
libcomposite 45183 2 g_file_storage,usb_f_mass_storage, Live 0x7f83b000
configfs 23773 3 usb_f_mass_storage,libcomposite, Live 0x7f830000
8189fs 1358749 0 - Live 0x7f6a6000 (O)
sdio_wifi_pwr 593 0 - Live 0x7f6a2000