From f42fef1c3dde7171af58433640fc178ebc7f8e80 Mon Sep 17 00:00:00 2001
From: Sascha Wildner <saw@online.de>
Date: Wed, 1 Feb 2017 19:35:06 +0100
Subject: [PATCH] WIP

---
 Makefile_upgrade.inc         |  4 ++
 etc/defaults/rc.conf         |  1 -
 etc/rc.d/Makefile            |  2 +-
 etc/rc.d/abi                 | 29 --------------
 etc/rc.d/localdaemons        |  1 -
 lib/libc/sys/rfork.2         | 19 ---------
 lib/libc/sys/setresuid.2     |  6 ---
 sbin/mount/mount.8           |  1 -
 sbin/mount_std/Makefile      |  6 +--
 sbin/mount_std/mount_std.8   | 23 ++++-------
 sbin/mount_ufs/mount_ufs.8   |  1 -
 share/man/man4/aac.4         | 12 ------
 share/man/man4/kld.4         |  4 +-
 share/man/man4/mrsas.4       |  3 --
 share/man/man4/pcm.4         |  5 +--
 share/man/man5/Makefile      |  1 -
 share/man/man5/linprocfs.5   | 94 --------------------------------------------
 share/man/man5/rc.conf.5     |  5 ---
 share/man/man5/sysctl.conf.5 |  5 ---
 19 files changed, 16 insertions(+), 206 deletions(-)
 delete mode 100644 etc/rc.d/abi
 delete mode 100644 share/man/man5/linprocfs.5

diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc
index 2fb3d8da69..d8f3706cb5 100644
--- a/Makefile_upgrade.inc
+++ b/Makefile_upgrade.inc
@@ -3197,6 +3197,10 @@ TO_REMOVE+=/usr/share/man/man9/fusword.9.gz
 TO_REMOVE+=/usr/share/man/man9/fuword.9.gz
 TO_REMOVE+=/usr/share/man/man9/susword.9.gz
 TO_REMOVE+=/usr/share/man/man9/suword.9.gz
+TO_REMOVE+=/etc/rc.d/abi
+TO_REMOVE+=/sbin/mount_linprocfs
+TO_REMOVE+=/usr/share/man/man5/linprocfs.5.gz
+TO_REMOVE+=/usr/share/man/man8/mount_linprocfs.8.gz
 
 .if !defined(WANT_INSTALLER)
 TO_REMOVE+=/usr/sbin/dfuibe_installer
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index cb71682a31..bfa2b75013 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -356,7 +356,6 @@ enable_quotas="NO"	# turn on quotas on startup (or NO).
 check_quotas="YES"	# Check quotas on startup (or NO).
 accounting_enable="NO"	# Turn on process accounting (or NO).
 sysvipcd_enable="NO"	# Run the System V IPC daemon at startup (or NO).
-linux_enable="NO"	# Linux binary compatibility loaded at startup (or NO).
 clear_tmp_enable="NO"	# Clear /tmp at startup.
 ldconfig_insecure="NO"	# Set to YES to disable ldconfig security checks
 ldconfig_paths="/lib /usr/lib /usr/local/lib /usr/pkg/lib"
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index e317e533c4..02a4587a1f 100644
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -6,7 +6,7 @@
 # note: bgfsk and lomac left out (from 5.0)
 #
 FILES=	DAEMON LOGIN NETWORKING SERVERS \
-	abi accounting addswap adjkerntz automount automountd autounmountd \
+	accounting addswap adjkerntz automount automountd autounmountd \
 	bootconf bootparams btconfig bthcid ccd cleanvar cryptdisks \
 	cleartmp cron cryptdisks devd devfs dhclient diskless dmesg dumpon \
 	fixbootfile fsck ftpd hostname hotplugd \
