From owner-svn-src-all@freebsd.org Sun Jan 3 19:28:06 2016 Return-Path: Delivered-To: svn-src-all@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 2AB0DA5FD83 for ; Sun, 3 Jan 2016 19:28:06 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) Received: from o1.l99.sendgrid.net (o1.l99.sendgrid.net [198.37.153.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41A51DCD for ; Sun, 3 Jan 2016 19:28:05 +0000 (UTC) (envelope-from bounces+73574-8822-svn-src-all=freebsd.org@sendgrid.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info; h=subject:to:references:from:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtpapi; bh=K/PKTfjtgrR/75ccGQ5VpfMFaHw=; b=C1foAMtWeyX5gkRFzS krjvHjnON0+VPPzZsOhvkeKvwsUslayYml8HIJNk1n2/Bmqbrx4O7SH5xlt4h4H6 SoJuYSY+nN55gKc+4zvx7Zs9lm4KsiMyGJ1FoCWOxd5+B5LElsENDEasemFoM8/L C6cDpsGLMfkE/0DGvkDvojvfM= Received: by filter0468p1mdw1.sendgrid.net with SMTP id filter0468p1mdw1.19232.5689763F3 2016-01-03 19:27:59.070509512 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id eLYfFgkeQv6rRO1jLSVq5A for ; Sun, 03 Jan 2016 19:27:57.898 +0000 (UTC) Received: (qmail 84904 invoked from network); 3 Jan 2016 19:25:44 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by ec2-107-20-205-189.compute-1.amazonaws.com with ESMTP; 3 Jan 2016 19:25:44 -0000 Received: (qmail 98101 invoked from network); 3 Jan 2016 19:27:30 -0000 Received: from unknown (HELO clamshell.daemonology.net) (127.0.0.1) by clamshell.daemonology.net with SMTP; 3 Jan 2016 19:27:30 -0000 Subject: Re: svn commit: r293115 - head/etc To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201601031918.u03JImBs012182@repo.freebsd.org> From: Colin Percival Message-ID: <56897621.6080505@freebsd.org> Date: Sun, 3 Jan 2016 11:27:29 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201601031918.u03JImBs012182@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SG-EID: A6W2xSVPHetogaU8rnzccWwgBYtN+QvIzXyjfe/10PHitGMBfC9ptb0j0BrWnwFRdLDDVnWNXpGHP8 G82ldmlEUvvcw1IHzxZjUmYiAAfPzitMUM2KIkgHHKfJtvuEA1lqCRhimm+soEaNAhyfBiMVNcUgjk JEbtLCT3JL4x2aVcJv3sakmcv3yszn9ymM3U5CAp4LJEKR3nLBzTf3CHLTGYvUt4u1ejUYvay6GGiv A= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Sun, 03 Jan 2016 19:28:06 -0000 On 01/03/16 11:18, Warner Losh wrote: > Log: > Use /bin/rm to remove /firstboot*. Otherwise rm -i alias is picked > up and can cause issues on boot with the prompts. Huh, I never realized that could be a problem. > Fix the read-only > root case with horrible kludge of mounting rw removing the files, then > mounting ro. The solution I intended when I introduced this (and used elsewhere) was to set $firstboot_sentinel in /etc(/defaults)?/rc.conf. This case is precisely why it's a shell variable, in fact. Colin Percival > 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 '' -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid