dps/remarkable-wikipedia

Accessing offline simple wikipedia when not on the SD card

Opened this issue · 0 comments

I've seen this topic pop up a lot in the (still opened) issues. Basically I:

  • Installed wikipedia through toltec;
  • Downloaded a .zim file of the simple English wikipedia nopics (2023-03) in my root folder on the remarkable;
  • Turned off WiFi;
  • Started Wikipedia

...And nothing loaded. Looking a bit around, in the current version of main.qml there is this line:

    property string edition: "fb92b95d083f0cb6a2a17794cf164156"; //"wikipedia_en_simple_all_nopic_2019-05";

Whereas in this file, which is the latest script available before everything got moved to toltech, there was the following snippet of code:

#!/bin/bash

mount /dev/sda /home/root/memcard

if [ -f /home/root/memcard/wikipedia.zim ]; then
  #/usr/bin/kiwix-serve --port=8000 /home/root/memcard/wikipedia.zim
  /usr/bin/zimserver -port 8081 -filename /home/root/memcard/wikipedia.zim
else
  #/usr/bin/kiwix-serve --port=8000 /home/root/wikipedia_en_simple_all_novid_2019-05.zim
  /usr/bin/zimserver -port 8081 -filename /home/root/wikipedia_en_simple_all_nopic_2020-04.zim
fi

In this case it is clear that the script is looking for a file named wikipedia.zim on the SD card and, if the SD card is not present, is looking for a file named wikipedia_en_simple_all_nopic_2020-04.zim.

So I tried to bruteforce, and established symlinks from my downloaded version of the .zim file to:

fb92b95d083f0cb6a2a17794cf164156.zim
wikipedia.zim
wikipedia_en_simple_all_nopic_2019-05.zim`
wikipedia_en_simple_all_nopic_2020-04.zim

...basically exhausting all the known names I found where the code would look for the .zim file. Still, I didn't succeed in making it load. Any suggestions?

BTW, I'm not proficient at all in c++ but a very cheap trick to make things work would be to implement the following workflow:

  • if SD is mounted and wikipedia.zim is present, use it. Else:
  • if wikipedia.zim is present in home/root/, use it. Else
  • fetch stuff from the internet.

This would solve a lot of headaches to many people. They could just upload the simple version on the remarkable, the 'big' version on a SD card, and either name them both wikipedia.zim or simlink them both to wikipedia.zim (in case they want to preserve the name of the original file).