blob: 5709cc55f5b2a4dd62796b95bc8a4147530145f6 [file] [log] [blame]
Koushik Dutta68df48c2010-09-13 15:04:54 -07001#include <ctype.h>
2#include <errno.h>
3#include <fcntl.h>
4#include <getopt.h>
5#include <limits.h>
6#include <linux/input.h>
7#include <stdio.h>
8#include <stdlib.h>
9#include <string.h>
10#include <sys/reboot.h>
11#include <sys/types.h>
12#include <time.h>
13#include <unistd.h>
14
15#include <sys/wait.h>
16#include <sys/limits.h>
17#include <dirent.h>
18#include <sys/stat.h>
19
20#include <signal.h>
21#include <sys/wait.h>
22
Steve Kondik4123b582010-11-14 03:18:40 -050023extern int __system(const char *command);
Koushik Dutta68df48c2010-09-13 15:04:54 -070024
Steve Kondik4123b582010-11-14 03:18:40 -050025int cmd_bml_restore_raw_partition(const char *partition, const char *filename)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080026{
Koushik Dutta68df48c2010-09-13 15:04:54 -070027 char tmp[PATH_MAX];
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080028 sprintf("dd if=%s of=/dev/block/bml7 bs=4096", filename);
Koushik Dutta68df48c2010-09-13 15:04:54 -070029 return __system(tmp);
30}
Koushik Dutta56c1b3b2010-09-13 15:08:49 -070031
Steve Kondik4123b582010-11-14 03:18:40 -050032int cmd_bml_backup_raw_partition(const char *partition, const char *filename)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080033{
Koushik Dutta56c1b3b2010-09-13 15:08:49 -070034 char tmp[PATH_MAX];
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080035 sprintf("dd of=%s if=/dev/block/bml7 bs=4096", filename);
Koushik Dutta56c1b3b2010-09-13 15:08:49 -070036 return __system(tmp);
37}
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080038
Steve Kondik4123b582010-11-14 03:18:40 -050039int cmd_bml_erase_raw_partition(const char *partition)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080040{
41 // TODO: implement raw wipe
42 return 0;
43}
44
Steve Kondik4123b582010-11-14 03:18:40 -050045int cmd_bml_erase_partition(const char *partition, const char *filesystem)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080046{
47 return -1;
48}
49
Steve Kondik4123b582010-11-14 03:18:40 -050050int cmd_bml_mount_partition(const char *partition, const char *mount_point, const char *filesystem, int read_only)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080051{
52 return -1;
53}
54
Steve Kondik4123b582010-11-14 03:18:40 -050055int cmd_bml_get_partition_device(const char *partition, char *device)
Koushik Duttae5c7e0e2010-11-11 01:19:10 -080056{
57 return -1;
58}