From owner-svn-src-head@freebsd.org Sun Jan 3 19:28:04 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 70592A5FD7F for ; Sun, 3 Jan 2016 19:28:04 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=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 23D6B1DCC for ; Sun, 3 Jan 2016 19:28:03 +0000 (UTC) (envelope-from bounces+73574-9504-svn-src-head=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 filter0805p1mdw1.sendgrid.net with SMTP id filter0805p1mdw1.7072.5689763C37 2016-01-03 19:27:56.99517716 +0000 UTC Received: from mail.tarsnap.com (ec2-54-86-246-204.compute-1.amazonaws.com [54.86.246.204]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id eebfvpqmQ_GTw4FqcgWG-Q for ; Sun, 03 Jan 2016 19:27:56.677 +0000 (UTC) Received: (qmail 84900 invoked from network); 3 Jan 2016 19:25:43 -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:43 -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: EvYvoie/qnEezyq2t4eRKjDm9X7ZKbCMt75WvXA+XNERlt/+tTHBguJQkLHfxog2hymAQmIIwmnnBy RealoZgjo0CwCLe5Eg8qntdX8GZAzUx5KI9jk7iGvPkp7ikoGxAEm9o53nCaDDiiOMfVLmo/mNyHQm cj9Sa3cgwtGpkFkvEzR8+13hRjNthgw+0t2KdY3jJIDueICTwclgV26uPSBcvI94rs3r0KKTojpjYR s= 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:28:04 -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