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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-07-2010, 10:10 PM   #1
Xaphiosis
Connoisseur
Xaphiosis doesn't litterXaphiosis doesn't litterXaphiosis doesn't litter
 
Posts: 52
Karma: 216
Join Date: Apr 2010
Device: PRS-T1
Log files disappearing after SD card unmount (buggy sync?), anyone seen this before?

I've encountered something very strange... as a result, I don't really know what question to ask exactly, other than: has anyone else seen this before?

Basically, I mount the SD card on /tmp/sd_card like so:
Code:
mkdir -p /tmp/sd_card
mount -t vfat -o noatime,nodiratime,iocharset=utf8,shortname=winnt /dev/sdmscard/sdmsa1 /tmp/sd_card
Then I run /tmp/sd_card/reader/main.sh which creates /tmp/sd_card/reader_out and tries to log its actions to /tmp/sd_card/reader_out/main.log like so (comments omitted):
Code:
#!/bin/sh
PATH="/usr/local/bin:/usr/bin:/sbin:/bin:/usr/local/sony/bin:/usr/sbin"
LD_LIBRARY_PATH="/opt/sony/ebook/application:/lib:/usr/lib:/usr/local/sony/lib:/opt/sony/ebook/lib"
SD_CARD=/tmp/sd_card
SD=$SD_CARD/reader
OUT=$SD_CARD/reader_out
export OUT SD
# working directory
WD=$SD
LOG=$OUT/main.log
export WD LOG
# Add our bin and lib on the SD reader
PATH="$WD/bin:$PATH"
LD_LIBRARY_PATH="$WD/lib:$LD_LIBRARY_PATH"
export PATH LD_LIBRARY_PATH

mkdir -p $OUT
echo main.sh begins > $LOG
$WD/programs/fb >> $LOG 2>&1
echo main.sh ends >> $LOG
sync
sync
return 0
After main.sh finishes running, I unmount the SD card:
Code:
sync
umount /tmp/sd_card
Now, here's the crazy bit. Note I call sync at least three times, but after I unmount, /reader_out/main.log is nowhere to be found on the SD card, it just gets lost. However, if I add
Code:
cp $LOG /dev/null
before the sync in main.sh, then /reader_out/main.log is there, with the right contents. If I don't do that, the file disappears, becoming a "lost chain", which might or might not cause filesystem issues (recoverable) on the SD card. During the entire time this script is running, tinyhttp is stopped (kill -STOP) so that it cannot interfere.

This also does not happen if I put the log under the /tmp filesystem and copy it across after main.sh finishes running.

Surely all relevant file buffers should be flushed upon a umount, but even if not, I call sync multiple times, only to get ignored. Grr.

If I can't figure this out I will reformat the SD card into ext2 rather than vfat, as it seems I've got a working ext2 filesystem driver installed on my reader now... maybe the problems will go away then.

My instinct tells me that the proprietary MS/SD card driver by SONY may well be buggy. Unfortunately, it's closed source, so I can't really confirm that.

Any ideas? This is the last roadblock to my being able to run programs off the SD card in a stable fashion
Xaphiosis is offline   Reply With Quote
Old 07-08-2010, 05:27 AM   #2
kartu
PRS+ author
kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.
 
Posts: 1,637
Karma: 2446233
Join Date: Dec 2007
Device: Sony PRS-300, 505, 600, 650, 950
Xaphiosis
I used to log stuff to SD card (for a couple of days) on 505 from tinyhttp.sh and didn't have any problems with it (not even calling sync). This is the command I've used:

Code:
mount -t vfat -o utf8 -o shortname=mixed /dev/sdmscard/r5c807a1  /opt/mnt/sd
kartu is offline   Reply With Quote
 
Advertisement
Old 07-12-2010, 08:49 PM   #3
Xaphiosis
Connoisseur
Xaphiosis doesn't litterXaphiosis doesn't litterXaphiosis doesn't litter
 
Posts: 52
Karma: 216
Join Date: Apr 2010
Device: PRS-T1
Hmm. The only two things that are different is my mount target is in under /tmp while yours is under /opt, which shouldn't matter, and I use winnt (which I pulled out of sony's .so files) rather than 'mixed'. I'll try your settings and see if that helps. Still looks like a bug in SONY's driver or the VFAT filesystem driver for that kernel version.

Thanks for your input kartu! Knowing it used to work on the 505 is useful knowledge
Xaphiosis 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
Disappearing txt files?!? JaneFancher Sigil 2 06-26-2010 03:55 PM
Automatic sync to a memory card (reader) klikklak Calibre 3 03-27-2010 12:42 AM
Disappearing files Argel Calibre 8 02-14-2010 11:42 PM
Files disappearing! The CB Calibre 2 08-11-2009 07:23 PM


All times are GMT -4. The time now is 05:52 AM.


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