Sync with FreeBSD. This removes the need for perl.
[dragonfly.git] / release / sysinstall / usb.c
1 /*
2  * USB support for sysinstall
3  *
4  * $FreeBSD: src/release/sysinstall/usb.c,v 1.1.2.1 2000/06/08 23:08:24 jhb Exp $
5  * $DragonFly: src/release/sysinstall/Attic/usb.c,v 1.2 2003/06/17 04:27:21 dillon Exp $
6  *
7  * Copyright (c) 2000 John Baldwin <jhb@FreeBSD.org>.  All rights reserved.
8  *
9  * This software may be used, modified, copied, and distributed, in
10  * both source and binary form provided that the above copyright and
11  * these terms are retained. Under no circumstances is the author
12  * responsible for the proper functioning of this software, nor does
13  * the author assume any responsibility for damages incurred with its
14  * use.
15  */
16
17 #include "sysinstall.h"
18 #include <sys/fcntl.h>
19 #include <sys/time.h>
20
21 void
22 usbInitialize(void)
23 {
24     int fd;
25     WINDOW *w;
26     
27     if (!RunningAsInit && !Fake) {
28         /* It's not my job... */
29         return;
30     }
31
32     if ((fd = open("/dev/usb", O_RDONLY)) < 0) {
33         msgDebug("Can't open USB controller.\n");
34         return;
35     }
36     close(fd);
37
38     w = savescr();
39     msgNotify("Initializing USB controller....");
40     
41     variable_set2("usbd_enable", "YES", 1);
42
43     vsystem("/stand/usbd");
44     restorescr(w);
45 }