diff --git a/etc/rc.d/abi b/etc/rc.d/abi
deleted file mode 100644
index 46e5615591..0000000000
--- a/etc/rc.d/abi
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: src/etc/rc.d/abi,v 1.2 2003/05/05 15:38:41 mtm Exp $
-#
-
-# PROVIDE: abi
-# REQUIRE: LOGIN
-# BEFORE:  securelevel
-
-. /etc/rc.subr
-
-echo -n 'Additional ABI support:'
-
-name="linux"
-rcvar=`set_rcvar`
-start_cmd="linux_start"
-
-linux_start()
-{
-	echo -n ' linux'
-	kldstat -m linux || kldload -n linux || return 1
-	if [ -x /compat/linux/sbin/ldconfig ]; then
-		/compat/linux/sbin/ldconfig
-	fi
-}
-load_rc_config $name
-run_rc_command "$1"
-
-echo '.'
diff --git a/etc/rc.d/localdaemons b/etc/rc.d/localdaemons
index e52921f13f..950ded80a2 100644
--- a/etc/rc.d/localdaemons
+++ b/etc/rc.d/localdaemons
@@ -4,7 +4,6 @@
 #
 
 # PROVIDE: localdaemons
-# REQUIRE: abi
 # BEFORE:  securelevel
 # KEYWORD: shutdown
 
diff --git a/lib/libc/sys/rfork.2 b/lib/libc/sys/rfork.2
index 7cd6765bd4..739f891bb5 100644
--- a/lib/libc/sys/rfork.2
+++ b/lib/libc/sys/rfork.2
@@ -4,7 +4,6 @@
 .\" use of this page comes from Rob Pike <rob@plan9.att.com>.
 .\"
 .\" $FreeBSD: src/lib/libc/sys/rfork.2,v 1.11.2.11 2002/07/30 19:04:25 silby Exp $
-.\" $DragonFly: src/lib/libc/sys/rfork.2,v 1.7 2007/12/08 23:20:29 swildner Exp $
 .\"
 .Dd January 12, 1996
 .Dt RFORK 2
@@ -169,21 +168,3 @@ There is insufficient swap space for the new process.
 The
 .Fn rfork
 function call first appeared in Plan 9.
-.Sh BUGS
-.Dx
-does not yet implement a native
-.Fn clone
-library call, and the current pthreads implementation does not use
-.Fn rfork
-with
-.Dv RFMEM .
-A native port of the linux threads library,
-.Pa /usr/ports/devel/linuxthreads ,
-contains a working
-.Fn clone
-call that utilizes
-.Dv RFMEM .
-The
-.Fn rfork_thread
-library call can often be used instead of
-.Fn clone .
diff --git a/lib/libc/sys/setresuid.2 b/lib/libc/sys/setresuid.2
index 7f6fd4a03a..ec485a837f 100644
--- a/lib/libc/sys/setresuid.2
+++ b/lib/libc/sys/setresuid.2
@@ -18,7 +18,6 @@
 .\" DAMAGES
 .\"
 .\" $FreeBSD: src/lib/libc/sys/setresuid.2,v 1.2.2.8 2001/12/14 18:34:01 ru Exp $
-.\" $DragonFly: src/lib/libc/sys/setresuid.2,v 1.4 2007/08/03 08:40:14 swildner Exp $
 .\"
 .Dd August 3, 2007
 .Dt SETRESUID 2
@@ -91,10 +90,5 @@ nor the current saved ID.
 .Xr setregid 2 ,
 .Xr setreuid 2 ,
 .Xr setuid 2
-.Sh STANDARDS
-These system calls are not available on many platforms.
-They exist in
-.Dx
-to support Linux binaries linked against GNU libc2.
 .Sh HISTORY
 These system calls first appeared in HP-UX.
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index 94066f4798..379344aa8b 100644
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -410,7 +410,6 @@ have permission to load the module.
 .Xr mount_ext2fs 8 ,
 .Xr mount_hammer 8 ,
 .Xr mount_hpfs 8 ,
