Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-15-2012, 12:06 PM   #1
matejs
Member
matejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with others
 
Posts: 10
Karma: 2602
Join Date: Jan 2012
Device: Kindle Touch
Arrow [Kindle Touch] Disable OTA updates [How To]

I have installed a few modifications and don't want Amazon breaking it with OTA updates.

This is how I disabled the 'Settings -> Menu -> Update Your Kindle' and hopefully automatic updates too.

Requirements: Kindle Touch 5.0.3, jailbreak, root ssh

What it does: If you start update from settings, it logs a message about disabled OTA, the update*.bin file stays untouched. If you restart the Kindle, the update fails (error 3, press home to continue) and the update*.bin is deleted.

Instructions:
1) edit file /etc/upstart/ota-update.conf
Spoiler:
Code:
description "Intitates the OTA update process"

emits ota-update

export LANG LC_ALL

env BATTERY_MIN_CHARGE=15

env ERR_NONE=0
env ERR_BAD_ARG=1
env ERR_FILE_NOT_FOUND=2
env ERR_LOW_BAT=3

pre-start script
	source /etc/upstart/functions

	############## DISABLE OTA UPDATES ##############
	if [ -e "/mnt/us/DISABLE_OTA" ]
	then
		f_log E ota-update check "" "####################################################"
		f_log E ota-update check "" "# UPDATES DISABLED in /etc/upstart/ota-update.conf #"
		f_log E ota-update check "" "#   REMOVE FILE /mnt/us/DISABLE_OTA (in USB root)  #"
		f_log E ota-update check "" "####################################################"
		return $ERR_LOW_BAT
	fi
	############## DISABLE OTA UPDATES ##############

	[ -n "${BUNDLE}" ] || {
		f_log E ota-update check "" "BUNDLE not defined"
		return $ERR_BAD_ARG
	}

	[ -e "${BUNDLE}" ] || {
		f_log E ota-update check "" "No update file found"
		return $ERR_FILE_NOT_FOUND
	}

	set +e
	BATTERY_CHARGE=$(gasgauge-info -s)
	ERROR_STATE=$?
	BATTERY_CHARGE=$(echo "${BATTERY_CHARGE}" | sed 's/\%//')
	set -e
	[ -n "${BATTERY_CHARGE}" -a ${ERROR_STATE} -eq $ERR_NONE ] || {
		f_log W ota-update check "" "Gas guage info not available"
		BATTERY_CHARGE=0
	}
	
	set +e
	BATTERY_THRESHOLD=$(get-dynconf-value update.battery.threshold)
	ERROR_STATE=$?
	set -e
	if [ ${ERROR_STATE} -ne $ERR_NONE ] 
	then
		BATTERY_THRESHOLD=$BATTERY_MIN_CHARGE
	fi
	[ ${BATTERY_CHARGE} -ge ${BATTERY_THRESHOLD} -o -n "${FORCE}" ] || {
		MESSAGE="Inadequate battery charge, must be "
		MESSAGE="${MESSAGE} ${BATTERY_THRESHOLD} % or higher, "
		MESSAGE="${MESSAGE} currently at ${BATTERY_CHARGE} %"
		f_log W ota-update check "" "${MESSAGE}"
		return $ERR_LOW_BAT
	}

	return $ERR_NONE
end script

script
	# Issue the ota-update signal and wait for completion.
	initctl emit ota-update
	exec /usr/sbin/otaup "${BUNDLE}" > /dev/console
end script

2) create file /mnt/us/DISABLE_OTA (/mnt/us is what you see if you connect Kindle as USB mass storage)

To re-enable updates: remove or rename the file /mnt/us/DISABLE_OTA . (Or delete the modification from /etc/upstart/ota-update.conf)

As always, make backups and be carefull. No guarantees.
matejs is offline   Reply With Quote
Old 02-20-2012, 08:43 AM   #2
spamcop
Junior Member
spamcop began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Feb 2012
Device: kindle touch
this is good stuff, thanks!
spamcop is offline   Reply With Quote
Advert
Old 02-21-2012, 04:58 AM   #3
ab5tract
Junior Member
ab5tract began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jan 2012
Device: Kindle Touch (5)
Hi,

