aboutsummaryrefslogtreecommitdiff
path: root/emulators/rtc
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2000-09-22 11:08:22 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2000-09-22 11:08:22 +0000
commit48af3464adb0f4e1d7572dca0420f509e588b497 (patch)
tree57812c619c3fedc1b9ac72451edd09303450322f /emulators/rtc
parent1ce4cbb7e58b8b51ff71da7be76cc108cfa4c6af (diff)
downloadports-48af3464adb0f4e1d7572dca0420f509e588b497.tar.gz
ports-48af3464adb0f4e1d7572dca0420f509e588b497.zip
Update for the latest current. (lminor() -> dev2unit())
Correct the startup script to unload rtc.ko module properly.
Notes
Notes: svn path=/head/; revision=32996
Diffstat (limited to 'emulators/rtc')
-rw-r--r--emulators/rtc/Makefile13
-rw-r--r--emulators/rtc/files/rtc.c2
-rw-r--r--emulators/rtc/files/rtc.sh7
3 files changed, 15 insertions, 7 deletions
diff --git a/emulators/rtc/Makefile b/emulators/rtc/Makefile
index b20a7acfd7cb..ec92a8215c7a 100644
--- a/emulators/rtc/Makefile
+++ b/emulators/rtc/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= rtc
-PORTVERSION= 2000.09.11
+PORTVERSION= 2000.09.22
CATEGORIES= emulators linux
MASTER_SITES= # none
DISTFILES= # none
@@ -25,13 +25,15 @@ STARTUP= rtc.sh
MAKE_ARGS= KMODDIR="${KMODDIR}" CDEV_MAJOR="${CDEV_MAJOR}"
PLIST_SUB= DEVDIR="${DEVDIR}" CDEV_MAJOR="${CDEV_MAJOR}" RTC_H_DIR="${RTC_H_DIR}"
+SRC_BASE?= /usr/src
+
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 400013
BROKEN= "Systems prior to 400013 is out of support"
.endif
-.if !exists(/sys/Makefile)
+.if !exists(${SRC_BASE}/sys/Makefile)
BROKEN= "Kernel source files required"
.endif
@@ -45,10 +47,15 @@ do-extract:
@cd ${FILESDIR} && ${CP} Makefile *.[ch] ${WRKSRC}/
post-patch:
-.if !exists(/sys/compat/linux/linux_ioctl.h)
+.if !exists(${SRC_BASE}/sys/compat/linux/linux_ioctl.h)
${PERL} -i -pe 's,compat(/linux/linux_ioctl\.h),i386$$1,' \
${WRKSRC}/rtc_linux.c
.endif
+ @if ! grep -w dev2unit ${SRC_BASE}/sys/kern/kern_conf.c >/dev/null; \
+ then \
+ ${ECHO} "dev2unit() not found in sys/kern/kern_conf.c. Using lminor() instead."; \
+ ${PERL} -i -pe 's,dev2unit,lminor,' ${WRKSRC}/rtc.c; \
+ fi
pre-install:
${MKDIR} ${KMODDIR}
diff --git a/emulators/rtc/files/rtc.c b/emulators/rtc/files/rtc.c
index 95681ce5bdc0..ff6899e3251b 100644
--- a/emulators/rtc/files/rtc.c
+++ b/emulators/rtc/files/rtc.c
@@ -115,7 +115,7 @@ rtc_attach(dev_t dev)
struct rtc_softc *sc;
int unit;
- unit = lminor(dev);
+ unit = dev2unit(dev);
DLog(Lenter, "%d %p", unit, dev);
if (dev->si_drv1) {
DLog(Lexit, "old %p, %p", dev, dev->si_drv1);
diff --git a/emulators/rtc/files/rtc.sh b/emulators/rtc/files/rtc.sh
index 5fa3843be1f4..8751f46c710d 100644
--- a/emulators/rtc/files/rtc.sh
+++ b/emulators/rtc/files/rtc.sh
@@ -1,12 +1,13 @@
#!/bin/sh
-kmod=@@PREFIX@@/modules/rtc.ko
+kmoddir=@@PREFIX@@/modules
+kmod=rtc.ko
case "$1" in
start)
- if [ -x $kmod ]; then
+ if [ -x $kmoddir/$kmod ]; then
echo -n ' rtc'
- kldload $kmod
+ kldload $kmoddir/$kmod
fi
;;
stop)