From owner-svn-src-all@freebsd.org Mon Jan 4 17:00:42 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 3A78DA62D37 for ; Mon, 4 Jan 2016 17:00:42 +0000 (UTC) (envelope-from 000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@amazonses.com) Received: from a9-121.smtp-out.amazonses.com (a9-121.smtp-out.amazonses.com [54.240.9.121]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0287D1238 for ; Mon, 4 Jan 2016 17:00:41 +0000 (UTC) (envelope-from 000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451926835; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=WnkckdDeZLxIwFtylNE37ObmcbcFo7eBubEq4x69SqXU+moQvdzaRJV1aud0EfYh RaeiiTmjZODuPsEp0Ppn4iYw1wFp8Dy/vruVl/tWkvMuJHxljy6I+cL+bTmbgQnW+vm e7nl722LFE0PxAmmQzkU0ARTdSRz/GgB4B/01/GA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451926835; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=rz1F9ks4C1Uh1KYWxqgQ3Z9CazRbP+9KXj6hZ1rQixb0K4oSG0m9st3PIbZy0c01 oIKQ3+sM9goB1mzafI0WZiE5M1e+xAvGL640gnlcYgQY6JI6EvG1KZVX6LxKos6xwpj zosBfAbBLzOOyQxxTi2gfJ4D85fhKIcVJAwjCB0c= From: Colin Percival 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> Message-ID: <000001520d954f60-58991ba7-6f57-4b0d-a600-bdd78572695b-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:00:35 +0000 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-SES-Outgoing: 2016.01.04-54.240.9.121 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES 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: Mon, 04 Jan 2016 17:00:42 -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