diff options
Diffstat (limited to 'sys/modules/linux')
-rw-r--r-- | sys/modules/linux/Makefile | 41 | ||||
-rw-r--r-- | sys/modules/linux/linux.8 | 47 | ||||
-rw-r--r-- | sys/modules/linux/linux.sh | 21 |
3 files changed, 109 insertions, 0 deletions
diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile new file mode 100644 index 0000000..7c5a53e --- /dev/null +++ b/sys/modules/linux/Makefile @@ -0,0 +1,41 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/linux + +MAINTAINER= marcel@FreeBSD.org + +KMOD= linux +SRCS= linux_file.c linux_ioctl.c linux_misc.c linux_signal.c \ + linux_ipc.c linux_socket.c linux_stats.c linux_mib.c \ + linux_dummy.c linux_sysent.c linux_sysvec.c linux_util.c \ + imgact_linux.c opt_compat.h opt_linux.h opt_vmpage.h vnode_if.h +OBJS= linux_locore.o +MAN8= linux.8 + +# CFLAGS+= -DDEBUG +EXPORT_SYMS=_linux_mod +CLEANFILES= linux_assym.h linux_genassym linux_genassym.o + +build-tools: linux_genassym + +linux_assym.h: linux_genassym + ./linux_genassym > linux_assym.h + +linux_locore.o: linux_locore.s linux_assym.h + ${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + +linux_genassym.o: linux_genassym.c linux.h @ machine + ${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC} + +linux_genassym: linux_genassym.o + ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + +opt_compat.h: + echo "#define COMPAT_43 1" > opt_compat.h + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/linux.sh ${DESTDIR}/usr/sbin/linux + +.include <bsd.kmod.mk> diff --git a/sys/modules/linux/linux.8 b/sys/modules/linux/linux.8 new file mode 100644 index 0000000..13f3f0b --- /dev/null +++ b/sys/modules/linux/linux.8 @@ -0,0 +1,47 @@ +.\" +.\" Copyright (c) 1997 +.\" The FreeBSD Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 9, 1997 +.Dt LINUX 8 +.Os FreeBSD +.Sh NAME +.Nm linux +.Nd load the Linux image activator module +.Sh SYNOPSIS +.Nm linux +.Sh DESCRIPTION +The +.Nm +utility loads the Linux image activator module. +.Sh FILES +.Bl -tag -width /modules/linux.ko +.It Pa /modules/linux.ko +Linux image activator loadable kernel module. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr kldstat 8 , +.Xr kldunload 8 diff --git a/sys/modules/linux/linux.sh b/sys/modules/linux/linux.sh new file mode 100644 index 0000000..a9215cf --- /dev/null +++ b/sys/modules/linux/linux.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +FOUND=`kldstat -v | egrep 'linux(aout|elf)'` + +exitcode=0 + +if [ "x$FOUND" != x ] ; then + echo Linux driver already loaded + exitcode=1 +else + kldload linux + exitcode=$? +fi + +if [ -f /compat/linux/sbin/ldconfig ] ; then + /compat/linux/sbin/ldconfig +fi + +exit $exitcode |