View Single Post
Old 05-11-2011, 07:36 PM   #2064
bbriand
Enthusiast
bbriand began at the beginning.
 
Posts: 26
Karma: 10
Join Date: Jan 2011
Device: Sony PRS-650
I spent many hours trying a lot of different things to get the scale factor feature working on my PRS650. I hadn't thought that it might only work on BBeB / LRF books

Anyhow it is all working now on my PRS+ / boroda'd PRS650. I grabbed trick-scaling-factor-650.zip file so graciously provided by ZeroChaos and unzipped that to my devices internal drive.

In my various root folder recursive dumps and debugging output I tried various linux commands and was pleasantly surprised that they worked.

This got me to thinking could the scaling XML lines be added to the devices kconfig.xml dynamically when the device boots up.

The script assumes that the kconfig.xml files environment section always starts on the 3rd line down

I created a file in /Data/test-startup/opt called kconfig_addon.xml and this is its contents:
Spoiler:

<variable name="bbebTextScale-1" value="80"/>

<variable name="bbebTextScale0" value="87"/>

<variable name="bbebTextScale1" value="94"/>

<variable name="bbebTextScale2" value="101"/>

<variable name="bbebTextScale3" value="108"/>

<variable name="bbebTextScale4" value="115"/>


So while it is nothing fancy and I may try to make it more dynamic the following is my modified /Data/test-startup/startup.sh file. If this has been done before I apologize in advance but in my many searches I never ran across this idea

Spoiler:

#!/bin/sh
# uncomment the following line to get the devices firmware copy of kconfig.xml
# cp /opt/sony/ebook/application/kconfig.xml /Data/test-startup/opt/kconfig_test.xml

# Trick to change the scaling factor
# the tmp directory does not exist on my device so I create it
mkdir /tmp

# pipe the first 3 lines of the devices firmware kconfig.xml into a new kconfig.xml
head -n3 /opt/sony/ebook/application/kconfig.xml > /Data/test-startup/opt/kconfig.xml

# pipe the additional XML lines we will use for scaling into the new kconfig.xml
cat /Data/test-startup/opt/kconfig_addon.xml >> /Data/test-startup/opt/kconfig.xml

# pipe a new line into the new kconfig.xml
echo >> /Data/test-startup/opt/kconfig.xml

# pipe everything after the first 3 lines of the devices firmwares kconfig.xml into the new kconfig.xml
tail -n+4 /opt/sony/ebook/application/kconfig.xml >> /Data/test-startup/opt/kconfig.xml

# copy the new kconfig.xml to the tmp directory
cp /Data/test-startup/opt/kconfig.xml /tmp/kconfig.xml

# mount the hybrid kconfig.xml so the device uses it instead
mount --bind /tmp/kconfig.xml /opt/sony/ebook/application/kconfig.xml

# uncomment the following 2 lines to get some debug info in the test-startup directory
# ls -alR /tmp > /Data/test-startup/filestructure.out # to ensure tmp directory was created
# mount > /Data/test-startup/mount.out # a mount to kconfig.xml should exist in this file

# Run installer script, if present
if [ -f /Data/PRSPInstaller/installer.sh ]
then
. /Data/PRSPInstaller/installer.sh
fi
# Run prsp.sh, if present
if [ -f /opt1/dict/prsp/prsp.sh ]
then
. /opt1/dict/prsp/prsp.sh
fi


I hope its a worthy idea. kudos to the Boroda / PRS+ fellows for making my reader even that much more awesome.

Bill

Last edited by bbriand; 05-11-2011 at 07:40 PM. Reason: added bold and italics to emphasize certain filenames / directories
bbriand is offline   Reply With Quote