[EXT2LIB]

- Fix formatting FAT or NTFS volumes into EXT2 by defining ZAP_BOOTBLOCK and fixing a bug in zap_sector()
[USETUP]
- Enable ext2 as an option in setup
- Formatting and building file copy list works but setup stalls shortly after starting to copy files (NewCC on)

svn path=/trunk/; revision=55896
This commit is contained in:
Cameron Gutman 2012-02-28 05:10:40 +00:00
parent 29f3456caf
commit 3998099eae
2 changed files with 7 additions and 3 deletions

View file

@ -5,7 +5,7 @@ NATIVE_CreateFileSystemList(
IN PFILE_SYSTEM_LIST List)
{
FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk);
//FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk);
return TRUE;
}

View file

@ -16,6 +16,9 @@ int inode_ratio = 4096;
BOOLEAN bLocked = FALSE;
/* This is needed for the ext2fs driver to mount the volume */
#define ZAP_BOOTBLOCK
/* FUNCTIONS *************************************************************/
int int_log2(int arg)
@ -197,8 +200,6 @@ bool zap_sector(PEXT2_FILESYS Ext2Sys, int sect, int nsect)
sect, sect + nsect - 1);
return false;
}
memset(buf, 0, (ULONG)nsect * SECTOR_SIZE);
#define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */
#define BSD_MAGICDISK (0x57455682UL) /* The disk magic number reversed */
@ -217,6 +218,8 @@ bool zap_sector(PEXT2_FILESYS Ext2Sys, int sect, int nsect)
goto clean_up;
}
memset(buf, 0, (ULONG)nsect * SECTOR_SIZE);
// Write buf to disk
Ext2WriteDisk( Ext2Sys,
(LONGLONG)(sect * SECTOR_SIZE),
@ -928,6 +931,7 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
blocks = Ext2Sb.s_blocks_count;
#ifdef ZAP_BOOTBLOCK
DPRINT1("Mke2fs: zeroing volume boot record\n");
zap_sector(&FileSys, 0, 2);
#endif