mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
Improve compatibility with 4.x, particularly:
o Don't use devinfo(8) in startup script, since it doesn't exist on 4.x. Use pciinfo(8) instead. o In zaptel driver don't require a specific major on the 5.x system that support auto major numbering; o Assign specific majors to wcfxs and wcfxo drivers on systems that don't support auto major numbering; o Ensure that nodes are created properly on non-devfs systems.
This commit is contained in:
parent
c68425a12b
commit
33f57ea588
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=120225
10 changed files with 230 additions and 6 deletions
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= zaptel
|
PORTNAME= zaptel
|
||||||
PORTVERSION= 0.8
|
PORTVERSION= 0.8
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= misc
|
CATEGORIES= misc
|
||||||
MASTER_SITES= http://www.portaone.com/~sobomax/
|
MASTER_SITES= http://www.portaone.com/~sobomax/
|
||||||
DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
|
DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
|
||||||
|
|
22
misc/zaptel/files/patch-wcfxo::wcfxo.c
Normal file
22
misc/zaptel/files/patch-wcfxo::wcfxo.c
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- wcfxo/wcfxo.c
|
||||||
|
+++ wcfxo/wcfxo.c
|
||||||
|
@@ -267,8 +267,14 @@
|
||||||
|
|
||||||
|
/* Character device entry points */
|
||||||
|
static struct cdevsw wcfxo_cdevsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
- .d_version = D_VERSION,
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = 197,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
+ .d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_name = "wcfxo",
|
||||||
|
.d_open = wcfxo_sys_open,
|
20
misc/zaptel/files/patch-wcfxs::wcfxs.c
Normal file
20
misc/zaptel/files/patch-wcfxs::wcfxs.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- wcfxs/wcfxs.c
|
||||||
|
+++ wcfxs/wcfxs.c
|
||||||
|
@@ -308,7 +308,13 @@
|
||||||
|
|
||||||
|
/* Character device entry points */
|
||||||
|
static struct cdevsw wcfxs_cdevsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = 198,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
.d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_name = "wcfxs",
|
26
misc/zaptel/files/patch-zaptel::zaptel.c
Normal file
26
misc/zaptel/files/patch-zaptel::zaptel.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- zaptel/zaptel.c
|
||||||
|
+++ zaptel/zaptel.c
|
||||||
|
@@ -156,12 +156,17 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static struct cdevsw zt_devsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = ZT_MAJOR,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
.d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_open = ztopen,
|
||||||
|
- .d_name = "zaptel",
|
||||||
|
- .d_maj = ZT_MAJOR
|
||||||
|
+ .d_name = "zaptel"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,59 @@ case "$1" in
|
||||||
/sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
|
/sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
|
||||||
/sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
|
/sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
|
||||||
/sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1
|
/sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1
|
||||||
if /usr/sbin/devinfo | /usr/bin/grep -q wcfxo
|
if [ ! -d /dev/zap ]
|
||||||
then
|
then
|
||||||
|
mkdir -p /dev/zap || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/channel ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/channel c 196 254 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/ctl ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/ctl c 196 0 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/pseudo ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/pseudo c 196 255 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/timer ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/timer c 196 253 || exit 1
|
||||||
|
fi
|
||||||
|
z=" zaptel"
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo
|
||||||
|
then
|
||||||
|
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
|
do
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo${i}
|
||||||
|
then
|
||||||
|
if [ ! -c /dev/wcfxo${i} ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/wcfxo${i} c 197 ${i} || exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
${PREFIX}/bin/ztcfg 2> /dev/null
|
${PREFIX}/bin/ztcfg 2> /dev/null
|
||||||
else
|
else
|
||||||
if /usr/sbin/devinfo | /usr/bin/grep -q wcfxs
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs
|
||||||
then
|
then
|
||||||
|
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
|
do
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs${i}
|
||||||
|
then
|
||||||
|
if [ ! -c /dev/wcfxs${i} ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/wcfxo${i} c 198 ${i} || exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
${PREFIX}/bin/ztcfg 2> /dev/null
|
${PREFIX}/bin/ztcfg 2> /dev/null
|
||||||
|
else
|
||||||
|
z=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo -n " zaptel"
|
echo -n ${z}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= zaptel
|
PORTNAME= zaptel
|
||||||
PORTVERSION= 0.8
|
PORTVERSION= 0.8
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= misc
|
CATEGORIES= misc
|
||||||
MASTER_SITES= http://www.portaone.com/~sobomax/
|
MASTER_SITES= http://www.portaone.com/~sobomax/
|
||||||
DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
|
DISTNAME= ${PORTNAME}-freebsd-${PORTVERSION}
|
||||||
|
|
22
net/zaptel12/files/patch-wcfxo::wcfxo.c
Normal file
22
net/zaptel12/files/patch-wcfxo::wcfxo.c
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- wcfxo/wcfxo.c
|
||||||
|
+++ wcfxo/wcfxo.c
|
||||||
|
@@ -267,8 +267,14 @@
|
||||||
|
|
||||||
|
/* Character device entry points */
|
||||||
|
static struct cdevsw wcfxo_cdevsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
- .d_version = D_VERSION,
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = 197,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
+ .d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_name = "wcfxo",
|
||||||
|
.d_open = wcfxo_sys_open,
|
20
net/zaptel12/files/patch-wcfxs::wcfxs.c
Normal file
20
net/zaptel12/files/patch-wcfxs::wcfxs.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- wcfxs/wcfxs.c
|
||||||
|
+++ wcfxs/wcfxs.c
|
||||||
|
@@ -308,7 +308,13 @@
|
||||||
|
|
||||||
|
/* Character device entry points */
|
||||||
|
static struct cdevsw wcfxs_cdevsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = 198,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
.d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_name = "wcfxs",
|
26
net/zaptel12/files/patch-zaptel::zaptel.c
Normal file
26
net/zaptel12/files/patch-zaptel::zaptel.c
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
$FreeBSD$
|
||||||
|
|
||||||
|
--- zaptel/zaptel.c
|
||||||
|
+++ zaptel/zaptel.c
|
||||||
|
@@ -156,12 +156,17 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static struct cdevsw zt_devsw = {
|
||||||
|
-#if __FreeBSD_version >= 502103
|
||||||
|
+#if __FreeBSD_version < 502103
|
||||||
|
+#ifdef MAJOR_AUTO
|
||||||
|
+ .d_maj = MAJOR_AUTO,
|
||||||
|
+#else
|
||||||
|
+ .d_maj = ZT_MAJOR,
|
||||||
|
+#endif
|
||||||
|
+#else
|
||||||
|
.d_version = D_VERSION,
|
||||||
|
#endif
|
||||||
|
.d_open = ztopen,
|
||||||
|
- .d_name = "zaptel",
|
||||||
|
- .d_maj = ZT_MAJOR
|
||||||
|
+ .d_name = "zaptel"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
|
@ -8,16 +8,59 @@ case "$1" in
|
||||||
/sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
|
/sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
|
||||||
/sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
|
/sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
|
||||||
/sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1
|
/sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1
|
||||||
if /usr/sbin/devinfo | /usr/bin/grep -q wcfxo
|
if [ ! -d /dev/zap ]
|
||||||
then
|
then
|
||||||
|
mkdir -p /dev/zap || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/channel ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/channel c 196 254 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/ctl ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/ctl c 196 0 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/pseudo ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/pseudo c 196 255 || exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -c /dev/zap/timer ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/zap/timer c 196 253 || exit 1
|
||||||
|
fi
|
||||||
|
z=" zaptel"
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo
|
||||||
|
then
|
||||||
|
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
|
do
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo${i}
|
||||||
|
then
|
||||||
|
if [ ! -c /dev/wcfxo${i} ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/wcfxo${i} c 197 ${i} || exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
${PREFIX}/bin/ztcfg 2> /dev/null
|
${PREFIX}/bin/ztcfg 2> /dev/null
|
||||||
else
|
else
|
||||||
if /usr/sbin/devinfo | /usr/bin/grep -q wcfxs
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs
|
||||||
then
|
then
|
||||||
|
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
|
do
|
||||||
|
if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs${i}
|
||||||
|
then
|
||||||
|
if [ ! -c /dev/wcfxs${i} ]
|
||||||
|
then
|
||||||
|
/sbin/mknod /dev/wcfxo${i} c 198 ${i} || exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
${PREFIX}/bin/ztcfg 2> /dev/null
|
${PREFIX}/bin/ztcfg 2> /dev/null
|
||||||
|
else
|
||||||
|
z=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo -n " zaptel"
|
echo -n ${z}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
|
Loading…
Add table
Reference in a new issue