Author Topic: RC5 dosfsck bug  (Read 2505 times)

rgrep

  • Full Member
  • ***
  • Posts: 149
    • View Profile
RC5 dosfsck bug
« on: October 16, 2004, 02:18:37 am »
There is a bug in the dosfsck utility (part of dosfstools) which causes the following behaviour:
Code: [Select]
# dosfsck /dev/mmcd/disc0/part1
dosfsck 2.9 (15 May 2003)
dosfsck 2.9, 15 May 2003, FAT32, LFN
Logical sector size is zero.
The fixed version shows this output instead:
Code: [Select]
# dosfsck /dev/mmcd/disc0/part1
dosfsck 2.10, 22 Sep 2003, FAT32, LFN
/dev/mmcd/disc0/part1: 0 files, 0/34603 clusters
To fix the bug I had to apply the following patch to the dosfstools source code:
Code: [Select]
diff -rNu dosfstools-2.10.orig/dosfsck/boot.c dosfstools-2.10/dosfsck/boot.c
--- dosfstools-2.10.orig/dosfsck/boot.c    2003-06-15 08:03:20.000000000 +1200
+++ dosfstools-2.10/dosfsck/boot.c    2004-10-16 14:59:27.000000000 +1300
@@ -34,13 +34,13 @@
     { 0xff, "5.25\" 320k floppy 2s/40tr/8sec" },
 };
 
-#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
+#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__ || __arm__
 /* Unaligned fields must first be copied byte-wise */
 #define GET_UNALIGNED_W(f)      \
     ({      \
  unsigned short __v;      \
  memcpy( &__v, &f, sizeof(__v) );    \
-    CF_LE_W( *(unsigned short *)&f );    \
+    CF_LE_W( *(unsigned short *)&__v );    \
     })
 #else
 #define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f )
This patch is available from http://beer.geek.nz/software/zaurus/dosfstools/

I got the idea for the fix from this Debian bug report.

You can download the fixed dosfstools ipk from my unstable feed.
« Last Edit: October 16, 2004, 02:19:33 am by rgrep »
[img]https://www.oesf.org/forums/style_emoticons/default/smile.gif\" border=\"0\" class=\"linked-sig-image\" /] Has: Dynamism C760 / Linksys WCF12 WiFi / Kingston 512MB SD
[img]https://www.oesf.org/forums/style_emoticons/default/biggrin.gif\" border=\"0\" class=\"linked-sig-image\" /] Loves: pdaXrom / Warwalking
[img]https://www.oesf.org/forums/style_emoticons/default/sad.gif\" border=\"0\" class=\"linked-sig-image\" /] Hates: NetGear MA701 WiFi / SanDisk 256MB SD / C760 Charging Faults

omega

  • Hero Member
  • *****
  • Posts: 626
    • View Profile
    • http://
RC5 dosfsck bug
« Reply #1 on: November 05, 2004, 09:22:44 am »
Thanks. It fixed the problem i was getting

File system has -3 clusters but only space for 1462 FAT entries...
Gorgeous C860, 256 Sandisk SD, 1Gig Pretec 40x CF, PDAIR leather case & the really cool retractable iPDA USB sync/charge cable. Powered by PDAXROM BETA 1.

My wish - to have a Command & Conquer style game on my Z! (FREECNC!!!) Simcity 2000 would also be great.