Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2014, 12:28 PM   #1
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Kobo Installer

I created a simple tool to install patches for Kobo. I get this idea from yoq.

Advantages:
  1. Really simple to use, no sed or regular expressions
  2. Safe: code is robust and "infinite reboots" are prevented
  3. You can easily patch files, that is better than overwrite them:
    • firmware upgrades can't be messed up
    • patches done by other users are not removed
  4. you can do single or multiline patches
  5. auto-backup of patched files
  6. Patches survive after firmware update (but not hard-resets), so you don't need to reinstall your modifications after a firmware upgrade

The Installer has also an optional and rudimentary package manager: it prevents installation of older Kobo modifications if a newer version is already installed. Read here for further informations.

If you want to use it for your mod, you've simply to:
  1. suggest users to install the Kobo Installer, or merge the content of this package with the source code of your project
  2. add to your project a /installer.d/ folder and write a script into it. The script must be an ".sh" or a ".py" script. This script will be invoked every time at boot. You can invoke kobo_patch.py from this script. Usage:

    PHP Code:
     kobo_patch.py append PROGNAME FILEPATH CODE
     kobo_patch
    .py add-after PROGNAME FILEPATH SEARCH_STRING CODE
     kobo_patch
    .py add-before PROGNAME FILEPATH SEARCH_STRING CODE 
    "append" action appends CODE at the end of FILEPATH.

    With "add-after" and "add-before", CODE is added after or before SEARCH_STRING in FILEPATH.

    FILEPATH will be backed up to FILEPATH_before_PROGNAME before any change will be applied. No patch will be performed if FILEPATH is already patched.
    If, and only if, kobo_patch.py will succesfully patch at least one file, system will be rebooted.
    IMPORTANT NOTE: failed scripts are removed from the device, so get a copy.

The package contains also Python 3 interpreter and some of its modules. Here is the entire py3 Standard Library, pyc compiled.
Attached Files
File Type: zip KoboInstaller_3.0.0.zip (3.48 MB, 737 views)

Last edited by Lucas Malor; 09-22-2014 at 04:03 AM.
Lucas Malor is offline   Reply With Quote
Old 04-28-2014, 01:17 PM   #2
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
I've modified the Installer, so it will be more simple to use. Furthermore you can install more mods at one time, and only one reboot will be performed.
Lucas Malor is offline   Reply With Quote
Old 08-14-2014, 12:58 PM   #3
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
I updated my Kobo Installer. Now it's quite useful and simple to use.

You need no regular expressions, and you can add text after and before some string inside a file. Multiline text can be added as well. This way you can easily and safely patch /etc/init.d/rcS or any other file.

I created a simple installer for the Night Mode mod. I created it for testing, but it works perfectly: Night Mode stay installed even after a firmware upgrade, and the installation works on every firmware. I plan to create package for the Kobo Installer also for the Start Menu, KoboLauncher and Koreader.
Attached Files
File Type: zip NightMode_13.zip (10.4 KB, 409 views)
Lucas Malor is offline   Reply With Quote
Old 08-14-2014, 01:21 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,285
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
You might like to clarify which version of Kobo f/w this applies to. As a bonus, make the patcher understand and detect different versions to ensure the correct one IS installed.

Additionally, I can see some major benefits to NOT automatically re installing a patch after a f/w upgrade in case of compatibility issues.
PeterT is offline   Reply With Quote
Old 08-14-2014, 01:34 PM   #5
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Quote:
Originally Posted by PeterT View Post
You might like to clarify which version of Kobo f/w this applies to.
[...]
Additionally, I can see some major benefits to NOT automatically re installing a patch after a f/w upgrade in case of compatibility issues.
Yep, this is planned. I have to see if some other dev is interested in using the Installer

Quote:
Originally Posted by PeterT View Post
As a bonus, make the patcher understand and detect different versions to ensure the correct one IS installed.
The Installer can do it already. If you rename your mod package from KoboRoot.tgz to MODNAME_VERSION.tar.gz (you can use also .tar.xz), put it inside a /package dir and zip that folder to a KoboRoot.tgz as usual, the package will be installed only if a newer version of MODNAME is not installed. Actually is what I've done with the NightMode installer test.
Of course this works only if you've installed also the newer version this way.

Last edited by Lucas Malor; 08-14-2014 at 02:36 PM.
Lucas Malor is offline   Reply With Quote
Old 08-14-2014, 05:04 PM   #6
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,285
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Noo... I meant different F/W levels NOT mod levels. I'm thinkiong for instance of the different levels of the nightmode library that are required for different Kobo f/w levels.
PeterT is offline   Reply With Quote
Old 08-14-2014, 05:56 PM   #7
Lucas Malor
Pain in the arse
Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.Lucas Malor will give the Devil his due.
 
Lucas Malor's Avatar
 
Posts: 758
Karma: 77856
Join Date: Apr 2013
Device: Kobo Aura One, Kindle 4
Yes, if some dev needs it I can add the possibility to specify the target firmware versions. I want to add also simple uninstall mechanism, in such a way that devs have only to write a text file with a list of files to be deleted and a script that reverts the patches. Users will simply have to write in a file the name of the packages they want to be uninstalled the next reboot.

In the immediate future, I'll change the patching behaviour as you suggested: patches will be applied only once. You'll be able to reapply them all, changing a setting to "1". That setting will be reverted to "0" after that.

Last edited by Lucas Malor; 08-14-2014 at 06:16 PM.
Lucas Malor is offline   Reply With Quote
Old 02-13-2021, 10:51 AM   #8
Creeperm4n
Junior Member
Creeperm4n has a complete set of Star Wars action figures.Creeperm4n has a complete set of Star Wars action figures.Creeperm4n has a complete set of Star Wars action figures.Creeperm4n has a complete set of Star Wars action figures.Creeperm4n has a complete set of Star Wars action figures.
 
Creeperm4n's Avatar
 
Posts: 7
Karma: 436
Join Date: Jan 2021
Device: Kobo Clara HD
Exclamation

can you make just the python? the new kobolauncher is actually on pbchess
Creeperm4n is offline   Reply With Quote
Old 02-13-2021, 02:35 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,648
Karma: 168431795
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Considering that @Lucas Malor hasn't been heard from in 7 years, I suspect your answer is going to be no.
DNSB is offline   Reply With Quote
Old 02-13-2021, 06:59 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,018
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
And I suspect that the project is dead.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Use Windows Installer? abundantmind Devices 6 12-28-2013 05:53 AM
Windows installer changes in 0.8.3 Manichean Calibre 25 06-01-2011 10:46 AM
Changes to Installer??? kgn Calibre 29 01-23-2011 10:40 AM
Installer for Reader shmish Sony Reader 6 09-01-2010 01:47 PM
Installer suggestion AprilHare Calibre 3 12-23-2008 11:35 AM


All times are GMT -4. The time now is 11:36 PM.


MobileRead.com is a privately owned, operated and funded community.