View | Details | Raw Unified | Return to bug 184628
Collapse All | Expand All

(-)./Makefile (-14 / +62 lines)
Lines 1-22 Link Here
1
# Created by: kaz@kobe1995.net (NAKAMURA Kauzushi)
1
# Created by: kaz@kobe1995.net (NAKAMURA Kauzushi)
2
# $FreeBSD: sysutils/xmbmon/Makefile 327772 2013-09-20 23:05:58Z bapt $
2
# $FreeBSD: head/sysutils/xmbmon/Makefile 327772 2013-09-20 23:05:58Z bapt $
3
3
4
PORTNAME=	xmbmon
4
PORTNAME=	xmbmon
5
PORTREVISION=	9
5
PORTVERSION=	205
6
6
PORTREVISION=	10
7
COMMENT=	X motherboard monitor for LM78/79, W8378x, AS99127F, VT82C686, and ADM9240
7
CATEGORIES=	sysutils
8
8
MASTER_SITES=	http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/${PORTNAME}/
9
MASTERDIR=	${.CURDIR}/../mbmon
9
DISTNAME=	${PORTNAME}${PORTVERSION}
10
10
11
MAINTAINER=	5u623l20@gmail.com
12
COMMENT=	MB monitor for LM78/79, W8378x, AS99127F, VT82C686 and ADM9240
13
14
LICENSE=	BSD
15
16
PORTSCOUT=	limit:^[0-9]+$
17
PATCH_SITES+=	${MASTER_SITES}
18
PATCHFILES+=	${PORTNAME}${PORTVERSION}_fflush.patch
19
20
ONLY_FOR_ARCHS=	i386 amd64
21
GNU_CONFIGURE=	yes
22
23
PORTDOCS=	ChangeLog ChangeLog.jp ReadMe ReadMe.jp ReadMe.tech
24
25
OPTIONS_DEFINE=	ASUS SMB DOCS
26
OPTIONS_MULTI=	INTERFACE
27
OPTIONS_MULTI_INTERFACE=	CLI X11
28
OPTIONS_DEFAULT=SMB CLI
29
ASUS_DESC=	"Enable A7N8X-VM support"
30
SMB_DESC=	"Enable smb(4) support"
31
CLI_DESC=	"CLI support only"
32
33
ASUS_PATCHFILES=	${PORTNAME}${PORTVERSION}_A7N8X-VM.patch
34
X11_PLIST_FILES=	lib/X11/app-defaults/${PORTNAME} \
35
			man/man1/${PORTNAME}.1x.gz
36
CLI_PLIST_FILES=	bin/mbmon \
37
			man/man1/mbmon.1.gz
38
39
.include <bsd.port.options.mk>
40
41
.if !${PORT_OPTIONS:MX11}
42
MAKE_ARGS=	PROGRAM="mbmon"
43
.else
11
USE_XORG=	x11 xt
44
USE_XORG=	x11 xt
12
EXTRA_PATCHES=	${.CURDIR}/files/patch-*
45
.endif
13
46
14
PLIST_FILES=	lib/X11/app-defaults/XMBmon
47
.if ${PORT_OPTIONS:MCLI}
15
MAN1=		xmbmon.1x
48
USE_RC_SUBR=	mbmon
49
.endif
50
51
post-patch:
52
	@${REINPLACE_CMD} -e 's+/usr/share/doc/mbmon+${STAGEIR}${DOCSDIR}+' ${WRKSRC}/mbmon.1
53
	@${REINPLACE_CMD} -e 's+%%STAGEDIR%%%%PREFIX%%+${STAGEDIR}${PREFIX}+' ${WRKSRC}/Makefile.in
54
.if !${PORT_OPTIONS:MX11}
55
	@${REINPLACE_CMD} -e '/p xmbmon/d' ${WRKSRC}/Makefile.in
56
.endif
57
.if !${PORT_OPTIONS:MCLI}
58
	@${REINPLACE_CMD} -e '/p mbmon/d' ${WRKSRC}/Makefile.in
