1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
diff -urN hwsetup-1.1.orig/hwsetup.c hwsetup-1.1/hwsetup.c
--- hwsetup-1.1.orig/hwsetup.c 2005-12-06 08:42:39.000000000 -0500
+++ hwsetup-1.1/hwsetup.c 2005-12-06 08:42:18.000000000 -0500
@@ -23,14 +23,15 @@
#endif
#define VERSION "HWSETUP 1.1, an automatic hardware configuration tool\n" \
- "(C) 2005 Klaus Knopper <knoppix@knopper.net>\n\n"
+ "(C) 2005 Klaus Knopper <knoppix@knopper.net>\n" \
+ "Modified for Gentoo Linux\n\n"
#define CARDSDB "/usr/share/hwdata/Cards"
-#define XPATH "/usr/X11R6/bin/"
-#define XMODPATH "/usr/X11R6/lib/modules/drivers/"
+#define XPATH "/usr/bin/"
+#define XMODPATH "/usr/lib/xorg/modules/drivers/"
#define VERBOSE_PRINT 1
-#define VERBOSE_PROMPT 2
+#define VERBOSE_PROMPT 0
#define SKIP_AUDIO 1
#define SKIP_SCSI 2
@@ -193,7 +194,7 @@
struct xinfo *getxinfo(struct device *d)
{
- const char *xfree4="XFree86", *xvesa4="vesa";
+ const char *xorg="X", *xvesa="vesa";
const char *xpath=XPATH;
static struct xinfo xi;
int rescanned=0;
@@ -203,10 +204,10 @@
{
const char *driver[]={"3DLabs", "Mach64", "Mach32", "Mach8", "AGX",
"P9000", "S3 ViRGE", "S3V", "S3", "W32",
- "8514", "I128", "SVGA", xfree4, NULL};
+ "8514", "I128", "SVGA", xorg, NULL};
const char *server[]={driver[0], driver[1], driver[2], driver[3], driver[4],
driver[5], "S3V", driver[7], driver[8], driver[9],
- driver[10], driver[11], driver[12], xfree4, NULL};
+ driver[10], driver[11], driver[12], xorg, NULL};
if(!strncasecmp(d->driver,"Card:",5)) /* RedHat Cards-DB */
{ /* Kudzu "Cards" format */
FILE *cardsdb;
@@ -255,7 +256,7 @@
char xmodule[32];
char fullpath[128];
sscanf(&buffer[7],"%31s",xmodule);
- sprintf(fullpath,XMODPATH"%.31s_drv.o",xmodule);
+ sprintf(fullpath,XMODPATH"%.31s_drv.so",xmodule);
if(exists(fullpath))
{
strncpy(xi.xmodule,xmodule,sizeof(xi.xmodule));
@@ -279,9 +280,9 @@
if(*xfree3server&&!*xi.xmodule)
strncpy(xi.xserver,xfree3server,sizeof(xi.xserver));
else
- strncpy(xi.xserver,xfree4,sizeof(xi.xserver));
+ strncpy(xi.xserver,xorg,sizeof(xi.xserver));
}
- if(!*xi.xmodule) strcpy(xi.xmodule,xvesa4);
+ if(!*xi.xmodule) strcpy(xi.xmodule,xvesa);
return ξ
}
}
@@ -292,14 +293,14 @@
if(strstr(d->driver,driver[i]))
{
char *xpos;
- if((xpos=strstr(d->driver,xfree4))!=NULL) /* Check for XFree 4 */
+ if((xpos=strstr(d->driver,xorg))!=NULL)
{
char xm[32]="";
- strcpy(xi.xserver,xfree4);
- if(sscanf(xpos,"XFree86(%30[^)])",xm)==1)
+ strcpy(xi.xserver,xorg);
+ if(sscanf(xpos,"X(%30[^)])",xm)==1)
strcpy(xi.xmodule,xm);
else
- strcpy(xi.xmodule,xvesa4);
+ strcpy(xi.xmodule,xvesa);
}
else
{
@@ -330,22 +331,22 @@
if(strstr(d->desc,"Trident")||strstr(d->desc,"TGUI")
||strstr(d->desc,"Cirrus")||strstr(d->desc,"clgd"))
{
- if(!strcmp(xi.xserver,xfree4))
+ if(!strcmp(xi.xserver,xorg))
strncpy(xi.xopts,"-depth 16",sizeof(xi.xopts)-1);
else
strncpy(xi.xopts,"-bpp 16",sizeof(xi.xopts)-1);
}
else if(strstr(d->desc,"Savage 4")) /* S3 Inc.|Savage 4 */
{
- if(!strcmp(xi.xserver,xfree4))
+ if(!strcmp(xi.xserver,xorg))
strncpy(xi.xopts,"-depth 32",sizeof(xi.xopts)-1);
else
strncpy(xi.xopts,"-bpp 32",sizeof(xi.xopts)-1);
}
}
/* Fallback values */
- if(!*xi.xserver) strcpy(xi.xserver,xfree4);
- if(!*xi.xmodule) strcpy(xi.xmodule,xvesa4);
+ if(!*xi.xserver) strcpy(xi.xserver,xorg);
+ if(!*xi.xmodule) strcpy(xi.xmodule,xvesa);
return ξ
}
@@ -517,7 +518,7 @@
int writeconfig(char *name,struct device *d,int verbose)
{
FILE *f,*k;
- const char *kconfig="/etc/sysconfig/knoppix";
+ const char *kconfig="/etc/sysconfig/gentoo";
unlink(name);
if((f=fopen(name,"w"))==NULL)
{ /* Read-only filesystem on /etc ?! */
|