SF.net SVN: morphix: [2565] trunk/mmaker/src/isomaker.c

[email protected] Sat, 13 Oct 2007 15:50:11 -0700
Newsgroups gmane.linux.morphix.cvs
Message-ID <[email protected]>
Revision: 2565
          http://morphix.svn.sourceforge.net/morphix/?rev=2565&view=rev
Author:   alextreme
Date:     2007-10-13 15:50:11 -0700 (Sat, 13 Oct 2007)

Log Message:
-----------
  * adding support for morphix-rebrand (-R)

Modified Paths:
--------------
    trunk/mmaker/src/isomaker.c

Modified: trunk/mmaker/src/isomaker.c
===================================================================
--- trunk/mmaker/src/isomaker.c	2007-10-08 19:42:51 UTC (rev 2564)
+++ trunk/mmaker/src/isomaker.c	2007-10-13 22:50:11 UTC (rev 2565)
@@ -31,16 +31,17 @@
 #define MAKEISO_PATH "/usr/bin/make-iso"
 
 void usage(gchar *filename) {
-	printf("Usage: %s -b basemod.xml [-g debootstrap.tar.gz] [-t tarball.tar.gz] [-m mainmod.xml] [-m mainmod2.xml] [-n minimod1.xml] [-n minimod2.xml] [-c] [-v] [-r repository [-p package1] [-p package2]] output.iso\n",filename);
+	printf("Usage: %s -b basemod.xml [-g debootstrap.tar.gz] [-t tarball.tar.gz] [-m mainmod.xml] [-m mainmod2.xml] [-n minimod1.xml] [-n minimod2.xml] [-c] [-v] [-r repository [-p package1] [-p package2]] [-R image.png] output.iso\n",filename);
 
 	printf("\t-b:\tBase module template to build output.iso with\n");
 	printf("\t-m:\tMain module template to include in output.iso\n");
 	printf("\t-n:\tMini module template to include in output.iso (needs morphmini)\n");
-	printf("\t-r:\tspecify Repository for deb/udeb packages to include on iso\n");
+	printf("\t-r:\tSpecify Repository for deb/udeb packages to include on iso\n");
 	printf("\t-p:\tPackages to be included on iso\n");
 	printf("\t-t:\tTarball to be included on iso\n");
 	printf("\t-g:\tTarball which contains a complete debootstrapped Debian\n\t\tsystem for building the base module (and any main modules)\n");
 	printf("\t-c:\tClean temporary directories\n");
+	printf("\t-R:\tCall morphix-rebrand on the resulting iso using this image-file\n");
 	printf("\t-v:\tverbose mode\n");
 	printf("\nThis tool uses mmaker to generate a Morphix iso from scratch,\n");
 	printf("using one basemodule template, and arbitrary number of mainmodule and minimodule templates,\nand optionally extra dpkg-deb-extracted deb/udeb packages\n\n");
@@ -206,6 +207,7 @@
 	gchar optchar;
 	gchar *gzipfile = NULL;
 	gchar *debtarball = NULL;
+	gchar *morphixrebrand = NULL;
 
 	GList *mainmodxmllist = NULL;
 	GList *minimodxmllist = NULL;
@@ -223,7 +225,7 @@
 		return(EXIT_FAILURE);
 	}
 	
-	while ((optchar = getopt(argc,argv,"b:m:n:r:g:t:p:cv")) != -1) {
+	while ((optchar = getopt(argc,argv,"b:m:n:r:g:t:p:R:cv")) != -1) {
 	  switch (optchar) {
 	  case 'b':
 		  // set temporary directory
@@ -265,6 +267,11 @@
 		  opts+=1;
 		  clean = TRUE;
 		  break;
+	  case 'R':
+		  // call morphix-rebrand afterwards
+		  opts+=2;
+		  morphixrebrand = (char *) g_strdup(optarg);
+		  break;
 	  case 'v':
 		  opts+=1;
 		  verbose = TRUE;
@@ -390,6 +397,22 @@
 	}
 	g_free(cmdline);
 
+	if (morphixrebrand != NULL) {
+		cmdline = g_strdup_printf("mv %s /tmp/tmp.iso", outputiso);
+		ExecuteCommand(cmdline);
+		g_free(cmdline);
+
+		cmdline = g_strdup_printf("morphix-rebrand /tmp/tmp.iso %s %s", outputiso, morphixrebrand);
+		ExecuteCommand(cmdline);
+		g_free(cmdline);
+
+		cmdline = g_strdup_printf("rm /tmp/tmp.iso");
+		ExecuteCommand(cmdline);
+		g_free(cmdline);
+	
+		g_free(morphixrebrand);
+	}
+
 	printf("Info: Your live CD should be available as %s\n",outputiso);
 
 	/* clean everything up... */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/