int format_ext3_device (const char *device) { char *const mke2fs[] = {MKE2FS_BIN, "-j", "-q", device, NULL}; char *const tune2fs[] = {TUNE2FS_BIN, "-C", "1", device, NULL}; // Run mke2fs if(run_exec_process(mke2fs)) { printf("failure while running mke2fs\n"); return -1; } // Run tune2fs if(run_exec_process(tune2fs)) { printf("failure while running mke2fs\n"); return -1; } // Run e2fsck char *const e2fsck[] = {E2FSCK_BIN, "-fy", device, NULL}; if(run_exec_process(e2fsck)) { printf("failure while running e2fsck\n"); return -1; } return 0; }
int format_ext3_device (const char *device) { #ifdef BOARD_HAS_LARGE_FILESYSTEM char *const mke2fs[] = { MKE2FS_BIN, "-j", "-q", device, NULL }; char *const tune2fs[] = { TUNE2FS_BIN, "-C", "1", device, NULL }; #else char *const mke2fs[] = { MKE2FS_BIN, "-j", device, NULL }; char *const tune2fs[] = { TUNE2FS_BIN, "-j", "-C", "1", device, NULL }; #endif // Run mke2fs if (run_exec_process (mke2fs)) return -1; // Run tune2fs if (run_exec_process (tune2fs)) return -1; // Run e2fsck char *const e2fsck[] = { E2FSCK_BIN, "-fy", device, NULL }; if (run_exec_process (e2fsck)) return -1; return 0; }
int format_ext2_device (const char *device) { // Run mke2fs char *const mke2fs[] = {MKE2FS_BIN, device, NULL}; if(run_exec_process(mke2fs)) return -1; // Run tune2fs char *const tune2fs[] = {TUNE2FS_BIN, "-C", "1", device, NULL}; if(run_exec_process(tune2fs)) return -1; // Run e2fsck char *const e2fsck[] = {E2FSCK_BIN, "-fy", device, NULL}; if(run_exec_process(e2fsck)) return -1; return 0; }
int mmc_format_ext3 (MmcPartition *partition) { char device[128]; strcpy(device, partition->device_index); // Run mke2fs char *const mke2fs[] = {MKE2FS_BIN, "-j", device, NULL}; if(run_exec_process(mke2fs)) return -1; // Run tune2fs char *const tune2fs[] = {TUNE2FS_BIN, "-j", "-C", "1", device, NULL}; if(run_exec_process(tune2fs)) return -1; // Run e2fsck char *const e2fsck[] = {E2FSCK_BIN, "-fy", device, NULL}; if(run_exec_process(e2fsck)) return -1; return 0; }