[PATCH] mountStage2 now needs to take an extra argument for where updates are.

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

 



---
 loader2/cdinstall.c |   13 +++++++++----
 loader2/method.c    |   17 ++++++++++++-----
 loader2/method.h    |    2 +-
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/loader2/cdinstall.c b/loader2/cdinstall.c
index 9ac338c..27f65cf 100644
--- a/loader2/cdinstall.c
+++ b/loader2/cdinstall.c
@@ -154,9 +154,10 @@ static void wrongCDMessage(void) {
 static void mountCdromStage2(char *cddev, char *location) {
     int gotcd1=0;
     int rc;
-    char *stage2loc;
+    char *stage2loc, *imageDir;
 
     rc = asprintf(&stage2loc, "%s/images/stage2.img", location);
+    rc = asprintf(&imageDir, "%s/images/", location);
 
     do {
         do {
@@ -168,7 +169,7 @@ static void mountCdromStage2(char *cddev, char *location) {
             }
         } while (1);
 
-        rc = mountStage2(stage2loc);
+        rc = mountStage2(stage2loc, imageDir);
 
         /* if we failed, umount location (usually) /mnt/source and keep going */
         if (rc) {
@@ -179,6 +180,9 @@ static void mountCdromStage2(char *cddev, char *location) {
             gotcd1 = 1;
         }
     } while (!gotcd1);
+
+    free(stage2loc);
+    free(imageDir);
 }
 
 /* ask about doing media check */
@@ -230,12 +234,13 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
     int i, r, rc;
     int foundinvalid = 0;
     int stage2inram = 0;
-    char *buf, *stage2loc, *discinfoloc;
+    char *buf, *stage2loc, *discinfoloc, *imageDir;
     char *stage2img;
     struct device ** devices;
     char *cddev = NULL;
 
     r = asprintf(&stage2loc, "%s/images/stage2.img", location);
+    r = asprintf(&imageDir, "%s/images", location);
     r = asprintf(&discinfoloc, "%s/.discinfo", location);
 
     devices = getDevices(DEVICE_CDROM);
@@ -277,7 +282,7 @@ char * setupCdrom(char * location, struct loaderData_s * loaderData,
                         stage2img = strdup(stage2loc);
                         stage2inram = 0;
                     }
-                    rc = mountStage2(stage2img);
+                    rc = mountStage2(stage2img, imageDir);
 
                     /* if we failed, umount location (usually /mnt/source) and
                      * keep going
diff --git a/loader2/method.c b/loader2/method.c
index 1da97a7..5dbac12 100644
--- a/loader2/method.c
+++ b/loader2/method.c
@@ -564,12 +564,15 @@ void umountStage2(void) {
 
 /* mount a second stage, verify the stamp file, copy updates 
  * Returns 0 on success, 1 on failure to mount, -1 on bad stamp */
-int mountStage2(char * path) {
-    if (access(path, R_OK)) {
+int mountStage2(char *stage2path, char *imageDir) {
+    char *buf;
+    int rc;
+
+    if (access(stage2path, R_OK)) {
         return 1;
     }
 
-    if (mountLoopback(path, "/mnt/runtime", "/dev/loop0")) {
+    if (mountLoopback(stage2path, "/mnt/runtime", "/dev/loop0")) {
         return 1;
     }
 
@@ -579,10 +582,14 @@ int mountStage2(char * path) {
     }
 
     /* JKFIXME: this is kind of silly.. /mnt/source is hardcoded :/ */
-    copyUpdatesImg("/mnt/source/images/updates.img");
+    rc = asprintf(&buf, "%s/updates.img", imageDir);
+    copyUpdatesImg(buf);
+    free(buf);
 
     /* more hard coding */
-    copyProductImg("/mnt/source/images/product.img");
+    rc = asprintf(&buf, "%s/product.img", imageDir);
+    copyProductImg(buf);
+    free(buf);
 
     return 0;
 }
diff --git a/loader2/method.h b/loader2/method.h
index ec34781..6102880 100644
--- a/loader2/method.h
+++ b/loader2/method.h
@@ -50,7 +50,7 @@ void queryIsoMediaCheck(char * isoDir);
 int verifyStamp(char * path);
 
 void umountStage2(void);
-int mountStage2(char * path);
+int mountStage2(char *stage2path, char *imageDir);
 int copyFileAndLoopbackMount(int fd, char *dest, char *device, char *mntpoint);
 int getFileFromBlockDevice(char *device, char *path, char * dest);
 
-- 
1.5.3.7

_______________________________________________
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