summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-09-20 03:31:26 +0000
committerJeremy Katz <katzj@redhat.com>2003-09-20 03:31:26 +0000
commit31f1add4879da48efb7af21fc5c575692cc3709d (patch)
tree7a541b8f54f91ed8309da17752e205b40db2cf30 /loader2
parent8307d33391423f13c1deed409b80d8e381582a93 (diff)
downloadanaconda-31f1add4879da48efb7af21fc5c575692cc3709d.tar.gz
anaconda-31f1add4879da48efb7af21fc5c575692cc3709d.tar.xz
anaconda-31f1add4879da48efb7af21fc5c575692cc3709d.zip
merge from taroon
fairly large merge, but all fairly obvious stuff. will test in a tree tomorrow
Diffstat (limited to 'loader2')
-rw-r--r--loader2/driverdisk.c14
-rw-r--r--loader2/hardware.c43
-rw-r--r--loader2/hardware.h3
-rw-r--r--loader2/linuxrc.s39018
-rw-r--r--loader2/loader.c14
-rw-r--r--loader2/module-info24
-rw-r--r--loader2/net.c2
-rw-r--r--loader2/nfsinstall.c7
-rw-r--r--loader2/urlinstall.c7
9 files changed, 116 insertions, 16 deletions
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index aa98653dd..da4f29003 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -157,9 +157,8 @@ int getRemovableDevices(char *** devNames) {
int numDevices = 0;
int i = 0, j = 0;
- floppies = probeDevices(CLASS_FLOPPY,
- BUS_IDE | BUS_SCSI | BUS_MISC, PROBE_ALL);
- cdroms = probeDevices(CLASS_CDROM, BUS_IDE | BUS_SCSI, PROBE_ALL);
+ floppies = probeDevices(CLASS_FLOPPY, BUS_UNSPEC, PROBE_ALL);
+ cdroms = probeDevices(CLASS_CDROM, BUS_UNSPEC, PROBE_ALL);
/* we should probably take detached into account here, but it just
* means we use a little bit more memory than we really need to */
@@ -195,6 +194,7 @@ int getRemovableDevices(char *** devNames) {
for (i = 0; devices[i] && (i < numDevices); i++)
(*devNames)[i] = strdup(devices[i]->device);
free(devices);
+ (*devNames)[i] = NULL;
if (i != numDevices)
logMessage("somehow numDevices != len(devices)");
@@ -441,11 +441,19 @@ void getDDFromSource(struct knownDevices * kd,
logMessage("unable to retrieve driver disk: %s", src);
return;
}
+ /* FIXME: this is a hack so that you can load a driver disk from, eg,
+ * scsi cdrom drives */
+ } else if (!strncmp(src, "cdrom", 5)) {
+ loadDriverDisks(CLASS_UNSPEC, loaderData->modLoaded,
+ loaderData->modDepsPtr, loaderData->modInfo,
+ kd, flags);
+ return;
} else {
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Unknown driver disk kickstart source: %s"), src);
return;
}
+
if (!mountLoopback("/tmp/dd.img", "/tmp/drivers", "loop6")) {
loadFromLocation(kd, loaderData, "/tmp/drivers", flags);
umountLoopback("/tmp/drivers", "loop6");
diff --git a/loader2/hardware.c b/loader2/hardware.c
index 4d0e8f68c..7638bcbbd 100644
--- a/loader2/hardware.c
+++ b/loader2/hardware.c
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <kudzu/kudzu.h>
+#include <popt.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
@@ -216,6 +217,45 @@ int probeiSeries(moduleInfoSet modInfo, moduleList modLoaded,
return 0;
}
+/* this allows us to do an early load of modules specified on the
+ * command line to allow automating the load order of modules so that
+ * eg, certain scsi controllers are definitely first.
+ * FIXME: this syntax is likely to change in a future release
+ * but is done as a quick hack for the present.
+ */
+int earlyModuleLoad(moduleInfoSet modInfo, moduleList modLoaded,
+ moduleDeps modDeps, int justProbe,
+ struct knownDevices * kd, int flags) {
+ int fd, len, i;
+ char buf[1024], *cmdLine;
+ int argc;
+ char ** argv;
+
+ /* FIXME: reparsing /proc/cmdline to avoid major loader changes.
+ * should probably be done in loader.c:parseCmdline() like everything
+ * else
+ */
+ if ((fd = open("/proc/cmdline", O_RDONLY)) < 0) return 1;
+ len = read(fd, buf, sizeof(buf) - 1);
+ close(fd);
+ if (len <= 0) return 1;
+
+ buf[len] = '\0';
+ cmdLine = buf;
+
+ if (poptParseArgvString(cmdLine, &argc, (const char ***) &argv))
+ return 1;
+
+ for (i=0; i < argc; i++) {
+ if (!strncasecmp(argv[i], "driverload=", 11)) {
+ logMessage("loading %s early", argv[i] + 11);
+ mlLoadModuleSet(argv[i] + 11, modLoaded, modDeps, modInfo, flags);
+ }
+ }
+ updateKnownDevices(kd);
+ return 0;
+}
+
int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
int justProbe, struct knownDevices * kd, int flags) {
int i;
@@ -293,13 +333,12 @@ void dasdSetup(moduleList modLoaded, moduleDeps modDeps,
dasd_parms[0] = NULL;
dasd_parms[1] = NULL;
- fd = fopen ("/proc/cmdline", "r");
+ fd = fopen ("/tmp/dasd_ports", "r");
if(fd) {
line = (char *)malloc(sizeof(char) * 200);
while (fgets (line, 199, fd) != NULL) {
if((parms = strstr(line, "dasd=")) ||
(parms = strstr(line, "DASD="))) {
- parms++;
strncpy(parms, "dasd", 4);
parms_end = parms;
while(*parms_end && !(isspace(*parms_end))) parms_end++;
diff --git a/loader2/hardware.h b/loader2/hardware.h
index 4d7ec319e..5b3ed14f5 100644
--- a/loader2/hardware.h
+++ b/loader2/hardware.h
@@ -14,6 +14,9 @@ void initializeParallelPort(moduleList modLoaded, moduleDeps modDeps,
moduleInfoSet modInfo, int flags);
void updateKnownDevices(struct knownDevices * kd);
+int earlyModuleLoad(moduleInfoSet modInfo, moduleList modLoaded,
+ moduleDeps modDeps, int justProbe,
+ struct knownDevices * kd, int flags);
int busProbe(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps modDeps,
int justProbe, struct knownDevices * kd, int flags);
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index 65f0d38e7..413f87c87 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -201,11 +201,8 @@ else # ctc0, escon0, iucv0
read GATEWAY
done
- if [ "$NETTYPE" = "ctc" ]; then
- if [ -z "$MTU" ]; then
- MTU="1500"
- fi
- MMTU="mtu 1500" # always use mtu 1500 for the installer
+ if [ "$NETTYPE" = "ctc" -a -z "$MTU" ]; then
+ MTU="1500"
fi
if [ ":$NETTYPE" = ":iucv" ]; then
while [ -z "$IUCV" ]; do
@@ -291,6 +288,17 @@ if [ -n "$DNS" ]; then
for i in "$DNS"; do echo "nameserver $i"; done >> /etc/resolv.conf
fi
+if [ -z "$DASD" ]; then
+ echo
+ echo $"Enter DASD range (e.g. 200-203 or 200,201,202,203)"
+ echo $"Press <Enter> for autoprobing (not recommended):"
+ echo
+ read DASD
+fi
+if [ -n "$DASD" ]; then
+ echo "DASD=$DASD" > /tmp/dasd_ports
+fi
+
grep -q ext3 /proc/filesystems
if [ "$?" != "0" ]; then
insmod jbd$LO
diff --git a/loader2/loader.c b/loader2/loader.c
index 8433f4542..0f880a218 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -668,8 +668,10 @@ static char *doLoaderMain(char * location,
/* so we can short circuit straight to stage 2 from CD */
if (url && (!FL_RESCUE(flags) && !hasGraphicalOverride()))
return url;
- else
+ else {
rhcdfnd = 1;
+ methodNum = 0; /* FIXME: this assumes cdrom is always first */
+ }
}
if (!FL_CMDLINE(flags))
@@ -749,6 +751,7 @@ static char *doLoaderMain(char * location,
for (i = 0; i < numMethods; i++) {
installNames[i] = _(installMethods[i].name);
}
+ installNames[i] = NULL;
rc = newtWinMenu(FL_RESCUE(flags) ? _("Rescue Method") :
_("Installation Method"),
@@ -1158,6 +1161,15 @@ int main(int argc, char ** argv) {
modInfo, &kd, flags);
}
+ /* this allows us to do an early load of modules specified on the
+ * command line to allow automating the load order of modules so that
+ * eg, certain scsi controllers are definitely first.
+ * FIXME: this syntax is likely to change in a future release
+ * but is done as a quick hack for the present.
+ */
+ earlyModuleLoad(modInfo, modLoaded, modDeps, 0, &kd, flags);
+
+
busProbe(modInfo, modLoaded, modDeps, 0, &kd, flags);
/* JKFIXME: should probably not be doing this, but ... */
diff --git a/loader2/module-info b/loader2/module-info
index 7bf3b2e06..2fe15dfdc 100644
--- a/loader2/module-info
+++ b/loader2/module-info
@@ -94,6 +94,10 @@ acenic
eth
"Alteon AceNIC Gigabit"
+amd8111e
+ eth
+ "AMD8111 based 10/100 Ethernet Controller"
+
#aironet4500_card
# eth
# "Aironet 4500 PCI-ISA-i365 wireless"
@@ -134,6 +138,10 @@ at1700
# atp
# "Attached (pocket) ethernet adapter"
+b44
+ eth
+ "Broadcom 4400 10/100 PCI ethernet adapter"
+
bcm5700
eth
"Broadcom BCM5700 10/100/1000 ethernet adapter"
@@ -171,6 +179,10 @@ dgrs
ipaddr "List of four IP addresses"
ipxnet "IPX network number"
+dl2k
+ eth
+ "D-Link DL2000-based Gigabit Ethernet Adapter"
+
#dlci
#dlci
#"RFC 1490 Frame Relay protocol"
@@ -240,6 +252,10 @@ ewrk3
io "Base I/O address" "0x[0-9a-fA-F]+"
irq "IRQ level" "[0-9]+"
+fealnx
+ eth
+ "Myson MTD-8xx 100/10M Ethernet PCI Adapter"
+
fmv18x
eth
"Fujitsu FMV-181/182/183/184"
@@ -452,6 +468,10 @@ tmspci
tr
"TMS380-based PCI token ring cards"
+typhoon
+ eth
+ "3Com Typhoon Family (3C990, 3CR990 and variants)"
+
lanstreamer
tr
"IBM Auto LANStreamer"
@@ -624,6 +644,10 @@ megaraid
scsi_hostadapter
"MegaRAID 418, 428, 438, 466, 762"
+megaraid2
+ scsi_hostadapter
+ "LSI MegaRAID Controllers"
+
mptbase
scsi_hostadapter
"LSI Logic Fusion MPT Base Driver"
diff --git a/loader2/net.c b/loader2/net.c
index f119ada2a..1995a59db 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -637,7 +637,7 @@ int findHostAndDomain(struct networkDeviceConfig * dev, int flags) {
if (!(dev->dev.set & PUMP_NETINFO_HAS_HOSTNAME)) {
if (!FL_CMDLINE(flags))
- winStatus(40, 3, _("Hostname"),
+ winStatus(50, 3, _("Hostname"),
_("Determining host name and domain..."));
else
printf("Determining host name and domain...\n");
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 8b86aa416..be63bf2be 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -217,7 +217,7 @@ char * mountNfsImage(struct installMethod * method,
void setKickstartNfs(struct knownDevices * kd,
struct loaderData_s * loaderData, int argc,
char ** argv, int * flagsPtr) {
- char * host, * dir;
+ char * host = NULL, * dir = NULL;
poptContext optCon;
int rc;
struct poptOption ksNfsOptions[] = {
@@ -238,6 +238,11 @@ void setKickstartNfs(struct knownDevices * kd,
return;
}
+ if (!host || !dir) {
+ logMessage("host and directory for nfs kickstart not specified");
+ return;
+ }
+
loaderData->method = strdup("nfs");
loaderData->methodData = calloc(sizeof(struct nfsInstallData *), 1);
if (host)
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 6921f5f17..d19766dc5 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -307,9 +307,10 @@ char * mountUrlImage(struct installMethod * method,
/* sanitize url so we dont have problems like bug #101265 */
/* basically avoid duplicate /'s */
- for (p=finalPrefix; *p == '/'; p++);
-
- finalPrefix = p;
+ if (ui.protocol == URL_METHOD_HTTP) {
+ for (p=finalPrefix; *p == '/'; p++);
+ finalPrefix = p;
+ }
sprintf(url, "%s://%s%s/%s",
ui.protocol == URL_METHOD_FTP ? "ftp" : "http",