View Single Post
Old 01-01-2014, 10:47 AM   #15
shadoooo
Member
shadoooo began at the beginning.
 
Posts: 18
Karma: 19
Join Date: Nov 2013
Device: Kobo AURA HD
Sorry for long delays...

The rcS has been modified to execute custom scripts from other folders.
Basically the added code searches for shell files present in a specified folders,
and execute all of them in sequence.
In this way it's easy to add / remove scripts without using KoboRoot.tgz file loading.

There are three entry points in the new rcS:
the first just after system devices configuration and factory reset / update
(if required), but before any other load / execution (including on-animator.sh, that shows small the black / white boxes during startup.
This entry point executes scripts in /mnt/onboard/.kobo/advboot/init_run folder.
I added here a script that uses pickle to show the start menu and saves the result in temporary file /tmp/bootselect.
Value "1" means nickel, "2" means koreader.

Then boot continues, and second entry point is reached just before nickel and hindenburg will be lauched.
This entry point executes scripts in /mnt/onboard/.kobo/advboot/pre_run folder.

Last entry point is executed at end of boot, just after nickel has been launched.This entry point executes scripts in /mnt/onboard/.kobo/advboot/post_run folder.

If you need to customize boot sequence, you need to add / remove / edit files in the three folders, no more updates required.
As the folders are visible simply connecting USB port, it's very easy.
To choose if nickel or koreader should be lauched, I simply putted in a
script in pre_run folder, that checks the value in /tmp/bootselect, previously created at early stages of startup, and in case executes koreader and does not terminates, so basically exclude the execution of nickel.
When you quit form koreader, it will invoke shutdown.

I added also the telnet enable script in the pre_run folder.
It will not check the /tmp/bootselect file, so it will be executed always.
shadoooo is offline   Reply With Quote