Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=1df4a7bf2d297907e85093e13b766f0cb88826bb

commit 1df4a7bf2d297907e85093e13b766f0cb88826bb
Author: James Buren <[email protected]>
Date:   Tue Aug 14 18:00:22 2012 -0500

add function that creates a new blank partition table (dos/gpt)

diff --git a/fwsetup.h b/fwsetup.h
index 53f0fd7..be7d576 100644
--- a/fwsetup.h
+++ b/fwsetup.h
@@ -128,6 +128,7 @@ extern void string_free(void *p);
extern void partition_free(void *p);
extern struct device *device_read_data(const char *path);
extern bool device_write_data(const struct device *device);
+extern void device_create_partition_table(struct device *device,const char 
*label);
extern void device_free(struct device *device);
extern int main(void);
extern struct module begin_module;
diff --git a/utility.c b/utility.c
index 8124993..8fe0959 100644
--- a/utility.c
+++ b/utility.c
@@ -555,6 +555,23 @@ extern bool device_write_data(const struct device *device)
return true;
}

+extern void device_create_partition_table(struct device *device,const char 
*label)
+{
+  ASSERT_ARGS(device == 0 || (strcmp(label,"dos") != 0 && strcmp(label,"gpt") 
!= 0),);
+
+  free(device->label);
+
+  free(device->uuid);
+
+  list_free(device->partitions,partition_free);
+
+  device->label = strdup(label);
+
+  device->uuid = 0;
+
+  device->partitions = 0;
+}
+
extern void device_free(struct device *device)
{
if(device == 0)
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to