-.Xr mount_linprocfs 8 ,
 .Xr mount_mfs 8 ,
 .Xr mount_msdos 8 ,
 .Xr mount_nfs 8 ,
diff --git a/sbin/mount_std/Makefile b/sbin/mount_std/Makefile
index 230cdc0458..b80c22b87e 100644
--- a/sbin/mount_std/Makefile
+++ b/sbin/mount_std/Makefile
@@ -3,13 +3,11 @@
 
 PROG=	mount_std
 MAN=	mount_std.8
-MLINKS=	mount_std.8 mount_linprocfs.8 \
-	mount_std.8 mount_procfs.8
+MLINKS=	mount_std.8 mount_procfs.8
 
 LDADD=	-lutil
 DPADD=	${LIBUTIL}
 
-LINKS=	${BINDIR}/mount_std ${BINDIR}/mount_linprocfs \
-	${BINDIR}/mount_std ${BINDIR}/mount_procfs
+LINKS=	${BINDIR}/mount_std ${BINDIR}/mount_procfs
 
 .include <bsd.prog.mk>
diff --git a/sbin/mount_std/mount_std.8 b/sbin/mount_std/mount_std.8
index 1fd2e67fd5..50ea27b4e9 100644
--- a/sbin/mount_std/mount_std.8
+++ b/sbin/mount_std/mount_std.8
@@ -37,7 +37,6 @@
 .Os
 .Sh NAME
 .Nm mount_std ,
-.Nm mount_linprocfs ,
 .Nm mount_procfs
 .Nd mount
 .Dq standard
@@ -53,10 +52,9 @@ The
 command is a generic mechanism for attaching ``standard'' filesystems to
 the filesystem.  The
 .Nm
-command currently supports the following filesystems:
-.Nm linprocfs
-and
-.Nm procfs .
+command currently supports the
+.Nm procfs
+filesystem.
 A ``standard'' filesystem is one which:
 .Bl -enum -offset indent
 .It
@@ -109,11 +107,9 @@ for that specific
 .Nm mount_ Ns Ar fsname
 command.
 .Pp
-Refer to the following manual pages for detailed information
-on these file system:
-.Xr linprocfs 5
-and
-.Xr procfs 5 .
+Refer to the
+.Xr procfs 5
+manual page for detailed information on this file system.
 .Sh DIAGNOSTICS
 .Bl -diag
 .It argv[0] must end in _fsname
@@ -133,7 +129,6 @@ loadable module for it was found.
 .Xr unmount 2 ,
 .Xr getvfsbyname 3 ,
 .Xr fstab 5 ,
-.Xr linprocfs 5 ,
 .Xr procfs 5 ,
 .Xr mount 8
 .Sh HISTORY
@@ -146,10 +141,6 @@ Loadable filesystem modules first appeared in
 The
 .Dq procfs
 filesystem type first appeared in
-.Fx 2.0 ;
-the
-.Dq linprocfs
-filesystem type first appeared in
-.Fx 4.0 .
+.Fx 2.0 .
 .Sh CAVEATS
 None of the ``standard'' filesystems may be NFS-exported.
diff --git a/sbin/mount_ufs/mount_ufs.8 b/sbin/mount_ufs/mount_ufs.8
index b0bc398c8f..057b8a9162 100644
--- a/sbin/mount_ufs/mount_ufs.8
+++ b/sbin/mount_ufs/mount_ufs.8
@@ -402,7 +402,6 @@ have permission to load the module.
 .Xr mount_ext2fs 8 ,
 .Xr mount_hammer 8 ,
 .Xr mount_hpfs 8 ,
-.Xr mount_linprocfs 8 ,
 .Xr mount_mfs 8 ,
 .Xr mount_msdos 8 ,
 .Xr mount_nfs 8 ,
