From owner-svn-src-head@freebsd.org Sun Jan 3 19:18:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCBEAA5F9A5; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@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 mx1.freebsd.org (Postfix) with ESMTPS id 90F53193A; Sun, 3 Jan 2016 19:18:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u03JImKS012183; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u03JImBs012182; Sun, 3 Jan 2016 19:18:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201601031918.u03JImBs012182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 3 Jan 2016 19:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293115 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2016 19:18:49 -0000 Author: imp Date: Sun Jan 3 19:18:48 2016 New Revision: 293115 URL: https://svnweb.freebsd.org/changeset/base/293115 Log: Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked up and can cause issues on boot with the prompts. Fix the read-only root case with horrible kludge of mounting rw removing the files, then mounting ro. But since that's no more horrible than the kludge of using marker files in /. With this change, NanoBSD configs can safely use /firstboot + growfs to produce minimal images that grow to the size of the card. Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Sun Jan 3 19:06:17 2016 (r293114) +++ head/etc/rc Sun Jan 3 19:18:48 2016 (r293115) @@ -131,11 +131,14 @@ done # Remove the firstboot sentinel, and reboot if it was requested. if [ -e ${firstboot_sentinel} ]; then - rm ${firstboot_sentinel} + [ ${root_rw_mount} = "yes" ] || mount -uw / + /bin/rm ${firstboot_sentinel} if [ -e ${firstboot_sentinel}-reboot ]; then - rm ${firstboot_sentinel}-reboot + /bin/rm ${firstboot_sentinel}-reboot + [ ${root_rw_mount} = "yes" ] || mount -ur / kill -INT 1 fi + [ ${root_rw_mount} = "yes" ] || mount -ur / fi echo ''