From owner-svn-src-head@freebsd.org Mon Jan 4 17:13:54 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 105CCA6128C for ; Mon, 4 Jan 2016 17:13:54 +0000 (UTC) (envelope-from 000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@amazonses.com) Received: from a9-100.smtp-out.amazonses.com (a9-100.smtp-out.amazonses.com [54.240.9.100]) (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 CE17D1FD3 for ; Mon, 4 Jan 2016 17:13:53 +0000 (UTC) (envelope-from 000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1451926834; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=nMLlpTmV6O4F+PxFLrPwyCG3LRBuvWhEMBozhyFECrznWgfr6egS7iy4kyF8eiD/ CX505foYwsHF9OUwkCXk+3+8/eSwNxCybo6YhPtz+h/vExM+SrhOxYb9GMFg7vY8/bs 9OYGYADDIbFBS8vwD1u1rGEreV9BiCNw1smSHcUE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1451926834; h=From:Subject:To:References:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=GSV3k0QuTaj1YWAchXOmcjDljyx0EUQMZ+hOy7aX6BY=; b=l1IwslDwrBXpp2Cw8ejaSxOBXFWHDvnTDpCFihgDxrKoU/RQBlvSBzt8yheRQoRf UryODIcLoe92HQ4LyHjpK2JvULvFh+FZ0wYmaiSu4tg/GFmM+L8Qx7prOYgNsMI6C22 fMuxUa6SCeUDI+JqtN31OPZlSillb7tWFxTNMKyo= 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: <000001520d954b29-7a1f5e1b-bca2-4d83-ac45-f2188bc22806-000000@email.amazonses.com> Date: Mon, 4 Jan 2016 17:00:34 +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.100 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES 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: Mon, 04 Jan 2016 17:13:54 -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