diff --git a/share/man/man4/aac.4 b/share/man/man4/aac.4
index b06c1d5d70..478db415ee 100644
--- a/share/man/man4/aac.4
+++ b/share/man/man4/aac.4
@@ -75,17 +75,6 @@ and
 .Pa /dev/hpn?
 exist for compatibility with the Dell and HP versions of management tools,
 respectively.
-.\"If the kernel is compiled with the
-.\".Dv COMPAT_LINUX
-.\"option, or the
-.\".Pa aac_linux.ko
-.\"and
-.\".Pa linux.ko
-.\"modules are loaded, the
-.\"Linux-compatible
-.\".Xr ioctl 2
-.\"interface for the management device will be enabled and will allow
-.\"Linux-based management applications to control the card.
 .Sh LOADER TUNABLES
 .Bl -tag -width indent
 .It Va hw.aac.msi.enable
@@ -285,7 +274,6 @@ These messages are printed on the system console,
 and are also queued for retrieval by a management application.
 .Sh SEE ALSO
 .Xr kld 4 ,
-.\".Xr linux 4 ,
 .Xr scsi 4 ,
 .Xr kldload 8
 .Sh HISTORY
diff --git a/share/man/man4/kld.4 b/share/man/man4/kld.4
index 24ee67c2fc..0528ae9a4f 100644
--- a/share/man/man4/kld.4
+++ b/share/man/man4/kld.4
@@ -56,9 +56,7 @@ The
 system makes extensive use of loadable kernel modules, and provides loadable
 versions of most filesystems, the
 .Tn NFS
-client and server, all the screen-savers, and the
-.Tn Linux
-emulator.
+client and server, and all the screen-savers.
 .Nm
 modules are placed by default in the
 .Pa /boot/kernel
diff --git a/share/man/man4/mrsas.4 b/share/man/man4/mrsas.4
index f88a702802..0da6c613c5 100644
--- a/share/man/man4/mrsas.4
+++ b/share/man/man4/mrsas.4
@@ -323,8 +323,5 @@ exposes devices as
 .Pa /dev/mfid? .
 .Pp
 .Nm
-does not support the Linux Emulator interface.
-.Pp
-.Nm
 will not work with
 .Xr mfiutil 8 .
diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4
index 71e9496fcd..b344ae0c3b 100644
--- a/share/man/man4/pcm.4
+++ b/share/man/man4/pcm.4
@@ -549,10 +549,7 @@ The driver supports most of the
 .Fn ioctl
 functions, and most applications work unmodified.
 A few differences exist, while memory mapped playback is
-supported natively and in
-.Tn Linux
-emulation, memory mapped recording is
-not due to
+supported natively, memory mapped recording is not due to
 .Tn VM
 system design.
 As a consequence, some applications may need to be recompiled
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
index 72c5a35fe2..3779aab336 100644
--- a/share/man/man5/Makefile
+++ b/share/man/man5/Makefile
@@ -29,7 +29,6 @@ MAN=	acct.5 \
 	libmap.conf.5 \
 	kernconf.5 \
 	link.5 \
-	linprocfs.5 \
 	loader.conf.5 \
 	mailer.conf.5 \
 	make.conf.5 \
