Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-25-2006, 10:10 AM   #1
design256
Connoisseur
design256 doesn't litterdesign256 doesn't litter
 
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
I survived 2.7.1

I entered the following in the file /etc/rc5.d/S99z
then chmod to 755.

Code:
#!/bin/sh

if test -f /mnt/card/startup.sh
then
  /bin/sh /mnt/card/startup.sh
fi

: exit 0
Then I held my breath and did the update to 2.7.1.

No problems afterwards - iliad executed startup.sh on my card fine and I'm back in again. This is also a very safe way of executing stuff on normal boot after /home/root/start.sh has completed.

Last edited by design256; 10-25-2006 at 10:38 AM.
design256 is offline   Reply With Quote
Old 10-25-2006, 10:29 AM   #2
TadW
Uebermensch
TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.TadW ought to be getting tired of karma fortunes by now.
 
TadW's Avatar
 
Posts: 2,583
Karma: 1094606
Join Date: Jul 2003
Location: Italy
Device: Kindle
Well done! This should be a sticky to everyone who wants to keep the door open to his iLiad.
TadW is offline   Reply With Quote
Advert
Old 10-25-2006, 11:31 AM   #3
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
That will only survive a patch update. On their full updates they dd a new file system into the disk on chip.

I hope that wasn't the real name you used for your rc script, I'm sure they'll have a patch for that in 2.7.2.

Still though, a worthy hack.

BTW I'm not some cowboy with my start.sh hack for the clock. Once their panel starts you have to kill out and restart the icon container, which is a central nexus in how the iLiad routes things like the keyboard events. I've done it by hand but its cleaner to just mod the actual start.

What is scary is how iRex doesn't understand rc scripting. That start.sh script should be broken up into several rc scripts.
scotty1024 is offline   Reply With Quote
Old 10-25-2006, 11:47 AM   #4
design256
Connoisseur
design256 doesn't litterdesign256 doesn't litter
 
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
Quote:
Originally Posted by scotty1024
That will only survive a patch update. On their full updates they dd a new file system into the disk on chip.
Yes, this will be more tricky, but still possible to backdoor. I'll wait until 2.8 is out before posting suggestions.

Quote:
I hope that wasn't the real name you used for your rc script, I'm sure they'll have a patch for that in 2.7.2.
It was a throwaway - but an interesting measure of their paranoia to see whether they do patch it or not.


Quote:
BTW I'm not some cowboy with my start.sh hack for the clock. Once their panel starts you have to kill out and restart the icon container, which is a central nexus in how the iLiad routes things like the keyboard events. I've done it by hand but its cleaner to just mod the actual start.
No indeed, but (as I find daily), you can't underestimate the clumsiness of people entering your scripts into their machine. If a mistake is possible, then somebody will make it. And missing off the last & in startup.sh is very easy and deadly to do.

Perhaps we could post an exploit to update er_registry (harmless), then supply clickable sed or shell scripts to do the rest...


On a related topic, have you any idea where the kernel boot image lives? Its symlink in /boot doesn't exist and it's not on /dev/tffsa1 where I might have expected to find it. I can only assume that there's another paged boot flash that we don't have access to... If we could find that, then we'd be on the first steps to brick-protection..
design256 is offline   Reply With Quote
Old 10-25-2006, 11:59 AM   #5
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Their code for flashing the kernel and user filesystem is all out in the public there in /old-root/linuxrc.

I know how to flash the iLiad what I'm working on is the buttons.

I'd like to write something that sniffs the connection button on startup, if it's pressed then mount the MMC/CF and flash off it.

Of course if you brick your kernel... we'd need access to the boot loader to make a truly brick free iLiad. But we nearly have all the tools needed to brick protect from user file system problems such as a bad start.sh.

Of course we could also post a start.sh upgrade that uses rc.d properly.
scotty1024 is offline   Reply With Quote
Advert
Old 10-25-2006, 12:19 PM   #6
design256
Connoisseur
design256 doesn't litterdesign256 doesn't litter
 
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
Quote:
Originally Posted by scotty1024
Their code for flashing the kernel and user filesystem is all out in the public there in /old-root/linuxrc.
Indeed it is, but can you find where the kernel ends up once it has been flashed? It's not on any of the accessible partitions.

Poking around inside /bin/firmupdate makes it look like it searches through /dev/tffsa for a hidden partition, then puts the kernel there. If we can find that, then we may also find any pre-kernel loading code that also runs.
design256 is offline   Reply With Quote
Old 10-25-2006, 01:14 PM   #7
CommanderROR
eink fanatic
CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.CommanderROR is fluent in JavaScript as well as Klingon.
 