Can you make the modifications to the config file available as a diff as well? This would make it more apparent what needs to be changed and where.
ab5tract is offline   Reply With Quote
Old 02-21-2012, 11:06 AM   #4
matejs
Member
matejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with others
 
Posts: 10
Karma: 2602
Join Date: Jan 2012
Device: Kindle Touch
Quote:
Originally Posted by ab5tract View Post
Hi,

Can you make the modifications to the config file available as a diff as well? This would make it more apparent what needs to be changed and where.
Hi. I just added the section between "############## DISABLE OTA UPDATES ##############" markers in pre-start script. No other modifications.
matejs is offline   Reply With Quote
Old 02-21-2012, 11:12 AM   #5
thatworkshop
hub
thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.thatworkshop ought to be getting tired of karma fortunes by now.
 
thatworkshop's Avatar
 
Posts: 715
Karma: 2151032
Join Date: Jan 2012
Location: Iranian in Canada
Device: K3G, DXG, Kobo mini
If it could disable just automatic updates, it could have been more useful.
thatworkshop is offline   Reply With Quote
Advert
Old 02-21-2012, 01:22 PM   #6
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
Try installing the packages via executing at SSH:
Code:
/usr/sbin/otaup /mnt/us/name-of-update.bin
That might help.
JustAMan is offline   Reply With Quote
Old 02-26-2012, 03:47 AM   #7
duxbelli
Member
duxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavensduxbelli is a rising star in the heavens
 
Posts: 15
Karma: 13968
Join Date: Mar 2010
Device: none
thanks for the post. i wonder, though, about preventing future OTA updates. if this just deletes the update.bin, what prevents amazon from trying again the next day?

matejs or cscat -- have you found a way to simply disable the automatic updates in general?
duxbelli is offline   Reply With Quote
Old 02-27-2012, 03:41 AM   #8
matejs
Member
matejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with others
 
Posts: 10
Karma: 2602
Join Date: Jan 2012
Device: Kindle Touch
Quote:
Originally Posted by duxbelli View Post
... if this just deletes the update.bin, what prevents amazon from trying again the next day?

matejs or cscat -- have you found a way to simply disable the automatic updates in general?
Hi.

I found a script which is run before updates. It checks if the file exists, if there is > 15% battery and so on. I just modified it a little, so it would claim it doesn't have enough battery and exit before calling the update process (if /mnt/us/DISABLE_OTA doesn't exist, it proceeds with update as normal).

It doesn't delete anything (so the update.bin doesn't download all the time).
However, when you restart the Kindle, something else attempts to install the update while starting up, fails and then deletes the update binary.

Since the /usr/sbin/otaup is still there, future OTA updates MAY install, if they skip the checks in the modified script above. I don't think that is likely though.

So, this should disable OTA updates (and all updates) in general.
matejs is offline   Reply With Quote
Old 02-28-2012, 05:45 AM   #9
Novo
Enthusiast
Novo began at the beginning.
 
Posts: 34
Karma: 10
Join Date: Dec 2011
Location: Germany
Device: Kindle PW4
Quote:
Originally Posted by matejs View Post
So, this should disable OTA updates (and all updates) in general.
after this, manual update to install jailbreak .bin still possible?
Novo is offline   Reply With Quote
Old 02-28-2012, 10:07 AM   #10
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
I didn't try this but according to what I found out poking at my KT - no, if you disable that update way you won't be able to install updates.
Feel free to prove me wrong, though...
JustAMan is offline   Reply With Quote
Old 02-29-2012, 08:30 AM   #11
matejs
Member
matejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with othersmatejs plays well with others
 
Posts: 10
Karma: 2602
Join Date: Jan 2012
Device: Kindle Touch
Quote:
Originally Posted by Novo View Post
after this, manual update to install jailbreak .bin still possible?
How to install updates with this modification:

1) plug your KT in USB
2) remove file DISABLE_UPDATES, copy update*.bin to KT (and remove any amazon OTA update*.bin files if you see them)
3) disconnect USB
4) Menus --> Settings, Menu --> Update your Kindle
5) plug your KT in USB
6) Create file DISABLE_UPDATES
7) disconnect USB
matejs is offline   Reply With Quote
Old 03-11-2012, 05:07 PM   #12
aleq
Enthusiast
aleq began at the beginning.
 
