diff options
| author | Jeremy Katz <katzj@redhat.com> | 2003-06-06 16:33:31 +0000 |
|---|---|---|
| committer | Jeremy Katz <katzj@redhat.com> | 2003-06-06 16:33:31 +0000 |
| commit | e0779b7bf137a60bf6e6cd3adee4aabffcd28c73 (patch) | |
| tree | 20b8340a621390a3fc967ef5fb3723c78b4033c7 /loader2/driverdisk.c | |
| parent | 91d5fc40d23a5fb5b225287090e8074d0054fa6e (diff) | |
merge taroon branch. mostly package bits, but a lot of other misc stuff
and cleanups in here too
Diffstat (limited to 'loader2/driverdisk.c')
| -rw-r--r-- | loader2/driverdisk.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/loader2/driverdisk.c b/loader2/driverdisk.c index 73a5ca2d4..ec063193f 100644 --- a/loader2/driverdisk.c +++ b/loader2/driverdisk.c @@ -56,7 +56,18 @@ static int verifyDriverDisk(char *mntpt, int flags) { } } - /* side effect: file is still mntpt/rhdd-6.1 */ + /* check for both versions */ + sprintf(file, "%s/rhdd", mntpt); + if (!access(file, R_OK)) { + logMessage("not a new format driver disk, checking for old"); + sprintf(file, "%s/rhdd-6.1", mntpt); + if (!access(file, R_OK)) { + logMessage("can't find either driver disk identifier, bad " + "driver disk"); + } + } + + /* side effect: file is still mntpt/ddident */ stat(file, &sb); if (!sb.st_size) return LOADER_BACK; @@ -74,9 +85,19 @@ static int loadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, struct moduleBallLocation * location; struct stat sb; static int disknum = 0; + int version = 1; int fd; - sprintf(file, "%s/rhdd-6.1", mntpt); + /* check for both versions */ + sprintf(file, "%s/rhdd", mntpt); + if (!access(file, R_OK)) { + version = 0; + sprintf(file, "%s/rhdd-6.1", mntpt); + if (!access(file, R_OK)) { + /* this can't happen, we already verified it! */ + return LOADER_BACK; + } + } stat(file, &sb); title = malloc(sb.st_size + 1); @@ -101,6 +122,7 @@ static int loadDriverDisk(moduleInfoSet modInfo, moduleList modLoaded, location = malloc(sizeof(struct moduleBallLocation)); location->title = strdup(title); location->path = sdupprintf("/tmp/ramfs/DD-%d/modules.cgz", disknum); + location->version = version; sprintf(file, "%s/modinfo", mntpt); readModuleInfo(file, modInfo, location, 1); |
