From: <ale...@us...> - 2006-03-21 16:39:55
|
Revision: 2147 Author: alextreme Date: 2006-03-21 08:38:46 -0800 (Tue, 21 Mar 2006) ViewCVS: http://svn.sourceforge.net/morphix/?rev=2147&view=rev Log Message: ----------- * adding Giulio's patch for adding -c to isomaker, use of tempdir Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2006-03-20 21:35:49 UTC (rev 2146) +++ trunk/mmaker/src/isomaker.c 2006-03-21 16:38:46 UTC (rev 2147) @@ -38,6 +38,7 @@ 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-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 templates,\nand optionally extra dpkg-deb-extracted deb/udeb packages\n\n"); @@ -81,7 +82,7 @@ gchar *cmdline = NULL; ptr = mainmodxmllist; while (ptr != NULL) { - gchar *xmltemplate = (gchar *)ptr->data; + gchar *xmltemplate = (gchar *)ptr->data; count++; cmdline = g_strdup_printf("%s -r %s %s %s/mainmod/mainmod%d.mod", MMAKER_PATH, @@ -170,6 +171,7 @@ gchar *basemodxml = NULL; gchar *repourl = NULL; gchar *workdir = NULL; + gchar *tempdir = NULL; gchar *cmdline = NULL; gchar *outputiso = NULL; gchar optchar; @@ -184,13 +186,14 @@ gint opts = 0; gboolean use_debget = TRUE; gboolean verbose = FALSE; + gboolean clean = FALSE; if (getuid() != 0) { fprintf(stderr,"You need to be root to use this tool! (mkisofs and chroot usage in mmaker)\n"); return(EXIT_FAILURE); } - while ((optchar = getopt(argc,argv,"b:m:r:g:t:p:v")) != -1) { + while ((optchar = getopt(argc,argv,"b:m:r:g:t:p:cv")) != -1) { switch (optchar) { case 'b': // set temporary directory @@ -223,6 +226,10 @@ opts+=2; tarballlist = g_list_append(tarballlist,optarg); break; + case 'c': + opts+=1; + clean = TRUE; + break; case 'v': opts+=1; verbose = TRUE; @@ -281,6 +288,13 @@ printf("Error: Unable to create temporary directory in %s for building in...\n",getTempRoot()); return(EXIT_FAILURE); } + + tempdir = getTempdir(); + if (tempdir == NULL) { + printf("Error: Unable to create temporary directory in %s for building in...\n",getTempRoot()); + return(EXIT_FAILURE); + } + if (g_file_test(DEBGET_PATH,G_FILE_TEST_EXISTS) == FALSE) { printf("Warning: Unable to find deb-get in: %s\n",DEBGET_PATH); printf("Continuing, however packages won't be retrieved or used\n"); @@ -299,9 +313,10 @@ /* build and add basemodule files */ - cmdline = g_strdup_printf("%s%s -m %s/boot/miniroot.gz -k %s/boot/vmlinuz %s %s %s/base/morphix", + cmdline = g_strdup_printf("%s%s -t %s -m %s/boot/miniroot.gz -k %s/boot/vmlinuz %s %s %s/base/morphix", MMAKER_PATH, (verbose ? " -v" : ""), + tempdir, workdir, workdir, basemodxml, @@ -339,8 +354,28 @@ printf("Info: Your live CD should be available as %s\n",outputiso); /* clean everything up... */ + if(clean){ + printf("Info: Cleaning up base module build directory %s\n",tempdir); + cmdline = g_strdup_printf("rm -rf %s",tempdir); + ExecuteCommand(cmdline); + g_free(cmdline); - printf("Info: Cleaning up (disabled, please remove %s manually)\n",workdir); + printf("Info: Cleaning up iso image build directory %s\n",workdir); + cmdline = g_strdup_printf("rm -rf %s",workdir); + ExecuteCommand(cmdline); + g_free(cmdline); + + printf("Info: Cleaning up miniroot %s/miniroot-dir\n",getTempRoot()); + cmdline = g_strdup_printf("rm -rf %s/miniroot-dir",getTempRoot()); + ExecuteCommand(cmdline); + g_free(cmdline); + } + else{ + printf("Info: Cleaning up disabled, please remove manually\n",tempdir); + printf("Info: base module build %s\n",tempdir); + printf("Info: iso image build %s\n",tempdir); + printf("Info: miniroot %s/miniroot-dir\n",getTempRoot()); + + } return (EXIT_SUCCESS); } - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2006-05-30 21:47:39
|
Revision: 2280 Author: alextreme Date: 2006-05-30 14:47:34 -0700 (Tue, 30 May 2006) ViewCVS: http://svn.sourceforge.net/morphix/?rev=2280&view=rev Log Message: ----------- * adding -n minimod.xml (via morphmini) Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2006-05-30 21:36:22 UTC (rev 2279) +++ trunk/mmaker/src/isomaker.c 2006-05-30 21:47:34 UTC (rev 2280) @@ -25,15 +25,17 @@ /* fixed paths, FIXMOI */ +#define MORPHMINI_PATH "/usr/sbin/morphmini" #define MMAKER_PATH "/usr/sbin/mmaker" #define DEBGET_PATH "/usr/bin/deb-get" #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] [-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]] 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-p:\tPackages to be included on iso\n"); printf("\t-t:\tTarball to be included on iso\n"); @@ -41,7 +43,7 @@ printf("\t-c:\tClean temporary directories\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 templates,\nand optionally extra dpkg-deb-extracted deb/udeb packages\n\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"); printf("\nIf you want to modify an existing iso, please take a look at isomorph from\nthe morphix repository, "); printf("Isomorph also allows you to include mini modules, \nscripts, directly-copied and install-on-boot packages\n"); printf("\nThis tool is made possible by an infinite amount of monkeys\n"); @@ -98,6 +100,33 @@ } } +void do_minimodules(gchar *workdir, GList *minimodxmllist) { + gint count = 0; + GList *ptr = NULL; + gchar *cmdline = NULL; + + if (!g_file_test(MORPHMINI_PATH, G_FILE_TEST_EXISTS)) { + printf("Warning: morphmini not found, not building minimodules!\n"); + return; + } + + ptr = minimodxmllist; + while (ptr != NULL) { + gchar *xmltemplate = (gchar *)ptr->data; + count++; + cmdline = g_strdup_printf("%s %s %s/minimod/minimod%d.mod", + MORPHMINI_PATH, + xmltemplate, + workdir, + count); + if (!executeCommandMain(cmdline)) { + printf("Warning: morphmini returned an error when building minimodule, continuing...\n"); + } + g_free(cmdline); + ptr = ptr->next; + } +} + void do_packages(gchar *workdir, GList *packagelist, gboolean use_debget,gchar *repourl) { GList *ptr = NULL; gchar *cmdline = NULL; @@ -179,6 +208,7 @@ gchar *debtarball = NULL; GList *mainmodxmllist = NULL; + GList *minimodxmllist = NULL; GList *packagelist = NULL; GList *tarballlist = NULL; GList *minirootlist = NULL; @@ -206,6 +236,11 @@ opts+=2; mainmodxmllist = g_list_append(mainmodxmllist,optarg); break; + case 'n': + // set debootstrapped base directory + opts+=2; + minimodxmllist = g_list_append(minimodxmllist,optarg); + break; case 'r': opts+=2; if (repourl == NULL) { @@ -332,6 +367,10 @@ do_mainmodules(workdir,mainmodxmllist,debtarball); + /* build and add minimodules */ + + do_minimodules(workdir,minimodxmllist); + /* package/repository stuff. yup, this is messy */ do_packages(workdir,packagelist,use_debget,repourl); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2006-06-26 19:04:36
|
Revision: 2325 Author: alextreme Date: 2006-06-26 12:04:29 -0700 (Mon, 26 Jun 2006) ViewCVS: http://svn.sourceforge.net/morphix/?rev=2325&view=rev Log Message: ----------- * fixing option-bug Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2006-06-25 16:43:29 UTC (rev 2324) +++ trunk/mmaker/src/isomaker.c 2006-06-26 19:04:29 UTC (rev 2325) @@ -223,7 +223,7 @@ return(EXIT_FAILURE); } - while ((optchar = getopt(argc,argv,"b:m:r:g:t:p:cv")) != -1) { + while ((optchar = getopt(argc,argv,"b:m:n:r:g:t:p:cv")) != -1) { switch (optchar) { case 'b': // set temporary directory This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2006-06-26 19:51:18
|
Revision: 2326 Author: alextreme Date: 2006-06-26 12:51:11 -0700 (Mon, 26 Jun 2006) ViewCVS: http://svn.sourceforge.net/morphix/?rev=2326&view=rev Log Message: ----------- * -r -> -c in mmaker Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2006-06-26 19:04:29 UTC (rev 2325) +++ trunk/mmaker/src/isomaker.c 2006-06-26 19:51:11 UTC (rev 2326) @@ -86,7 +86,7 @@ while (ptr != NULL) { gchar *xmltemplate = (gchar *)ptr->data; count++; - cmdline = g_strdup_printf("%s -r %s %s %s/mainmod/mainmod%d.mod", + cmdline = g_strdup_printf("%s -c %s %s %s/mainmod/mainmod%d.mod", MMAKER_PATH, debtarball, xmltemplate, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2006-07-03 21:09:31
|
Revision: 2335 Author: alextreme Date: 2006-07-03 14:09:24 -0700 (Mon, 03 Jul 2006) ViewCVS: http://svn.sourceforge.net/morphix/?rev=2335&view=rev Log Message: ----------- * fixing wrong output in isomaker (tempdir->workdir) Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2006-07-03 20:42:52 UTC (rev 2334) +++ trunk/mmaker/src/isomaker.c 2006-07-03 21:09:24 UTC (rev 2335) @@ -412,7 +412,7 @@ else{ printf("Info: Cleaning up disabled, please remove manually\n",tempdir); printf("Info: base module build %s\n",tempdir); - printf("Info: iso image build %s\n",tempdir); + printf("Info: iso image build %s\n",workdir); printf("Info: miniroot %s/miniroot-dir\n",getTempRoot()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bms...@us...> - 2007-10-02 21:44:15
|
Revision: 2563 http://morphix.svn.sourceforge.net/morphix/?rev=2563&view=rev Author: bmsleight Date: 2007-10-02 14:44:12 -0700 (Tue, 02 Oct 2007) Log Message: ----------- I am not a number ... (Untested) Modified Paths: -------------- trunk/mmaker/src/isomaker.c Modified: trunk/mmaker/src/isomaker.c =================================================================== --- trunk/mmaker/src/isomaker.c 2007-10-02 21:26:01 UTC (rev 2562) +++ trunk/mmaker/src/isomaker.c 2007-10-02 21:44:12 UTC (rev 2563) @@ -86,12 +86,12 @@ while (ptr != NULL) { gchar *xmltemplate = (gchar *)ptr->data; count++; - cmdline = g_strdup_printf("%s -c %s %s %s/mainmod/mainmod%d.mod", + cmdline = g_strdup_printf("%s -c %s %s %s/mainmod/%s.mod", MMAKER_PATH, debtarball, xmltemplate, workdir, - count); + xmltemplate); if (!executeCommandMain(cmdline)) { printf("Warning: mmaker returned an error when building mainmodule, continuing...\n"); } @@ -114,11 +114,11 @@ while (ptr != NULL) { gchar *xmltemplate = (gchar *)ptr->data; count++; - cmdline = g_strdup_printf("%s %s %s/minimod/minimod%d.mod", + cmdline = g_strdup_printf("%s %s %s/minimod/%s.mod", MORPHMINI_PATH, xmltemplate, workdir, - count); + xmltemplate); if (!executeCommandMain(cmdline)) { printf("Warning: morphmini returned an error when building minimodule, continuing...\n"); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ale...@us...> - 2007-10-13 22:50:40
|
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. |