diff -Nru dosfstools-3.0.13/debian/changelog dosfstools-3.0.13/debian/changelog --- dosfstools-3.0.13/debian/changelog 2012-06-30 17:15:47.000000000 +0000 +++ dosfstools-3.0.13/debian/changelog 2014-12-26 13:34:44.000000000 +0000 @@ -1,3 +1,10 @@ +dosfstools (3.0.13-1+rpi1) wheezy-staging; urgency=low + + * Apply upstream patch to support dirty bit handling and hence avoid warnings + with newer kernels. + + -- Peter Michael Green Fri, 26 Dec 2014 13:34:16 +0000 + dosfstools (3.0.13-1) unstable; urgency=low * Merging upstream version 3.0.13. diff -Nru dosfstools-3.0.13/debian/patches/dirty-bit.diff dosfstools-3.0.13/debian/patches/dirty-bit.diff --- dosfstools-3.0.13/debian/patches/dirty-bit.diff 1970-01-01 00:00:00.000000000 +0000 +++ dosfstools-3.0.13/debian/patches/dirty-bit.diff 2014-12-26 13:33:56.000000000 +0000 @@ -0,0 +1,92 @@ +commit ce2f8dc349a8a6b2c26d1b3892cc9b5f0408bd34 +Author: Oleksij Rempel +Date: Wed Jan 23 12:35:13 2013 +0100 + + Checking boot sector for dirty bit. + + Some OSos use reseved byte of boot sector to set state of the file + system. If first bit set, then filesystem is proably damaged - write + operation was not finished/cache not snycted/... + + Signed-off-by: Oleksij Rempel + Signed-off-by: Daniel Baumann + +Index: dosfstools-3.0.13/src/boot.c +=================================================================== +--- dosfstools-3.0.13.orig/src/boot.c 2012-06-27 14:02:26.000000000 +0000 ++++ dosfstools-3.0.13/src/boot.c 2014-12-26 13:33:47.000000000 +0000 +@@ -290,6 +290,45 @@ + fs->free_clusters = CF_LE_L(i.free_clusters); + } + ++static char print_fat_dirty_state(void) ++{ ++ printf("Dirty bit is set. Fs was not properly unmounted and" ++ " some data may be corrupt.\n"); ++ ++ if (interactive) { ++ printf("1) Remove dirty bit\n" ++ "2) No action\n"); ++ return get_key("12", "?"); ++ } else ++ printf(" Automaticaly removing dirty bit.\n"); ++ return '1'; ++} ++ ++static void check_fat_state_bit (DOS_FS *fs, void *b) ++{ ++ if (fs->fat_bits == 32) { ++ struct boot_sector *b32 = b; ++ ++ if (b32->reserved3 & FAT_STATE_DIRTY) { ++ printf("0x41: "); ++ if (print_fat_dirty_state() == '1') { ++ b32->reserved3 &= ~FAT_STATE_DIRTY; ++ fs_write(0, sizeof(*b32), b32); ++ } ++ } ++ } else { ++ struct boot_sector_16 *b16 = b; ++ ++ if (b16->reserved2 & FAT_STATE_DIRTY) { ++ printf("0x25: "); ++ if (print_fat_dirty_state() == '1') { ++ b16->reserved2 &= ~FAT_STATE_DIRTY; ++ fs_write(0, sizeof(*b16), b16); ++ } ++ } ++ } ++} ++ + void read_boot(DOS_FS * fs) + { + struct boot_sector b; +@@ -362,6 +401,7 @@ + " This may lead to problems on some systems.\n", + fs->clusters, FAT16_THRESHOLD); + ++ check_fat_state_bit(fs, &b); + fs->backupboot_start = CF_LE_W(b.backup_boot) * logical_sector_size; + check_backup_boot(fs, &b, logical_sector_size); + +@@ -372,6 +412,7 @@ + fs->fat_bits = (fs->clusters >= FAT12_THRESHOLD) ? 16 : 12; + if (fs->clusters >= FAT16_THRESHOLD) + die("Too many clusters (%lu) for FAT16 filesystem.", fs->clusters); ++ check_fat_state_bit(fs, &b); + } else { + /* On Atari, things are more difficult: GEMDOS always uses 12bit FATs + * on floppies, and always 16 bit on harddisks. */ +Index: dosfstools-3.0.13/src/dosfsck.h +=================================================================== +--- dosfstools-3.0.13.orig/src/dosfsck.h 2012-06-27 14:02:26.000000000 +0000 ++++ dosfstools-3.0.13/src/dosfsck.h 2014-12-26 13:33:47.000000000 +0000 +@@ -56,6 +56,8 @@ + + #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME) + ++#define FAT_STATE_DIRTY 0x01 ++ + /* ++roman: Use own definition of boot sector structure -- the kernel headers' + * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */ + struct boot_sector { diff -Nru dosfstools-3.0.13/debian/patches/series dosfstools-3.0.13/debian/patches/series --- dosfstools-3.0.13/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ dosfstools-3.0.13/debian/patches/series 2014-12-26 13:33:45.000000000 +0000 @@ -0,0 +1 @@ +dirty-bit.diff