59
.endif
60
.if ${PORT_OPTIONS:MSMB}
61
	@${REINPLACE_CMD} -e 's/^DEFS=/&-DSMBUS_IOCTL /' ${WRKSRC}/Makefile.in
62
.endif
16
63
17
NO_STAGE=	yes
18
post-install:
64
post-install:
19
	${MKDIR} ${PREFIX}/lib/X11/app-defaults
65
.if ${PORT_OPTIONS:MDOCS}
20
	${INSTALL_DATA} ${WRKSRC}/xmbmon.resources ${PREFIX}/lib/X11/app-defaults/XMBmon
66
	${MKDIR} ${STAGEDIR}${DOCSDIR}
67
	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
68
.endif
21
69
22
.include "${MASTERDIR}/Makefile"
70
.include <bsd.port.mk>
(-)./distinfo (+6 lines)
Line 0 Link Here
1
SHA256 (xmbmon205.tar.gz) = 65b10ebfe53585ac22d6a31d8ef3fea552cb266cf2c124c00421dec1df5a4a4f
2
SIZE (xmbmon205.tar.gz) = 142987
3
SHA256 (xmbmon205_fflush.patch) = f837f465861ce46e4a90d1d3c7a680c1904f7fb91e14efcbad22313c90e2cdc7
4
SIZE (xmbmon205_fflush.patch) = 242
5
SHA256 (xmbmon205_A7N8X-VM.patch) = 20565e0b1216d3becb87f796fa547e81fec84e37cff05405eb8f71bc97eebc68
6
SIZE (xmbmon205_A7N8X-VM.patch) = 274
(-)./files/mbmon.in (+32 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD: head/sysutils/mbmon/files/mbmon.in 302141 2012-08-05 23:19:36Z dougb $
4
#
5
6
# PROVIDE: mbmon
7
# REQUIRE: LOGIN
8
# BEFORE:  securelevel
9
# KEYWORD: shutdown
10
11
# Add the following lines to /etc/rc.conf to enable the mbmon daemon:
12
#
13
# mbmon_enable="YES"
14
# mbmon_flags="<set as needed>"
15
#
16
# See mbmon(1) for mbmon_flags
17
# Set mbmon_port to the TCP port to listen to, default is 12999
18
19
. /etc/rc.subr
20
21
name="mbmon"
22
rcvar=mbmon_enable
23
24
# read configuration and set defaults
25
load_rc_config "$name"
26
: ${mbmon_enable="NO"}
27
: ${mbmon_port="12999"}
28
29
command="%%PREFIX%%/bin/${name}"
30
command_args="-P ${mbmon_port}"
31
32
run_rc_command "$1"
(-)./files/patch-Makefile.in (+48 lines)
Line 0 Link Here
1
--- Makefile.in.orig	Wed Feb  1 20:12:01 2006
2
+++ Makefile.in	Wed Feb  1 20:12:22 2006
3
@@ -27,9 +27,9 @@
4
 
5
 #CC=/compat/linux/usr/bin/gcc
6
 CC=@CC@
7
-CFLAGS=-O3 $(INCLUDES) $(DEFS)
8
+CFLAGS+=$(INCLUDES) $(DEFS)
9
 CFLAGSX=$(CFLAGS) @X_CFLAGS@
10
-LDFLAGS=-s
11
+LDFLAGS=
12
 
13
 LINT=lint
14
 # LINT=$(CC) -c -Wall -Wshadow -Wpointer-arith
15
@@ -37,9 +37,9 @@
16
 RM=rm -f
17
 INSTALL=install
18
 
19
-INST_DIR=/usr/local/bin
20
-INST_MANDIR=/usr/local/man/man1
21
-INST_XDIR=/usr/X11R6/bin
22
+INST_DIR=%%STAGEDIR%%%%PREFIX%%/bin
23
+INST_MANDIR=%%STAGEDIR%%%%PREFIX%%/man/man1
24
+INST_XDIR=%%STAGEDIR%%%%PREFIX%%/lib/X11/app-defaults
25
 INST_MANXDIR=/usr/X11R6/man/man1
26
 INST_XRDIR=/usr/X11R6/lib/X11/app-defaults
27
  
28
@@ -56,7 +56,7 @@
29
 HWM_OBJ = sens_winbond.o sens_via686.o sens_it87.o sens_gl52.o sens_lm85.o sens_lm80.o sens_lm90.o sens_lm75.o sens_wl784.o smb_extemp.o
30
 OBJS = getMBinfo.o tyan_tiger.o pci_pm.o sensors.o $(MB_OBJ) $(SMB_OBJ) $(HWM_OBJ)
31
 
32
-all: $(PROGRAM)
33
+all: $(PROGRAM) $(MANPAGE)
34
 
35
 mbmon: mbmon.c mbmon.h methods.h pci_pm.h smbuses.h sensors.h $(OBJS)
36
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mbmon.c $(OBJS) $(LIBS)
37
@@ -135,10 +135,8 @@
38
 install: $(PROGRAM)
39
 	$(INSTALL) -o root -g wheel -m 4555 -c -p mbmon $(INST_DIR)
40
 	$(INSTALL) -o root -g wheel -m 4555 -c -p xmbmon $(INST_XDIR)
41
-
42
-install-man: $(MANPAGE)
43
 	$(INSTALL) -o root -g wheel -m 444 -c -p mbmon.1 $(INST_MANDIR)
44
-	$(INSTALL) -o root -g wheel -m 444 -c -p xmbmon.1x $(INST_MANXDIR)
45
+	$(INSTALL) -o root -g wheel -m 444 -c -p xmbmon.1x $(INST_MANDIR)
46
 
47
 lint:
48
 	$(LINT) $(INCLUDES) $(DEFS) $(FONTDEFINES) $(SRCS) -lm
(-)./files/patch-configure (+27 lines)
Line 0 Link Here
1
--- configure.orig	Wed Feb  1 20:34:58 2006
2
+++ configure	Wed Feb  1 20:35:38 2006
3
@@ -3487,7 +3487,6 @@
4
 
5
 case "${host}" in
6
 	i?86-*-freebsd*)
