From owner-svn-src-all@freebsd.org Mon Aug 31 12:14:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DCBF93BFC7D; Mon, 31 Aug 2020 12:14:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bg8JX5SK1z4RF8; Mon, 31 Aug 2020 12:14:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F28E2767A; Mon, 31 Aug 2020 12:14:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07VCEKQr091306; Mon, 31 Aug 2020 12:14:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07VCEKao091305; Mon, 31 Aug 2020 12:14:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <202008311214.07VCEKao091305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 31 Aug 2020 12:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r364985 - stable/12/libexec/rc/rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: stable/12/libexec/rc/rc.d X-SVN-Commit-Revision: 364985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2020 12:14:20 -0000 Author: trasz Date: Mon Aug 31 12:14:20 2020 New Revision: 364985 URL: https://svnweb.freebsd.org/changeset/base/364985 Log: In 13-CURRENT, the linux rc script uses "nocover" mount option to avoid mounting required filesystems twice. However, this option hasn't been MFC'd. Implement its functionality in a different way, by stating the mount point. Submitted by: sigsys@gmail.com Differential Revision: https://reviews.freebsd.org/D26217 Modified: stable/12/libexec/rc/rc.d/linux Modified: stable/12/libexec/rc/rc.d/linux ============================================================================== --- stable/12/libexec/rc/rc.d/linux Mon Aug 31 09:05:45 2020 (r364984) +++ stable/12/libexec/rc/rc.d/linux Mon Aug 31 12:14:20 2020 (r364985) @@ -15,6 +15,12 @@ rcvar="linux_enable" start_cmd="${name}_start" stop_cmd=":" +unmounted() +{ + [ `stat -f "%d" "$1"` == `stat -f "%d" "$1/.."` -a \ + `stat -f "%i" "$1"` != `stat -f "%i" "$1/.."` ] +} + linux_start() { local _emul_path _tmpdir @@ -48,11 +54,12 @@ linux_start() if checkyesno linux_mounts_enable; then _emul_path="/compat/linux" - mount -t linprocfs linprocfs "${_emul_path}/proc" - mount -t linsysfs linsysfs "${_emul_path}/sys" - mount -t devfs devfs "${_emul_path}/dev" - mount -o linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd" - mount -o mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" + unmounted "${_emul_path}/proc" && mount -t linprocfs linprocfs "${_emul_path}/proc" + unmounted "${_emul_path}/sys" && mount -t linsysfs linsysfs "${_emul_path}/sys" + unmounted "${_emul_path}/dev" && mount -t devfs devfs "${_emul_path}/dev" + unmounted "${_emul_path}/dev/fd" && mount -o linrdlnk -t fdescfs fdescfs "${_emul_path}/dev/fd" + unmounted "${_emul_path}/dev/shm" && mount -o mode=1777 -t tmpfs tmpfs "${_emul_path}/dev/shm" + true fi }