diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-10-08 14:07:33 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-10-08 14:07:33 +0000 |
commit | 3dc82ede70cb9f1ca6b26ee9c286127043779e73 (patch) | |
tree | 1266bb8a76bb020f47757188286801bbb89ff0d9 | |
parent | 7df0d97b9467aa28ad554dc426a99789df71bbc4 (diff) | |
download | drakx-backup-do-not-use-3dc82ede70cb9f1ca6b26ee9c286127043779e73.tar drakx-backup-do-not-use-3dc82ede70cb9f1ca6b26ee9c286127043779e73.tar.gz drakx-backup-do-not-use-3dc82ede70cb9f1ca6b26ee9c286127043779e73.tar.bz2 drakx-backup-do-not-use-3dc82ede70cb9f1ca6b26ee9c286127043779e73.tar.xz drakx-backup-do-not-use-3dc82ede70cb9f1ca6b26ee9c286127043779e73.zip |
*** empty log message ***
-rw-r--r-- | mdk-stage1/mount.c | 13 | ||||
-rw-r--r-- | mdk-stage1/probing.c | 37 |
2 files changed, 42 insertions, 8 deletions
diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c index 257638421..917100479 100644 --- a/mdk-stage1/mount.c +++ b/mdk-stage1/mount.c @@ -40,6 +40,7 @@ int ensure_dev_exists(char *dev) int type = S_IFBLK; /* my default type is block. don't forget to change for chars */ char * name; struct stat buf; + char * ptr; name = &dev[5]; /* we really need that dev be passed as /dev/something.. */ @@ -85,8 +86,8 @@ int ensure_dev_exists(char *dev) minor = name[2] - '0'; } else if (ptr_begins_static_str(name, "ida/") || ptr_begins_static_str(name, "cciss/")) { - /* Compaq Smart Array */ - char * ptr = strchr(name, '/'); + /* Compaq Smart Array "ida/c0d0{p1}" */ + ptr = strchr(name, '/'); mkdir("/dev/ida", 0755); mkdir("/dev/cciss", 0755); major = ptr_begins_static_str(name, "ida/") ? 72 : 104 + charstar_to_int(ptr+2); @@ -94,6 +95,14 @@ int ensure_dev_exists(char *dev) minor = 16 * charstar_to_int(ptr+1); ptr = strchr(ptr, 'p'); minor += charstar_to_int(ptr+1); + } else if (ptr_begins_static_str(name, "rd/")) { + /* DAC960 "rd/cXdXXpX" */ + mkdir("/dev/rd", 0755); + major = 48 + charstar_to_int(name+4); + ptr = strchr(name+4, 'd'); + minor = 8 * charstar_to_int(ptr+1); + ptr = strchr(ptr, 'p'); + minor += charstar_to_int(ptr+1); } else { log_message("I don't know how to create device %s, please post bugreport to me!", dev); return -1; diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 664ab159f..3390636e2 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -53,13 +53,10 @@ #include "probing.h" -enum bus_type { IDE, SCSI, CPQ }; - struct media_info { char * name; char * model; enum media_type type; - enum bus_type bus; }; @@ -379,7 +376,6 @@ static void find_media(void) close(fd); log_message("IDE/%d: %s is a %s", tmp[count].type, tmp[count].name, tmp[count].model); - tmp[count].bus = IDE; count++; } @@ -496,7 +492,6 @@ static void find_media(void) if (*tmp_name) { tmp[count].name = strdup(tmp_name); log_message("SCSI/%d: %s is a %s", tmp[count].type, tmp[count].name, tmp[count].model); - tmp[count].bus = SCSI; count++; } @@ -530,7 +525,6 @@ static void find_media(void) tmp[count].type = DISK; tmp[count].model = cpq_descr; log_message("CPQ: found %s", tmp[count].name); - tmp[count].bus = CPQ; count++; } } @@ -541,6 +535,37 @@ static void find_media(void) } /* ----------------------------------------------- */ + log_message("looking for DAC960"); + { + FILE * f; + if ((f = fopen("/tmp/syslog", "rb"))) { + while (fgets(buf, sizeof(buf), f)) { + char * start; + if ((start = strstr(buf, "/dev/rd/"))) { + char * end = strchr(start, ':'); + if (!end) + log_message("Inconsistency in syslog, line:\n%s", buf); + else { + *end = '\0'; + tmp[count].name = strdup(start+5); + tmp[count].type = DISK; + start = end + 2; + end = strchr(start, ','); + if (end) { + *end = '\0'; + tmp[count].model = strdup(start); + } else + tmp[count].model = "(unknown)"; + log_message("DAC960: found %s (%s)", tmp[count].name, tmp[count].model); + count++; + } + } + } + fclose(f); + } + } + + /* ----------------------------------------------- */ tmp[count].name = NULL; count++; |