CommanderROR's Avatar
 
Posts: 2,022
Karma: 4924
Join Date: Mar 2006
Location: Germany
Device: STAReBOOK, iRex Iliad, Sony 505, Kindle 2
Well, then I hope you get lucky and find that as wel...:-)

I'm moving this one to the dev. section as well...I hope you don't mind.
CommanderROR is offline   Reply With Quote
Old 10-26-2006, 01:49 AM   #8
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
tffsa1 looks like the winner...

Code:
root@ereader:/proc# cat partitions 
major minor  #blocks  name

 100     0     239616 tffsa
 100     1       3094 tffsa1
 100     2      74256 tffsa2
 100     3          1 tffsa3
 100     5      29926 tffsa5
 100     6     131326 tffsa6
 100     7        910 tffsa7
root@ereader:/proc# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/tffsa2               3040      2368       672  78% /old-root
/dev/tffsa2              73045     60249     12796  82% /
/dev/tffsa5              28973       885     26592   3% /mnt/protected
/dev/tffsa6             131180    122848      8332  94% /mnt/free
/dev/tffsa7                888       179       664  21% /mnt/settings
I yanked it with dd and I can see why firmupdate says it has to search for the kernel. Lots of garbage at the front of that partition.
scotty1024 is offline   Reply With Quote
Old 10-26-2006, 02:33 AM   #9
design256
Connoisseur
design256 doesn't litterdesign256 doesn't litter
 
Posts: 78
Karma: 103
Join Date: Aug 2006
Location: Ipswich, UK
Device: Irex Iliad
Quote:
Originally Posted by scotty1024
tffsa1 looks like the winner...

Code:
root@ereader:/proc# cat partitions 
major minor  #blocks  name

 100     0     239616 tffsa
 100     1       3094 tffsa1
 100     2      74256 tffsa2
 100     3          1 tffsa3
 100     5      29926 tffsa5
 100     6     131326 tffsa6
 100     7        910 tffsa7
root@ereader:/proc# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/tffsa2               3040      2368       672  78% /old-root
/dev/tffsa2              73045     60249     12796  82% /
/dev/tffsa5              28973       885     26592   3% /mnt/protected
/dev/tffsa6             131180    122848      8332  94% /mnt/free
/dev/tffsa7                888       179       664  21% /mnt/settings
I yanked it with dd and I can see why firmupdate says it has to search for the kernel. Lots of garbage at the front of that partition.
...and why are there two different partitions called tffsa2? /old-root should be tffsa1, hinting that there was another partition before it that was mounted to load the kernel.

Last edited by design256; 10-26-2006 at 03:43 AM.
design256 is offline   Reply With Quote
Old 10-26-2006, 03:23 AM   #10
ath
Addict
ath doesn't litterath doesn't litter
 
Posts: 222
Karma: 110
Join Date: Jun 2006
Location: Malmo, Sweden
Device: iLiad, Sony PRS-505, Kindle Paperwhite & Oasis
Quote:
Originally Posted by design256
...and why are there two different partitions called tffsa2?
(DELETED -- misreading)
ath is offline   Reply With Quote
Old 10-26-2006, 05:36 AM   #11
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
You're right:
Code:
root@ereader:/mnt/cf# file zImage
zImage: Linux rev 0.0 ext2 filesystem data (mounted or unclean)
But then that would tend to mean tffsa3 is the boot block and ttfsa4 is the "hidden" kernel.

Strange.
scotty1024 is offline   Reply With Quote
Old 10-26-2006, 06:37 AM   #12
Matthijs
Groupie
Matthijs will become famous soon enoughMatthijs will become famous soon enoughMatthijs will become famous soon enoughMatthijs will become famous soon enoughMatthijs will become famous soon enoughMatthijs will become famous soon enough
 
Matthijs's Avatar
 
Posts: 199
Karma: 666
Join Date: Oct 2006
Location: Eindhoven, the Netherlands
Device: iLiad, DR1000S, DR800SG
You really shouldn't try to flash any kernel to a TFFS# partition, that will certainly brick your iLiad. You'd better have a look at the contents of the tffsa1 partition...

The kernel is not located on any of these TFFS partitions.

Also: if you flash your own kernel, you most certainly won't have a working iLiad anymore: no wired ethernet, no filesystem -> brick.

Last edited by Matthijs; 10-26-2006 at 06:40 AM.
Matthijs is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How I survived my iLiad Hisko iRex 3 09-11-2008 10:11 PM


All times are GMT -4. The time now is 04:44 PM.


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