7
-  		CC=cc
8
 		;;
9
 	i?86-*-linux-*)
10
   		CC=gcc
11
@@ -3499,7 +3498,6 @@
12
 		ADDLIBS="-li386"
13
 		;;
14
 	*)
15
-  		CC=gcc
16
 		;;
17
 esac
18
 
19
@@ -3946,7 +3944,7 @@
20
 done
21
 
22
 
23
-for ac_header in machine/smb.h
24
+for ac_header in dev/smbus/smb.h machine/smb.h
25
 do
26
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
27
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
(-)./files/patch-getMB-smb_ioctl.c (+24 lines)
Line 0 Link Here
1
$FreeBSD: head/sysutils/mbmon/files/patch-getMB-smb_ioctl.c 300897 2012-07-14 14:29:18Z beat $
2
3
--- getMB-smb_ioctl.c.orig	Sat Jul  5 18:15:24 2003
4
+++ getMB-smb_ioctl.c	Fri Dec 16 17:56:54 2005
5
@@ -5,6 +5,7 @@
6
 #ifdef HAVE_SMBUS
7
 /* assume SMBus ioctl support, only for FreeBSD */
8
 
9
+#include <sys/param.h>
10
 #include <stdlib.h>
11
 #include <stdio.h>
12
 #include <fcntl.h>
13
@@ -13,7 +14,11 @@
14
 #include <sys/types.h>
15
 #include <sys/ioctl.h>
16
 
17
+#if __FreeBSD_version >= 500000
18
+#include <dev/smbus/smb.h>
19
+#else
20
 #include <machine/smb.h>
21
+#endif
22
 
23
 #include "methods.h"
24
 
