summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-09-17 08:11:09 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-09-17 08:11:09 +0200
commitdb1c42bfa62eac791a02b42015c83e300dd6016d (patch)
tree92edeaa85befd1483623ce310f1859c060c7e0d8 /src/godmode.c
parent5e1d369053d5bb5d530465953ca505d006576e40 (diff)
Write dmsetup commands in the log file for Linux advanced users
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/godmode.c b/src/godmode.c
index de30f19..43688c7 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -1346,10 +1346,26 @@ int interface_recovery(disk_t *disk_car, const list_part_t * list_part_org, cons
disk_car->arch->init_structure(disk_car,list_part,verbose);
if(verbose>0)
{
+#ifdef TARGET_LINUX
+ unsigned int i=0;
+#endif
/* Write found partitions in the log file */
log_info("\nResults\n");
for(element=list_part;element!=NULL;element=element->next)
log_partition(disk_car,element->part);
+#ifdef TARGET_LINUX
+ if(list_part!=NULL)
+ log_info("\nHint for advanced users. dmsetup may be used if you prefer to avoid to rewrite the partition table for the moment:\n");
+ for(element=list_part;element!=NULL;element=element->next)
+ {
+ const partition_t *partition=element->part;
+ log_info("echo \"0 %llu linear %s %llu\" | dmsetup create test%u\n",
+ (long long unsigned)(partition->part_size/512),
+ disk_car->device,
+ (long long unsigned)(partition->part_offset/512),
+ i++);
+ }
+#endif
}
list_part=ask_structure(disk_car,list_part,verbose,current_cmd);
if(disk_car->arch->test_structure(list_part)==0)