Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwlive.git;a=commitdiff;h=d65bc681902285fa9597986a493a402f11b85b1a

commit d65bc681902285fa9597986a493a402f11b85b1a
Author: James Buren <[email protected]>
Date:   Sat Mar 2 11:14:35 2013 -0600

export format data to global variable for future fstab

diff --git a/new/fwsetup/format.c b/new/fwsetup/format.c
index 4f4b1b0..34c464e 100644
--- a/new/fwsetup/format.c
+++ b/new/fwsetup/format.c
@@ -319,6 +319,26 @@ static bool format_process_devices(void)
return true;
}

+static void format_prepare_fstab(void)
+{
+  size_t i = 0;
+  char text[TEXT_MAX] = {0};
+
+  for( ; targets[i] != 0 ; ++i )
+    ;
+
+  g->fstabdata = malloc0(sizeof(char *) * (i+1));
+
+  g->fstabdata[i] = 0;
+
+  do
+  {
+    --i;
+    
strfcpy(text,sizeof(text),"%s:%s:%s",targets[i]->devicepath,targets[i]->mountpath,targets[i]->newfilesystem);
+    g->fstabdata[i] = strdup(text);
+  } while(i > 0);
+}
+
static bool format_run(void)
{
if(!format_setup())
@@ -338,6 +358,8 @@ static bool format_run(void)
if(!mount_special())
return false;

+  format_prepare_fstab();
+
return true;
}

diff --git a/new/fwsetup/local.h b/new/fwsetup/local.h
index 5d2f92a..cf4b4a7 100644
--- a/new/fwsetup/local.h
+++ b/new/fwsetup/local.h
@@ -61,6 +61,7 @@ struct global
char *xkbmodel;
char *xkbvariant;
char *xkboptions;
+  char **fstabdata;
};

struct device;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to