From owner-svn-src-all@FreeBSD.ORG Tue Aug 25 13:39:15 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDDC1106568B; Tue, 25 Aug 2009 13:39:14 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C255E8FC24; Tue, 25 Aug 2009 13:39:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n7PDdEe8029564; Tue, 25 Aug 2009 13:39:14 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7PDdEcD029562; Tue, 25 Aug 2009 13:39:14 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200908251339.n7PDdEcD029562@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 25 Aug 2009 13:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196541 - stable/7/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 25 Aug 2009 13:39:15 -0000 Author: bms Date: Tue Aug 25 13:39:14 2009 New Revision: 196541 URL: http://svn.freebsd.org/changeset/base/196541 Log: MFC r179014: Add support for /conf/T/M/remount_optional. The rc.initdiskless functionality is used by NanoBSD to allow configuration files to live on a separate configuration slice, which acts as NVRAM, whilst the system image is mounted read-only. Normally, if the remount command fails during boot, this is regarded as a fatal error. If /conf/T/M/remount_optional is present, this error is non-fatal. If the file is not present, the default behaviour is unchanged. This is very useful for people building live CD images using FreeBSD, where the NVRAM lives somewhere completely differently from the system image, and may be present on removable media which is not present during the initial boot. Modified: stable/7/etc/ (props changed) stable/7/etc/rc.initdiskless stable/7/etc/termcap.small (props changed) Modified: stable/7/etc/rc.initdiskless ============================================================================== --- stable/7/etc/rc.initdiskless Tue Aug 25 13:04:13 2009 (r196540) +++ stable/7/etc/rc.initdiskless Tue Aug 25 13:39:14 2009 (r196541) @@ -69,6 +69,10 @@ # /conf/1.2.3.4/foo/remount contains "mount -o ro /dev/ad0s3", # then /dev/ad0s3 will be be mounted on /conf/1.2.3.4/foo/ # +# /conf/T/M/remount_optional +# If this file exists, then failure to execute the mount +# command contained in /conf/T/M/remount is non-fatal. +# # /conf/T/M/diskless_remount # The contents of the file points to an NFS filesystem, # possibly followed by mount_nfs options. If the server name @@ -147,8 +151,12 @@ log() { # # checks error code and drops into shell on failure. # if shell exits, terminates script as well as /etc/rc. +# if remount_optional exists under the mountpoint, skip this check. # chkerr() { + lastitem () ( n=$(($# - 1)) ; shift $n ; echo $1 ) + mountpoint="$(lastitem $2)" + [ -r $mountpoint/remount_optional ] && ( echo "$2 failed: ignoring due to remount_optional" ; return ) case $1 in 0) ;;