diff options
author | Jeremy Katz <katzj@redhat.com> | 2003-10-14 19:36:32 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2003-10-14 19:36:32 +0000 |
commit | 60a8f9866e39b0eb0f5f0e15057f36679d007522 (patch) | |
tree | e86d39f59a06ada627d57addf02b31810730853d /loader2/urlinstall.c | |
parent | 6af42d3070c2528db2c3fb47a3613e150ef1c449 (diff) | |
download | anaconda-60a8f9866e39b0eb0f5f0e15057f36679d007522.tar.gz anaconda-60a8f9866e39b0eb0f5f0e15057f36679d007522.tar.xz anaconda-60a8f9866e39b0eb0f5f0e15057f36679d007522.zip |
read product path from the build stamp if possible, default to RedHat if not
available. basically notting's patch with some fixes and genhdlist handled
Diffstat (limited to 'loader2/urlinstall.c')
-rw-r--r-- | loader2/urlinstall.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c index d19766dc5..480e32c74 100644 --- a/loader2/urlinstall.c +++ b/loader2/urlinstall.c @@ -43,8 +43,12 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags, int fd; int rc; char * newFile = NULL; + char filepath[1024]; + + /* BNFIXME: hack - all callers want RedHat/<foo>, so add prefix here */ + snprintf(filepath, sizeof(filepath), "%s/%s", getProductPath(), file); - fd = urlinstStartTransfer(ui, file, NULL, 1, flags); + fd = urlinstStartTransfer(ui, filepath, NULL, 1, flags); if (fd == -2) return 2; @@ -52,7 +56,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags, /* file not found */ newFile = alloca(strlen(device) + 20); - sprintf(newFile, "disc1/%s", file); + sprintf(newFile, "disc1/%s", filepath); fd = urlinstStartTransfer(ui, newFile, NULL, 1, flags); @@ -63,7 +67,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags, _("Unable to retrieve %s://%s/%s/%s."), (ui->protocol == URL_METHOD_FTP ? "ftp" : "http"), - ui->address, ui->prefix, file); + ui->address, ui->prefix, filepath); return 2; } } @@ -92,7 +96,7 @@ static int loadUrlImages(struct iurlinfo * ui, int flags) { /* grab the updates.img before netstg1.img so that we minimize our * ramdisk usage */ - if (!loadSingleUrlImage(ui, "RedHat/base/updates.img", flags, + if (!loadSingleUrlImage(ui, "base/updates.img", flags, "/tmp/ramfs/updates-disk.img", "/tmp/update-disk", "loop7", 1)) { copyDirectory("/tmp/update-disk", "/tmp/updates"); @@ -103,7 +107,7 @@ static int loadUrlImages(struct iurlinfo * ui, int flags) { /* grab the product.img before netstg1.img so that we minimize our * ramdisk usage */ - if (!loadSingleUrlImage(ui, "RedHat/base/product.img", flags, + if (!loadSingleUrlImage(ui, "base/product.img", flags, "/tmp/ramfs/product-disk.img", "/tmp/product-disk", "loop7", 1)) { copyDirectory("/tmp/product-disk", "/tmp/product"); @@ -122,7 +126,7 @@ static int loadUrlImages(struct iurlinfo * ui, int flags) { stage2img = "stage2.img"; } - snprintf(tmpstr1, sizeof(tmpstr1), "RedHat/base/%s", stage2img); + snprintf(tmpstr1, sizeof(tmpstr1), "base/%s", stage2img); snprintf(tmpstr2, sizeof(tmpstr2), "/tmp/ramfs/%s", stage2img); rc = loadSingleUrlImage(ui, tmpstr1, flags, tmpstr2, |