summaryrefslogtreecommitdiffstats
path: root/loader/modules.c
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-04-28 19:51:24 +0000
committerMatt Wilson <msw@redhat.com>2000-04-28 19:51:24 +0000
commit6429f95aeffac054ab81732e1eb69cfb03795c25 (patch)
tree362e7a0756a39f8c50959725d561c29726ece97d /loader/modules.c
parent5e4baa77c8a0186a2c0f4aa2c5cb716906782aaa (diff)
downloadanaconda-6429f95aeffac054ab81732e1eb69cfb03795c25.tar.gz
anaconda-6429f95aeffac054ab81732e1eb69cfb03795c25.tar.xz
anaconda-6429f95aeffac054ab81732e1eb69cfb03795c25.zip
shuffle *all* newt code away from modules.c
Diffstat (limited to 'loader/modules.c')
-rw-r--r--loader/modules.c81
1 files changed, 1 insertions, 80 deletions
diff --git a/loader/modules.c b/loader/modules.c
index 1132b9721..46fe4cb3a 100644
--- a/loader/modules.c
+++ b/loader/modules.c
@@ -21,6 +21,7 @@
#include "loader.h"
#include "log.h"
#include "modules.h"
+#include "devices.h"
struct moduleDependency_s {
char * name;
@@ -206,86 +207,6 @@ static void removeExtractedModule(char * path) {
rmdir(path);
}
-static char * extractModule(char * location, char * modName) {
- char * pattern[] = { NULL, NULL };
- struct utsname un;
- gzFile from;
- gzFile to;
- int first = 1;
- int fd;
- char * buf;
- struct stat sb;
- int rc;
- int failed;
- char * toPath;
-
- uname(&un);
-
- pattern[0] = alloca(strlen(modName) + strlen(un.release) + 5);
- sprintf(pattern[0], "%s*/%s.o", un.release, modName);
- logMessage("extracting pattern %s", pattern[0]);
-
- devMakeInode("fd0", "/tmp/fd0");
- while (1) {
- failed = 0;
-
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "vfat", 1, 0, NULL, NULL))
- if (doPwMount("/tmp/fd0", "/tmp/drivers", "ext2", 1, 0, NULL, NULL))
- failed = 1;
-
- if (failed && !first) {
- newtWinMessage(_("Error"), _("OK"),
- _("Failed to mount driver disk."));
- } else if (!failed) {
- if ((fd = open("/tmp/drivers/rhdd-6.1", O_RDONLY)) < 0)
- failed = 1;
- if (!failed) {
- fstat(fd, &sb);
- buf = malloc(sb.st_size + 1);
- read(fd, buf, sb.st_size);
- if (buf[sb.st_size - 1] == '\n')
- sb.st_size--;
- buf[sb.st_size] = '\0';
- close(fd);
-
- failed = strcmp(buf, location);
- free(buf);
- }
-
- if (failed && !first) {
- umount("/tmp/drivers");
- newtWinMessage(_("Error"), _("OK"),
- _("The wrong diskette was inserted."));
- }
- }
-
- if (!failed) {
- from = gzopen("/tmp/drivers/modules.cgz", "r");
- toPath = malloc(strlen(modName) + 30);
- sprintf(toPath, "/tmp/modules/%s", modName);
- mkdirChain(toPath);
- strcat(toPath, "/modules.cgz");
- to = gzopen(toPath, "w");
-
- myCpioFilterArchive(from, to, pattern);
-
- gzclose(from);
- gzclose(to);
- umount("/tmp/drivers");
-
- sprintf(toPath, "/tmp/modules/%s", modName);
- return toPath;
- }
-
- first = 0;
-
- ejectFloppy();
- rc = newtWinChoice(_("Driver Disk"), _("OK"), _("Cancel"),
- _("Please insert the %s driver disk now."), location);
- if (rc == 2) return NULL;
- }
-}
-
int mlLoadModule(char * modName, char * location, moduleList modLoaded,
moduleDeps modDeps, char ** args, moduleInfoSet modInfo,
int flags) {