02-01-2017, 03:17 PM | #31 | |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
Edit: I guess I mistook "at the same time". I meant to say you can use the virtual sd, when the real sd is inserted. But now I see that you rather meant that you can access the content of both at the same time Last edited by tshering; 02-01-2017 at 04:10 PM. |
|
02-01-2017, 03:28 PM | #32 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Maybe, but Kobo puts some data, creates some subdirs on /mnt/sd after the mount, so I don't know what happens when a virtual sd is mounted in a subdir of /mnt/sd
|
Advert | |
|
02-01-2017, 03:33 PM | #33 | |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Quote:
|
|
02-01-2017, 03:40 PM | #34 |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Taking a sub folder of /mnt/sd as mount point, as advised by Frostschutz, seems to have solved my problem with the library not updating after remounting the virtual sd.
Last edited by tshering; 02-01-2017 at 03:49 PM. |
02-01-2017, 04:22 PM | #35 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
What if you mount /mnt/onboad/.mysd to /mnt/sd/virtual, then after nickel does the content update, you execute this sql query:
Code:
UPDATE content SET ContentID = REPLACE(ContentID,'/mnt/sd/virtual/','/mnt/onboard/.mysd/'), BookID = REPLACE(BookID,'/mnt/sd/virtual/','/mnt/onboard/.mysd/'); UPDATE Activity SET Id = REPLACE(Id,'/mnt/sd/virtual/','/mnt/onboard/.mysd/'); I tried, but edited the database offline, then copied back over ftp, rebooted, and it works. So it should work on Kobo itself with a script. EDIT: I tried the query on the Kobo itself, and it works. nickel needs a restart tho to see the changes. It would be good to detect when nickel finishes the content update from the virtual sd, so we could execute a script with the query and make a restart. Maybe it's not a real good idea, because every time it gets mounted, the old files are updated to, so it would be a better idea to move the content already read by nickel to another subdir. Makes it too complicated and vulnerable maybe. Last edited by kido.resuri; 02-01-2017 at 04:42 PM. Reason: added some comments after testing |
Advert | |
|
02-01-2017, 05:24 PM | #36 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Ok, played with it a bit.
Code:
mkdir -p /mnt/onboard/.mysd mkdir -p /mnt/onboard/.mybooks Then i did over telnet: Code:
mount --bind /mnt/onboard/.mysd/ /mnt/sd/virtual echo sd add /dev/mmcblk1p1 >> /tmp/nickel-hardware-status (wait untill nickel finished reading content) umount /mnt/sd/virtual/ mv /mnt/onboard/.mysd/* /mnt/onboard/.mybooks/ echo "UPDATE Activity SET Id = REPLACE(Id,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/');" | sqlite3 "/mnt/onboard/.kobo/KoboReader.sqlite" echo "UPDATE content SET ContentID = REPLACE(ContentID,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/'), BookID = REPLACE(BookID,'/mnt/sd/virtual/','/mnt/onboard/.mybooks/') WHERE (ContentID LIKE '%/mnt/sd/virtual/%') OR (BookID LIKE '%/mnt/sd/virtual/%');" | sqlite3 "/mnt/onboard/.kobo/KoboReader.sqlite" reboot Last edited by kido.resuri; 02-02-2017 at 04:51 PM. Reason: modified sql query to work faster |
02-01-2017, 05:58 PM | #37 |
Connoisseur
Posts: 83
Karma: 10
Join Date: Jul 2013
Location: Planet Ocean
Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a
|
|
02-01-2017, 06:08 PM | #38 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Seems extreme, but unless anyone can find a better way to make nickel recognize the database changes, i have no better idea.
|
02-01-2017, 06:20 PM | #39 |
Connoisseur
Posts: 83
Karma: 10
Join Date: Jul 2013
Location: Planet Ocean
Device: Kobo Glo HD, Onyx Boox Note Pro 2, Samsung Galaxy Tab S5e, Pixel 4a
|
can't you kill nickel and restart it?
|
02-01-2017, 06:30 PM | #40 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Would that make any difference? Besides, i would have to make sure wifi is off when starting nickel, and that would make it impossible to run any telnet commands... sure a script could do it, but i find reboot more clean and fast than restarting nickel.
|
02-01-2017, 07:03 PM | #41 | |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
02-02-2017, 04:52 AM | #42 |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
I do not exactly understand your use case of the whole thing, but I wonder whether it is necessary to move the new files and modify the database immediately after nickel has processed them. You could as well continue to use your reader (for reading), and if you exit nickel and nickel gives control back to start_nickel.sh (from the above description I guess you are using KSM), the script could check whether there are files in /mnt/onboard/.mysd, and if so move them to /mnt/onboard/.mybooks and modify the database. And once you really need that the library knows the newly downloaded books and those located on the external sd, you simply exit nickel and reenter again.
|
02-02-2017, 10:46 AM | #43 |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Well, the above was just a test, to see if this works. I didn't use any scripts yet, but manually started the commands in telnet. I don't use KSM, but according to that, I can't simply close nickel and start it again if the wifi is on, is that right? And if I'm on telnet, executing commands manually, it didn't sound a good idea to turn the wifi off, so I used reboot command.
This whole thing could be of course done on next reboot, before nickel starts, as the user won't unmount the virtual sd on normal usage. But what if (s)he wants to plug in a real sd when the virtual one is still mounted? I didn't try that yet. |
02-02-2017, 11:08 AM | #44 | |
Wizard
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
|
Quote:
|
|
02-02-2017, 03:28 PM | #45 | |
Groupie
Posts: 172
Karma: 4282
Join Date: Dec 2016
Location: Hungary
Device: Kobo Aura H2O
|
Quote:
Moving the files can prevent beeing added each time. |
|
Tags |
filesystem, hack, reload, sdcard |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Refresh library | MrX | Calibre | 11 | 06-07-2016 05:45 PM |
Is it no possible to refresh the page automatically in Moon+ Reader? | cicabum | Android Devices | 4 | 10-22-2015 01:23 PM |
Library refresh after editing metadata | kelleybean | Library Management | 2 | 01-13-2015 10:10 AM |
Refresh library view? | Pepin33 | Development | 4 | 08-31-2012 06:18 AM |
7.40 - Automatically refresh the covers | edbro | Calibre | 0 | 01-14-2011 11:02 PM |