Add support for USB to sysinstall. This includes running usbd and
setting 'usbd_enable' in rc.conf during nwe installs if USB is detected. Also, since usbd already handles USB mice automatically, note that the mouse setup section in sysinstall only applies to non-USB mice.
This commit is contained in:
parent
fead5c443b
commit
9f8b8491c9
@ -14,8 +14,8 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \
|
||||
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
|
||||
msg.c network.c nfs.c options.c package.c pccard.c \
|
||||
system.c tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
|
||||
keymap.h
|
||||
system.c tape.c tcpip.c termcap.c ufs.c usb.c user.c variable.c \
|
||||
wizard.c keymap.h
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
|
||||
.if ${MACHINE_ARCH} != "i386" || defined(X_AS_PKG)
|
||||
|
@ -608,7 +608,7 @@ installStandard(dialogMenuItem *self)
|
||||
#endif /* notyet */
|
||||
|
||||
dialog_clear_norefresh();
|
||||
if (!msgYesNo("Does this system have a mouse attached to it?"))
|
||||
if (!msgYesNo("Does this system have a non-USB mouse attached to it?"))
|
||||
dmenuOpenSimple(&MenuMouse, FALSE);
|
||||
|
||||
/* Now would be a good time to checkpoint the configuration data */
|
||||
|
@ -90,6 +90,9 @@ main(int argc, char **argv)
|
||||
/* Initialize PC-card */
|
||||
pccardInitialize();
|
||||
|
||||
/* Initialize USB */
|
||||
usbInitialize();
|
||||
|
||||
/* Probe for all relevant devices on the system */
|
||||
deviceGetAll();
|
||||
|
||||
|
@ -733,6 +733,9 @@ extern void mediaShutdownUFS(Device *dev);
|
||||
extern Boolean mediaInitUFS(Device *dev);
|
||||
extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
|
||||
|
||||
/* usb.c */
|
||||
extern void usbInitialize(void);
|
||||
|
||||
/* user.c */
|
||||
extern int userAddGroup(dialogMenuItem *self);
|
||||
extern int userAddUser(dialogMenuItem *self);
|
||||
|
44
release/sysinstall/usb.c
Normal file
44
release/sysinstall/usb.c
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* USB support for sysinstall
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* Copyright (c) 2000 John Baldwin <jhb@FreeBSD.org>. All rights reserved.
|
||||
*
|
||||
* This software may be used, modified, copied, and distributed, in
|
||||
* both source and binary form provided that the above copyright and
|
||||
* these terms are retained. Under no circumstances is the author
|
||||
* responsible for the proper functioning of this software, nor does
|
||||
* the author assume any responsibility for damages incurred with its
|
||||
* use.
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
void
|
||||
usbInitialize(void)
|
||||
{
|
||||
int fd;
|
||||
WINDOW *w;
|
||||
|
||||
if (!RunningAsInit && !Fake) {
|
||||
/* It's not my job... */
|
||||
return;
|
||||
}
|
||||
|
||||
if ((fd = open("/dev/usb", O_RDONLY)) < 0) {
|
||||
msgDebug("Can't open USB controller.\n");
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
w = savescr();
|
||||
msgNotify("Initializing USB controller....");
|
||||
|
||||
variable_set2("usbd_enable", "YES", 1);
|
||||
|
||||
vsystem("/stand/usbd");
|
||||
restorescr(w);
|
||||
}
|
@ -14,8 +14,8 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \
|
||||
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
|
||||
msg.c network.c nfs.c options.c package.c pccard.c \
|
||||
system.c tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
|
||||
keymap.h
|
||||
system.c tape.c tcpip.c termcap.c ufs.c usb.c user.c variable.c \
|
||||
wizard.c keymap.h
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
|
||||
.if ${MACHINE_ARCH} != "i386" || defined(X_AS_PKG)
|
||||
|
@ -608,7 +608,7 @@ installStandard(dialogMenuItem *self)
|
||||
#endif /* notyet */
|
||||
|
||||
dialog_clear_norefresh();
|
||||
if (!msgYesNo("Does this system have a mouse attached to it?"))
|
||||
if (!msgYesNo("Does this system have a non-USB mouse attached to it?"))
|
||||
dmenuOpenSimple(&MenuMouse, FALSE);
|
||||
|
||||
/* Now would be a good time to checkpoint the configuration data */
|
||||
|
@ -90,6 +90,9 @@ main(int argc, char **argv)
|
||||
/* Initialize PC-card */
|
||||
pccardInitialize();
|
||||
|
||||
/* Initialize USB */
|
||||
usbInitialize();
|
||||
|
||||
/* Probe for all relevant devices on the system */
|
||||
deviceGetAll();
|
||||
|
||||
|
@ -733,6 +733,9 @@ extern void mediaShutdownUFS(Device *dev);
|
||||
extern Boolean mediaInitUFS(Device *dev);
|
||||
extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
|
||||
|
||||
/* usb.c */
|
||||
extern void usbInitialize(void);
|
||||
|
||||
/* user.c */
|
||||
extern int userAddGroup(dialogMenuItem *self);
|
||||
extern int userAddUser(dialogMenuItem *self);
|
||||
|
44
usr.sbin/sade/usb.c
Normal file
44
usr.sbin/sade/usb.c
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* USB support for sysinstall
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* Copyright (c) 2000 John Baldwin <jhb@FreeBSD.org>. All rights reserved.
|
||||
*
|
||||
* This software may be used, modified, copied, and distributed, in
|
||||
* both source and binary form provided that the above copyright and
|
||||
* these terms are retained. Under no circumstances is the author
|
||||
* responsible for the proper functioning of this software, nor does
|
||||
* the author assume any responsibility for damages incurred with its
|
||||
* use.
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
void
|
||||
usbInitialize(void)
|
||||
{
|
||||
int fd;
|
||||
WINDOW *w;
|
||||
|
||||
if (!RunningAsInit && !Fake) {
|
||||
/* It's not my job... */
|
||||
return;
|
||||
}
|
||||
|
||||
if ((fd = open("/dev/usb", O_RDONLY)) < 0) {
|
||||
msgDebug("Can't open USB controller.\n");
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
w = savescr();
|
||||
msgNotify("Initializing USB controller....");
|
||||
|
||||
variable_set2("usbd_enable", "YES", 1);
|
||||
|
||||
vsystem("/stand/usbd");
|
||||
restorescr(w);
|
||||
}
|
@ -14,8 +14,8 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
|
||||
ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \
|
||||
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
|
||||
msg.c network.c nfs.c options.c package.c pccard.c \
|
||||
system.c tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \
|
||||
keymap.h
|
||||
system.c tape.c tcpip.c termcap.c ufs.c usb.c user.c variable.c \
|
||||
wizard.c keymap.h
|
||||
|
||||
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
|
||||
.if ${MACHINE_ARCH} != "i386" || defined(X_AS_PKG)
|
||||
|
@ -608,7 +608,7 @@ installStandard(dialogMenuItem *self)
|
||||
#endif /* notyet */
|
||||
|
||||
dialog_clear_norefresh();
|
||||
if (!msgYesNo("Does this system have a mouse attached to it?"))
|
||||
if (!msgYesNo("Does this system have a non-USB mouse attached to it?"))
|
||||
dmenuOpenSimple(&MenuMouse, FALSE);
|
||||
|
||||
/* Now would be a good time to checkpoint the configuration data */
|
||||
|
@ -90,6 +90,9 @@ main(int argc, char **argv)
|
||||
/* Initialize PC-card */
|
||||
pccardInitialize();
|
||||
|
||||
/* Initialize USB */
|
||||
usbInitialize();
|
||||
|
||||
/* Probe for all relevant devices on the system */
|
||||
deviceGetAll();
|
||||
|
||||
|
@ -733,6 +733,9 @@ extern void mediaShutdownUFS(Device *dev);
|
||||
extern Boolean mediaInitUFS(Device *dev);
|
||||
extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
|
||||
|
||||
/* usb.c */
|
||||
extern void usbInitialize(void);
|
||||
|
||||
/* user.c */
|
||||
extern int userAddGroup(dialogMenuItem *self);
|
||||
extern int userAddUser(dialogMenuItem *self);
|
||||
|
44
usr.sbin/sysinstall/usb.c
Normal file
44
usr.sbin/sysinstall/usb.c
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* USB support for sysinstall
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* Copyright (c) 2000 John Baldwin <jhb@FreeBSD.org>. All rights reserved.
|
||||
*
|
||||
* This software may be used, modified, copied, and distributed, in
|
||||
* both source and binary form provided that the above copyright and
|
||||
* these terms are retained. Under no circumstances is the author
|
||||
* responsible for the proper functioning of this software, nor does
|
||||
* the author assume any responsibility for damages incurred with its
|
||||
* use.
|
||||
*/
|
||||
|
||||
#include "sysinstall.h"
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
void
|
||||
usbInitialize(void)
|
||||
{
|
||||
int fd;
|
||||
WINDOW *w;
|
||||
|
||||
if (!RunningAsInit && !Fake) {
|
||||
/* It's not my job... */
|
||||
return;
|
||||
}
|
||||
|
||||
if ((fd = open("/dev/usb", O_RDONLY)) < 0) {
|
||||
msgDebug("Can't open USB controller.\n");
|
||||
return;
|
||||
}
|
||||
close(fd);
|
||||
|
||||
w = savescr();
|
||||
msgNotify("Initializing USB controller....");
|
||||
|
||||
variable_set2("usbd_enable", "YES", 1);
|
||||
|
||||
vsystem("/stand/usbd");
|
||||
restorescr(w);
|
||||
}
|
Loading…
Reference in New Issue
Block a user