diff --git a/share/man/man5/linprocfs.5 b/share/man/man5/linprocfs.5
deleted file mode 100644
index 580a8bf871..0000000000
--- a/share/man/man5/linprocfs.5
+++ /dev/null
@@ -1,94 +0,0 @@
-.\" $FreeBSD: src/share/man/man5/linprocfs.5,v 1.1.2.5 2001/08/17 13:08:47 ru Exp $
-.\" $DragonFly: src/share/man/man5/linprocfs.5,v 1.3 2006/02/17 19:37:10 swildner Exp $
-.\" Written by Garrett Wollman
-.\" This file is in the public domain.
-.\"
-.Dd August 10, 1994
-.Dt LINPROCFS 5
-.Os
-.Sh NAME
-.Nm linprocfs
-.Nd Linux process file system
-.Sh SYNOPSIS
-.Bd -literal
-linproc		/compat/linux/proc	linprocfs	rw 0 0
-.Ed
-.Sh DESCRIPTION
-The Linux process file system, or
-.Nm ,
-emulates a subset of Linux' process file system and is required for
-the complete operation of some Linux binaries.
-.Pp
-The
-.Nm
-provides a two-level view of process space.
-At the highest level, processes themselves are named, according to
-their process ids in decimal, with no leading zeros.  There is also a
-special node called
-.Pa self
-which always refers to the process making the lookup request.
-.Pp
-Each node is a directory which contains the following entries:
-.Pp
-Each directory contains several files:
-.Bl -tag -width status
-.It Pa exe
-A reference to the vnode from which the process text was read.
-This can be used to gain access to the process' symbol table,
-or to start another copy of the process.
-.It Pa mem
-The complete virtual memory image of the process.
-Only those addresses which exist in the process can be accessed.
-Reads and writes to this file modify the process.
-Writes to the text segment remain private to the process.
-.El
-.Pp
-Each node is owned by the process's user, and belongs to that user's
-primary group, except for the
-.Pa mem
-node, which belongs to the
-.Li kmem
-group.
-.Sh FILES
-.Bl -tag -width /compat/linux/proc/self/XXXXXXX -compact
-.It Pa /compat/linux/proc
-normal mount point for the
-.Nm .
-.It Pa /compat/linux/proc/cpuinfo
-CPU vendor and model information in human-readable form.
-.It Pa /compat/linux/proc/meminfo
-System memory information in human-readable form.
-.It Pa /compat/linux/proc/pid
-directory containing process information for process
-.Pa pid .
-.It Pa /compat/linux/proc/self
-directory containing process information for the current process
-.It Pa /compat/linux/proc/self/exe
-executable image
-.It Pa /compat/linux/proc/self/mem
-the complete virtual address space of the process
-.El
-.Sh SEE ALSO
-.Xr mount 2 ,
-.Xr unmount 2 ,
-.Xr procfs 5 ,
-.Xr mount_linprocfs 8
-.Sh HISTORY
-The
-.Nm
-first appeared in
-.Fx 4.0 .
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-was derived from
-.Nm procfs
-by
-.An Pierre Beyssac .
-This manual page was written by
-.An Dag-Erling Sm\(/orgrav ,
-based on the
-.Xr procfs 5
-manual page by
-.An Garrett Wollman .
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index d750a2a04f..7ee39d56e7 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -2089,11 +2089,6 @@ Set to
 to enable system accounting through the
 .Xr accton 8
 facility.
-.It Va linux_enable
-.Pq Vt bool
-Set to
-.Dq Li YES
-to enable Linux/ELF binary emulation at system initial boot time.
 .\" ----- cleanvar_enable setting--------------------------------
 .It Va cleanvar_enable
 .Pq Vt bool
diff --git a/share/man/man5/sysctl.conf.5 b/share/man/man5/sysctl.conf.5
index 7359dbda6a..54dcbc19f4 100644
--- a/share/man/man5/sysctl.conf.5
+++ b/share/man/man5/sysctl.conf.5
@@ -23,7 +23,6 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD: src/share/man/man5/sysctl.conf.5,v 1.3.4.9 2002/01/09 16:10:10 ru Exp $
-.\" $DragonFly: src/share/man/man5/sysctl.conf.5,v 1.2 2003/06/17 04:37:00 dillon Exp $
 .\"
 .Dd December 30, 1999
 .Dt SYSCTL.CONF 5
@@ -77,7 +76,3 @@ If loadable kernel modules are used to introduce additional kernel
 functionality and sysctls to manage that functionality,
 .Nm
 may be processed too early in the boot process to set those sysctls.
-For example, sysctls to manage the linux emulator cannot be set in
-.Nm
-if the linux emulator is loaded as a module rather than
-compiled into the kernel.
-- 
2.11.0

