diff -urN anaconda-7.1/loader/devices.c anaconda-7.1-loader/loader/devices.c --- anaconda-7.1/loader/devices.c Tue Mar 13 16:05:56 2001 +++ anaconda-7.1-loader/loader/devices.c Wed Feb 6 11:56:56 2002 @@ -1,3 +1,23 @@ +/* + * devices.c + * + * Erik Troan + * Matt Wilson + * + * Copyright 1999 Red Hat, Inc. + * + * Portions Copyright 2002 Hewlett-Packard Company + * Portions Copyright 2002 Martin K. Petersen + * + * This software may be freely redistributed under the terms of the GNU + * public license. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + #include #include #include @@ -209,6 +229,7 @@ fprintf(f, "%s\n", ddi->mntDevice); fprintf(f, "%s\n", ddi->fs); fprintf(f, "%s\n", ddi->device ? ddi->device : "(NONE)"); + fprintf(f, "%s\n", ddi->dir ? ddi->dir : "(NONE)"); fclose(f); ddNum++; @@ -246,6 +267,7 @@ ddi->device = strdup(device); ddi->mntDevice = malloc(strlen(device) + 10); sprintf(ddi->mntDevice, "/tmp/%s", device); + ddi->dir = NULL; devMakeInode(ddi->device, ddi->mntDevice); @@ -275,6 +297,28 @@ return 0; } +int devLoadDriverDir(moduleInfoSet modInfo, moduleList modLoaded, + moduleDeps *modDepsPtr, int flags, char * path) { + + struct driverDiskInfo * ddi; + + logMessage("devLoadDriverDir"); + + ddi = calloc(sizeof(*ddi), 1); + + ddi->device = NULL; + ddi->mntDevice = "foo"; + ddi->fs = "ext2"; + ddi->dir = path; + + if (devInitDriverDisk(modInfo, modLoaded, modDepsPtr, flags, path, ddi)) + newtWinMessage(_("Error"), _("OK"), + _("The vendor directory does not contain valid drivers " + "for this release of Red Hat Linux.")); + + return 0; +} + struct sortModuleList { int index; moduleInfoSet modInfo; @@ -469,6 +513,27 @@ if (ddi->device) devMakeInode(ddi->device, ddi->mntDevice); + if (ddi->dir) { + from = gzopen("/drv/modules.cgz", "r"); + toPath = malloc(strlen(modName) + 30); + sprintf(toPath, "/tmp/modules/%s", modName); + mkdirChain(toPath); + strcat(toPath, "/modules.cgz"); + to = gzopen(toPath, "w"); + + winStatus(50, 3, _("Loading"), _("Loading %s driver..."), modName); + + myCpioFilterArchive(from, to, pattern); + + newtPopWindow(); + + gzclose(from); + gzclose(to); + + sprintf(toPath, "/tmp/modules/%s", modName); + return toPath; + } + while (1) { failed = 0; @@ -552,10 +617,15 @@ ddi->mntDevice = readLine(f); ddi->fs = readLine(f); ddi->device = readLine(f); + ddi->dir = readLine(f); if (!strcmp("(NONE)", ddi->device)) { free(ddi->device); ddi->device = NULL; } + if (!strcmp("(NONE)", ddi->dir)) { + free(ddi->dir); + ddi->dir = NULL; + } fclose(f); sprintf(fileName, "/tmp/DD-%d/modinfo", num); diff -urN anaconda-7.1/loader/devices.h anaconda-7.1-loader/loader/devices.h --- anaconda-7.1/loader/devices.h Tue Jan 30 14:16:39 2001 +++ anaconda-7.1-loader/loader/devices.h Wed Feb 6 11:54:48 2002 @@ -9,6 +9,7 @@ char * mntDevice; char * fs; char * title; + char * dir; }; int devDeviceMenu(enum driverMajor type, moduleInfoSet modInfo, @@ -20,6 +21,8 @@ int devInitDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, moduleDeps *modDepsPtr, int flags, char * mntPoint, struct driverDiskInfo * ddi); +int devLoadDriverDir(moduleInfoSet modInfo, moduleList modLoaded, + moduleDeps *modDepsPtr, int flags, char * path); void ddReadDriverDiskModInfo(moduleInfoSet modInfo); void ejectFloppy(void); diff -urN anaconda-7.1/loader/loader.c anaconda-7.1-loader/loader/loader.c --- anaconda-7.1/loader/loader.c Wed Apr 4 17:03:54 2001 +++ anaconda-7.1-loader/loader/loader.c Wed Feb 6 11:59:21 2002 @@ -11,6 +11,9 @@ * * Copyright 1999 Red Hat, Inc. * + * Portions Copyright 2002 Hewlett-Packard Company + * Portions Copyright 2002 Martin K. Petersen + * * This software may be freely redistributed under the terms of the GNU * public license. * @@ -2622,6 +2625,20 @@ #endif if (!continuing) { + char *path = "/drv"; + if (!access(path, R_OK|X_OK) && !ksFile) { + startNewt(flags); + logMessage("found vendor drivers"); + devLoadDriverDir(modInfo, modLoaded, &modDeps, flags, path); + } + else + logMessage("no vendor drivers found"); + + busProbe(modInfo, modLoaded, modDeps, probeOnly, &kd, flags); + if (probeOnly) exit(0); + } + + if (!continuing) { if (((access("/proc/bus/pci/devices", X_OK) && access("/proc/openprom", X_OK)) || FL_MODDISK(flags)) && !ksFile) {