summaryrefslogtreecommitdiffstats
path: root/loader2
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-08-14 02:00:12 +0000
committerJeremy Katz <katzj@redhat.com>2003-08-14 02:00:12 +0000
commitc540e134193f9759873ced09b0156c6219983101 (patch)
treeb36013fe219e6c3d8762bf2a0a32b538ac5c0373 /loader2
parent3f01dfc8e9d6b8bf25b79b1cbda94ca0ff4ada09 (diff)
downloadanaconda-c540e134193f9759873ced09b0156c6219983101.tar.gz
anaconda-c540e134193f9759873ced09b0156c6219983101.tar.xz
anaconda-c540e134193f9759873ced09b0156c6219983101.zip
merge from taroon-branch. all kinds of miscellaneous bugfixes, including
* firewall update * iSeries PReP size * ppc mediacheck * tzdata stuff * cmdline mode * pkg defaults screen
Diffstat (limited to 'loader2')
-rw-r--r--loader2/driverdisk.c9
-rw-r--r--loader2/linuxrc.s3906
-rw-r--r--loader2/loader.c5
-rw-r--r--loader2/md5.c31
-rw-r--r--loader2/md5.h1
-rw-r--r--loader2/mediacheck.c1
-rw-r--r--loader2/modules.c8
-rw-r--r--loader2/net.c4
-rw-r--r--loader2/nfsinstall.c2
-rw-r--r--loader2/telnetd.c12
-rw-r--r--loader2/urlinstall.c11
-rw-r--r--loader2/urls.c12
-rw-r--r--loader2/urls.h6
13 files changed, 64 insertions, 44 deletions
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c
index 01eb920db..aa98653dd 100644
--- a/loader2/driverdisk.c
+++ b/loader2/driverdisk.c
@@ -115,8 +115,10 @@ static int loadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
sprintf(file, "/tmp/ramfs/DD-%d", disknum);
mkdirChain(file);
- startNewt(flags);
- winStatus(40, 3, _("Loading"), _("Reading driver disk..."));
+ if (!FL_CMDLINE(flags)) {
+ startNewt(flags);
+ winStatus(40, 3, _("Loading"), _("Reading driver disk..."));
+ }
for (fnPtr = driverDiskFiles; *fnPtr; fnPtr++) {
sprintf(file, "%s/%s", mntpt, *fnPtr);
@@ -138,7 +140,8 @@ static int loadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded,
sprintf(file, "%s/pcitable", mntpt);
pciReadDrivers(file);
- newtPopWindow();
+ if (!FL_CMDLINE(flags))
+ newtPopWindow();
disknum++;
return 0;
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390
index d063e1d6a..849eb211c 100644
--- a/loader2/linuxrc.s390
+++ b/loader2/linuxrc.s390
@@ -210,7 +210,9 @@ else # ctc0, escon0, iucv0
if [ ":$NETTYPE" = ":iucv" ]; then
while [ -z "$IUCV" ]; do
echo $"Enter iucv kernel module options (usually iucv=HOST,"
- echo $"where HOST is TCPIP for VM, \$TCPIP for VIF):"
+ echo $"where HOST is TCPIP for the VM TCP/IP service machine"
+ echo $"or the name (in capital letters) of another"
+ echo $"Linux guest:"
read IUCV
done
fi
@@ -250,7 +252,7 @@ elif [ -n "$QETH" -o -n "$HSI" ]; then
insmod qeth$LO
ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST
route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null
- echo "alias $DEVICE qeth" >> /tmp/modules.conf
+ echo "alias $DEVICE qeth" >> /tmp/modules.conf
else
echo $"Unknown network device, aborting installation"
exit 1
diff --git a/loader2/loader.c b/loader2/loader.c
index b08e0b0f2..648916e31 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -283,8 +283,6 @@ void loadUpdates(struct knownDevices *kd, int flags) {
char * buf;
int num = 0;
- startNewt(flags);
-
do {
rc = getRemovableDevices(&devNames);
if (rc == 0)
@@ -673,7 +671,8 @@ static char *doLoaderMain(char * location,
rhcdfnd = 1;
}
- startNewt(flags);
+ if (!FL_CMDLINE(flags))
+ startNewt(flags);
step = STEP_LANG;
diff --git a/loader2/md5.c b/loader2/md5.c
index 559298b6c..22f59a04e 100644
--- a/loader2/md5.c
+++ b/loader2/md5.c
@@ -16,14 +16,20 @@
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
+ * Modified 12 June 2003 Jeremy Katz <katzj@redhat.com> to handle
+ * endianness better
+ *
*/
#include <string.h>
+#include <endian.h>
#include "md5.h"
-#ifndef HIGHFIRST
-#define byteReverse(buf, len) /* Nothing */
-#else
+void MD5_Transform(uint32 *buf, uint32 const *in);
+
+#define IS_BIG_ENDIAN() (__BYTE_ORDER == __BIG_ENDIAN)
+#define IS_LITTLE_ENDIAN() (__BYTE_ORDER == __LITTLE_ENDIAN)
+
static void byteReverse(unsigned char *buf, unsigned longs);
#ifndef ASM_MD5
@@ -41,9 +47,6 @@ static void byteReverse(unsigned char *buf, unsigned longs)
} while (--longs);
}
#endif
-#endif
-
-void MD5_Transform(uint32 buf[4], uint32 const in[16]);
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
@@ -58,6 +61,12 @@ void MD5_Init(struct MD5Context *ctx)
ctx->bits[0] = 0;
ctx->bits[1] = 0;
+
+
+ if (IS_BIG_ENDIAN())
+ ctx->doByteReverse = 1;
+ else
+ ctx->doByteReverse = 0;
}
/*
@@ -88,7 +97,7 @@ void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len)
return;
}
memcpy(p, buf, t);
- byteReverse(ctx->in, 16);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
MD5_Transform(ctx->buf, (uint32 *) ctx->in);
buf += t;
len -= t;
@@ -97,7 +106,7 @@ void MD5_Update(struct MD5Context *ctx, unsigned const char *buf, unsigned len)
while (len >= 64) {
memcpy(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
MD5_Transform(ctx->buf, (uint32 *) ctx->in);
buf += 64;
len -= 64;
@@ -132,7 +141,7 @@ void MD5_Final(unsigned char digest[16], struct MD5Context *ctx)
if (count < 8) {
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
- byteReverse(ctx->in, 16);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 16);
MD5_Transform(ctx->buf, (uint32 *) ctx->in);
/* Now fill the next block with 56 bytes */
@@ -141,14 +150,14 @@ void MD5_Final(unsigned char digest[16], struct MD5Context *ctx)
/* Pad block to 56 bytes */
memset(p, 0, count - 8);
}
- byteReverse(ctx->in, 14);
+ if (ctx->doByteReverse) byteReverse(ctx->in, 14);
/* Append length in bits and transform */
((uint32 *) ctx->in)[14] = ctx->bits[0];
((uint32 *) ctx->in)[15] = ctx->bits[1];
MD5_Transform(ctx->buf, (uint32 *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
+ if (ctx->doByteReverse) byteReverse((unsigned char *) ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
}
diff --git a/loader2/md5.h b/loader2/md5.h
index 705692ab6..fb6bf20a9 100644
--- a/loader2/md5.h
+++ b/loader2/md5.h
@@ -9,6 +9,7 @@ struct MD5Context {
uint32 buf[4];
uint32 bits[2];
unsigned char in[64];
+ int doByteReverse;
};
void MD5_Init(struct MD5Context *);
diff --git a/loader2/mediacheck.c b/loader2/mediacheck.c
index 83dda6e61..e507050e1 100644
--- a/loader2/mediacheck.c
+++ b/loader2/mediacheck.c
@@ -373,5 +373,6 @@ int main(int argc, char **argv) {
newtCls();
rc = mediaCheckFile(argv[1], "TESTING");
newtFinished();
+ exit (0);
}
#endif
diff --git a/loader2/modules.c b/loader2/modules.c
index dbe9e8c98..927fbc834 100644
--- a/loader2/modules.c
+++ b/loader2/modules.c
@@ -268,9 +268,11 @@ static int loadModule(const char * modName, struct extractedModule * path,
if (mi->major == DRIVER_SCSI) {
deviceCount = scsiDiskCount();
- startNewt(flags);
- scsiWindow(modName);
- popWindow = 1;
+ if (!FL_CMDLINE(flags)) {
+ startNewt(flags);
+ scsiWindow(modName);
+ popWindow = 1;
+ }
}
}
diff --git a/loader2/net.c b/loader2/net.c
index 57891ee6c..97f689a30 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -227,7 +227,7 @@ void setupNetworkDeviceConfig(struct networkDeviceConfig * cfg,
_("Sending request for IP information for %s..."),
loaderData->netDev, 0);
} else {
- printf(_("Sending request for IP information for %s..."),
+ printf("Sending request for IP information for %s...\n",
loaderData->netDev);
}
@@ -638,7 +638,7 @@ int findHostAndDomain(struct networkDeviceConfig * dev, int flags) {
winStatus(40, 3, _("Hostname"),
_("Determining host name and domain..."));
else
- printf(_("Determining host name and domain..."));
+ printf("Determining host name and domain...\n");
name = mygethostbyaddr(inet_ntoa(dev->dev.ip));
diff --git a/loader2/nfsinstall.c b/loader2/nfsinstall.c
index 41a26ec5a..8b86aa416 100644
--- a/loader2/nfsinstall.c
+++ b/loader2/nfsinstall.c
@@ -165,7 +165,7 @@ char * mountNfsImage(struct installMethod * method,
/* JKFIXME: hack because /mnt/source is hard-coded
* in mountStage2() */
copyUpdatesImg("/mnt/source2/RedHat/base/updates.img");
- copyUpdatesImg("/mnt/source2/RedHat/base/product.img");
+ copyProductImg("/mnt/source2/RedHat/base/product.img");
queryIsoMediaCheck(path, flags);
diff --git a/loader2/telnetd.c b/loader2/telnetd.c
index c6c6343cd..c2f28d923 100644
--- a/loader2/telnetd.c
+++ b/loader2/telnetd.c
@@ -95,7 +95,7 @@ int beTelnet(int flags) {
telnet_negotiate(conn, &termType, &height, &width);
-#ifdef DEBUG
+#ifdef DEBUG_TELNET
printf("got term type %s\n", termType);
#endif
@@ -107,7 +107,7 @@ int beTelnet(int flags) {
}
if (height != -1 && width != -1) {
-#ifdef DEBUF
+#ifdef DEBUG_TELNET
printf("setting window size to %d x %d\n", width, height);
#endif
ws.ws_row = height;
@@ -119,7 +119,7 @@ int beTelnet(int flags) {
child = fork();
if (child) {
-#ifndef DEBUG
+#ifndef DEBUG_TELNET
startNewt(flags);
winStatus(45, 3, _("Telnet"), _("Running anaconda via telnet..."));
#endif
@@ -134,7 +134,7 @@ int beTelnet(int flags) {
if (fds[0].revents) {
i = read(masterFd, buf, sizeof(buf));
-#ifdef DEBUG
+#ifdef DEBUG_TELNET
{
int j;
int row;
@@ -173,7 +173,7 @@ int beTelnet(int flags) {
i = telnet_process_input(&ts, buf, i);
write(masterFd, buf, i);
-#ifdef DEBUG
+#ifdef DEBUG_TELNET
{
int j;
@@ -192,7 +192,7 @@ int beTelnet(int flags) {
logMessage("poll: %s", strerror(errno));
}
-#ifndef DEBUG
+#ifndef DEBUG_TELNET
stopNewt();
#endif
diff --git a/loader2/urlinstall.c b/loader2/urlinstall.c
index 719b425e6..1b2587bce 100644
--- a/loader2/urlinstall.c
+++ b/loader2/urlinstall.c
@@ -44,7 +44,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags,
int rc;
char * newFile = NULL;
- fd = urlinstStartTransfer(ui, file, NULL, 1);
+ fd = urlinstStartTransfer(ui, file, NULL, 1, flags);
if (fd == -2) return 1;
@@ -54,7 +54,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags,
newFile = alloca(strlen(device) + 20);
sprintf(newFile, "disc1/%s", file);
- fd = urlinstStartTransfer(ui, newFile, NULL, 1);
+ fd = urlinstStartTransfer(ui, newFile, NULL, 1, flags);
if (fd == -2) return 1;
if (fd < 0) {
@@ -70,7 +70,7 @@ static int loadSingleUrlImage(struct iurlinfo * ui, char * file, int flags,
rc = copyFileAndLoopbackMount(fd, dest, flags, device, mntpoint);
- urlinstFinishTransfer(ui, fd);
+ urlinstFinishTransfer(ui, fd, flags);
if (newFile) {
newFile = malloc(strlen(ui->prefix ) + 20);
@@ -383,8 +383,7 @@ int getFileFromUrl(char * url, char * dest, struct knownDevices * kd,
}
}
- fd = urlinstStartTransfer(&ui, file, ehdrs, 1);
-
+ fd = urlinstStartTransfer(&ui, file, ehdrs, 1, flags);
if (fd < 0) {
logMessage("failed to retrieve http://%s/%s/%s", ui.address, ui.prefix, file);
return 1;
@@ -397,7 +396,7 @@ int getFileFromUrl(char * url, char * dest, struct knownDevices * kd,
return 1;
}
- urlinstFinishTransfer(&ui, fd);
+ urlinstFinishTransfer(&ui, fd, flags);
return 0;
}
diff --git a/loader2/urls.c b/loader2/urls.c
index 03acda76e..5074a137e 100644
--- a/loader2/urls.c
+++ b/loader2/urls.c
@@ -144,7 +144,8 @@ char *convertUIToURL(struct iurlinfo *ui) {
/* see ftp.c:httpGetFileDesc() for details */
/* set to NULL if not needed */
int urlinstStartTransfer(struct iurlinfo * ui, char * filename,
- char *extraHeaders, int silentErrors) {
+ char *extraHeaders, int silentErrors,
+ int flags) {
char * buf;
int fd;
char * finalPrefix;
@@ -191,17 +192,20 @@ int urlinstStartTransfer(struct iurlinfo * ui, char * filename,
}
}
- winStatus(70, 3, _("Retrieving"), "%s %s...", _("Retrieving"), filename);
+ if (!FL_CMDLINE(flags))
+ winStatus(70, 3, _("Retrieving"), "%s %s...", _("Retrieving"),
+ filename);
return fd;
}
-int urlinstFinishTransfer(struct iurlinfo * ui, int fd) {
+int urlinstFinishTransfer(struct iurlinfo * ui, int fd, int flags) {
if (ui->protocol == URL_METHOD_FTP)
close(ui->ftpPort);
close(fd);
- newtPopWindow();
+ if (!FL_CMDLINE(flags))
+ newtPopWindow();
return 0;
}
diff --git a/loader2/urls.h b/loader2/urls.h
index f2110bff2..49290d832 100644
--- a/loader2/urls.h
+++ b/loader2/urls.h
@@ -22,8 +22,8 @@ int setupRemote(struct iurlinfo * ui);
int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
char * doSecondarySetup);
int urlSecondarySetupPanel(struct iurlinfo * ui, urlprotocol protocol);
-int urlinstStartTransfer(struct iurlinfo * ui, char * filename, char *extraHeaders,
- int silentErrors);
-int urlinstFinishTransfer(struct iurlinfo * ui, int fd);
+int urlinstStartTransfer(struct iurlinfo * ui, char * filename,
+ char *extraHeaders, int silentErrors, int flags);
+int urlinstFinishTransfer(struct iurlinfo * ui, int fd, int flags);
#endif