Posts: 25
Karma: 10
Join Date: Mar 2012
Location: CZ, EU
Device: K4NT (4.0.1), KT (5.3.7.3), KPW1 (sold), KPW2
Anyone tried on Kindle 4 NT? Could it work there as well?

Last edited by aleq; 03-11-2012 at 05:09 PM.
aleq is offline   Reply With Quote
Old 03-18-2012, 03:42 AM   #13
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
EDIT: provided recipe has been included by dsmid into his unified, easy installable BackDoorLock hack.

(using of overlay root filesystem is no fun with silent sudden OTA updating, so I've researched OTA updating subsystem for proper disabling)

Here is how OTA updating works on Kindle Touch (checked on 5.0.4):
  1. todo process pulls service info from Amazon server. URL for getting info is built with the help of supporting libraries, through which some parameters are taken from SQLite database at /var/local/appreg.db. There is software revision in service info URL's query string and in separate HTTP request header. Value for query string is taken from table properties from row with handlerId = 'urlbuilder.gparams' and name = 'software_rev'. Value for header is taken from table properties from row with handlerId = 'urlbuilder.headers' and name = 'X-ADP-SW'.
  2. server checks client KT software version (from HTTP request query string and/or header) and, if needed, adds to service info message about available OTA update
  3. if service info contains message about available OTA update, todo sends it to lipc service, which is defined by appropriate values in service message (values GET, FWUO). todo is looking for these values in it's internal handler registry (which is built and cached in RAM at todo startup from content of /etc/todo/handler_registry.conf). For legacy.GET.FWUO com.lab126.ota service is defined, so todo sends message to com.lab126.ota by setting lipc property handleToDoItem
  4. service com.lab126.ota is provided by otaupd process, so this daemon handles downloading and checking validness of downloaded update bundle
  5. after downloading and checking for validness of downloaded update bundle, otaupd invokes ota-update upstart script with path to bundle as parameter
  6. on successful/failed OTA update install otaupd reports back to todo, which is sending status back to Amazon (no new information is sent to Amazon here except of fact of success/fail)
So:
  • make backup of /etc/todo/handler_registry.conf !
  • look for strings with com.lab126.ota in /etc/todo/handler_registry.conf
  • comment them (with # character)
  • then restart todo process with command restart todo in SSH session.
I think, it will be sufficient for disabling OTA updates. (And it looks like when handler is unknown to todo, it sends FAILED status to Amazon, which isn't different from unsuccessful OTA update install.)

Note that with commented handlers, todo will not send message to com.lab126.ota service, so ota-update upstart script will not be invoked. But manual updates should still work (with unmodified ota-update).

UPD This solution isn't more reliable than editing of ota-update upstart script, because it's the same in general and closes only the current "official channel" for pushing OTA update. I didn't checked whether Amazon could use other existing "channels" (i.e. service messages) for invoking otaupd daemon to initiate OTA updating procedure.

Last edited by eureka; 05-15-2013 at 07:12 AM. Reason: point to BackDoorLock hack
eureka is offline   Reply With Quote
Old 03-18-2012, 05:53 AM   #14
JustAMan
Groupie
JustAMan doesn't litterJustAMan doesn't litter
 
JustAMan's Avatar
 
Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
I've just blocked todo URL in /etc/hosts on my KT...

Got it from /etc/todo/todoserver.conf and set it pointing to 127.0.0.1
JustAMan is offline   Reply With Quote
Old 03-18-2012, 08:50 AM   #15
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Wouldn't the simpler way be to just move Amazon's signature keyfile to another directory?

Then anything downloaded by the machine would fail the signature check and not be installed.

You could always move the key back into the proper directory after you have reviewed the contents of the download and have decided that you want it installed.
knc1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable Kindle touch screen saver? comnread66 Amazon Kindle 1 02-03-2012 08:42 PM
Got a Kindle touch for christmas, any updates I need to download? Dragoro Amazon Kindle 1 01-14-2012 03:35 AM
Hacks Kindle Touch - disable special offers & change screensaver Touch Amazon Kindle 73 01-04-2012 09:00 AM
9to5Mac: OTA Updates coming to iOS? kjk Apple Devices 1 05-08-2011 08:21 AM
Stealth OTA Nook Color updates to counter rooting? RockdaMan News 3 12-17-2010 12:57 PM


All times are GMT -4. The time now is 02:37 AM.


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