Re: memory usage and stage2= ??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jerry Vonau wrote:
Hi All:

How is stage2= suppose to work? For the hdinstall.c in the patch,
if you give "anything" as stage2= then the installer looks for /mnt/isodir/images/stage2.img to loopback mount,

Well rather than break everything, I'll just break what I was playing around with. ;-) For the boot prompt, I added a sting input in the form of stg2= that goes where I was trying to use stage2= as a string. Well I wonder if rescue mode works... be back later.

Jerry






--- loader.h.orig	2008-03-21 20:33:14.000000000 -0500
+++ loader.h	2008-03-21 20:36:00.000000000 -0500
@@ -115,6 +115,7 @@
     int lang_set;
     char * kbd;
     int kbd_set;
+    char * stg2;    
     char * netDev;
     int netDev_set;
     char * bootIf;
--- loader.c.orig	2008-03-21 20:28:42.000000000 -0500
+++ loader.c	2008-03-21 18:58:22.000000000 -0500
@@ -870,6 +870,11 @@
             loaderData->kbd = strdup(argv[i] + 7);
             loaderData->kbd_set = 1;
         }
+        else if (!strncasecmp(argv[i], "stg2=", 5) &&
+                   (strlen(argv[i]) > 5)) {   
+            loaderData->stg2 = strdup(argv[i] + 5);
+            flags |= LOADER_FLAGS_STAGE2;
+        }    
         else if (!strncasecmp(argv[i], "method=", 7) && !FL_STAGE2(flags))
             setMethodFromCmdline(argv[i] + 7, loaderData);
         else if (!strncasecmp(argv[i], "stage2=", 7)) {
--- hdinstall.c.orig	2008-03-21 20:30:16.000000000 -0500
+++ hdinstall.c	2008-03-21 20:04:43.000000000 -0500
@@ -140,7 +140,7 @@
 }
 
 /* given a partition device and directory, tries to mount hd install image */
-static char * setupIsoImages(char * device, char * dirName, char * location) {
+static char * setupIsoImages(char * device, char * dirName, char * location, char * stg2 ) {
     int rc;
     char *url = NULL, *dirspec, *updpath, *stg2path;
     char *path;
@@ -163,7 +163,7 @@
 /*    this is messed up stage2=/blah doesn't populate just triggers... 
 *            rc = asprintf(&dirspec, "/mnt/isodir%.*s", (int)  (strrchr(dirName, '/') - dirName), dirName); 
 */
-            rc = asprintf(&dirspec, "/mnt/isodir/images" ); 
+            rc = asprintf(&dirspec, "/mnt/isodir%s", stg2 ); 
             rc = asprintf(&path, "/mnt/isodir%s", dirName );
         } else {
 
@@ -263,6 +263,7 @@
 
     int done = 0;
     char * dir = strdup("");
+    char * stg2;
     char * tmpDir;
     char * url = NULL;
     char * buf;
@@ -273,6 +274,12 @@
     char *kspartition, *ksdirectory;
 
     /* handle kickstart data first if available */
+
+    if (loaderData->stg2 == "") {
+        stg2 = "/";
+    } else {  
+        stg2 = loaderData->stg2;
+    }
     if (loaderData->method == METHOD_HD && loaderData->methodData) {
         kspartition = ((struct hdInstallData *)loaderData->methodData)->partition;
         ksdirectory = ((struct hdInstallData *)loaderData->methodData)->directory;
@@ -293,7 +300,7 @@
             if (!strncmp(kspart, "/dev/", 5))
                 kspart = kspart + 5;
 
-            url = setupIsoImages(kspart, ksdirectory, location);
+            url = setupIsoImages(kspart, ksdirectory, location, stg2);
             if (!url) {
                 logMessage(ERROR, "unable to find %s installation images on hd",
                            getProductName());
@@ -402,15 +409,15 @@
         newtFormRun(form, &es);
 
         selpart = newtListboxGetCurrent(listbox);
-        
 	
-        free(dir); 
+        free(dir);
         if (tmpDir && *tmpDir) {
             /* Protect from form free. */
             dir = strdup(tmpDir);
         } else  {
             dir = strdup("");
         }
+
         newtFormDestroy(form);
         newtPopWindow();
 
@@ -425,8 +432,7 @@
         }
 
         logMessage(INFO, "partition %s selected", selpart);
-
-        url = setupIsoImages(selpart, dir, location);
+        url = setupIsoImages(selpart, dir, location, stg2);
         if (!url) {
             newtWinMessage(_("Error"), _("OK"), 
                            _("Device %s does not appear to contain "
@@ -596,4 +602,3 @@
 }
 
 /* vim:set shiftwidth=4 softtabstop=4: */
-
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux