diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-15 16:21:10 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-15 16:21:10 +0000 |
commit | 0a608020ca8ac7086e4c8bda6632c6de3371557d (patch) | |
tree | 5cd14f8429c545bf05b57d3db39aae1b37ae9270 | |
parent | 685ecfc4277d59baa4edf2ef39c962e3bdcab039 (diff) | |
download | FreeBSD-src-0a608020ca8ac7086e4c8bda6632c6de3371557d.zip FreeBSD-src-0a608020ca8ac7086e4c8bda6632c6de3371557d.tar.gz |
Keep our serial ports distinct so that first device is not found for
all (closes PR#2296).
Print better FTP failure diagnostics
Do better media failure checking in install.
-rw-r--r-- | release/sysinstall/devices.c | 17 | ||||
-rw-r--r-- | release/sysinstall/ftp.c | 5 | ||||
-rw-r--r-- | release/sysinstall/install.c | 12 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 1 | ||||
-rw-r--r-- | release/sysinstall/tcpip.c | 2 | ||||
-rw-r--r-- | usr.sbin/sade/devices.c | 17 | ||||
-rw-r--r-- | usr.sbin/sade/install.c | 12 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 17 | ||||
-rw-r--r-- | usr.sbin/sysinstall/ftp.c | 5 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 12 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 1 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 2 |
13 files changed, 86 insertions, 18 deletions
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c index 5dcca80..9580cdb 100644 --- a/release/sysinstall/devices.c +++ b/release/sysinstall/devices.c @@ -358,6 +358,23 @@ deviceFind(char *name, DeviceType class) return j ? found : NULL; } +Device ** +deviceFindDescr(char *name, char *desc, DeviceType class) +{ + static Device *found[DEV_MAX]; + int i, j; + + j = 0; + for (i = 0; i < numDevs; i++) { + if ((!name || !strcmp(Devices[i]->name, name)) && + (!desc || !strcmp(Devices[i]->description, desc)) && + (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + found[j++] = Devices[i]; + } + found[j] = NULL; + return j ? found : NULL; +} + int deviceCount(Device **devs) { diff --git a/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index f1e4304..1c5a6e6 100644 --- a/release/sysinstall/ftp.c +++ b/release/sysinstall/ftp.c @@ -103,9 +103,10 @@ try: if (dir && *dir != '\0') { if ((i = ftpChdir(OpenConn, dir)) != 0) { if (i == 550) - msgConfirm("No such directory %s, please check your path and try again.", dir); + msgConfirm("No such directory ftp://%s/%s\n" + "please check your URL and try again.", hostname, dir); else - msgConfirm("FTP chdir to directory %s returned FTP error status %d\n", dir, i); + msgConfirm("FTP chdir to ftp://%s/%s returned error status %d\n", hostname, dir, i); goto punt; } } diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index af9d364..bf7e84a 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -674,10 +674,14 @@ installCommit(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } - if (!mediaDevice && !msgYesNo("You need to select a media type first. Do you want\n" - "to do this now?")) { - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE; + if (!mediaDevice) { + if (!msgYesNo("You need to select a media type first. Do you want\n" + "to do this now?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RECREATE; + } + else + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 199ce9c..c429beb 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -415,6 +415,7 @@ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogM int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern Device **deviceFind(char *name, DeviceType type); +extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index e807002..6dfe32c 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -315,7 +315,7 @@ netHook(dialogMenuItem *self) { Device **devs; - devs = deviceFind(self->prompt, DEVICE_TYPE_NETWORK); + devs = deviceFindDescr(self->prompt, self->title, DEVICE_TYPE_NETWORK); if (devs) { if (DITEM_STATUS(tcpOpenDialog(devs[0])) != DITEM_FAILURE) mediaDevice = devs[0]; diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index 5dcca80..9580cdb 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -358,6 +358,23 @@ deviceFind(char *name, DeviceType class) return j ? found : NULL; } +Device ** +deviceFindDescr(char *name, char *desc, DeviceType class) +{ + static Device *found[DEV_MAX]; + int i, j; + + j = 0; + for (i = 0; i < numDevs; i++) { + if ((!name || !strcmp(Devices[i]->name, name)) && + (!desc || !strcmp(Devices[i]->description, desc)) && + (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + found[j++] = Devices[i]; + } + found[j] = NULL; + return j ? found : NULL; +} + int deviceCount(Device **devs) { diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index af9d364..bf7e84a 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -674,10 +674,14 @@ installCommit(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } - if (!mediaDevice && !msgYesNo("You need to select a media type first. Do you want\n" - "to do this now?")) { - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE; + if (!mediaDevice) { + if (!msgYesNo("You need to select a media type first. Do you want\n" + "to do this now?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RECREATE; + } + else + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 199ce9c..c429beb 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -415,6 +415,7 @@ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogM int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern Device **deviceFind(char *name, DeviceType type); +extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 5dcca80..9580cdb 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -358,6 +358,23 @@ deviceFind(char *name, DeviceType class) return j ? found : NULL; } +Device ** +deviceFindDescr(char *name, char *desc, DeviceType class) +{ + static Device *found[DEV_MAX]; + int i, j; + + j = 0; + for (i = 0; i < numDevs; i++) { + if ((!name || !strcmp(Devices[i]->name, name)) && + (!desc || !strcmp(Devices[i]->description, desc)) && + (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + found[j++] = Devices[i]; + } + found[j] = NULL; + return j ? found : NULL; +} + int deviceCount(Device **devs) { diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index f1e4304..1c5a6e6 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -103,9 +103,10 @@ try: if (dir && *dir != '\0') { if ((i = ftpChdir(OpenConn, dir)) != 0) { if (i == 550) - msgConfirm("No such directory %s, please check your path and try again.", dir); + msgConfirm("No such directory ftp://%s/%s\n" + "please check your URL and try again.", hostname, dir); else - msgConfirm("FTP chdir to directory %s returned FTP error status %d\n", dir, i); + msgConfirm("FTP chdir to ftp://%s/%s returned error status %d\n", hostname, dir, i); goto punt; } } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index af9d364..bf7e84a 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -674,10 +674,14 @@ installCommit(dialogMenuItem *self) return DITEM_FAILURE | DITEM_RESTORE; } - if (!mediaDevice && !msgYesNo("You need to select a media type first. Do you want\n" - "to do this now?")) { - if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE; + if (!mediaDevice) { + if (!msgYesNo("You need to select a media type first. Do you want\n" + "to do this now?")) { + if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) + return DITEM_FAILURE | DITEM_RECREATE; + } + else + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 199ce9c..c429beb 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -415,6 +415,7 @@ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogM int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern Device **deviceFind(char *name, DeviceType type); +extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index e807002..6dfe32c 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -315,7 +315,7 @@ netHook(dialogMenuItem *self) { Device **devs; - devs = deviceFind(self->prompt, DEVICE_TYPE_NETWORK); + devs = deviceFindDescr(self->prompt, self->title, DEVICE_TYPE_NETWORK); if (devs) { if (DITEM_STATUS(tcpOpenDialog(devs[0])) != DITEM_FAILURE) mediaDevice = devs[0]; |