1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

Update for the latest current. (lminor() -> dev2unit())

Correct the startup script to unload rtc.ko module properly.
This commit is contained in:
Akinori MUSHA 2000-09-22 11:08:22 +00:00
parent 1ce4cbb7e5
commit 48af3464ad
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=32996
3 changed files with 15 additions and 7 deletions

View File

@ -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}

View File

@ -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);

View File

@ -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)