View Single Post
Old 12-24-2011, 04:05 AM   #26
richf
Junior Member
richf began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2011
Device: Kindle Touch
chmod doesn't work, ad address is wrong, possible /etc/hosts workaround

I tried the instructions here wrt replacing the ad screensavers with one of my own, and it worked. Mostly. The ads went away, but about a week or so later, I woke up in the morning to discover the Kindle displaying an ad again.

One step in the instructions didn't work, and I was suspicious at the time, and this is probably why. It's the following instruction in step 6:

chmod -w /mnt/us/system/.assets

EVERY file (even if it's not an executable) in /mnt/us has permissions 755 (i.e. rwxr-xr-x). You can't change this with chmod. I'm not entirely positive right now if this is a limitation of the vfat filesystem, or the mount options, or both.

For this filesystem, /etc/fstab has:
/dev/loop/0 /mnt/base-us vfat defaults,noatime,nodiratime,utf8,noexec,shortname= mixed 0 0

which results in a mounted entry in /etc/mtab of:
/dev/loop/0 /mnt/base-us vfat rw,noexec,noatime,nodiratime,fmask=0022,dmask=0022 ,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

And I think it's the mask's of 0022 that are the problem. I tried setting the umask for the process to 0222, but the filesystem mask seems to take precedence.

This post:
http://superuser.com/questions/13443...in-ubuntu-9-10
Seems to suggest that if the fmask and dmask options in /etc/fstab were more fully specified (and not using "defaults"), that that might be a workaround.

But I tried something else first, before I found that possible solution, so I'll only try that if the other solution fails. (Although if someone else tries it, I encourage them to post results.)

Anyway, I believe that the update that suggests blocking DNS resolution of adpublisher.s3.amazon.com is somewhat in error. I can't get that host to resolve at all. I believe the proper address is likely adpublisher.s3.amazonaws.com. This is from:
http://www.pierotoffanin.com/2011/12...le-4-for-free/
which was the 2nd google result when I searched for the other address.

If you block it at your router, that solution will only work if you never enable wifi when connected to any other router.

What I tried instead was to always route this on the kindle to a bogus address, by adding the following line to /etc/hosts:
0.0.0.0 adpublisher.s3.amazonaws.com

vi is included and can be used to edit the file. Note that you will first need to make the root filesystem rw *before* you invoke vi, with:
mntroot rw

I suspect it would revert on a reboot, but when you're done, it's probably a good idea to put it back to ro with:
mntroot ro

Sorry if this isn't written in the most user friendly way. It's a little late at night right now for me to go about explaining unix permissions, mounts, filesystems, how dns works, and/or how to use vi for anyone that doesn't know. (And it would make this post even longer than it already is.) Someone else can explain any relevant parts. Or just google for "vi cheatsheet", since if this solution works, it's only really the part at the end that matters, you don't really need to understand why.

Oh, and for the naysayers here, I have absolutely no moral qualms about getting rid of the ads. I did not buy this for myself, it was given to me. So I never agreed to receive the ads, and I would never agree to this. I consider the Kindle a reasonably okay thing to have, and I don't mind having it for free, but it's not anything that I ever would have gone out and bought for myself, not even for the $30 that it would cost me to get amazon to stop force feeding me ads.
richf is offline