(-)./files/patch-mbmon.c (+27 lines)
Line 0 Link Here
1
--- mbmon.c.orig	2004-08-13 16:23:32.000000000 +0900
2
+++ mbmon.c	2009-06-10 12:13:47.000000000 +0900
3
@@ -315,7 +315,7 @@
4
 
5
 	name = argv[0];
6
 #if !defined(LINUX) && defined(HAVE_SMBUS) && defined(SMBUS_IOCTL)
7
-	while ((ch = getopt(argc,argv,"VSIAfdDYe:p:s:c:T:F:tunNirh")) != -1) {
8
+	while ((ch = getopt(argc,argv,"VSIAfdDYe:p:s:c:T:F:tunNirhP:")) != -1) {
9
 #else
10
 	while ((ch = getopt(argc,argv,"VSIAfdDYe:p:c:T:F:tunNirhP:")) != -1) {
11
 #endif
12
@@ -641,6 +641,7 @@
13
 			fprintf(out, "%4d\n%4d\n%4d\n", rot1, rot2, rot3);
14
 	}
15
 	if (port) {
16
+		fflush(out);
17
 #ifdef LOGGING
18
 		if (nfd)
19
 #endif
20
@@ -659,6 +660,7 @@
21
 	if (hostname_flag == 1) {
22
 		hostname(sh_flag);
23
 	}
24
+	fflush(stdout);
25
 
26
 /* count */
27
 	if (count != 0) {
(-)./files/patch-pci__pm.c (+36 lines)
Line 0 Link Here
1
--- pci_pm.c.orig	2004-08-17 22:38:04.000000000 +0600
2
+++ pci_pm.c	2013-12-05 23:58:00.000000000 +0600
3
@@ -64,7 +64,7 @@
4
 			comt = "Intel8XX(ICH/ICH2/ICH3/ICH4/ICH5/ICH6)";
5
 			break;
6
 		case AMD756SMB:
7
-			comt = "AMD756/766/768";
8
+			comt = "AMD756/766/768/8111";
9
 			break;
10
 		case NFORCESMB:
11
 			comt = "NVidia nForce";
12
@@ -158,6 +158,7 @@
13
 		case ID_I801CA:
14
 		case ID_I801DB:
15
 		case ID_I801EB:
16
+		case ID_I801IB:
17
 		case ID_I6300ESB:
18
 		case ID_IICH6:
19
 			ret = ICH801SMB;
20
@@ -166,6 +167,7 @@
21
 		case ID_AMD756:
22
 		case ID_AMD766:
23
 		case ID_AMD768:
24
+		case ID_AMD8111_1:
25
 			ret = AMD756SMB;
26
 			inq_smbba = getSMBBA3;
27
 			break;
28
@@ -182,7 +184,7 @@
29
 				inq_smbba = getSMBBA4;
30
 			}
31
 			break;
32
-		case ID_AMD8111:
33
+		case ID_AMD8111_2:
34
 			ret = AMD8111SMB;
35
 			inq_smbba = getSMBBA6;
36
 			break;
(-)./files/patch-pci__pm.h (+31 lines)
Line 0 Link Here
1
--- pci_pm.h.orig	2004-07-14 21:02:49.000000000 +0600
2
+++ pci_pm.h	2013-12-05 23:53:34.000000000 +0600
3
@@ -32,10 +32,10 @@
4
 #define getSMBBA0	0x90	/* PIIX4, VIA596,686 */
5
 #define getSMBBA1	0xD0	/* VT8233/A/C */
6
 #define getSMBBA2	0x20	/* Intel801_ICH's */
7
-#define getSMBBA3	0x58	/* AMD756,766,768 */
8
+#define getSMBBA3	0x58	/* AMD756,766,768,8111 */
9
 #define getSMBBA4	0x14	/* NVidia nForce */
10
 #define getSMBBA5	0xE2	/* ALI7101 */
11
-#define getSMBBA6	0x10	/* AMD8111 */
12
+#define getSMBBA6	0x10	/* AMD8111 SMBus 2.0 */
13
 #define getSMBBA70	0x50	/* NVidia nForce2, bus0 */
14
 #define getSMBBA71	0x54	/* NVidia nForce2, bus1 */
15
 
16
@@ -63,12 +63,14 @@
17
 #define ID_I801CA	0x24838086
18
 #define ID_I801DB	0x24C38086
19
 #define ID_I801EB	0x24D38086
20
+#define ID_I801IB	0x29308086
21
 #define ID_I6300ESB	0x25A48086
22
 #define ID_IICH6	0x266A8086
23
 #define ID_AMD756	0x740B1022
24
 #define ID_AMD766	0x74131022
25
 #define ID_AMD768	0x74431022
26
-#define ID_AMD8111	0x746A1022
27
+#define ID_AMD8111_1	0x746B1022
28
+#define ID_AMD8111_2	0x746A1022
29
 #define ID_NFORCE	0x01B410DE
30
 #define ID_NFORCE2	0x006410DE
31
 #define ID_ALI7101	0x710110B9
(-)./files/patch-sens_lm85.c (+71 lines)
Line 0 Link Here
1
$FreeBSD: head/sysutils/mbmon/files/patch-sens_lm85.c 300897 2012-07-14 14:29:18Z beat $
2
3
--- sens_lm85.c	Mon Oct 13 10:12:58 2003
4
+++ sens_lm85.c	Wed Dec 21 15:37:56 2005
5
@@ -53,7 +53,6 @@
6
 #define ADM_24FAN(nr)	(0x28 + (nr))
7
 #define ADM_24FANDIV	0x47
8
 #define ADM_24MODE		0x16
9
-#define ADM_TEMPOFF(nr)	(0x70 + (nr))
10
 #define ADM_EXTRES1		0x76
11
 #define ADM_EXTRES2		0x77
12
 #define ADM_FANPPR		0x7B
13
@@ -213,7 +212,7 @@
14
 static	float	lm85_temp( LM_METHODS *method, int no )
15
 {
16
 	int n, ne;
17
-	float ext = 0.0, offset = 0.0;
18
+	float ext = 0.0;
19
 
20
 	if (no < 0 || 2 < no)
21
 		return 0xFFFF;
22
@@ -226,18 +225,20 @@
23
 	} else if (lm85chipid >= ADM1027) {
24
 		ne = method->Read(ADM_EXTRES2);	
25
 		ext = 0.25 * ((ne >> ((no + 1) * 2)) & 0x03);
26
-		n = method->Read(ADM_TEMPOFF(no));
27
-		if (n > 0x80)
28
-			n -= 0xFF;
29
-		offset = (float) n;
30
+		/* Unlock temperature registers. */
31
+		if (no != 0) method->Read(LM85_TEMP(0));
32
+		if (no != 1) method->Read(LM85_TEMP(1));
33
+		if (no != 2) method->Read(LM85_TEMP(2));
34
+		/* Unlock voltage register. */
35
+		method->Read(LM85_VOLT(4));
36
 	}
37
 	n = method->Read(LM85_TEMP(no));
38
 	if (n == 0x80)
39
 		return 0xFFFF;
40
 	else if (n > 0x80)
41
-		return (float) (n - 0xFF) + ext - offset;
42
+		return (float) (n - 0xFF) + ext;
43
 	else
44
-		return (float) n + ext - offset;
45
+		return (float) n + ext;
46
 }
47
 
48
 
49
@@ -262,10 +263,20 @@
50
 		return 0xFFFF;
51
 
52
 	if (lm85chipid >= ADM1027) {
53
-		if (no == 4)
54
+		if (no == 4) {
55
 			ne = method->Read(ADM_EXTRES2) & 0x03;
56
-		else
57
+			/* Unlock temperature registers. */
58
+			method->Read(LM85_TEMP(0));
59
+			method->Read(LM85_TEMP(1));
60
+			method->Read(LM85_TEMP(2));
61
+		} else {
62
 			ne = (method->Read(ADM_EXTRES1) >> (no * 2)) & 0x03;
63
+			/* Unlock voltage registers. */
64
+			if (no != 0) method->Read(LM85_VOLT(0));
65
+			if (no != 1) method->Read(LM85_VOLT(1));
66
+			if (no != 2) method->Read(LM85_VOLT(2));
67
+			if (no != 3) method->Read(LM85_VOLT(3));
68
+		}
69
 	}
70
 	n = method->Read(LM85_VOLT(no));
71
 	if (lm85chipid >= ADM1027)
(-)./files/patch-sens_winbond.c (+11 lines)
Line 0 Link Here
1
--- sens_winbond.c	Fri Jul  9 07:34:41 2004
2
+++ sens_winbond.c	Wed May  3 16:43:40 2006
3
@@ -245,6 +244,8 @@
4
 		case 0x20:	/* 0x20 (or 0x21) 627HF */
5
 		case 0x90:	/* 0x90 (or 0x91?) 627THF */
6
 		case 0x1A:	/* 0x1A (??)  627THF-A */
7
+		case 0xA0:	/* 0xA0 (or 0xA1) */
8
+		case 0xC0:	/* 0xC0 (or 0xC1) 627DHG */
9
 			wbdchipid = W83627HF;
10
 			break;
11
 		case 0x30:	/* 0x30 (or 0x31) */
(-)./files/patch-testsmb.c (+44 lines)
Line 0 Link Here
1
$FreeBSD: head/sysutils/mbmon/files/patch-testsmb.c 300897 2012-07-14 14:29:18Z beat $
2
3
--- testsmb.c	Thu Aug 12 07:34:48 2004
4
+++ testsmb.c	Fri Dec 30 23:11:29 2005
5
@@ -105,8 +105,9 @@
6
 	case ID_AMD756:
7
 	case ID_AMD766:
8
 	case ID_AMD768:
9
+	case ID_AMD8111_1:
10
 		smbus = &smbus_amd;
11
-		fprintf(stderr, "AMD756/766/768 found.\n");
12
+		fprintf(stderr, "AMD756/766/768/8111 found.\n");
13
 		break;
14
 	case ID_NFORCE:
15
 		smbus = &smbus_amd;
16
@@ -116,9 +117,9 @@
17
 		smbus = &smbus_ali;
18
 		fprintf(stderr, "ALi M1535D+ found.\n");
19
 		break;
20
-	case ID_AMD8111:
21
+	case ID_AMD8111_2:
22
 		smbus = &smbus_amd8;
23
-		fprintf(stderr, "AMD8111 found.\n");
24
+		fprintf(stderr, "AMD8111 SMBus 2.0 found.\n");
25
 		break;
26
 	case ID_NFORCE2:
27
 		smbus = &smbus_amd8;
28
@@ -126,7 +127,7 @@
29
 		break;
30
 	default:
31
 		fprintf(stderr, "No known SMBus(I2C) chip found.\n");
32
-		goto exit;
33
+		continue;
34
 	}
35
 
36
 	if(OpenIO() == -1) return -1;
37
@@ -141,7 +142,6 @@
38
 	}
39
 	
40
 	CloseIO();
41
-exit:
42
 	;	/* dummy statment for gcc 3.4 or after */
43
 
44
   } /* endo of Big loop for smb_base candidates */
(-)./pkg-descr (+13 lines)
Line 0 Link Here
1
This is a X/tty motherboard monitor which supports LM78/79, WINBond
2
83781D/83782D/83783S, ASUS 991227F, and VIA VT82C686A/B PC-health
3
chips via 3 methods: ISA-I/O, SMBus, VIA-direct.
4
5
Run "mbmon -h" or "xmbmon -help" to see the usage.
6
7
***CAUTION*** 
8
9
These programs access to the SMBus or the ISA-IO port directly under
10
the superuser privilege, so it may cause a system crash.  Please test
11
"mbmon -d" or "xmbmon -debug" first.
12
13
WWW: http://www.nt.phys.kyushu-u.ac.jp/shimizu/download/download.html

Return to bug 184628