summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-06-23 19:02:38 +0000
committerJeremy Katz <katzj@redhat.com>2003-06-23 19:02:38 +0000
commitc8c0190205336f69c1a94f890a28a3e040565a97 (patch)
treee14cbf45307c02955d4e358dfb7e584026346953 /loader2
parentd1636e475e29facfa7c08db38d4845a9bfe682e7 (diff)
downloadanaconda-c8c0190205336f69c1a94f890a28a3e040565a97.tar.gz
anaconda-c8c0190205336f69c1a94f890a28a3e040565a97.tar.xz
anaconda-c8c0190205336f69c1a94f890a28a3e040565a97.zip
merge from taroon. highlights of this time around
* ppc boot constraints * md5 endianness * don't prompt to save tracebacks to a floppy without a floppy * autopart for kickstart * network configuration in the loader if vnc/display case
Diffstat (limited to 'loader2')
-rw-r--r--loader2/hdinstall.c1
-rw-r--r--loader2/lang.c18
-rw-r--r--loader2/linuxrc.s39068
-rw-r--r--loader2/loader.c118
-rw-r--r--loader2/loader.h13
-rw-r--r--loader2/nfsinstall.c49
-rw-r--r--loader2/urlinstall.c44
7 files changed, 126 insertions, 185 deletions
diff --git a/loader2/hdinstall.c b/loader2/hdinstall.c
index 3941c1fea..bd9255145 100644
--- a/loader2/hdinstall.c
+++ b/loader2/hdinstall.c
@@ -590,6 +590,7 @@ void setKickstartHD(struct loaderData_s * loaderData, int argc,
logMessage("kickstartFromHD");
optCon = poptGetContext(NULL, argc, (const char **) argv, ksHDOptions, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
+ startNewt(*flagsPtr);
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Bad argument to HD kickstart method "
"command %s: %s"),
diff --git a/loader2/lang.c b/loader2/lang.c
index 7450f7162..44c6c82a4 100644
--- a/loader2/lang.c
+++ b/loader2/lang.c
@@ -227,7 +227,7 @@ static int setupLanguage(int choice, int flags) {
logMessage("going to set language to %s", languages[choice].lc_all);
/* load the language only if it is displayable. if they're using
- * a serial console, we hope it's smart enough */
+ * a serial console or iSeries vioconsole, we hope it's smart enough */
if (!strcmp(languages[choice].font, "bterm") && !FL_SERIAL(flags) &&
!isVioConsole() && startBterm(flags)) {
if (FL_KICKSTART(flags)) return 0;
@@ -385,21 +385,7 @@ int chooseLanguage(char ** lang, int flags) {
/* this can't happen */
if (i == numLanguages) abort();
- /* load the language only if it is displayable. assume that if they're
- * on a serial console or iSeries vioconsole that their terminal is
- * smart. */
- if (!strcmp(languages[choice].font, "bterm") && !FL_SERIAL(flags) &&
- !isVioConsole() && startBterm(flags)) {
- newtWinMessage("Language Unavailable", "OK",
- "%s display is unavailable in text mode. The "
- "installation will continue in English until the "
- "display of %s is possible.", languages[choice].lang,
- languages[choice].lang);
- return 0;
- }
-
- setupLanguage(choice, flags);
- return 0;
+ return setupLanguage(choice, flags);
}
void setKickstartLanguage(struct loaderData_s * loaderData, int argc,
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index a0ab94f47..56c1513a6 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -97,14 +97,6 @@ echo "1 4 1 1" > /proc/sys/kernel/printk
# make /tmp/ramfs
mount -t ramfs none /tmp
-mkdir /OCO
-mount -t ext2 /dev/ram /OCO >/dev/null 2>&1
-# if there is no second initrd, remove mountpoint because
-# anaconda checks for its existance:
-if [ "$?" != "0" ]; then
- rm -rf /OCO 2>/dev/null
-fi
-
ifconfig lo 127.0.0.1 netmask 255.0.0.0
route add -host 127.0.0.1 dev lo 2>/dev/null
@@ -182,16 +174,18 @@ if [ ":$NETTYPE" = ":eth" ] || [ ":$NETTYPE" = ":tr" ] || [ ":$NETTYPE" = ":hsi"
read GATEWAY
done
if echo "$CHANDEV" |grep -q "lcs"; then
- LCS="on"
+ if [ ":$NETTYPE" = ":tr" ]; then
+ TR="on"
+ else
+ LCS="on"
+ fi
fi
# qeth and nettype!= eth is hipersockets !
if echo "$CHANDEV" |grep -q "qeth"; then
- if echo "$NETTYPE" |grep -q "eth"; then
+ if [ ":$NETTYPE" = ":eth" ]; then
QETH="on"
- elif echo "$NETTYPE" |grep -q "hsi"; then
+ elif [ ":$NETTYPE" = ":hsi" ]; then
HSI="on"
- elif echo "$NETTYPE" |grep -q "tr"; then
- TR="on"
fi
fi
else # ctc0, escon0, iucv0
@@ -201,10 +195,6 @@ else # ctc0, escon0, iucv0
done
if [ "$NETTYPE" = "ctc" ]; then
-# if [ -z "$MTU" ]; then
-# echo $"Enter the maximal transfer unit (MTU) for this connection or leave empty:"
-# read MTU
-# fi
if [ -z "$MTU" ]; then
MTU="1500"
fi
@@ -237,41 +227,23 @@ elif [ ":$NETTYPE" = ":iucv" ]; then
insmod netiucv$LO $IUCV
ifconfig $DEVICE $IPADDR $MMTU pointopoint $GATEWAY
route add -host $IPADDR dev $DEVICE 2>/dev/null
-else # lcs, tr, qeth, hsi or older kernel without opensource-lcs
+elif [ -n "$LCS" -o -n "$TR" ]; then
+ insmod lcs$LO
+ ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
+ route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
+elif [ -n "$QETH" -o -n "$HSI" ]; then
if [ "$DEVICE" = "eth0" -a "$HSI" = "on" ]; then
DEVICE="hsi0"
fi
- insmod ipv6$LO
- if [ -n "$LCS" ]; then
- insmod -f lcs$LO
- if [ "$?" = "1" ]; then
- echo $"warning: no lcs module found in the first initrd, "
- echo $" looking for second initrd"
- else
- ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
- route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
- fi
- fi
- if [ -d "/OCO" ]; then
- if [ -n "$LCS" ]; then
- if [ -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/lcs.o ]; then
- insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/lcs$LO
- else
- echo $"error: no lcs module found"
- fi
- else # qeth or hsi
- if [ -f /OCO/$KERNELVERSION/kernel/drivers/s390/qdio.o -a -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/qeth.o ]; then
- insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/qdio$LO
- insmod -f /OCO/$KERNELVERSION/kernel/drivers/s390/net/qeth$LO
- else
- echo $"error: The qdio and the qeth modules are needed for this"
- echo $"They cannot be found in /OCO/$KERNELVERSION/kernel/drivers/s390/, skipping..."
- fi
- fi
- ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
- route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
- fi
+ insmod qdio$LO
+ insmod qeth$LO
+ ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
+ route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
+else
+ echo $"Unknown network device, aborting installation"
+ exit 1
fi
+
route add default gw $GATEWAY dev $DEVICE 2>/dev/null
if [ -z "$DNS" ]; then
diff --git a/loader2/loader.c b/loader2/loader.c
index ffff64ea1..164bbdf79 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -70,6 +70,7 @@
#include "hdinstall.h"
#include "urlinstall.h"
+#include "net.h"
#include "telnetd.h"
#include "../isys/imount.h"
@@ -80,6 +81,8 @@
/* maximum number of extra arguments that can be passed to the second stage */
#define MAX_EXTRA_ARGS 128
+static char * extraArgs[MAX_EXTRA_ARGS];
+static int hasGraphicalOverride();
static int newtRunning = 0;
@@ -106,7 +109,6 @@ static int numMethods = sizeof(installMethods) / sizeof(struct installMethod);
/* JKFIXME: bad hack for second stage modules without module-info */
struct moduleBallLocation * secondStageModuleLocation;
-
#if 0
#if !defined(__s390__) && !defined(__s390x__)
@@ -418,7 +420,7 @@ static void readNetInfo(int flags, struct loaderData_s ** ld) {
* NOTE: in test mode, can specify a cmdline with --cmdline
*/
static int parseCmdLineFlags(int flags, struct loaderData_s * loaderData,
- char * cmdLine, char * extraArgs[]) {
+ char * cmdLine) {
int fd;
char buf[500];
int len;
@@ -596,6 +598,16 @@ static void checkForRam(int flags) {
}
}
+static int haveDeviceOfType(struct knownDevices * kd, int type) {
+ int i;
+
+ for (i = 0; i < kd->numKnown; i++) {
+ if (type == kd->known[i].class)
+ return 1;
+ }
+ return 0;
+}
+
/* fsm for the basics of the loader. */
static char *doLoaderMain(char * location,
struct loaderData_s * loaderData,
@@ -605,7 +617,8 @@ static char *doLoaderMain(char * location,
moduleDeps * modDepsPtr,
int flags) {
enum { STEP_LANG, STEP_KBD, STEP_METHOD, STEP_DRIVER,
- STEP_DRIVERDISK, STEP_URL, STEP_DONE } step;
+ STEP_DRIVERDISK, STEP_NETWORK, STEP_IFACE,
+ STEP_IP, STEP_URL, STEP_DONE } step;
char * url = NULL;
int dir = 1;
int rc, i;
@@ -615,6 +628,12 @@ static char *doLoaderMain(char * location,
int validMethods[10];
int methodNum = -1;
+ int needed = -1;
+ int needsNetwork = 0;
+
+ char * devName = NULL;
+ static struct networkDeviceConfig netDev;
+
char * kbdtype = NULL;
for (i = 0; i < numMethods; i++, numValidMethods++) {
@@ -638,11 +657,6 @@ static char *doLoaderMain(char * location,
if (url && !FL_RESCUE(flags)) return url;
}
- /* iSeries vio console users will be telnetting in to the primary
- partition, so use a terminal type that is appripriate */
- if (isVioConsole())
- setenv("TERM", "vt100", 1);
-
startNewt(flags);
step = STEP_LANG;
@@ -699,6 +713,8 @@ static char *doLoaderMain(char * location,
if (FL_RESCUE(flags) && url)
return url;
+ needed = -1;
+
if (loaderData->method && (methodNum != -1)) {
rc = 1;
} else {
@@ -722,24 +738,18 @@ static char *doLoaderMain(char * location,
step = STEP_KBD;
dir = -1;
} else {
+ needed = installMethods[validMethods[methodNum]].deviceType;
step = STEP_DRIVER;
dir = 1;
}
break;
case STEP_DRIVER: {
- int found = 0;
-
updateKnownDevices(kd);
- for (i = 0; i < kd->numKnown; i++) {
- if (installMethods[validMethods[methodNum]].deviceType ==
- kd->known[i].class)
- found = 1;
- }
-
- if (found) {
- step = STEP_URL;
+ if (needed == -1 || haveDeviceOfType(kd, needed)) {
+ step = STEP_NETWORK;
dir = 1;
+ needed = -1;
break;
}
@@ -770,7 +780,7 @@ static char *doLoaderMain(char * location,
case STEP_DRIVERDISK:
- rc = loadDriverFromMedia(installMethods[validMethods[methodNum]].deviceType,
+ rc = loadDriverFromMedia(needed,
modLoaded, modDepsPtr, modInfo, kd,
flags, 0, 0);
if (rc == LOADER_BACK) {
@@ -783,6 +793,63 @@ static char *doLoaderMain(char * location,
* the right kind of driver after loading the driver disk */
step = STEP_DRIVER;
break;
+
+ case STEP_NETWORK:
+ if ( (installMethods[validMethods[methodNum]].deviceType !=
+ CLASS_NETWORK) && (!hasGraphicalOverride())) {
+ needsNetwork = 0;
+ if (dir == 1)
+ step = STEP_URL;
+ else if (dir == -1)
+ step = STEP_METHOD;
+ break;
+ }
+
+ needsNetwork = 1;
+ if (!haveDeviceOfType(kd, CLASS_NETWORK)) {
+ needed = CLASS_NETWORK;
+ step = STEP_DRIVER;
+ break;
+ }
+ logMessage("need to set up networking");
+
+ initLoopback();
+ memset(&netDev, 0, sizeof(netDev));
+ netDev.isDynamic = 1;
+
+ /* fall through to interface selection */
+ case STEP_IFACE:
+ logMessage("going to pick interface");
+ rc = chooseNetworkInterface(kd, loaderData, flags);
+ if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
+ ((dir == -1) && (rc == LOADER_NOOP))) {
+ step = STEP_METHOD;
+ dir = -1;
+ break;
+ }
+
+ devName = loaderData->netDev;
+ strcpy(netDev.dev.device, devName);
+
+ /* fall through to ip config */
+ case STEP_IP:
+ if (!needsNetwork) step = STEP_METHOD; /* only hit going back */
+
+ logMessage("going to do getNetConfig");
+ /* populate netDev based on any kickstart data */
+ setupNetworkDeviceConfig(&netDev, loaderData, flags);
+
+ rc = readNetConfig(devName, &netDev, flags);
+ if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
+ ((dir == -1) && (rc == LOADER_NOOP))) {
+ step = STEP_IFACE;
+ dir = -1;
+ break;
+ }
+
+ writeNetInfo("/tmp/netinfo", &netDev, kd);
+ step = STEP_URL;
+ dir = 1;
case STEP_URL:
logMessage("starting to STEP_URL");
@@ -791,7 +858,7 @@ static char *doLoaderMain(char * location,
location, kd, loaderData, modInfo, modLoaded,
modDepsPtr, flags);
if (!url) {
- step = STEP_METHOD;
+ step = STEP_IP ;
dir = -1;
} else {
logMessage("got url %s", url);
@@ -888,7 +955,7 @@ static void migrate_runtime_directory(char * dirname) {
}
-static int hasGraphicalOverride(char *extraArgs[]) {
+static int hasGraphicalOverride() {
int i;
if (getenv("DISPLAY"))
@@ -909,7 +976,6 @@ int main(int argc, char ** argv) {
FILE *f;
char twelve = 12;
- char * extraArgs[MAX_EXTRA_ARGS];
struct knownDevices kd;
moduleInfoSet modInfo;
@@ -998,9 +1064,9 @@ int main(int argc, char ** argv) {
memset(&loaderData, 0, sizeof(loaderData));
extraArgs[0] = NULL;
- flags = parseCmdLineFlags(flags, &loaderData, cmdLine, extraArgs);
+ flags = parseCmdLineFlags(flags, &loaderData, cmdLine);
- if (FL_SERIAL(flags) && !hasGraphicalOverride(extraArgs))
+ if (FL_SERIAL(flags) && !hasGraphicalOverride())
flags |= LOADER_FLAGS_TEXT;
setupRamfs();
@@ -1020,6 +1086,10 @@ int main(int argc, char ** argv) {
initializeConsole(modLoaded, modDeps, modInfo, flags);
checkForRam(flags);
+ /* iSeries vio console users will be telnetting in to the primary
+ partition, so use a terminal type that is appripriate */
+ if (isVioConsole())
+ setenv("TERM", "vt100", 1);
mlLoadModuleSet("cramfs:vfat:nfs:loop:isofs:floppy", modLoaded, modDeps,
modInfo, flags);
diff --git a/loader2/loader.h b/loader2/loader.h
index 4e981b60e..e7b007cc0 100644
--- a/loader2/loader.h
+++ b/loader2/loader.h
@@ -12,23 +12,17 @@
#define LOADER_FLAGS_TEXT (1 << 2)
#define LOADER_FLAGS_RESCUE (1 << 3)
#define LOADER_FLAGS_KICKSTART (1 << 4)
-#define LOADER_FLAGS_KSFLOPPY (1 << 5)
-#define LOADER_FLAGS_KSHD (1 << 6)
#define LOADER_FLAGS_NOPROBE (1 << 7)
#define LOADER_FLAGS_MODDISK (1 << 8)
#define LOADER_FLAGS_ISA (1 << 9)
#define LOADER_FLAGS_SERIAL (1 << 10)
#define LOADER_FLAGS_UPDATES (1 << 11)
#define LOADER_FLAGS_KSFILE (1 << 12)
-#define LOADER_FLAGS_KSCDROM (1 << 13)
-#define LOADER_FLAGS_MCHECK (1 << 14)
-#define LOADER_FLAGS_KSNFS (1 << 15)
#define LOADER_FLAGS_NOUSB (1 << 16)
#define LOADER_FLAGS_NOSHELL (1 << 17)
#define LOADER_FLAGS_NOPCMCIA (1 << 18)
#define LOADER_FLAGS_TELNETD (1 << 19)
#define LOADER_FLAGS_NOPASS (1 << 20)
-#define LOADER_FLAGS_KSHTTP (1 << 21)
#define LOADER_FLAGS_MEDIACHECK (1 << 22)
#define LOADER_FLAGS_NOUSBSTORAGE (1 << 23)
#define LOADER_FLAGS_ASKMETHOD (1 << 24)
@@ -43,26 +37,19 @@
#define FL_TEXT(a) ((a) & LOADER_FLAGS_TEXT)
#define FL_RESCUE(a) ((a) & LOADER_FLAGS_RESCUE)
#define FL_KICKSTART(a) ((a) & LOADER_FLAGS_KICKSTART)
-#define FL_KSFLOPPY(a) ((a) & LOADER_FLAGS_KSFLOPPY)
-#define FL_KSHD(a) ((a) & LOADER_FLAGS_KSHD)
#define FL_NOPROBE(a) ((a) & LOADER_FLAGS_NOPROBE)
#define FL_MODDISK(a) ((a) & LOADER_FLAGS_MODDISK)
#define FL_ISA(a) ((a) & LOADER_FLAGS_ISA)
#define FL_SERIAL(a) ((a) & LOADER_FLAGS_SERIAL)
#define FL_UPDATES(a) ((a) & LOADER_FLAGS_UPDATES)
#define FL_KSFILE(a) ((a) & LOADER_FLAGS_KSFILE)
-#define FL_KSCDROM(a) ((a) & LOADER_FLAGS_KSCDROM)
-#define FL_MCHECK(a) ((a) & LOADER_FLAGS_MCHECK)
-#define FL_KSNFS(a) ((a) & LOADER_FLAGS_KSNFS)
#define FL_NOUSB(a) ((a) & LOADER_FLAGS_NOUSB)
#define FL_NOSHELL(a) ((a) & LOADER_FLAGS_NOSHELL)
-#define FL_LOWRES(a) ((a) & LOADER_FLAGS_LOWRES)
#define FL_NOFB(a) ((a) & LOADER_FLAGS_NOFB)
#define FL_NOPCMCIA(a) ((a) & LOADER_FLAGS_NOPCMCIA)
#define FL_RESCUE_NOMOUNT(a) ((a) & LOADER_FLAGS_RESCUE_NOMOUNT)
#define FL_TELNETD(a) ((a) & LOADER_FLAGS_TELNETD)
#define FL_NOPASS(a) ((a) & LOADER_FLAGS_NOPASS)
-#define FL_KSHTTP(a) ((a) & LOADER_FLAGS_KSHTTP)
#define FL_MEDIACHECK(a) ((a) & LOADER_FLAGS_MEDIACHECK)
#define FL_NOUSBSTORAGE(a) ((a) & LOADER_FLAGS_NOUSBSTORAGE)
#define FL_ASKMETHOD(a) ((a) & LOADER_FLAGS_ASKMETHOD)
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 37f7e70e8..aa3324688 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -75,58 +75,21 @@ char * mountNfsImage(struct installMethod * method,
struct loaderData_s * loaderData,
moduleInfoSet modInfo, moduleList modLoaded,
moduleDeps * modDepsPtr, int flags) {
- static struct networkDeviceConfig netDev;
- char * devName = NULL;
char * host = NULL;
char * directory = NULL;
char * fullPath = NULL;
char * path;
char * url = NULL;
- enum { NFS_STAGE_IFACE, NFS_STAGE_IP, NFS_STAGE_NFS,
- NFS_STAGE_MOUNT, NFS_STAGE_DONE } stage = NFS_STAGE_IFACE;
+ enum { NFS_STAGE_NFS, NFS_STAGE_MOUNT,
+ NFS_STAGE_DONE } stage = NFS_STAGE_NFS;
int rc;
int dir = 1;
- initLoopback();
-
- memset(&netDev, 0, sizeof(netDev));
- netDev.isDynamic = 1;
-
- /* JKFIXME: ASSERT -- we have a network device when we get here */
+ /* JKFIXME: ASSERT -- we have a network device setup when we get here */
while (stage != NFS_STAGE_DONE) {
switch (stage) {
- case NFS_STAGE_IFACE:
- logMessage("going to pick interface");
- rc = chooseNetworkInterface(kd, loaderData, flags);
-
- if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
- ((dir == -1) && (rc == LOADER_NOOP))) return NULL;
-
- stage = NFS_STAGE_IP;
- dir = 1;
- logMessage("using interface %s", loaderData->netDev);
- devName = loaderData->netDev;
- strcpy(netDev.dev.device, devName);
- break;
-
- case NFS_STAGE_IP:
- logMessage("going to do getNetConfig");
-
- /* populate netDev based on any kickstart data */
- setupNetworkDeviceConfig(&netDev, loaderData, flags);
-
- rc = readNetConfig(devName, &netDev, flags);
- if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
- ((dir == -1) && (rc == LOADER_NOOP))) {
- stage = NFS_STAGE_IFACE;
- dir = -1;
- break;
- }
- stage = NFS_STAGE_NFS;
- break;
-
case NFS_STAGE_NFS:
logMessage("going to do nfsGetSetup");
if (loaderData->method && *loaderData->method &&
@@ -144,9 +107,7 @@ char * mountNfsImage(struct installMethod * method,
break;
}
} else if (nfsGetSetup(&host, &directory) == LOADER_BACK) {
- stage = NFS_STAGE_IP;
- dir = -1;
- break;
+ return NULL;
}
stage = NFS_STAGE_MOUNT;
@@ -241,7 +202,6 @@ char * mountNfsImage(struct installMethod * method,
}
}
- writeNetInfo("/tmp/netinfo", &netDev, kd);
free(host);
free(directory);
@@ -263,6 +223,7 @@ void setKickstartNfs(struct loaderData_s * loaderData, int argc,
logMessage("kickstartFromNfs");
optCon = poptGetContext(NULL, argc, (const char **) argv, ksNfsOptions, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
+ startNewt(*flagsPtr);
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Bad argument to NFS kickstart method "
"command %s: %s"),
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 27af6b486..302e9b7c0 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -168,8 +168,6 @@ char * mountUrlImage(struct installMethod * method,
moduleDeps * modDeps, int flags) {
int rc;
char * url;
- char * devName = NULL;
- static struct networkDeviceConfig netDev;
struct iurlinfo ui;
char needsSecondary = ' ';
int dir = 1;
@@ -177,50 +175,18 @@ char * mountUrlImage(struct installMethod * method,
char * finalPrefix;
char * cdurl;
- enum { URL_STAGE_IFACE, URL_STAGE_IP, URL_STAGE_MAIN, URL_STAGE_SECOND,
- URL_STAGE_FETCH, URL_STAGE_DONE } stage = URL_STAGE_IFACE;
+ enum { URL_STAGE_MAIN, URL_STAGE_SECOND, URL_STAGE_FETCH,
+ URL_STAGE_DONE } stage = URL_STAGE_MAIN;
enum urlprotocol_t proto =
!strcmp(method->name, "FTP") ? URL_METHOD_FTP : URL_METHOD_HTTP;
/* JKFIXME: we used to do another ram check here... keep it? */
- initLoopback();
-
memset(&ui, 0, sizeof(ui));
- memset(&netDev, 0, sizeof(netDev));
- netDev.isDynamic = 1;
while (stage != URL_STAGE_DONE) {
switch(stage) {
- case URL_STAGE_IFACE:
- logMessage("going to pick interface");
- rc = chooseNetworkInterface(kd, loaderData, flags);
- if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
- ((dir == -1) && (rc == LOADER_NOOP))) return NULL;
-
- devName = loaderData->netDev;
- strcpy(netDev.dev.device, devName);
- stage = URL_STAGE_IP;
- dir = 1;
- break;
-
- case URL_STAGE_IP:
- logMessage("going to do getNetConfig");
-
- /* populate netDev based on any kickstart data */
- setupNetworkDeviceConfig(&netDev, loaderData, flags);
-
- rc = readNetConfig(devName, &netDev, flags);
- if ((rc == LOADER_BACK) || (rc == LOADER_ERROR) ||
- ((dir == -1) && (rc == LOADER_NOOP))) {
- stage = URL_STAGE_IFACE;
- dir = -1;
- break;
- }
- stage = URL_STAGE_MAIN;
- dir = 1;
-
case URL_STAGE_MAIN:
if (loaderData->method && *loaderData->method &&
(!strncmp(loaderData->method, "ftp", 3) ||
@@ -246,9 +212,7 @@ char * mountUrlImage(struct installMethod * method,
dir = 1;
break;
} else if (urlMainSetupPanel(&ui, proto, &needsSecondary)) {
- stage = URL_STAGE_IP;
- dir = -1;
- break;
+ return NULL;
}
/* got required information from user, proceed */
@@ -323,7 +287,6 @@ char * mountUrlImage(struct installMethod * method,
sprintf(url, "%s://%s%s/%s",
ui.protocol == URL_METHOD_FTP ? "ftp" : "http",
login, ui.address, finalPrefix);
- writeNetInfo("/tmp/netinfo", &netDev, kd);
return url;
}
@@ -396,6 +359,7 @@ void setKickstartUrl(struct loaderData_s * loaderData, int argc,
logMessage("kickstartFromUrl");
optCon = poptGetContext(NULL, argc, (const char **) argv, ksUrlOptions, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
+ startNewt(*flagsPtr);
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Bad argument to Url kickstart method "
"command %s: %s"),